[system] / trunk / webwork2 / lib / WeBWorK / ContentGenerator / Problem.pm Repository:
ViewVC logotype

Diff of /trunk/webwork2/lib/WeBWorK/ContentGenerator/Problem.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

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
537sub canRecordAnswers($$$$$) { 538sub canRecordAnswers($$$$$) {
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);
544 return $recordAnswers;
543} 545}
544 546
545sub mustRecordAnswers($) { 547sub mustRecordAnswers($) {
546 my ($permissionLevel) = @_; 548 my ($permissionLevel) = @_;
547 return $permissionLevel == 0; 549 return $permissionLevel == 0;

Legend:
Removed from v.616  
changed lines
  Added in v.617

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9