--- loncom/homework/grades.pm 2006/04/03 20:45:38 1.347 +++ loncom/homework/grades.pm 2006/04/09 20:53:27 1.348 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # The LON-CAPA Grading handler # -# $Id: grades.pm,v 1.347 2006/04/03 20:45:38 banghart Exp $ +# $Id: grades.pm,v 1.348 2006/04/09 20:53:27 bowersj2 Exp $ # # Copyright Michigan State University Board of Trustees # @@ -722,7 +722,14 @@ LISTJAVASCRIPT $gradeTable.=''."\n". ''."\n". ''."\n". - ''."\n". + '
'."\n". + ' Grading Increments: '. + ''."\n". ''."\n". '
'."\n". @@ -1436,6 +1443,16 @@ sub sub_page_kw_js { SUBJAVASCRIPT } +sub getIncrement +{ + my $increment = $env{'form.increment'}; + if ($increment != 1 && $increment != .5 && $increment != .25 && + $increment != .1) { + $increment = 1; + } + return $increment; +} + #--- displays the grading box, used in essay type problem and grading by page/sequence sub gradeBox { my ($request,$symb,$uname,$udom,$counter,$partid,$record) = @_; @@ -1458,13 +1475,16 @@ sub gradeBox { $result.='
'. 'Part: '.$display_part.' Points: '."\n"; my $ctr = 0; + my $thisweight = 0; + my $increment = getIncrement(); $result.=''."\n"; # display radio buttons in a nice table 10 across - while ($ctr<=$wgt) { + while ($thisweight<=$wgt) { $result.= '\n"; + $thisweight.')" value="'.$thisweight.'" '. + ($score eq $thisweight ? 'checked':'').' /> '.$thisweight."\n"; $result.=(($ctr+1)%10 == 0 ? '' : ''); + $thisweight += $increment; $ctr++; } $result.='
'; @@ -1995,6 +2015,8 @@ KEYWORDS '  '; $endform.='(Next and Previous (student) do not save the scores.)'."\n" ; + $endform.=""; $endform.='
'; $endform.=&show_grading_menu_form($symb); $request->print($endform);