Set Definition File
The set definition file is an ascii file which defines the set. It defines
the set name, opening, due, and answer dates, optionally header files for the
set, and finally the list of problems (with optional values, limits
on attemps allowed, and links --- see below).
The set definition file MUST be placed in the templates/ directory (as
defined by $templateDirectory in webworkCourse.ph ) and
MUST be named setxxx.def where xxx is the name of the set. E.g. set1.def,
setExam.def, and setsample7.def define sets named 1, Exam, and sample7
respectively. Set names are case sensitive, e.g. setexam1.def and setExam1.def
give different sets as do set1.def and sef01.def.
We begin with an example of a set definition file (with copious comments).
Further discussion will follow it.
File name: set1.def
## Blank lines or comment lines (anything following a # is a comment) ## may be used for clarity.
paperHeaderFile=set1/SetHeader.pg ## This line is optional. ## The default paper Header file will be used if this line is not present
screenHeaderFile=set1/screenHeader.pg ## This line is optional. ## The default screen Header file will be used if this line is not present.
openDate = 9/9/96 at 9:00 AM ## The date/time the set opens and problems can be viewed and answered by students ## (professors can view sets before the open date). ## The date/time can also be given in the format 9/9/96, 0900
dueDate = 09/24/96 at 1:00 PM ## After this date/time, answers will not be recorded.(or 09/24/96, 1300)
answerDate = 09/25/96 at 11:30 PM ## After this date/time, the student can view the correct answer(s) ## and solutions (if available). Professors can view these at any time.
## The above lines can occur in any order, but must precede ## the problemList= line.
## All lines following the problemList= line give the filenames (and ## optionally the values, limits on attempts, and links) ## of the problems in the set. The format is
## File path/name, value, number of allowed attempts, link
## with the last three parameters being optional.
## Explanation of the problems list follows the entire list problemList = set1/s2_5_1.pg, 2 set1/s2_5_4.pg, 5 set1/s2_5_5.pg, 3 set1/s2_5_2.pg, 1 set1/s2_5_3.pg
set1/s2_5_6.pg, 1 , 4 set1/s2_5_7.pg, 1 ,-1 set1/s2_5_8.pg, 1 ,-1, 1 set1/s2_5_9.pg, 1 ,-1, 1 set1/s2_5_10.pg, 2
## Problem set explanation
## Problem 1 is given by the file <templatesdirectory>/set1/s2_5_1.pg . ## It's value is 2 points. Unlimited attempts allowed.
## Problem 2 is given by the file <templates directory>/set1/s2_5_4.pg . ## It's value is 5 points. Unlimited attempts allowed.
## Problem 3, 3 points, unlimited attempts.
## Problem 4, 1 point, unlimited attempts.
## Problem 5, value is still 1 point which is the default; ## unlimited attempts which is the default.
## Problem 6, 1 point. The student is only allowed 4 attempts after ## which answers will not be recorded. Note that we had to specify the value as 1 point.
## Problem 7, 1 point, unlimited attempts (any negative integer ## denotes unlimited attempts).
## Problem 8, 1 point, unlimited attempts, linked to previous problem.
## Problem 9, 1 point, unlimited attempts, linked to previous problem.
## Problem 10, 2 points, unlimited attempts (not linked to the ## previous problem). The last problem in the set.
The set definition file has six special lines which begin:
paperHeaderFile = ,screenHeaderFile = ,openDate = , dueDate = , answerDate
= , and problemList = . Blank lines and everything following
a # are considered comments and are ignored. The first five special lines may
occur in any order but must proceed the problemList = line. See the comments in
the above example for explanations of the main points. Here are some more
technical points.
The openDate, dueDate, and answerDate must be in chronological order.
The paperHeaderFile = line is optional. If it is present, WeBWorK will use
the given file as a header file when downloading a postscript or pdf version of
the entire set. If this line is not present, WeBWorK will use the file defined
by $Global::SET_HEADER in webworkCourse.ph. If
$Global::SET_HEADER is not given in webworkCourse.ph ,
WeBWorK will use the file given by $SET_HEADER in
Global.pm This file usually contains the student name and
assignment number, the due date, instructions, etc.
The screenHeaderFile = line is optional. If it is present, WeBWorK will use
the given file as an insert on the probSet page, i.e. the page which lists the
probems in a set. If this line is not present, WeBWorK will use the file defined
by $Global::PROB_HEADER in webworkCourse.ph. If
$Global::PROB_HEADER is not given in webworkCourse.ph ,
WeBWorK will use the file given by $PROB_HEADER in
Global.pm This file usually contains the due date, instructions,
etc.
N.B. Old style set definition files had a line
setNumber =
1 for example, which defined the set name to be 1. In the new style, a
line begining with setNumber = will be ignored. The set name is
now derived from the filename of the set definition file as described above. All files are assumed to be in the templates directory (as defined by
$templateDirectory in webworkCourse.ph ). Normally it
is convenient to put all files for a set in a subdirectory of the
templates directory. In the example above, the file
s2_5_1.pg for problem 1 is in the subdirectory set1 of
the templates directory.
All lines following the problemList = line define problems for the set. The
first line gives problem 1, the second line gives problem 2, etc. Blank lines
may be inserted say every 5 lines for clarity. The format for each line is:
problemFileName , value , maximumAllowedAttempts, linkToPreviousProblem
Don't forget the commas (,) unless you want default values. The problem
value is assumed to be a nonnegative integer or a nonnegative decimal. All non digits except decimal points are discarded so -5
becomes 5, 4+5 becomes 45, 0.5 remains 0.5, etc. If there are no digits, the problem value
defaults to 1. The scoring routines use this value to determine the value of a
problem.
The maximumAllowedAttempts is assumed to be an integer. A negative integer
means allow unlimited attempts (the default). All non digits except the minus
sign (-) are discarded so 4+5 becomes 45, etc. If there are no digits, the value
defaults to -1. After the allowed number of attempts answers will not be
recorded.
The linkToPreviousProblem is assumed to be 1 (true) or 0 (false, the
default). If 1 this means, for every student, this problem will have
the same seed as the previous problem. This means you can have a
connected or linked series of problems that share the same "random
data." For this the linked problems have to define the same random
variables in the same order (it is the responsibility of problem
authors to do this). Note: this is set to 0 for the first problem
regardless of what is listed. Also 0 and 1 are Perl's truth values and
other values are interpreted as true or false according to Perl's rules. problemFileName is equivalent to: problemFileName , 1 , -1, 0 problemFileName, 2 is equivalent to: problemFileName , 2 , -1 , 0 problemFileName, 2 , 3 is equivalent to: problemFileName , 2 , 3 , 0
<| Post or View Comments |> |