--- loncom/homework/grades.pm 2006/04/03 19:00:27 1.346 +++ loncom/homework/grades.pm 2006/04/10 06:34:07 1.349 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # The LON-CAPA Grading handler # -# $Id: grades.pm,v 1.346 2006/04/03 19:00:27 banghart Exp $ +# $Id: grades.pm,v 1.349 2006/04/10 06:34:07 albertel 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,15 @@ sub sub_page_kw_js { SUBJAVASCRIPT } +sub get_increment { + 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 +1474,16 @@ sub gradeBox { $result.='
'. 'Part: '.$display_part.' Points: '."\n"; my $ctr = 0; + my $thisweight = 0; + my $increment = &get_increment(); $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.='
'; @@ -1517,7 +1536,10 @@ sub handback_box { next if (!@$files); my $file_counter = 1; foreach my $file (@$files) { - my ($file_disp) = ($file =~ m|.+/(.+)$|); + my ($file_path, $file_disp) = ($file =~ m|(.+/)(.+)$|); + my ($name,$version,$ext) = &file_name_version_ext($file_disp); + $file_disp = "$name.$ext"; + $file = $file_path.$file_disp; $result.=&mt('Return commented version of [_1] to student.', ''.$file_disp.''); $result.=''."\n"; @@ -1992,6 +2014,8 @@ KEYWORDS '  '; $endform.='(Next and Previous (student) do not save the scores.)'."\n" ; + $endform.=""; $endform.='
'; $endform.=&show_grading_menu_form($symb); $request->print($endform);