version 1.118, 2003/07/17 22:08:25
|
version 1.119, 2003/07/18 20:14:35
|
Line 140 sub showResourceInfo {
|
Line 140 sub showResourceInfo {
|
#--- Currently filters option response type only. |
#--- Currently filters option response type only. |
sub cleanRecord { |
sub cleanRecord { |
my ($answer,$response) = @_; |
my ($answer,$response) = @_; |
$answer =~ s|^<br />||; |
|
if ($response eq 'option') { |
if ($response eq 'option') { |
my (@IDs,@ans); |
my (@IDs,@ans); |
foreach (split(/\&/,&Apache::lonnet::unescape($answer))) { |
foreach (split(/\&/,&Apache::lonnet::unescape($answer))) { |
Line 471 LISTJAVASCRIPT
|
Line 470 LISTJAVASCRIPT
|
$request->print($result); |
$request->print($result); |
|
|
my $checkhdgrade = ($ENV{'form.handgrade'} eq 'yes' && scalar(@$partlist) > 1 ) ? 'checked' : ''; |
my $checkhdgrade = ($ENV{'form.handgrade'} eq 'yes' && scalar(@$partlist) > 1 ) ? 'checked' : ''; |
my $checklastsub = ($ENV{'form.handgrade'} eq 'no') ? 'checked' : ''; |
my $checklastsub = $checkhdgrade eq '' ? 'checked' : ''; |
$checklastsub = 'checked' if ($checkhdgrade eq '' && $checklastsub eq ''); |
|
my $gradeTable='<form action="/adm/grades" method="post" name="gradesub">'."\n". |
my $gradeTable='<form action="/adm/grades" method="post" name="gradesub">'."\n". |
' <b>View Problem Text: </b><input type="radio" name="vProb" value="no" checked /> no '."\n". |
' <b>View Problem Text: </b><input type="radio" name="vProb" value="no" checked /> no '."\n". |
'<input type="radio" name="vProb" value="yes" /> one student '."\n". |
'<input type="radio" name="vProb" value="yes" /> one student '."\n". |
Line 1033 sub sub_page_kw_js {
|
Line 1031 sub sub_page_kw_js {
|
hDoc.write(" self.close()"); |
hDoc.write(" self.close()"); |
hDoc.write("}"); |
hDoc.write("}"); |
|
|
/* hDoc.write("function radioSelection(radioButton) {"); |
|
hDoc.write(" var selection=null;"); |
|
hDoc.write(" for (var i=0; i<radioButton.length; i++) {"); |
|
hDoc.write(" if (radioButton[i].checked) {"); |
|
hDoc.write(" selection=radioButton[i].value;"); |
|
hDoc.write(" return selection;"); |
|
hDoc.write(" }"); |
|
hDoc.write(" }"); |
|
hDoc.write("}"); */ |
|
|
|
hDoc.write("<"); |
hDoc.write("<"); |
hDoc.write("/script>"); |
hDoc.write("/script>"); |
|
|
Line 1233 sub submission {
|
Line 1221 sub submission {
|
$request->print('<form action="/adm/grades" method="post" name="SCORE">'."\n". |
$request->print('<form action="/adm/grades" method="post" name="SCORE">'."\n". |
'<input type="hidden" name="command" value="handgrade" />'."\n". |
'<input type="hidden" name="command" value="handgrade" />'."\n". |
'<input type="hidden" name="saveState" value="'.$ENV{'form.saveState'}.'" />'."\n". |
'<input type="hidden" name="saveState" value="'.$ENV{'form.saveState'}.'" />'."\n". |
|
'<input type="hidden" name="Status" value="'.$ENV{'form.Status'}.'" />'."\n". |
'<input type="hidden" name="probTitle" value="'.$ENV{'form.probTitle'}.'" />'."\n". |
'<input type="hidden" name="probTitle" value="'.$ENV{'form.probTitle'}.'" />'."\n". |
'<input type="hidden" name="refresh" value="off" />'."\n". |
'<input type="hidden" name="refresh" value="off" />'."\n". |
'<input type="hidden" name="symb" value="'.$symb.'" />'."\n". |
'<input type="hidden" name="symb" value="'.$symb.'" />'."\n". |
Line 1377 KEYWORDS
|
Line 1366 KEYWORDS
|
$$fullname{$ENV{'form.'.$uname.':'.$udom.':submitted_by'}}.'</a>'; |
$$fullname{$ENV{'form.'.$uname.':'.$udom.':submitted_by'}}.'</a>'; |
$request->print($submitby); |
$request->print($submitby); |
} else { |
} else { |
my ($string,$timestamp)= |
my ($string,$timestamp)= &get_last_submission (\%record); |
&get_last_submission (%record); |
|
my $lastsubonly=''. |
my $lastsubonly=''. |
($$timestamp eq '' ? '' : '<b>Date Submitted:</b> '. |
($$timestamp eq '' ? '' : '<b>Date Submitted:</b> '. |
$$timestamp)."</td></tr>\n"; |
$$timestamp)."</td></tr>\n"; |
Line 1416 KEYWORDS
|
Line 1404 KEYWORDS
|
'"><img src="/adm/lonIcons/unknown.gif" border=0"> File uploaded by student</a> '. |
'"><img src="/adm/lonIcons/unknown.gif" border=0"> File uploaded by student</a> '. |
'<font color="red" size="1">Like all files provided by users, '. |
'<font color="red" size="1">Like all files provided by users, '. |
'this file may contain virusses</font><br />':''). |
'this file may contain virusses</font><br />':''). |
'<b>Submitted Answer: </b>'.($responsetype eq 'essay' ? '<blockquote>' : ''). |
'<b>Submitted Answer: </b>'.($responsetype =~ /^(essay|option)$/ ? |
|
'<blockquote>' : ''). |
&cleanRecord(&keywords_highlight($subval),$responsetype). |
&cleanRecord(&keywords_highlight($subval),$responsetype). |
($responsetype eq 'essay' ? '</blockquote><br />' : '<br /><br />').$similar."\n" |
($responsetype =~ /^(essay|option)$/ ? '</blockquote><br />' : |
|
'<br /><br />').$similar."\n" |
if ($ENV{'form.lastSub'} eq 'lastonly' || |
if ($ENV{'form.lastSub'} eq 'lastonly' || |
($ENV{'form.lastSub'} eq 'hdgrade' && |
($ENV{'form.lastSub'} eq 'hdgrade' && |
$$handgrade{$part} =~ /:yes$/)); |
$$handgrade{$part} =~ /:yes$/)); |
Line 1439 KEYWORDS
|
Line 1429 KEYWORDS
|
|
|
# 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))) { |
# if (!&canmodify($usec)) { |
|
$request->print('</td></tr></table></td></tr></table></form>'."\n"); |
$request->print('</td></tr></table></td></tr></table></form>'."\n"); |
$request->print(&show_grading_menu_form($symb,$url)) |
$request->print(&show_grading_menu_form($symb,$url)) |
if (($ENV{'form.command'} eq 'submission') || |
if (($ENV{'form.command'} eq 'submission') || |
Line 1447 KEYWORDS
|
Line 1436 KEYWORDS
|
return; |
return; |
} |
} |
|
|
|
$result='<input type="hidden" name="newmsg'.$counter.'" value="" />'."\n". |
|
'<input type="hidden" name="includemsg'.$counter.'" value="" />'."\n". |
|
'<input type="hidden" name="unamedom'.$counter.'" value="'.$uname.':' |
|
.$udom.'" />'."\n"; |
# essay grading options |
# essay grading options |
if ($ENV{'form.handgrade'} eq 'yes') { |
if ($ENV{'form.handgrade'} eq 'yes') { |
$result='<input type="hidden" name="newmsg'.$counter.'" value="" />'."\n". |
|
'<input type="hidden" name="includemsg'.$counter.'" value="" />'."\n". |
|
'<input type="hidden" name="unamedom'.$counter.'" value="'.$uname.':' |
|
.$udom.'" />'."\n"; |
|
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 1468 KEYWORDS
|
Line 1457 KEYWORDS
|
'/mailbkgrd.gif" width="14" height="10" name="mailicon'.$counter.'" />'."\n". |
'/mailbkgrd.gif" width="14" height="10" name="mailicon'.$counter.'" />'."\n". |
'<br /> (Message will be sent when you click on Save & Next below.)'."\n" |
'<br /> (Message will be sent when you click on Save & Next below.)'."\n" |
if ($ENV{'form.handgrade'} eq 'yes'); |
if ($ENV{'form.handgrade'} eq 'yes'); |
$request->print($result); |
|
} |
} |
|
$request->print($result); |
|
|
my %seen = (); |
my %seen = (); |
my @partlist; |
my @partlist; |
Line 1496 KEYWORDS
|
Line 1485 KEYWORDS
|
if ($counter == $total) { |
if ($counter == $total) { |
my $endform='<table border="0"><tr><td>'. |
my $endform='<table border="0"><tr><td>'. |
'<input type="hidden" name="gradeOpt" value="" />'."\n"; |
'<input type="hidden" name="gradeOpt" value="" />'."\n"; |
# if ($ENV{'form.handgrade'} eq 'yes') { |
$endform.='<input type="button" value="Save & Next" '. |
$endform.='<input type="button" value="Save & Next" '. |
'onClick="javascript:checksubmit(this.form,\'Save & Next\','. |
'onClick="javascript:checksubmit(this.form,\'Save & Next\','. |
$total.','.scalar(@partlist).');" TARGET=_self> '."\n"; |
$total.','.scalar(@partlist).');" TARGET=_self> '."\n"; |
my $ntstu ='<select name="NTSTU">'. |
my $ntstu ='<select name="NTSTU">'. |
'<option>1</option><option>2</option>'. |
'<option>1</option><option>2</option>'. |
'<option>3</option><option>5</option>'. |
'<option>3</option><option>5</option>'. |
'<option>7</option><option>10</option></select>'."\n"; |
'<option>7</option><option>10</option></select>'."\n"; |
my $nsel = ($ENV{'form.NTSTU'} ne '' ? $ENV{'form.NTSTU'} : '1'); |
my $nsel = ($ENV{'form.NTSTU'} ne '' ? $ENV{'form.NTSTU'} : '1'); |
$ntstu =~ s/<option>$nsel</<option selected="on">$nsel</; |
$ntstu =~ s/<option>$nsel</<option selected="on">$nsel</; |
$endform.=$ntstu.'student(s) '; |
$endform.=$ntstu.'student(s) '; |
|
# } else { |
|
# $endform.='<input type="hidden" name="NTSTU" value="1" />'."\n"; |
|
# } |
|
$endform.='<input type="button" value="Next" '. |
$endform.='<input type="button" value="Next" '. |
'onClick="javascript:checksubmit(this.form,\'Next\');" TARGET=_self> '."\n". |
'onClick="javascript:checksubmit(this.form,\'Next\');" TARGET=_self> '."\n". |
'<input type="button" value="Previous" '. |
'<input type="button" value="Previous" '. |
'onClick="javascript:checksubmit(this.form,\'Previous\');" TARGET=_self> '; |
'onClick="javascript:checksubmit(this.form,\'Previous\');" TARGET=_self> '; |
$endform.='(Next and Previous do not save the scores.)'."\n" ; |
$endform.='(Next and Previous do not save the scores.)'."\n" ; |
# if ($ENV{'form.handgrade'} eq 'yes'); |
|
$endform.='</td><tr></table></form>'; |
$endform.='</td><tr></table></form>'; |
$endform.=&show_grading_menu_form($symb,$url); |
$endform.=&show_grading_menu_form($symb,$url); |
$request->print($endform); |
$request->print($endform); |
Line 1525 KEYWORDS
|
Line 1509 KEYWORDS
|
|
|
#--- Retrieve the last submission for all the parts |
#--- Retrieve the last submission for all the parts |
sub get_last_submission { |
sub get_last_submission { |
my (%returnhash)=@_; |
my ($returnhash)=@_; |
my (@string,$timestamp); |
my (@string,$timestamp); |
if ($returnhash{'version'}) { |
if ($$returnhash{'version'}) { |
my %lasthash=(); |
my %lasthash=(); |
my ($version); |
my ($version); |
for ($version=1;$version<=$returnhash{'version'};$version++) { |
for ($version=1;$version<=$$returnhash{'version'};$version++) { |
foreach (sort(split(/\:/,$returnhash{$version.':keys'}))) { |
foreach (sort(split(/\:/,$$returnhash{$version.':keys'}))) { |
$lasthash{$_}=$returnhash{$version.':'.$_}; |
$lasthash{$_}=$$returnhash{$version.':'.$_}; |
$timestamp = scalar(localtime($returnhash{$version.':timestamp'})); |
$timestamp = scalar(localtime($$returnhash{$version.':timestamp'})); |
} |
} |
} |
} |
foreach ((keys %lasthash)) { |
foreach ((keys %lasthash)) { |
Line 1557 sub keywords_highlight {
|
Line 1541 sub keywords_highlight {
|
(my $styleoff = $styleon) =~ s/\</\<\//; |
(my $styleoff = $styleon) =~ s/\</\<\//; |
my @keylist = split(/[,\s+]/,$ENV{'form.keywords'}); |
my @keylist = split(/[,\s+]/,$ENV{'form.keywords'}); |
foreach (@keylist) { |
foreach (@keylist) { |
$string =~ s/\b\Q$_\E(\b|\.)/\<font color\=$ENV{'form.kwclr'} $size\>$styleon$_$styleoff\<\/font\>/gi; |
$string =~ s/\b\Q$_\E(\b|\.)/<font color\=$ENV{'form.kwclr'} $size\>$styleon$_$styleoff<\/font>/gi; |
} |
} |
# This is not really the right place to do this, but I cannot find a |
|
# better one at this time. So here we go - the m in the s:::mg causes |
|
# ^ to match the beginning of a new line. So we replace(???) the beginning |
|
# of the line with <br /> to make things formatted a little better. |
|
$string =~ s:^:<br />:mg; |
|
return $string; |
return $string; |
} |
} |
|
|
Line 1609 sub processHandGrade {
|
Line 1588 sub processHandGrade {
|
if ($ENV{'form.collaborator'.$ctr}) { |
if ($ENV{'form.collaborator'.$ctr}) { |
my (@collaborators) = split(/:/,$ENV{'form.collaborator'.$ctr}); |
my (@collaborators) = split(/:/,$ENV{'form.collaborator'.$ctr}); |
foreach (@collaborators) { |
foreach (@collaborators) { |
my ($errorflag,$pts,$wgt) = &saveHandGrade($request,$url,$symb,$_,$udom,$ctr,$ENV{'form.unamedom'.$ctr}); |
my ($errorflag,$pts,$wgt) = |
|
&saveHandGrade($request,$url,$symb,$_,$udom,$ctr,$ENV{'form.unamedom'.$ctr}); |
if ($errorflag eq 'not_allowed') { |
if ($errorflag eq 'not_allowed') { |
$request->print("<font color=\"red\">Not allowed to modify grades for $_:$udom</font>"); |
$request->print("<font color=\"red\">Not allowed to modify grades for $_:$udom</font>"); |
next; |
next; |
Line 1626 sub processHandGrade {
|
Line 1606 sub processHandGrade {
|
} |
} |
} |
} |
|
|
# Keywords sorted in alphabatical order |
if ($ENV{'form.handgrade'} eq 'yes') { |
my $loginuser = $ENV{'user.name'}.':'.$ENV{'user.domain'}; |
# Keywords sorted in alphabatical order |
my %keyhash = (); |
my $loginuser = $ENV{'user.name'}.':'.$ENV{'user.domain'}; |
$ENV{'form.keywords'} =~ s/,\s{0,}|\s+/ /g; |
my %keyhash = (); |
$ENV{'form.keywords'} =~ s/^\s+|\s+$//; |
$ENV{'form.keywords'} =~ s/,\s{0,}|\s+/ /g; |
my (@keywords) = sort(split(/\s+/,$ENV{'form.keywords'})); |
$ENV{'form.keywords'} =~ s/^\s+|\s+$//; |
$ENV{'form.keywords'} = join(' ',@keywords); |
my (@keywords) = sort(split(/\s+/,$ENV{'form.keywords'})); |
$keyhash{$symb.'_keywords'} = $ENV{'form.keywords'}; |
$ENV{'form.keywords'} = join(' ',@keywords); |
$keyhash{$symb.'_subject'} = $ENV{'form.msgsub'}; |
$keyhash{$symb.'_keywords'} = $ENV{'form.keywords'}; |
$keyhash{$loginuser.'_kwclr'} = $ENV{'form.kwclr'}; |
$keyhash{$symb.'_subject'} = $ENV{'form.msgsub'}; |
$keyhash{$loginuser.'_kwsize'} = $ENV{'form.kwsize'}; |
$keyhash{$loginuser.'_kwclr'} = $ENV{'form.kwclr'}; |
$keyhash{$loginuser.'_kwstyle'} = $ENV{'form.kwstyle'}; |
$keyhash{$loginuser.'_kwsize'} = $ENV{'form.kwsize'}; |
|
$keyhash{$loginuser.'_kwstyle'} = $ENV{'form.kwstyle'}; |
# message center - Order of message gets changed. Blank line is eliminated. |
|
# New messages are saved in ENV for the next student. |
# message center - Order of message gets changed. Blank line is eliminated. |
# All messages are saved in nohist_handgrade.db |
# New messages are saved in ENV for the next student. |
my ($ctr,$idx) = (1,1); |
# All messages are saved in nohist_handgrade.db |
while ($ctr <= $ENV{'form.savemsgN'}) { |
my ($ctr,$idx) = (1,1); |
if ($ENV{'form.savemsg'.$ctr} ne '') { |
while ($ctr <= $ENV{'form.savemsgN'}) { |
$keyhash{$symb.'_savemsg'.$idx} = $ENV{'form.savemsg'.$ctr}; |
if ($ENV{'form.savemsg'.$ctr} ne '') { |
$idx++; |
$keyhash{$symb.'_savemsg'.$idx} = $ENV{'form.savemsg'.$ctr}; |
|
$idx++; |
|
} |
|
$ctr++; |
} |
} |
$ctr++; |
$ctr = 0; |
} |
while ($ctr < $ngrade) { |
$ctr = 0; |
if ($ENV{'form.newmsg'.$ctr} ne '') { |
while ($ctr < $ngrade) { |
$keyhash{$symb.'_savemsg'.$idx} = $ENV{'form.newmsg'.$ctr}; |
if ($ENV{'form.newmsg'.$ctr} ne '') { |
$ENV{'form.savemsg'.$idx} = $ENV{'form.newmsg'.$ctr}; |
$keyhash{$symb.'_savemsg'.$idx} = $ENV{'form.newmsg'.$ctr}; |
$idx++; |
$ENV{'form.savemsg'.$idx} = $ENV{'form.newmsg'.$ctr}; |
} |
$idx++; |
$ctr++; |
} |
} |
$ctr++; |
$ENV{'form.savemsgN'} = --$idx; |
|
$keyhash{$symb.'_savemsgN'} = $ENV{'form.savemsgN'}; |
|
my $putresult = &Apache::lonnet::put |
|
('nohist_handgrade',\%keyhash, |
|
$ENV{'course.'.$ENV{'request.course.id'}.'.domain'}, |
|
$ENV{'course.'.$ENV{'request.course.id'}.'.num'}); |
} |
} |
$ENV{'form.savemsgN'} = --$idx; |
|
$keyhash{$symb.'_savemsgN'} = $ENV{'form.savemsgN'}; |
|
my $putresult = &Apache::lonnet::put |
|
('nohist_handgrade',\%keyhash, |
|
$ENV{'course.'.$ENV{'request.course.id'}.'.domain'}, |
|
$ENV{'course.'.$ENV{'request.course.id'}.'.num'}); |
|
|
|
# Called by Save & Refresh from Highlight Attribute Window |
# Called by Save & Refresh from Highlight Attribute Window |
my (undef,undef,$fullname) = &getclasslist($ENV{'form.section'},'0'); |
# my (undef,undef,$fullname) = &getclasslist($ENV{'form.section'},'0'); |
|
my (undef,undef,$fullname) = &getclasslist($ENV{'form.section'},'1'); |
if ($ENV{'form.refresh'} eq 'on') { |
if ($ENV{'form.refresh'} eq 'on') { |
my ($ctr,$total) = (0,0); |
my ($ctr,$total) = (0,0); |
while ($ctr < $ngrade) { |
while ($ctr < $ngrade) { |
Line 1689 sub processHandGrade {
|
Line 1671 sub processHandGrade {
|
# Get the next/previous one or group of students |
# Get the next/previous one or group of students |
my $firststu = $ENV{'form.unamedom0'}; |
my $firststu = $ENV{'form.unamedom0'}; |
my $laststu = $ENV{'form.unamedom'.($ngrade-1)}; |
my $laststu = $ENV{'form.unamedom'.($ngrade-1)}; |
$ctr = 2; |
my $ctr = 2; |
while ($laststu eq '') { |
while ($laststu eq '') { |
$laststu = $ENV{'form.unamedom'.($ngrade-$ctr)}; |
$laststu = $ENV{'form.unamedom'.($ngrade-$ctr)}; |
$ctr++; |
$ctr++; |
Line 1773 sub saveHandGrade {
|
Line 1755 sub saveHandGrade {
|
$wgt = $ENV{'form.WGT'.$newflg.'_'.$_} eq '' ? 1 : |
$wgt = $ENV{'form.WGT'.$newflg.'_'.$_} eq '' ? 1 : |
$ENV{'form.WGT'.$newflg.'_'.$_}; |
$ENV{'form.WGT'.$newflg.'_'.$_}; |
my $partial= $pts/$wgt; |
my $partial= $pts/$wgt; |
|
next if ($partial eq $record{'resource.'.$_.'.awarded'}); #do not update score for part if not changed. |
$newrecord{'resource.'.$_.'.awarded'} = $partial |
$newrecord{'resource.'.$_.'.awarded'} = $partial |
if ($record{'resource.'.$_.'.awarded'} ne $partial); |
if ($record{'resource.'.$_.'.awarded'} ne $partial); |
my $reckey = 'resource.'.$_.'.solved'; |
my $reckey = 'resource.'.$_.'.solved'; |
Line 2047 sub viewgrades {
|
Line 2030 sub viewgrades {
|
'<input type="hidden" name="totalparts" value="'.$ctsparts.'" />'; |
'<input type="hidden" name="totalparts" value="'.$ctsparts.'" />'; |
$result.='<input type="button" value="Reset" '. |
$result.='<input type="button" value="Reset" '. |
'onClick="javascript:resetEntry('.$ctsparts.');" TARGET=_self>'; |
'onClick="javascript:resetEntry('.$ctsparts.');" TARGET=_self>'; |
# $result.=' <input type="button" value="Submit Changes" name="subButton1'. |
|
# 'onClick="javascript:submit();" TARGET=_self />'."\n"; |
|
|
|
#table listing all the students in a section/class |
#table listing all the students in a section/class |
#header of table |
#header of table |
Line 2824 sub displayPage {
|
Line 2805 sub displayPage {
|
if ($record{'version'} eq '') { |
if ($record{'version'} eq '') { |
$studentTable.='<br /> <font color="red">No recorded submission for this problem</font><br />'; |
$studentTable.='<br /> <font color="red">No recorded submission for this problem</font><br />'; |
} else { |
} else { |
$studentTable.='<table border="0" width="100%"><tr><td bgcolor="#777777">'. |
|
'<table border="0" width="100%"><tr bgcolor="#e6ffff">'. |
|
'<td><b>Date/Time</b></td>'. |
|
'<td><b>Submission</b></td>'. |
|
'<td><b>Status </b></td></tr>'; |
|
my %responseType = (); |
my %responseType = (); |
foreach my $partid (@{$parts}) { |
foreach my $partid (@{$parts}) { |
$responseType{$partid} = $curRes->responseType($partid); |
$responseType{$partid} = $curRes->responseType($partid); |
} |
} |
my ($version); |
$studentTable.= &displaySubByDates(\%record,$parts,\%responseType,$checkIcon); |
my %mark; |
|
$mark{'correct_by_student'} = $checkIcon; |
|
for ($version=1;$version<=$record{'version'};$version++) { |
|
my $timestamp = scalar(localtime($record{$version.':timestamp'})); |
|
$studentTable.='<tr bgcolor="#ffffff" valign="top"><td>'.$timestamp.'</td>'; |
|
my @versionKeys = split(/\:/,$record{$version.':keys'}); |
|
my @displaySub = (); |
|
foreach my $partid (@{$parts}) { |
|
my @matchKey = grep /^resource\.$partid\..*?\.submission$/,@versionKeys; |
|
next if ($record{"$version:resource.$partid.solved"} eq ''); |
|
$displaySub[0].=(exists $record{$version.':'.$matchKey[0]}) ? |
|
'<b>Part '.$partid.' '. |
|
($record{"$version:resource.$partid.tries"} eq '' ? 'Trial not counted' : |
|
'Trial '.$record{"$version:resource.$partid.tries"}).'</b> '. |
|
&cleanRecord($record{$version.':'.$matchKey[0]},$responseType{$partid}).'<br />' : ''; |
|
$displaySub[1].=(exists $record{"$version:resource.$partid.award"}) ? |
|
'<b>Part '.$partid.'</b> '. |
|
lc($record{"$version:resource.$partid.award"}).' '. |
|
$mark{$record{"$version:resource.$partid.solved"}}.'<br />' : ''; |
|
# $record{"$version:resource.$partid.solved"}.'<br />' : ''; |
|
$displaySub[2].=(exists $record{"$version:resource.$partid.regrader"}) ? |
|
$record{"$version:resource.$partid.regrader"}.' (<b>Part:</b> '.$partid.')' : ''; |
|
} |
|
$displaySub[2].=(exists $record{"$version:resource.regrader"}) ? |
|
$record{"$version:resource.regrader"} : ''; |
|
$studentTable.='<td>'.$displaySub[0].' </td><td>'.$displaySub[1]. |
|
($displaySub[2] eq '' ? '' : 'Manually graded by '.$displaySub[2]).' </td></tr>'; |
|
} |
|
$studentTable.='</table></td></tr></table>'; |
|
} |
} |
} elsif ($ENV{'form.lastSub'} eq 'all') { |
} elsif ($ENV{'form.lastSub'} eq 'all') { |
my $last = ($ENV{'form.lastSub'} eq 'last' ? 'last' : ''); |
my $last = ($ENV{'form.lastSub'} eq 'last' ? 'last' : ''); |
Line 2896 sub displayPage {
|
Line 2843 sub displayPage {
|
return ''; |
return ''; |
} |
} |
|
|
|
sub displaySubByDates { |
|
my ($record,$parts,$responseType,$checkIcon) = @_; |
|
my $studentTable='<table border="0" width="100%"><tr><td bgcolor="#777777">'. |
|
'<table border="0" width="100%"><tr bgcolor="#e6ffff">'. |
|
'<td><b>Date/Time</b></td>'. |
|
'<td><b>Submission</b></td>'. |
|
'<td><b>Status </b></td></tr>'; |
|
my ($version); |
|
my %mark; |
|
$mark{'correct_by_student'} = $checkIcon; |
|
for ($version=1;$version<=$$record{'version'};$version++) { |
|
my $timestamp = scalar(localtime($$record{$version.':timestamp'})); |
|
$studentTable.='<tr bgcolor="#ffffff" valign="top"><td>'.$timestamp.'</td>'; |
|
my @versionKeys = split(/\:/,$$record{$version.':keys'}); |
|
my @displaySub = (); |
|
foreach my $partid (@{$parts}) { |
|
my @matchKey = grep /^resource\.$partid\..*?\.submission$/,@versionKeys; |
|
next if ($$record{"$version:resource.$partid.solved"} eq ''); |
|
$displaySub[0].=(exists $$record{$version.':'.$matchKey[0]}) ? |
|
'<b>Part '.$partid.' '. |
|
($$record{"$version:resource.$partid.tries"} eq '' ? 'Trial not counted' : |
|
'Trial '.$$record{"$version:resource.$partid.tries"}).'</b> '. |
|
&cleanRecord($$record{$version.':'.$matchKey[0]},$$responseType{$partid}).'<br />' : ''; |
|
$displaySub[1].=(exists $$record{"$version:resource.$partid.award"}) ? |
|
'<b>Part '.$partid.'</b> '. |
|
lc($$record{"$version:resource.$partid.award"}).' '. |
|
$mark{$$record{"$version:resource.$partid.solved"}}.'<br />' : ''; |
|
# $$record{"$version:resource.$partid.solved"}.'<br />' : ''; |
|
$displaySub[2].=(exists $$record{"$version:resource.$partid.regrader"}) ? |
|
$$record{"$version:resource.$partid.regrader"}.' (<b>Part:</b> '.$partid.')' : ''; |
|
} |
|
$displaySub[2].=(exists $$record{"$version:resource.regrader"}) ? |
|
$$record{"$version:resource.regrader"} : ''; |
|
$studentTable.='<td>'.$displaySub[0].' </td><td>'.$displaySub[1]. |
|
($displaySub[2] eq '' ? '' : 'Manually graded by '.$displaySub[2]).' </td></tr>'; |
|
} |
|
$studentTable.='</table></td></tr></table>'; |
|
return $studentTable; |
|
} |
|
|
sub updateGradeByPage { |
sub updateGradeByPage { |
my ($request) = shift; |
my ($request) = shift; |
|
|