--- loncom/homework/grades.pm 2007/10/26 00:39:09 1.467 +++ loncom/homework/grades.pm 2007/10/26 00:41:31 1.468 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # The LON-CAPA Grading handler # -# $Id: grades.pm,v 1.467 2007/10/26 00:39:09 albertel Exp $ +# $Id: grades.pm,v 1.468 2007/10/26 00:41:31 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1739,27 +1739,27 @@ sub show_problem { $companswer=~s|||g; $companswer=~s|name="submit"|name="would_have_been_submit"|g; } - my $result.='
'; - $result.=''; - if ($viewon) { - $result.=''; - } + $rendered= + '
'. + &mt('View of the problem'). + '
'. + $rendered. + '
'; + $companswer= + '
'. + &mt('Correct answer'). + '
'. + $companswer. + '
'; + my $result; if ($mode eq 'both') { - $result.='
'; - if ($mode eq 'both' or $mode eq 'text') { - $result.='View of the problem - '; - } else { - $result.='Correct answer: '; - } - $result.=$env{'form.fullname'}.'
'.$rendered.'
'; - $result.='Correct answer:
'.$companswer; + $result=$rendered.$companswer; } elsif ($mode eq 'text') { - $result.='
'.$rendered; + $result=$rendered; } elsif ($mode eq 'answer') { - $result.='
'.$companswer; + $result=$companswer; } - $result.='
'; - $result.='

'; + $result='
'.$result.'
'; return $result; } @@ -1959,10 +1959,11 @@ KEYWORDS } # This is where output for one specific student would start - my $bgcolor='#DDEEDD'; - if ($counter%2) { $bgcolor='#DDDDEE'; } + my $add_class = ($counter%2) ? 'LC_grade_show_user_odd_row' : ''; $request->print("\n\n". - '

'.$env{'form.fullname'}.'
'); + '
'. + '
'.&nameUserString(undef,$env{'form.fullname'},$uname,$udom).'
'. + '
'."\n"); if ($env{'form.vProb'} eq 'all' or $env{'form.vAns'} eq 'all') { my $mode; @@ -1982,10 +1983,10 @@ KEYWORDS # Display student info $request->print(($counter == 0 ? '' : '
')); - my $result='
'."\n". - '\n"; + + my $lastsubonly; + if ($$timestamp eq '') { - $lastsubonly.='
'."\n"; - - $result.='Fullname: '.&nameUserString(undef,$env{'form.fullname'},$uname,$udom).'
'."\n"; + my $result='
'; + + $result.='
'; + $result.= &mt('Submissions'); $result.=''."\n"; @@ -1999,7 +2000,7 @@ KEYWORDS $result.=$sub_result; } $request->print($result."\n"); - + $request->print('
'."\n"); # print student answer/submission # Options are (1) Handgaded submission only # (2) Last submission, includes submission that is not handgraded @@ -2008,12 +2009,14 @@ KEYWORDS # (4) The whole record for this student if ($env{'form.lastSub'} =~ /^(lastonly|hdgrade)$/) { my ($string,$timestamp)= &get_last_submission(\%record); - my $lastsubonly=''. - ($$timestamp eq '' ? '' : 'Date Submitted: '. - $$timestamp)."
'.$$string[0]; + $lastsubonly.='
'.$$string[0].'
'; } else { + $lastsubonly = '
Date Submitted: '.$$timestamp."\n"; + my %seenparts; my @part_response_id = &flatten_responseType($responseType); foreach my $part (@part_response_id) { @@ -2036,16 +2039,16 @@ KEYWORDS } my $responsetype = $responseType->{$partid}->{$respid}; if (!exists($record{"resource.$partid.$respid.submission"})) { - $lastsubonly.='
Part: '. + $lastsubonly.="\n".'
Part: '. $display_part.' ( ID '.$respid. ' )   '. - 'Nothing submitted - no attempts

'; + ''.&mt('Nothing submitted - no attempts').'

'; next; } - foreach (@$string) { - my ($partid,$respid) = /^resource\.([^\.]*)\.([^\.]*)\.submission/; + foreach my $submission (@$string) { + my ($partid,$respid) = ($submission =~ /^resource\.([^\.]*)\.([^\.]*)\.submission/); if (join('_',@{$part}) ne ($partid.'_'.$respid)) { next; } - my ($ressub,$subval) = split(/:/,$_,2); + my ($ressub,$subval) = split(/:/,$submission,2); # Similarity check my $similar=''; if($env{'form.checkPlag'}){ @@ -2075,31 +2078,32 @@ KEYWORDS ($env{'form.lastSub'} eq 'hdgrade' && $$handgrade{$$part[0].'_'.$$part[1]} eq 'yes')) { my $display_part=&get_display_part($partid,$symb); - $lastsubonly.='
Part: '. + $lastsubonly.='
Part: '. $display_part.' ( ID '.$respid. ' )   '; my $files=&get_submitted_files($udom,$uname,$partid,$respid,\%record); if (@$files) { - $lastsubonly.='
Like all files provided by users, this file may contain virusses
'; + $lastsubonly.='
'.&mt('Like all files provided by users, this file may contain virusses').'
'; my $file_counter = 0; foreach my $file (@$files) { - $file_counter ++; + $file_counter++; &Apache::lonnet::allowuploaded('/adm/grades',$file); $lastsubonly.='
'.$file.''; } $lastsubonly.='
'; } - $lastsubonly.='Submitted Answer: '. + $lastsubonly.=''.&mt('Submitted Answer:').' '. &cleanRecord($subval,$responsetype,$symb,$partid, $respid,\%record,$order); if ($similar) {$lastsubonly.="

$similar\n";} + $lastsubonly.='
'; } } } + $lastsubonly.=''."\n"; } - $lastsubonly.='
'."\n"; $request->print($lastsubonly); - } elsif ($env{'form.lastSub'} eq 'datesub') { + } elsif ($env{'form.lastSub'} eq 'datesub') { my (undef,$responseType,undef,$parts) = &showResourceInfo($symb); $request->print(&displaySubByDates($symb,\%record,$parts,$responseType,$checkIcon,$uname,$udom)); } elsif ($env{'form.lastSub'} =~ /^(last|all)$/) { @@ -2111,13 +2115,12 @@ KEYWORDS $request->print(''."\n"); - # return if view submission with no grading option if ($env{'form.showgrading'} eq '' || (!&canmodify($usec))) { my $toGrade.='  '."\n" if (&canmodify($usec)); - $toGrade.='
'."\n"; + $toGrade.='
'."\n"; if (($env{'form.command'} eq 'submission') || ($env{'form.command'} eq 'processGroup' && $counter == $total)) { $toGrade.=''.&show_grading_menu_form($symb); @@ -2125,11 +2128,15 @@ KEYWORDS $request->print($toGrade); return; } else { - $request->print('
'."\n"); + $request->print(''."\n"); } # essay grading message center if ($env{'form.handgrade'} eq 'yes') { + my $result='

'; + + $result.='
'. + &mt('Send Message').'
'; my ($lastname,$givenn) = split(/,/,$env{'form.fullname'}); my $msgfor = $givenn.' '.$lastname; if (scalar(@$col_fullnames) > 0) { @@ -2137,7 +2144,7 @@ KEYWORDS $msgfor .= ', '.(join ', ',@$col_fullnames).' and '.$lastone.'.'; } $msgfor =~ s/\'/\\'/g; #' stupid emacs - no! javascript - $result=''."\n". + $result.=''."\n". ''."\n"; $result.=' '. @@ -2146,24 +2153,20 @@ KEYWORDS ''."\n". '
 ('. - &mt('Message will be sent when you click on Save & Next below.').")\n"; + &mt('Message will be sent when you click on Save & Next below.').")\n"; + $result.='
'; $request->print($result); } - if ($perm{'vgr'}) { - $request->print('
'. - &Apache::loncommon::track_student_link(&mt('View recent activity'), - $uname,$udom,'check')); - } - if ($perm{'opa'}) { - $request->print('
'. - &Apache::loncommon::pprmlink(&mt('Set/Change parameters'), - $uname,$udom,$symb,'check')); - } my %seen = (); my @partlist; my @gradePartRespid; my @part_response_id = &flatten_responseType($responseType); + $request->print('
'. + + '
'. + &mt('Assign Grades').'
'. + '
'); foreach my $part_response_id (@part_response_id) { my ($partid,$respid) = @{ $part_response_id }; my $part_resp = join('_',@{ $part_response_id }); @@ -2175,6 +2178,21 @@ KEYWORDS push @gradePartRespid,$partid.'.'.$respid; $request->print(&gradeBox($request,$symb,$uname,$udom,$counter,$partid,\%record)); } + $request->print('
'); + + $request->print(''); + $result=''."\n"; $result.=''."\n"; $ctr++; } - $request->print($result.''."\n"); + $request->print($result.''."\n"); # Done with printing info for one student - $request->print('

'); + $request->print('');#LC_grade_show_user_body + $request->print('');#LC_grade_show_user # print end of form