Building Problem Sets
In Webwork version 1, most of the set construction was done from the unix command line.
With Webwork 2, the web interface can be used to avoid the shell.
The problem sets are stored in the database (SQL) but can be viewed and changed
by importing and exporting.
Generally the easiest way to create sets is using the problem library.
If you want to build a set from scratch, you can do that too, but it is much more work
and quite honestly not really worth it.
The best option is to either select problem that are similar to what you want and then edit them,
or use the library browser to copy problems to your new set to use as templates.
(Note: I have found errors in the problem library, so just make sure you test the problems!)
Using the Template Library
When viewing problems in the template directory, please do not edit any of the problems
unless you are fixing errors!
This is because this edits the problems forever!
Generally What you want to do is just browse the problem library and choose problem to add to the set you are
working on.
This is a very nice way to create problem sets and is described nicely at:
A Day In The Life Of A Webwork2 Professor
- Go the Library Browser Page. Pick one of the libraries.
("Local" is the problems stored on the local webwork server, "Course" are the problem
sets that are already created for your course, and I don't know what "Problem Library" is).
- Create a new set if you need to do so (you probably do).
Name the set "2" or something like the set number.
- Select a Target set (probably the new set that you just created).
This will be the set that you add problems to.
- Select a problem collection. Hopefully it will be clear what directory you will want to choose
problems from.
- Start viewing problems in the set you selected.
PLEASE DO NOT EDIT THE PROBLEM LIBRARY UNLESS YOU ARE CERTAIN OF WHAT YOU ARE DOING!
(You shouldn't be able to edit any of these problems anyway because they shouldn't have
write permissions.)
- Select the problems to add to your set by selecting "Add this problem" and then pressing "Update".
These problems will now be in your new set.
- The "Rerandomize" button changes the problem seed for the problems,
which is what determines what the variables are.
Do not worry what order the problems are added in,
or if you accidentally add a problem you didn't want,
you'll get a chance to fix that later.
You can change which problems you're viewing using the method described above,
and add as many as you want to to a set.
- To edit your set (i.e., change the due dates and such),
go to "Instructor Tools" and then choose to edit the set you just created.
- To edit the actual problems is a bit trickier.
Currently, your problem files are the files in the library.
This is fine, unless you want to modify the problems.
To take ownership of the problems, you need to save the files in your directory.
Here are the steps:
- Okay, first I thought these step would work, but they didn't.
I'm not quite sure what to do now.
I know that some combination of importing and exporting with these step
should work, but that seems way too difficult!
- I assume you have built a problem set as described above.
- Go to homework editor. Click on the problem column of the problem set for
your newly built problem set (you might have to first choose "Show problem sets").
- You can change the order of the problems by the box on the upper left hand corner of the
problem box.
- Choose "Edit It" for one of the problems.
You should have an error at the top of the page saying something like:
"Write permissions have not been enabled . . ."
(If you don't have this error, don't worry and still follow these steps)
- Choose the "Save As" option at the bottom of the screen.
Name your problem something nice
(if you named the set "3", name your problems set3/pr1.pg, set3/pr2.pg, etc).
When you do this, it will now tell you that you are editing problem "set3/pr1.pg"
(or whatever you named the problem).
Creating a homework set template from scratch
I found this to be a pain, but if you do it a couple of times, you should see some obvious short cuts.
- Go to "Hmwk Sets Editor" then "Create a new set named:"
(name it "1" or something similar) and click "Take Action".
It should say that the creation was successful.
- To add home problems to the newly created, you must export this set.
Select the set (you might have to click on "Show All sets" and then select the set),
and choose to export the selected set.
Check the box "Export selected sets" and "take action"
(making sure the box "Select Set Name" is checked with file name something like set1.def).
This should create the file "set1.def" which you will be able to edit (see how below).
- Click on "File Transfer" (I have found that this page sometimes need refreshed!).
You can now select your "set1.def" file and download it.
If you now open this file in a text editor, it should look like:
openDate = 12/31/69 at 06:00pm
dueDate = 12/31/69 at 06:00pm
answerDate = 12/31/69 at 06:00pm
paperHeaderFile =
screenHeaderFile =
problemList =
You can read more about what this means at Webwork's doc page:
SetDefinitionFormat
- Edit the file so that it looks like:
openDate = 12/31/69 at 06:00pm
dueDate = 12/31/69 at 06:00pm
answerDate = 12/31/69 at 06:00pm
paperHeaderFile =
screenHeaderFile =
problemList =
set1/pr1.pg, 1
set1/pr2.pg, 1
set1/pr3.pg, 1
set1/pr4.pg, 1
set1/pr5.pg, 1
set1/pr6.pg, 1
set1/pr7.pg, 1
set1/pr8.pg, 1
set1/pr9.pg, 1
set1/pr10.pg, 1
The other things you can change later.
Just put in the number of problems that you want for your problem set.
- Go to "File Transfer" and delete the exisiting "set1.def" file.
- Go to "File Transfer" and upload your newly edited file to the webwork server:
Use name "set1.def".
- Go to "Hmwk Sets Editor" and choose to delete the homework set you previously created
(the one with no problems in it-- you have to do this to replace it with your new
homework set that you created).
- Go to "Hmwk Sets Editor" and now choose to import set and select your file (set1.def).
(I found that I had to refresh this page to get the file to show up.)
- If you click on Show problem sets, you should see your newly created problem set.
Choose to edit this problem set.
Here you can change your due dates and Header files.
(Contact me if you care about the Header files, these are the files that the students
see to the right of the problems when the do their problems or at the top of the page
if they choose to print out the file. We'll just keep them as the default for now.)
Congratulations! You should now have a problem set all set up.
You will now need to edit the problem files.
Editing the problems in a problem set
- Go to the "Hmwk Sets Editor" and view your problem set.
Click on the link to the problems and you can start editing your problems.
- Assuming you don't have any files for your problems, you will need to
enter these by hand.
After you click on the problem link, click on edit the problem.
Below is a basic template for a problem file (you can cut and paste this into your browser).
You can read all about the pg language on the Internet if you want to know more.
## -*- perl -*-
##
##DESCRIPTION
##
##ENDDESCRIPTION
##KEYWORDS('')
DOCUMENT(); # This should be the first executable line in the problem.
loadMacros(
"PG.pl",
"PGbasicmacros.pl",
"PGchoicemacros.pl",
"PGanswermacros.pl",
"PGauxiliaryFunctions.pl"
);
# 1: show partial answers
# 0: don't show partial answers
$showPartialCorrectAnswers = 1;
TEXT(beginproblem());
BEGIN_TEXT
$BR
What is \( 2 + 2 \)? \{ ans_rule(10) \}
$BR
END_TEXT
ANS(std_num_cmp("4"));
HINT(EV3(<<'END_HINT'));
Come on, just take a guess!
END_HINT
SOLUTION(EV3(<<'END_SOLUTION'));
$BR$BBOLD Solution:$EBOLD
According to George Orwell, "The Party" can say that the answer is 5!
END_SOLUTION
ENDDOCUMENT(); # This should be the last executable line in the problem.
- Problem Library: There should be a library of problems, but I haven't successfully linked this!
Congratulations! You should now have a problem set all built up and edited.
Assigning the problem set to your students
When you first build problem sets, they are assigned to no one (including you!).
Therefore, you must assign these problem sets to the students.
BUT, and this is important,
only assign problem sets to the students when the problem set is error free!
You might be thinking that the students can't view the set anyway because of the open dates
(and this is true), but with its tex files, Webwork can generate images and such that might
change if you are changing the files.
So, the best thing to do is have someone else go through the problems and make sure there aren't any errors.
Then, and only then, assign the problem sets to the students (easily done on the "Hmwk Sets Editor" page
or the "Set Assigner" page).
Scoring the problem set
I have never really understood this, but I understand that you don't want to score a problem set twice.
So, since this doesn't really provide any useful data, it is just as easy to just score all the problem
sets at the send of the semester when all the sets are done.