version 1.467, 2007/10/26 00:39:09
|
version 1.468, 2007/10/26 00:41:31
|
Line 1739 sub show_problem {
|
Line 1739 sub show_problem {
|
$companswer=~s|</form>||g; |
$companswer=~s|</form>||g; |
$companswer=~s|name="submit"|name="would_have_been_submit"|g; |
$companswer=~s|name="submit"|name="would_have_been_submit"|g; |
} |
} |
my $result.='<table border="0" width="100%"><tr><td bgcolor="#777777">'; |
$rendered= |
$result.='<table border="0" width="100%">'; |
'<div class="LC_grade_show_problem_header">'. |
if ($viewon) { |
&mt('View of the problem'). |
$result.='<tr><td bgcolor="#e6ffff"><b> '; |
'</div><div class="LC_grade_show_problem_problem">'. |
if ($mode eq 'both' or $mode eq 'text') { |
$rendered. |
$result.='View of the problem - '; |
'</div>'; |
} else { |
$companswer= |
$result.='Correct answer: '; |
'<div class="LC_grade_show_problem_header">'. |
} |
&mt('Correct answer'). |
$result.=$env{'form.fullname'}.'</b></td></tr>'; |
'</div><div class="LC_grade_show_problem_problem">'. |
} |
$companswer. |
|
'</div>'; |
|
my $result; |
if ($mode eq 'both') { |
if ($mode eq 'both') { |
$result.='<tr><td bgcolor="#ffffff">'.$rendered.'<br />'; |
$result=$rendered.$companswer; |
$result.='<b>Correct answer:</b><br />'.$companswer; |
|
} elsif ($mode eq 'text') { |
} elsif ($mode eq 'text') { |
$result.='<tr><td bgcolor="#ffffff">'.$rendered; |
$result=$rendered; |
} elsif ($mode eq 'answer') { |
} elsif ($mode eq 'answer') { |
$result.='<tr><td bgcolor="#ffffff">'.$companswer; |
$result=$companswer; |
} |
} |
$result.='</td></tr></table>'; |
$result='<div class="LC_grade_show_problem">'.$result.'</div>'; |
$result.='</td></tr></table><br />'; |
|
return $result; |
return $result; |
} |
} |
|
|
Line 1959 KEYWORDS
|
Line 1959 KEYWORDS
|
} |
} |
|
|
# This is where output for one specific student would start |
# This is where output for one specific student would start |
my $bgcolor='#DDEEDD'; |
my $add_class = ($counter%2) ? 'LC_grade_show_user_odd_row' : ''; |
if ($counter%2) { $bgcolor='#DDDDEE'; } |
|
$request->print("\n\n". |
$request->print("\n\n". |
'<p><table border="2"><tr><th bgcolor="'.$bgcolor.'">'.$env{'form.fullname'}.'</th></tr><tr><td bgcolor="'.$bgcolor.'">'); |
'<div class="LC_grade_show_user '.$add_class.'">'. |
|
'<div class="LC_grade_user_name">'.&nameUserString(undef,$env{'form.fullname'},$uname,$udom).'</div>'. |
|
'<div class="LC_grade_show_user_body">'."\n"); |
|
|
if ($env{'form.vProb'} eq 'all' or $env{'form.vAns'} eq 'all') { |
if ($env{'form.vProb'} eq 'all' or $env{'form.vAns'} eq 'all') { |
my $mode; |
my $mode; |
Line 1982 KEYWORDS
|
Line 1983 KEYWORDS
|
|
|
# Display student info |
# Display student info |
$request->print(($counter == 0 ? '' : '<br />')); |
$request->print(($counter == 0 ? '' : '<br />')); |
my $result='<table border="0" width="100%"><tr><td bgcolor="#777777">'."\n". |
my $result='<div class="LC_grade_submissions">'; |
'<table border="0" width="100%"><tr bgcolor="#edffff"><td>'."\n"; |
|
|
$result.='<div class="LC_grade_submissions_header">'; |
$result.='<b>Fullname: </b>'.&nameUserString(undef,$env{'form.fullname'},$uname,$udom).'<br />'."\n"; |
$result.= &mt('Submissions'); |
$result.='<input type="hidden" name="name'.$counter. |
$result.='<input type="hidden" name="name'.$counter. |
'" value="'.$env{'form.fullname'}.'" />'."\n"; |
'" value="'.$env{'form.fullname'}.'" />'."\n"; |
|
|
Line 1999 KEYWORDS
|
Line 2000 KEYWORDS
|
$result.=$sub_result; |
$result.=$sub_result; |
} |
} |
$request->print($result."\n"); |
$request->print($result."\n"); |
|
$request->print('</div>'."\n"); |
# print student answer/submission |
# print student answer/submission |
# Options are (1) Handgaded submission only |
# Options are (1) Handgaded submission only |
# (2) Last submission, includes submission that is not handgraded |
# (2) Last submission, includes submission that is not handgraded |
Line 2008 KEYWORDS
|
Line 2009 KEYWORDS
|
# (4) The whole record for this student |
# (4) The whole record for this student |
if ($env{'form.lastSub'} =~ /^(lastonly|hdgrade)$/) { |
if ($env{'form.lastSub'} =~ /^(lastonly|hdgrade)$/) { |
my ($string,$timestamp)= &get_last_submission(\%record); |
my ($string,$timestamp)= &get_last_submission(\%record); |
my $lastsubonly=''. |
|
($$timestamp eq '' ? '' : '<b>Date Submitted:</b> '. |
my $lastsubonly; |
$$timestamp)."</td></tr>\n"; |
|
if ($$timestamp eq '') { |
if ($$timestamp eq '') { |
$lastsubonly.='<tr><td bgcolor="#ffffe6">'.$$string[0]; |
$lastsubonly.='<div class="LC_grade_submissions_body">'.$$string[0].'</div>'; |
} else { |
} else { |
|
$lastsubonly = '<div class="LC_grade_submissions_body"> <b>Date Submitted:</b> '.$$timestamp."\n"; |
|
|
my %seenparts; |
my %seenparts; |
my @part_response_id = &flatten_responseType($responseType); |
my @part_response_id = &flatten_responseType($responseType); |
foreach my $part (@part_response_id) { |
foreach my $part (@part_response_id) { |
Line 2036 KEYWORDS
|
Line 2039 KEYWORDS
|
} |
} |
my $responsetype = $responseType->{$partid}->{$respid}; |
my $responsetype = $responseType->{$partid}->{$respid}; |
if (!exists($record{"resource.$partid.$respid.submission"})) { |
if (!exists($record{"resource.$partid.$respid.submission"})) { |
$lastsubonly.='<tr><td bgcolor="#ffffe6"><b>Part:</b> '. |
$lastsubonly.="\n".'<div class="LC_grade_submission_part"><b>Part:</b> '. |
$display_part.' <span class="LC_internal_info">( ID '.$respid. |
$display_part.' <span class="LC_internal_info">( ID '.$respid. |
' )</span> '. |
' )</span> '. |
'<span class="LC_warning">Nothing submitted - no attempts</span><br /><br />'; |
'<span class="LC_warning">'.&mt('Nothing submitted - no attempts').'</span><br /><br /></div>'; |
next; |
next; |
} |
} |
foreach (@$string) { |
foreach my $submission (@$string) { |
my ($partid,$respid) = /^resource\.([^\.]*)\.([^\.]*)\.submission/; |
my ($partid,$respid) = ($submission =~ /^resource\.([^\.]*)\.([^\.]*)\.submission/); |
if (join('_',@{$part}) ne ($partid.'_'.$respid)) { next; } |
if (join('_',@{$part}) ne ($partid.'_'.$respid)) { next; } |
my ($ressub,$subval) = split(/:/,$_,2); |
my ($ressub,$subval) = split(/:/,$submission,2); |
# Similarity check |
# Similarity check |
my $similar=''; |
my $similar=''; |
if($env{'form.checkPlag'}){ |
if($env{'form.checkPlag'}){ |
Line 2075 KEYWORDS
|
Line 2078 KEYWORDS
|
($env{'form.lastSub'} eq 'hdgrade' && |
($env{'form.lastSub'} eq 'hdgrade' && |
$$handgrade{$$part[0].'_'.$$part[1]} eq 'yes')) { |
$$handgrade{$$part[0].'_'.$$part[1]} eq 'yes')) { |
my $display_part=&get_display_part($partid,$symb); |
my $display_part=&get_display_part($partid,$symb); |
$lastsubonly.='<tr><td bgcolor="#ffffe6"><b>Part:</b> '. |
$lastsubonly.='<div class="LC_grade_submission_part"><b>Part:</b> '. |
$display_part.' <span class="LC_internal_info">( ID '.$respid. |
$display_part.' <span class="LC_internal_info">( ID '.$respid. |
' )</span> '; |
' )</span> '; |
my $files=&get_submitted_files($udom,$uname,$partid,$respid,\%record); |
my $files=&get_submitted_files($udom,$uname,$partid,$respid,\%record); |
if (@$files) { |
if (@$files) { |
$lastsubonly.='<br /><span class="LC_warning">Like all files provided by users, this file may contain virusses</span><br />'; |
$lastsubonly.='<br /><span class="LC_warning">'.&mt('Like all files provided by users, this file may contain virusses').'</span><br />'; |
my $file_counter = 0; |
my $file_counter = 0; |
foreach my $file (@$files) { |
foreach my $file (@$files) { |
$file_counter ++; |
$file_counter++; |
&Apache::lonnet::allowuploaded('/adm/grades',$file); |
&Apache::lonnet::allowuploaded('/adm/grades',$file); |
$lastsubonly.='<br /><a href="'.$file.'?rawmode=1" target="lonGRDs"><img src="'.&Apache::loncommon::icon($file).'" border=0"> '.$file.'</a>'; |
$lastsubonly.='<br /><a href="'.$file.'?rawmode=1" target="lonGRDs"><img src="'.&Apache::loncommon::icon($file).'" border=0"> '.$file.'</a>'; |
} |
} |
$lastsubonly.='<br />'; |
$lastsubonly.='<br />'; |
} |
} |
$lastsubonly.='<b>Submitted Answer: </b>'. |
$lastsubonly.='<b>'.&mt('Submitted Answer:').' </b>'. |
&cleanRecord($subval,$responsetype,$symb,$partid, |
&cleanRecord($subval,$responsetype,$symb,$partid, |
$respid,\%record,$order); |
$respid,\%record,$order); |
if ($similar) {$lastsubonly.="<br /><br />$similar\n";} |
if ($similar) {$lastsubonly.="<br /><br />$similar\n";} |
|
$lastsubonly.='</div>'; |
} |
} |
} |
} |
} |
} |
|
$lastsubonly.='</div>'."\n"; |
} |
} |
$lastsubonly.='</td></tr><tr bgcolor="#ffffff"><td>'."\n"; |
|
$request->print($lastsubonly); |
$request->print($lastsubonly); |
} elsif ($env{'form.lastSub'} eq 'datesub') { |
} elsif ($env{'form.lastSub'} eq 'datesub') { |
my (undef,$responseType,undef,$parts) = &showResourceInfo($symb); |
my (undef,$responseType,undef,$parts) = &showResourceInfo($symb); |
$request->print(&displaySubByDates($symb,\%record,$parts,$responseType,$checkIcon,$uname,$udom)); |
$request->print(&displaySubByDates($symb,\%record,$parts,$responseType,$checkIcon,$uname,$udom)); |
} elsif ($env{'form.lastSub'} =~ /^(last|all)$/) { |
} elsif ($env{'form.lastSub'} =~ /^(last|all)$/) { |
Line 2111 KEYWORDS
|
Line 2115 KEYWORDS
|
|
|
$request->print('<input type="hidden" name="unamedom'.$counter.'" value="'.$uname.':' |
$request->print('<input type="hidden" name="unamedom'.$counter.'" value="'.$uname.':' |
.$udom.'" />'."\n"); |
.$udom.'" />'."\n"); |
|
|
# return if view submission with no grading option |
# return if view submission with no grading option |
if ($env{'form.showgrading'} eq '' || (!&canmodify($usec))) { |
if ($env{'form.showgrading'} eq '' || (!&canmodify($usec))) { |
my $toGrade.='<input type="button" value="Grade Student" '. |
my $toGrade.='<input type="button" value="Grade Student" '. |
'onClick="javascript:checksubmit(this.form,\'Grade Student\',\'' |
'onClick="javascript:checksubmit(this.form,\'Grade Student\',\'' |
.$counter.'\');" target="_self" /> '."\n" if (&canmodify($usec)); |
.$counter.'\');" target="_self" /> '."\n" if (&canmodify($usec)); |
$toGrade.='</td></tr></table></td></tr></table>'."\n"; |
$toGrade.='</div>'."\n"; |
if (($env{'form.command'} eq 'submission') || |
if (($env{'form.command'} eq 'submission') || |
($env{'form.command'} eq 'processGroup' && $counter == $total)) { |
($env{'form.command'} eq 'processGroup' && $counter == $total)) { |
$toGrade.='</form>'.&show_grading_menu_form($symb); |
$toGrade.='</form>'.&show_grading_menu_form($symb); |
Line 2125 KEYWORDS
|
Line 2128 KEYWORDS
|
$request->print($toGrade); |
$request->print($toGrade); |
return; |
return; |
} else { |
} else { |
$request->print('</td></tr></table></td></tr></table>'."\n"); |
$request->print('</div>'."\n"); |
} |
} |
|
|
# essay grading message center |
# essay grading message center |
if ($env{'form.handgrade'} eq 'yes') { |
if ($env{'form.handgrade'} eq 'yes') { |
|
my $result='<div class="LC_grade_message_center">'; |
|
|
|
$result.='<div class="LC_grade_message_center_header">'. |
|
&mt('Send Message').'</div><div class="LC_grade_message_center_body">'; |
my ($lastname,$givenn) = split(/,/,$env{'form.fullname'}); |
my ($lastname,$givenn) = split(/,/,$env{'form.fullname'}); |
my $msgfor = $givenn.' '.$lastname; |
my $msgfor = $givenn.' '.$lastname; |
if (scalar(@$col_fullnames) > 0) { |
if (scalar(@$col_fullnames) > 0) { |
Line 2137 KEYWORDS
|
Line 2144 KEYWORDS
|
$msgfor .= ', '.(join ', ',@$col_fullnames).' and '.$lastone.'.'; |
$msgfor .= ', '.(join ', ',@$col_fullnames).' and '.$lastone.'.'; |
} |
} |
$msgfor =~ s/\'/\\'/g; #' stupid emacs - no! javascript |
$msgfor =~ s/\'/\\'/g; #' stupid emacs - no! javascript |
$result='<input type="hidden" name="includemsg'.$counter.'" value="" />'."\n". |
$result.='<input type="hidden" name="includemsg'.$counter.'" value="" />'."\n". |
'<input type="hidden" name="newmsg'.$counter.'" value="" />'."\n"; |
'<input type="hidden" name="newmsg'.$counter.'" value="" />'."\n"; |
$result.=' <a href="javascript:msgCenter(document.SCORE,'.$counter. |
$result.=' <a href="javascript:msgCenter(document.SCORE,'.$counter. |
',\''.$msgfor.'\');" target="_self">'. |
',\''.$msgfor.'\');" target="_self">'. |
Line 2146 KEYWORDS
|
Line 2153 KEYWORDS
|
'<img src="'.$request->dir_config('lonIconsURL'). |
'<img src="'.$request->dir_config('lonIconsURL'). |
'/mailbkgrd.gif" width="14" height="10" name="mailicon'.$counter.'" />'."\n". |
'/mailbkgrd.gif" width="14" height="10" name="mailicon'.$counter.'" />'."\n". |
'<br /> ('. |
'<br /> ('. |
&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.='</div></div>'; |
$request->print($result); |
$request->print($result); |
} |
} |
if ($perm{'vgr'}) { |
|
$request->print('<br />'. |
|
&Apache::loncommon::track_student_link(&mt('View recent activity'), |
|
$uname,$udom,'check')); |
|
} |
|
if ($perm{'opa'}) { |
|
$request->print('<br />'. |
|
&Apache::loncommon::pprmlink(&mt('Set/Change parameters'), |
|
$uname,$udom,$symb,'check')); |
|
} |
|
|
|
my %seen = (); |
my %seen = (); |
my @partlist; |
my @partlist; |
my @gradePartRespid; |
my @gradePartRespid; |
my @part_response_id = &flatten_responseType($responseType); |
my @part_response_id = &flatten_responseType($responseType); |
|
$request->print('<div class="LC_grade_assign">'. |
|
|
|
'<div class="LC_grade_assign_header">'. |
|
&mt('Assign Grades').'</div>'. |
|
'<div class="LC_grade_assign_body">'); |
foreach my $part_response_id (@part_response_id) { |
foreach my $part_response_id (@part_response_id) { |
my ($partid,$respid) = @{ $part_response_id }; |
my ($partid,$respid) = @{ $part_response_id }; |
my $part_resp = join('_',@{ $part_response_id }); |
my $part_resp = join('_',@{ $part_response_id }); |
Line 2175 KEYWORDS
|
Line 2178 KEYWORDS
|
push @gradePartRespid,$partid.'.'.$respid; |
push @gradePartRespid,$partid.'.'.$respid; |
$request->print(&gradeBox($request,$symb,$uname,$udom,$counter,$partid,\%record)); |
$request->print(&gradeBox($request,$symb,$uname,$udom,$counter,$partid,\%record)); |
} |
} |
|
$request->print('</div></div>'); |
|
|
|
$request->print('<div class="LC_grade_info_links">'); |
|
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')); |
|
} |
|
$request->print('</div>'); |
|
|
$result='<input type="hidden" name="partlist'.$counter. |
$result='<input type="hidden" name="partlist'.$counter. |
'" value="'.(join ":",@partlist).'" />'."\n"; |
'" value="'.(join ":",@partlist).'" />'."\n"; |
$result.='<input type="hidden" name="gradePartRespid'. |
$result.='<input type="hidden" name="gradePartRespid'. |
Line 2185 KEYWORDS
|
Line 2203 KEYWORDS
|
$partlist[$ctr].'" />'."\n"; |
$partlist[$ctr].'" />'."\n"; |
$ctr++; |
$ctr++; |
} |
} |
$request->print($result.'</td></tr></table></td></tr></table>'."\n"); |
$request->print($result.''."\n"); |
|
|
# Done with printing info for one student |
# Done with printing info for one student |
|
|
$request->print('</td></tr></table></p>'); |
$request->print('</div>');#LC_grade_show_user_body |
|
$request->print('</div>');#LC_grade_show_user |
|
|
|
|
# print end of form |
# print end of form |