WeBWorK Main Forum

import/export between 2.10 to 2.11

import/export between 2.10 to 2.11

by Andras Balogh -
Number of replies: 2
It seems to me that set import/export is not compatible between v2.11 and v.210.

In v2.11 exported set definition files have a lot more information (see the below for example) that v2.10 does not understand, and fails to import.

Is this a bug, is there a fix?

Older set def file example:
setNumber=Orientation openDate = 6/26/04 at 11:30am dueDate = 4/4/15 at 12:20pm answerDate = 4/5/15 at 12:00pm paperHeaderFile = setOrientation/setHeader.pg screenHeaderFile = setOrientation/setHeader.pg problemList = setOrientation/prob01.pg, 1

v2.11 set def file example:
assignmentType = default openDate = 06/26/2004 at 11:30am CDT reducedScoringDate = 12/31/1969 at 06:00pm CST dueDate = 04/04/2015 at 12:20pm CDT answerDate = 04/05/2015 at 12:00pm CDT enableReducedScoring = N paperHeaderFile = setOrientation/setHeader.pg screenHeaderFile = setOrientation/setHeader.pg description = restrictProbProgression = emailInstructor = problemListV2 problem_start problem_id = 1 source_file = setOrientation/prob01.pg value = 1 max_attempts = -1 showMeAnother = counts_parent_grade = att_to_open_children = problem_end
========
Error message while trying to read the v2.11 exported set definition file to v2.10:
  • readSetDef error, can't read the line: ||reducedScoringDate = 12/31/1969 at 06:00pm CST|| at /opt/webwork/webwork2/lib/WeBWorK/ContentGenerator/Instructor/ProblemSetList2.pm line 2010, <SETFILENAME> line 3.
  • readSetDef error, can't read the line: ||enableReducedScoring = N|| at /opt/webwork/webwork2/lib/WeBWorK/ContentGenerator/Instructor/ProblemSetList2.pm line 2010, <SETFILENAME> line 6.
  • readSetDef error, can't read the line: ||restrictProbProgression =|| at /opt/webwork/webwork2/lib/WeBWorK/ContentGenerator/Instructor/ProblemSetList2.pm line 2010, <SETFILENAME> line 10.
  • readSetDef error, can't read the line: ||emailInstructor =|| at /opt/webwork/webwork2/lib/WeBWorK/ContentGenerator/Instructor/ProblemSetList2.pm line 2010, <SETFILENAME> line 11.
  • readSetDef error, can't read the line: ||problemListV2|| at /opt/webwork/webwork2/lib/WeBWorK/ContentGenerator/Instructor/ProblemSetList2.pm line 2010, <SETFILENAME> line 13.
  • ...
==========
Andras
In reply to Andras Balogh

Re: import/export between 2.10 to 2.11

by Michael Gage -
set definition files for 2.10 can be read in 2.11 (if not then that is a bug).  However 2.10 will not be able to read 2.11 set definition files (or at least it will complain about the extra lines it doesn't understand which concern features it 
doesn't have).  You could edit those files by hand to make them acceptable to WW2.10 by removing the extra information. 


In reply to Michael Gage

Re: import/export between 2.10 to 2.11

by Andras Balogh -
Thanks. It is good to know.
We had about 100 set definition files, so I ended up using these lines at the command prompt. Maybe some one else can also use these:

sed -i '/assignmentType/d' *.def
sed -i '/reducedScoringDate/d' *.def
sed -i '/enableReducedScoring/d' *.def
sed -i '/restrictProbProgression/d' *.def
sed -i '/emailInstructor/d' *.def
sed -i '/^$/d' *.def
sed -i 's/problemListV2/problemList = /g' *.def
sed -i '/problem_start/d' *.def
sed -i '/problem_id/d' *.def
sed -i 's/source_file = //g' *.def
sed -i '/value =/d' *.def
sed -i '/max_attempts/d' *.def
sed -i '/showMeAnother/d' *.def
sed -i '/counts_parent_grade/d' *.def
sed -i '/att_to_open_children/d' *.def
sed -i '/problem_end/d' *.def
sed -i 's/.pg/.pg, 1, -1/g' *.def

The last command also changes the lines of specific (non-default) header files. We only had a few of those.