From: dpvc v. a. <we...@ma...> - 2010-03-29 14:21:39
|
Log Message: ----------- Set main::problemSeed so images will refresh when the problem is re-seeded. Make changes made by professors acting as students only temporary changes Modified Files: -------------- pg/macros: problemRandomize.pl Revision Data ------------- Index: problemRandomize.pl =================================================================== RCS file: /webwork/cvs/system/pg/macros/problemRandomize.pl,v retrieving revision 1.12 retrieving revision 1.13 diff -Lmacros/problemRandomize.pl -Lmacros/problemRandomize.pl -u -r1.12 -r1.13 --- macros/problemRandomize.pl +++ macros/problemRandomize.pl @@ -180,6 +180,7 @@ when => "correct", onlyAfterDue => 1, style => "Button", + styleName => ($main::inputs_ref->{effectiveUser} ne $main::inputs_ref->{user} ? "checkAnswers" : "submitAnswers"), label => undef, buttonLabel => "Get a new version of this problem", checkboxLabel => "Get a new version of this problem", @@ -219,6 +220,7 @@ $main::PG_FLAGS{PROBLEM_GRADER_TO_USE} = \&problemRandomize::grader; $main::PG_FLAGS{problemRandomize} = $self; $self->reset if $self->{isReset}; + $main::problemSeed = $self->{status}{seed}; $self->{random}->srand($self->{status}{seed}); } @@ -258,7 +260,7 @@ my $self = shift; my $label = quoteHTML(shift || $self->{buttonLabel}); my $par = shift; $par = ($par ? $main::PAR : ''); - $par . qq!<input type="submit" name="submitAnswers" value="$label" ! + $par . qq!<input type="submit" name="$self->{styleName}" value="$label" ! . q!onclick="document.getElementById('_reseed').value=!.seed().'" />'; } @@ -269,7 +271,7 @@ my $self = shift; my $label = quoteHTML(shift || $self->{inputLabel}); my $par = shift; $par = ($par ? main::PAR : ''); - $par . qq!<input type="submit" name="submitAnswers" value="$label" ! + $par . qq!<input type="submit" name="$self->{styleName}" value="$label" ! . q!onclick="document.getElementById('_reseed').value=document.getElementById('_seed').value" />! . qq!<input name="_seed" id="_seed" value="$self->{status}{seed}" size="10">!; } |