--- loncom/homework/grades.pm 2007/10/26 00:27:55 1.465 +++ loncom/homework/grades.pm 2007/10/26 00:39:09 1.467 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # The LON-CAPA Grading handler # -# $Id: grades.pm,v 1.465 2007/10/26 00:27:55 albertel Exp $ +# $Id: grades.pm,v 1.467 2007/10/26 00:39:09 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -332,8 +332,8 @@ sub cleanRecord { $bottomrow.=''.$grayFont.$foil.' '; } return '
'. - ''.$toprow.''. - ''. + ''.$toprow.''. + ''. $grayFont.$bottomrow.''.'
Answer
'.$grayFont.'Option ID
'.&mt('Answer').'
'.$grayFont.&mt('Option ID').'
'; } elsif ($response eq 'match') { my %answer=&Apache::lonnet::str2hash($answer); @@ -352,10 +352,10 @@ sub cleanRecord { $bottomrow.=''.$grayFont.$foil.' '; } return '
'. - ''.$toprow.''. - ''. + ''.$toprow.''. + ''. $middlerow.''. - ''. + ''. $bottomrow.''.'
Answer
'.$grayFont.'Item ID
'.&mt('Answer').'
'.$grayFont.&mt('Item ID').'
'.$grayFont.'Option ID
'.$grayFont.&mt('Option ID').'
'; } elsif ($response eq 'radiobutton') { my %answer=&Apache::lonnet::str2hash($answer); @@ -365,18 +365,18 @@ sub cleanRecord { foreach my $foil (@$order) { if (exists($answer{$foil})) { if ($foil eq $correct) { - $toprow.='true'; + $toprow.=''.&mt('true').''; } else { - $toprow.='true'; + $toprow.=''.&mt('true').''; } } else { - $toprow.='false'; + $toprow.=''.&mt('false').''; } $bottomrow.=''.$grayFont.$foil.' '; } return '
'. - ''.$toprow.''. - ''. + ''.$toprow.''. + ''. $grayFont.$bottomrow.''.'
Answer
'.$grayFont.'Option ID
'.&mt('Answer').'
'.$grayFont.&mt('Option ID').'
'; } elsif ($response eq 'essay') { if (! exists ($env{'form.'.$symb})) { @@ -1615,13 +1615,13 @@ sub gradeBox { '" src="'.$request->dir_config('lonIconsURL'). '/check.gif" height="16" border="0" />'; my $wgt = &Apache::lonnet::EXT('resource.'.$partid.'.weight',$symb,$udom,$uname); - my $wgtmsg = ($wgt > 0 ? '(problem weight)' : - 'problem weight assigned by computer'); + my $wgtmsg = ($wgt > 0) ? &mt('(problem weight)') + : ''.&mt('problem weight assigned by computer').''; $wgt = ($wgt > 0 ? $wgt : '1'); my $score = ($$record{'resource.'.$partid.'.awarded'} eq '' ? '' : &compute_points($$record{'resource.'.$partid.'.awarded'},$wgt)); my $result=''."\n"; - my $display_part=&get_display_part($partid,$symb); + my $display_part= &get_display_part($partid,$symb); my %last_resets = &get_last_resets($symb,$env{'request.course.id'}, [$partid]); my $aggtries = $$record{'resource.'.$partid.'.tries'}; @@ -1703,7 +1703,7 @@ sub handback_box { ''.$file_disp.''); $result.=''."\n"; $result.='
'; - $result.='(File will be uploaded when you click on Save & Next below.)
'; + $result.='(File will be uploaded when you click on Save & Next below.)
'; $file_counter++; } } @@ -2248,25 +2248,25 @@ sub check_collaborators { } } if (scalar(@good_collaborators) != 0) { - $result.='Collaborators: '; + $result.='
'.&mt('Collaborators: '); foreach my $name (@good_collaborators) { my ($lastname,$givenn) = split(/,/,$$fullname{$name}); push(@col_fullnames, $givenn.' '.$lastname); $result.=$fullname->{$name}.'     '; } $result.='
'."\n"; - my ($part)=split(/\./,$_); + my ($part)=split(/\./,$part); $result.=''. "\n"; } if (scalar(@bad_collaborators) > 0) { - $result.='
'; + $result.='
'; $result.=&mt('This student has submitted [quant,_1,invalid collaborator]: [_2]',scalar(@bad_collaborators),join(', ',@bad_collaborators)); $result .= '
'; } if (scalar(@bad_collaborators > $ncol)) { - $result .= '
'; + $result .= '
'; $result .= &mt('This student has submitted too many '. 'collaborators. Maximum is [_1].',$ncol); $result .= '
'; @@ -4273,30 +4273,33 @@ sub displaySubByDates { my $isCODE=0; my $isTask = ($symb =~/\.task$/); if (exists($record->{'resource.CODE'})) { $isCODE=1; } - my $studentTable='
'. - ''. - ''. - ($isCODE?'':''). - ''. - ''; + my $studentTable=&Apache::loncommon::start_data_table(). + &Apache::loncommon::start_data_table_header_row(). + ''. + ($isCODE?'':''). + ''. + ''. + &Apache::loncommon::end_data_table_header_row(); my ($version); my %mark; my %orders; $mark{'correct_by_student'} = $checkIcon; if (!exists($$record{'1:timestamp'})) { - return '
 Nothing submitted - no attempts
'; + return '
 '.&mt('Nothing submitted - no attempts').'
'; } my $interaction; for ($version=1;$version<=$$record{'version'};$version++) { - my $timestamp = scalar(localtime($$record{$version.':timestamp'})); + my $timestamp = + &Apache::lonlocal::locallocaltime($$record{$version.':timestamp'}); if (exists($$record{$version.':resource.0.version'})) { $interaction = $$record{$version.':resource.0.version'}; } my $where = ($isTask ? "$version:resource.$interaction" : "$version:resource"); - $studentTable.=''; + $studentTable.=&Apache::loncommon::start_data_table_row(). + ''; if ($isCODE) { $studentTable.=''; } @@ -4315,14 +4318,14 @@ sub displaySubByDates { my ($responseId)= ($isTask ? ($matchKey=~ /^resource\.(.*?)\.\Q$partid\E\.award$/) : ($matchKey=~ /^resource\.\Q$partid\E\.(.*?)\.submission$/)); - $displaySub[0].='Part: '.$display_part.' '; - $displaySub[0].='(ID '. + $displaySub[0].=''.&mt('Part:').' '.$display_part.' '; + $displaySub[0].='('.&mt('ID').' '. $responseId.') '; if ($$record{"$where.$partid.tries"} eq '') { - $displaySub[0].='Trial not counted'; + $displaySub[0].=&mt('Trial not counted'); } else { - $displaySub[0].='Trial '. - $$record{"$where.$partid.tries"}; + $displaySub[0].=&mt('Trial [_1]', + $$record{"$where.$partid.tries"}); } my $responseType=($isTask ? 'Task' : $responseType->{$partid}->{$responseId}); @@ -4362,12 +4365,12 @@ sub displaySubByDates { } $studentTable.=''; - + $studentTable.=' '. + &Apache::loncommon::end_data_table_row(); } - $studentTable.='
Date/TimeCODESubmissionStatus 
'.&mt('Date/Time').''.&mt('CODE').''.&mt('Submission').''.&mt('Status').'
'.$timestamp.''.$timestamp.''.$record->{$version.':resource.CODE'}.''.$displaySub[0].' '.$displaySub[1]; if ($displaySub[2]) { - $studentTable.='Manually graded by '.$displaySub[2]; + $studentTable.=&mt('Manually graded by [_1]',$displaySub[2]); } - $studentTable.=' 
'; + $studentTable.=&Apache::loncommon::end_data_table(); return $studentTable; }