[system] / trunk / webwork-modperl / lib / WeBWorK / ContentGenerator / Problem.pm Repository: Repository Listing bbplugincoursesdistsnplrochestersystemwww

# Diff of /trunk/webwork-modperl/lib/WeBWorK/ContentGenerator/Problem.pm

Revision 616 Revision 617
96 # num_correct+num_incorrect+1 -- as this happens before updating \$problem 96 # num_correct+num_incorrect+1 -- as this happens before updating \$problem
97 ); 97 );
98 98
99 # final values for options 99 # final values for options
100 my %will; 100 my %will;
101 foreach(keys %must) { 101 foreach (keys %must) {
102 \$will{\$_} = \$can{\$_} && (\$want{\$_} || \$must{\$_}); 102 \$will{\$_} = \$can{\$_} && (\$want{\$_} || \$must{\$_});
103 #warn "\$_: can? \$can{\$_} want? \$want{\$_} must? \$must{\$_} will? \$will{\$_}\n";
103 } 104 }
104 105
105 ##### sticky answers ##### 106 ##### sticky answers #####
106 107
107 if (not \$submitAnswers and \$will{showOldAnswers}) { 108 if (not \$submitAnswers and \$will{showOldAnswers}) {
536 537
538 my (\$permissionLevel, \$openDate, \$dueDate, \$maxAttempts, \$attempts) = @_; 539 my (\$permissionLevel, \$openDate, \$dueDate, \$maxAttempts, \$attempts) = @_;
539 my \$permHigh = \$permissionLevel > 0; 540 my \$permHigh = \$permissionLevel > 0;
540 my \$timeOK = time >= \$openDate && time <= \$dueDate; 541 my \$timeOK = time >= \$openDate && time <= \$dueDate;
541 my \$attemptsOK = \$attempts <= \$maxAttempts; 542 my \$attemptsOK = \$maxAttempts == -1 || \$attempts <= \$maxAttempts;
542 return \$permHigh || (\$timeOK && \$attemptsOK); 543 my \$recordAnswers = \$permHigh || (\$timeOK && \$attemptsOK);