I haven't been able to check Arnie's suggestion, but I would suggest setting
the $recordSubmittedAnswers flag to zero only for practice users.
I'm pretty sure that you are running into a bug in WeBWorK 2. One work around is
to change the flag
$pg->{options}->{showOldAnswers}
equal to zero in global.conf.
This means that showOldAnswers is off by default and
can be turned on using the display options menu at the lower left corner of each
problem page. In this case displaying the old answers would be off by default
for practice users, but could be turned on by anyone who wanted to see the old answers.
Annoying, but doable without changing code. Better would be to have practice users
override the default and turn "showOldAnswers" off.
Unfortunately the WeBWorK 2 bug prevents one from overriding a default
where the saved answers are shown and forcing them NOT to be shown.
(The technical problem is that a check box that is not checked returns
no value at all -- the variable is undefined -- rather than returning a
value of 0. Hence the value of 1 set in global.conf is unchanged rather
than being set to 0.) I have a temporary fix in the CVS (in the HEAD
version of WeBWorK, not the rel-2-1-patches version) which replaces the
checkbox with a radio button and makes other modifications that fix
this bug.
This fix is not completely satisfying since you still need to look at
the first problem in order to turn off the "show saved answers"
feature. A longer range fix is to move the selection of options, such
as the display mode and whether answers are shown from the Problem
module to the ContentGenerator.pm module. Then options could be set
from any webpage and not just from the problem web pages. This would
require more code to be modified and more state variables to maintained
on all webpages.
An alternative to modifying ContentGenerator.pm immediately is to wait
for WeBWorK 2.2 which will allow (I hope) the user's preferences and
options to be stored in the database, rather than being passed from one
web page to another. This would make it easier to maintain a large
number of session and user preferences in a robust way.
<| Post or View Comments |>
|