version 1.121, 2003/07/21 13:32:49
|
version 1.124, 2003/07/23 18:04:51
|
Line 123 sub showResourceInfo {
|
Line 123 sub showResourceInfo {
|
my $result ='<table border="0">'. |
my $result ='<table border="0">'. |
'<tr><td colspan=3><font size=+1><b>Current Resource: </b>'.$probTitle.'</font></td></tr>'."\n"; |
'<tr><td colspan=3><font size=+1><b>Current Resource: </b>'.$probTitle.'</font></td></tr>'."\n"; |
my ($partlist,$handgrade) = &response_type($url); |
my ($partlist,$handgrade) = &response_type($url); |
my ($resptype,$hdgrade)=('','no'); |
my %resptype = (); #,$hdgrade)=('','no'); |
|
my $hdgrade='no'; |
for (sort keys(%$handgrade)) { |
for (sort keys(%$handgrade)) { |
my ($responsetype,$handgrade)=split(/:/,$$handgrade{$_}); |
my ($responsetype,$handgrade)=split(/:/,$$handgrade{$_}); |
$resptype = $responsetype; |
my $partID = (split(/_/))[0]; |
|
$resptype{$partID} = $responsetype; |
$hdgrade = $handgrade if ($handgrade eq 'yes'); |
$hdgrade = $handgrade if ($handgrade eq 'yes'); |
$result.='<tr><td><b>Part </b>'.(split(/_/))[0].'</td>'. |
$result.='<tr><td><b>Part </b>'.$partID.'</td>'. |
'<td><b>Type: </b>'.$responsetype.'</td></tr>'; |
'<td><b>Type: </b>'.$responsetype.'</td></tr>'; |
# '<td><b>Handgrade: </b>'.$handgrade.'</td></tr>'; |
# '<td><b>Handgrade: </b>'.$handgrade.'</td></tr>'; |
} |
} |
$result.='</table>'."\n"; |
$result.='</table>'."\n"; |
return $result,$resptype,$hdgrade,$partlist,$handgrade; |
return $result,\%resptype,$hdgrade,$partlist,$handgrade; |
} |
} |
|
|
#--- Clean response type for display |
#--- Clean response type for display |
#--- Currently filters option response type only. |
#--- Currently filters option response type only. |
sub cleanRecord { |
sub cleanRecord { |
my ($answer,$response) = @_; |
my ($answer,$response,$symb) = @_; |
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 155 sub cleanRecord {
|
Line 157 sub cleanRecord {
|
(join '</td><td>'.$grayFont,@IDs).'</font></td></tr>'. |
(join '</td><td>'.$grayFont,@IDs).'</font></td></tr>'. |
'</table>'; |
'</table>'; |
} |
} |
|
if ($response eq 'essay') { |
|
if (! exists ($ENV{'form.'.$symb})) { |
|
my (%keyhash) = &Apache::lonnet::dump('nohist_handgrade', |
|
$ENV{'course.'.$ENV{'request.course.id'}.'.domain'}, |
|
$ENV{'course.'.$ENV{'request.course.id'}.'.num'}); |
|
|
|
my $loginuser = $ENV{'user.name'}.':'.$ENV{'user.domain'}; |
|
$ENV{'form.keywords'} = $keyhash{$symb.'_keywords'} ne '' ? $keyhash{$symb.'_keywords'} : ''; |
|
$ENV{'form.kwclr'} = $keyhash{$loginuser.'_kwclr'} ne '' ? $keyhash{$loginuser.'_kwclr'} : 'red'; |
|
$ENV{'form.kwsize'} = $keyhash{$loginuser.'_kwsize'} ne '' ? $keyhash{$loginuser.'_kwsize'} : '0'; |
|
$ENV{'form.kwstyle'} = $keyhash{$loginuser.'_kwstyle'} ne '' ? $keyhash{$loginuser.'_kwstyle'} : ''; |
|
$ENV{'form.'.$symb} = 1; # so that we don't have to read it from disk for multiple sub of the same prob. |
|
} |
|
return &keywords_highlight($answer); |
|
} |
return $answer; |
return $answer; |
} |
} |
|
|
Line 431 sub listStudents {
|
Line 448 sub listStudents {
|
my $result='<h3><font color="#339933"> '.$viewgrade. |
my $result='<h3><font color="#339933"> '.$viewgrade. |
' Submissions for a Student or a Group of Students</font></h3>'; |
' Submissions for a Student or a Group of Students</font></h3>'; |
|
|
my ($table,$resptype,$hdgrade,$partlist,$handgrade) = &showResourceInfo($url,$ENV{'form.probTitle'}); |
my ($table,undef,$hdgrade,$partlist,$handgrade) = &showResourceInfo($url,$ENV{'form.probTitle'}); |
$result.=$table; |
$result.=$table; |
|
|
$request->print(<<LISTJAVASCRIPT); |
$request->print(<<LISTJAVASCRIPT); |
Line 486 LISTJAVASCRIPT
|
Line 503 LISTJAVASCRIPT
|
|
|
$gradeTable.='<input type="radio" name="lastSub" value="lastonly" '.$checklastsub.' /> last sub only'."\n". |
$gradeTable.='<input type="radio" name="lastSub" value="lastonly" '.$checklastsub.' /> last sub only'."\n". |
'<input type="radio" name="lastSub" value="last" /> last sub & parts info'."\n". |
'<input type="radio" name="lastSub" value="last" /> last sub & parts info'."\n". |
|
'<input type="radio" name="lastSub" value="datesub" /> by dates and submissions'."\n". |
'<input type="radio" name="lastSub" value="all" /> all details'."\n". |
'<input type="radio" name="lastSub" value="all" /> all details'."\n". |
'<input type="hidden" name="section" value="'.$getsec.'" />'."\n". |
'<input type="hidden" name="section" value="'.$getsec.'" />'."\n". |
'<input type="hidden" name="submitonly" value="'.$submitonly.'" />'."\n". |
'<input type="hidden" name="submitonly" value="'.$submitonly.'" />'."\n". |
'<input type="hidden" name="response" value="'.$ENV{'form.response'}.'" />'."\n". |
|
'<input type="hidden" name="handgrade" value="'.$ENV{'form.handgrade'}.'" /><br />'."\n". |
'<input type="hidden" name="handgrade" value="'.$ENV{'form.handgrade'}.'" /><br />'."\n". |
'<input type="hidden" name="showgrading" value="'.$ENV{'form.showgrading'}.'" /><br />'."\n". |
'<input type="hidden" name="showgrading" value="'.$ENV{'form.showgrading'}.'" /><br />'."\n". |
'<input type="hidden" name="saveState" value="'.$ENV{'form.saveState'}.'" />'."\n". |
'<input type="hidden" name="saveState" value="'.$ENV{'form.saveState'}.'" />'."\n". |
Line 498 LISTJAVASCRIPT
|
Line 515 LISTJAVASCRIPT
|
'<input type="hidden" name="symb" value="'.$symb.'" />'."\n". |
'<input type="hidden" name="symb" value="'.$symb.'" />'."\n". |
'<input type="hidden" name="saveStatusOld" value="'.$saveStatus.'" />'."\n"; |
'<input type="hidden" name="saveStatusOld" value="'.$saveStatus.'" />'."\n"; |
|
|
$gradeTable.='<b>Student Status:</b> '. |
if (exists($ENV{'form.gradingMenu'}) && exists($ENV{'form.Status'})) { |
&Apache::lonhtmlcommon::StatusOptions($saveStatus,undef,1,'javascript:reLoadList(this.form);').'<br />'; |
$gradeTable.='<input type="hidden" name="Status" value="'.$ENV{'form.Status'}.'" />'."\n"; |
|
} else { |
|
$gradeTable.='<b>Student Status:</b> '. |
|
&Apache::lonhtmlcommon::StatusOptions($saveStatus,undef,1,'javascript:reLoadList(this.form);').'<br />'; |
|
} |
|
|
$gradeTable.='To '.lc($viewgrade).' a submission, click on the check box next to the student\'s name. Then '."\n". |
$gradeTable.='To '.lc($viewgrade).' a submission, click on the check box next to the student\'s name. Then '."\n". |
'click on the '.$viewgrade.' button. To view the submissions for a group of students, click'."\n". |
'click on the '.$viewgrade.' button. To view the submissions for a group of students, click'."\n". |
Line 806 sub sub_page_kw_js {
|
Line 827 sub sub_page_kw_js {
|
<script type="text/javascript" language="javascript"> |
<script type="text/javascript" language="javascript"> |
|
|
//===================== Show list of keywords ==================== |
//===================== Show list of keywords ==================== |
function keywords(keyform) { |
function keywords(formname) { |
var nret = prompt("Keywords list, separated by a space. Add/delete to list if desired.",keyform.value); |
var nret = prompt("Keywords list, separated by a space. Add/delete to list if desired.",formname.keywords.value); |
if (nret==null) return; |
if (nret==null) return; |
keyform.value = nret; |
formname.keywords.value = nret; |
|
|
document.SCORE.refresh.value = "on"; |
formname.refresh.value = "on"; |
if (document.SCORE.keywords.value != "") { |
if (formname.keywords.value != "") { |
document.SCORE.submit(); |
formname.submit(); |
} |
} |
return; |
return; |
} |
} |
Line 864 sub sub_page_kw_js {
|
Line 885 sub sub_page_kw_js {
|
re = /msgsub/; |
re = /msgsub/; |
var shwsel = ""; |
var shwsel = ""; |
if (re.test(msgchk)) { shwsel = "checked" } |
if (re.test(msgchk)) { shwsel = "checked" } |
displaySubject(subject,shwsel); |
subject = (document.SCORE.shownSub.value == 0 ? checkEntities(subject) : subject); |
|
displaySubject(checkEntities(subject),shwsel); |
for (var i=1; i<=Nmsg; i++) { |
for (var i=1; i<=Nmsg; i++) { |
var testpt = "savemsg"+i+","; |
var testmsg = "savemsg"+i+","; |
re = /testpt/; |
re = new RegExp(testmsg,"g"); |
shwsel = ""; |
shwsel = ""; |
if (re.test(msgchk)) { shwsel = "checked" } |
if (re.test(msgchk)) { shwsel = "checked" } |
var message = eval("document.SCORE.savemsg"+i+".value"); |
var message = eval("document.SCORE.savemsg"+i+".value"); |
displaySavedMsg(i,message,shwsel); |
var shownOnce = eval("document.SCORE.shownOnce"+i+".value"); |
|
message = (shownOnce == 0 ? checkEntities(message) : message); |
|
displaySavedMsg(i,message,shwsel); //I do not get it. w/o checkEntities on saved messages, |
|
//any < is already converted to <, etc. However, only once!! |
} |
} |
newmsg = eval("document.SCORE.newmsg"+usrctr+".value"); |
newmsg = eval("document.SCORE.newmsg"+usrctr+".value"); |
shwsel = ""; |
shwsel = ""; |
Line 882 sub sub_page_kw_js {
|
Line 907 sub sub_page_kw_js {
|
return; |
return; |
} |
} |
|
|
|
function checkEntities(strx) { |
|
if (strx.length == 0) return strx; |
|
var orgStr = ["&", "<", ">", '"']; |
|
var newStr = ["&", "<", ">", """]; |
|
var counter = 0; |
|
while (counter < 4) { |
|
strx = strReplace(strx,orgStr[counter],newStr[counter]); |
|
counter++; |
|
} |
|
return strx; |
|
} |
|
|
|
function strReplace(strx, orgStr, newStr) { |
|
return strx.split(orgStr).join(newStr); |
|
} |
|
|
function savedMsgHeader(Nmsg,usrctr,fullname) { |
function savedMsgHeader(Nmsg,usrctr,fullname) { |
var height = 70*Nmsg+250; |
var height = 70*Nmsg+250; |
var scrollbar = "no"; |
var scrollbar = "no"; |
Line 903 sub sub_page_kw_js {
|
Line 944 sub sub_page_kw_js {
|
|
|
pDoc.write("<script language=javascript>"); |
pDoc.write("<script language=javascript>"); |
pDoc.write("function checkInput() {"); |
pDoc.write("function checkInput() {"); |
pDoc.write(" opener.document.SCORE.msgsub.value = document.msgcenter.msgsub.value;"); |
pDoc.write(" opener.document.SCORE.msgsub.value = opener.checkEntities(document.msgcenter.msgsub.value);"); |
pDoc.write(" var nmsg = opener.document.SCORE.savemsgN.value;"); |
pDoc.write(" var nmsg = opener.document.SCORE.savemsgN.value;"); |
pDoc.write(" var usrctr = document.msgcenter.usrctr.value;"); |
pDoc.write(" var usrctr = document.msgcenter.usrctr.value;"); |
pDoc.write(" var newval = eval(\\"opener.document.SCORE.newmsg\\"+usrctr);"); |
pDoc.write(" var newval = eval(\\"opener.document.SCORE.newmsg\\"+usrctr);"); |
pDoc.write(" newval.value = document.msgcenter.newmsg.value;"); |
pDoc.write(" newval.value = opener.checkEntities(document.msgcenter.newmsg.value);"); |
|
|
pDoc.write(" var msgchk = \\"\\";"); |
pDoc.write(" var msgchk = \\"\\";"); |
pDoc.write(" if (document.msgcenter.subchk.checked) {"); |
pDoc.write(" if (document.msgcenter.subchk.checked) {"); |
Line 917 sub sub_page_kw_js {
|
Line 958 sub sub_page_kw_js {
|
pDoc.write(" for (var i=1; i<=nmsg; i++) {"); |
pDoc.write(" for (var i=1; i<=nmsg; i++) {"); |
pDoc.write(" var opnmsg = eval(\\"opener.document.SCORE.savemsg\\"+i);"); |
pDoc.write(" var opnmsg = eval(\\"opener.document.SCORE.savemsg\\"+i);"); |
pDoc.write(" var frmmsg = eval(\\"document.msgcenter.msg\\"+i);"); |
pDoc.write(" var frmmsg = eval(\\"document.msgcenter.msg\\"+i);"); |
pDoc.write(" opnmsg.value = frmmsg.value;"); |
pDoc.write(" opnmsg.value = opener.checkEntities(frmmsg.value);"); |
|
pDoc.write(" var showflg = eval(\\"opener.document.SCORE.shownOnce\\"+i);"); |
|
pDoc.write(" showflg.value = \\"1\\";"); |
pDoc.write(" var chkbox = eval(\\"document.msgcenter.msgn\\"+i);"); |
pDoc.write(" var chkbox = eval(\\"document.msgcenter.msgn\\"+i);"); |
pDoc.write(" if (chkbox.checked) {"); |
pDoc.write(" if (chkbox.checked) {"); |
pDoc.write(" msgchk += \\"savemsg\\"+i+\\",\\";"); |
pDoc.write(" msgchk += \\"savemsg\\"+i+\\",\\";"); |
Line 1183 sub submission {
|
Line 1226 sub submission {
|
return; |
return; |
} |
} |
|
|
$ENV{'form.lastSub'} = ($ENV{'form.lastSub'} eq '' ? 'all' : $ENV{'form.lastSub'}); |
$ENV{'form.lastSub'} = ($ENV{'form.lastSub'} eq '' ? 'datesub' : $ENV{'form.lastSub'}); |
my $last = ($ENV{'form.lastSub'} eq 'last' ? 'last' : ''); |
my $last = ($ENV{'form.lastSub'} eq 'last' ? 'last' : ''); |
|
my $checkIcon = '<img src="'.$request->dir_config('lonIconsURL'). |
|
'/check.gif" height="16" border="0" />'; |
|
|
# header info |
# header info |
if ($counter == 0) { |
if ($counter == 0) { |
Line 1197 sub submission {
|
Line 1242 sub submission {
|
'<font size=+1> <b>Resource: </b>'.$ENV{'form.probTitle'}.'</font>'."\n"); |
'<font size=+1> <b>Resource: </b>'.$ENV{'form.probTitle'}.'</font>'."\n"); |
|
|
if ($ENV{'form.handgrade'} eq 'no') { |
if ($ENV{'form.handgrade'} eq 'no') { |
my $checkIcon = '<img src="'.$request->dir_config('lonIconsURL'). |
|
'/check.gif" height="16" border="0" />'; |
|
my $checkMark='<br /><br /> <b>Note:</b> Part(s) graded correct by the computer is marked with a '. |
my $checkMark='<br /><br /> <b>Note:</b> Part(s) graded correct by the computer is marked with a '. |
$checkIcon.' symbol.'."\n"; |
$checkIcon.' symbol.'."\n"; |
$request->print($checkMark); |
$request->print($checkMark); |
Line 1226 sub submission {
|
Line 1269 sub submission {
|
$ENV{'form.msgsub'} = $keyhash{$symb.'_subject'} ne '' ? |
$ENV{'form.msgsub'} = $keyhash{$symb.'_subject'} ne '' ? |
$keyhash{$symb.'_subject'} : $ENV{'form.probTitle'}; |
$keyhash{$symb.'_subject'} : $ENV{'form.probTitle'}; |
$ENV{'form.savemsgN'} = $keyhash{$symb.'_savemsgN'} ne '' ? $keyhash{$symb.'_savemsgN'} : '0'; |
$ENV{'form.savemsgN'} = $keyhash{$symb.'_savemsgN'} ne '' ? $keyhash{$symb.'_savemsgN'} : '0'; |
|
|
} |
} |
my $overRideScore = $ENV{'form.overRideScore'} eq '' ? 'no' : $ENV{'form.overRideScore'}; |
my $overRideScore = $ENV{'form.overRideScore'} eq '' ? 'no' : $ENV{'form.overRideScore'}; |
|
|
Line 1246 sub submission {
|
Line 1288 sub submission {
|
'<input type="hidden" name="lastSub" value="'.$ENV{'form.lastSub'}.'" />'."\n". |
'<input type="hidden" name="lastSub" value="'.$ENV{'form.lastSub'}.'" />'."\n". |
'<input type="hidden" name="section" value="'.$ENV{'form.section'}.'">'."\n". |
'<input type="hidden" name="section" value="'.$ENV{'form.section'}.'">'."\n". |
'<input type="hidden" name="submitonly" value="'.$ENV{'form.submitonly'}.'">'."\n". |
'<input type="hidden" name="submitonly" value="'.$ENV{'form.submitonly'}.'">'."\n". |
'<input type="hidden" name="response" value="'.$ENV{'form.response'}.'">'."\n". |
|
'<input type="hidden" name="handgrade" value="'.$ENV{'form.handgrade'}.'">'."\n". |
'<input type="hidden" name="handgrade" value="'.$ENV{'form.handgrade'}.'">'."\n". |
'<input type="hidden" name="keywords" value="'.$ENV{'form.keywords'}.'" />'."\n". |
|
'<input type="hidden" name="kwclr" value="'.$ENV{'form.kwclr'}.'" />'."\n". |
|
'<input type="hidden" name="kwsize" value="'.$ENV{'form.kwsize'}.'" />'."\n". |
|
'<input type="hidden" name="kwstyle" value="'.$ENV{'form.kwstyle'}.'" />'."\n". |
|
'<input type="hidden" name="msgsub" value="'.$ENV{'form.msgsub'}.'" />'."\n". |
|
'<input type="hidden" name="savemsgN" value="'.$ENV{'form.savemsgN'}.'" />'."\n". |
|
'<input type="hidden" name="NCT"'. |
'<input type="hidden" name="NCT"'. |
' value="'.($ENV{'form.NTSTU'} ne '' ? $ENV{'form.NTSTU'} : $total+1).'" />'."\n"); |
' value="'.($ENV{'form.NTSTU'} ne '' ? $ENV{'form.NTSTU'} : $total+1).'" />'."\n"); |
|
if ($ENV{'form.handgrade'} eq 'yes') { |
|
$request->print('<input type="hidden" name="keywords" value="'.$ENV{'form.keywords'}.'" />'."\n". |
|
'<input type="hidden" name="kwclr" value="'.$ENV{'form.kwclr'}.'" />'."\n". |
|
'<input type="hidden" name="kwsize" value="'.$ENV{'form.kwsize'}.'" />'."\n". |
|
'<input type="hidden" name="kwstyle" value="'.$ENV{'form.kwstyle'}.'" />'."\n". |
|
'<input type="hidden" name="msgsub" value="'.$ENV{'form.msgsub'}.'" />'."\n". |
|
'<input type="hidden" name="shownSub" value="0" />'."\n". |
|
'<input type="hidden" name="savemsgN" value="'.$ENV{'form.savemsgN'}.'" />'."\n"); |
|
} |
|
|
my ($cts,$prnmsg) = (1,''); |
my ($cts,$prnmsg) = (1,''); |
while ($cts <= $ENV{'form.savemsgN'}) { |
while ($cts <= $ENV{'form.savemsgN'}) { |
$prnmsg.='<input type="hidden" name="savemsg'.$cts.'" value="'. |
$prnmsg.='<input type="hidden" name="savemsg'.$cts.'" value="'. |
($keyhash{$symb.'_savemsg'.$cts} eq '' ? |
(!exists($keyhash{$symb.'_savemsg'.$cts}) ? |
&Apache::lonfeedback::clear_out_html($ENV{'form.savemsg'.$cts}) : |
&Apache::lonfeedback::clear_out_html($ENV{'form.savemsg'.$cts}) : |
&Apache::lonfeedback::clear_out_html($keyhash{$symb.'_savemsg'.$cts})). |
&Apache::lonfeedback::clear_out_html($keyhash{$symb.'_savemsg'.$cts})). |
'" />'."\n"; |
'" />'."\n". |
|
'<input type="hidden" name="shownOnce'.$cts.'" value="0" />'."\n"; |
$cts++; |
$cts++; |
} |
} |
$request->print($prnmsg); |
$request->print($prnmsg); |
Line 1274 sub submission {
|
Line 1319 sub submission {
|
# |
# |
$request->print(<<KEYWORDS); |
$request->print(<<KEYWORDS); |
<b>Keyword Options:</b> |
<b>Keyword Options:</b> |
<a href="javascript:keywords(document.SCORE.keywords)"; TARGET=_self>List</a> |
<a href="javascript:keywords(document.SCORE)"; TARGET=_self>List</a> |
<a href="#" onMouseDown="javascript:getSel(); return false" |
<a href="#" onMouseDown="javascript:getSel(); return false" |
CLASS="page">Paste Selection to List</a> |
CLASS="page">Paste Selection to List</a> |
<a href="javascript:kwhighlight()"; TARGET=_self>Highlight Attribute</a><br /><br /> |
<a href="javascript:kwhighlight()"; TARGET=_self>Highlight Attribute</a><br /><br /> |
Line 1393 KEYWORDS
|
Line 1438 KEYWORDS
|
if (!exists($record{'resource.'.$partid.'.'.$respid.'.submission'})) { |
if (!exists($record{'resource.'.$partid.'.'.$respid.'.submission'})) { |
$lastsubonly.='<tr><td bgcolor="#ffffe6"><b>Part '. |
$lastsubonly.='<tr><td bgcolor="#ffffe6"><b>Part '. |
$partid.'</b> <font color="#999999">( ID '.$respid. |
$partid.'</b> <font color="#999999">( ID '.$respid. |
' )</font> Nothing submitted<br /><br />'; |
' )</font> Nothing submitted - no attempts<br /><br />'; |
} else { |
} else { |
foreach (@$string) { |
foreach (@$string) { |
my ($partid,$respid) = /^resource\.(\w+)\.(\w+)\.submission/; |
my ($partid,$respid) = /^resource\.(\w+)\.(\w+)\.submission/; |
Line 1420 KEYWORDS
|
Line 1465 KEYWORDS
|
'this file may contain virusses</font><br />':''). |
'this file may contain virusses</font><br />':''). |
'<b>Submitted Answer: </b>'.($responsetype =~ /^(essay|option)$/ ? |
'<b>Submitted Answer: </b>'.($responsetype =~ /^(essay|option)$/ ? |
'<blockquote>' : ''). |
'<blockquote>' : ''). |
&cleanRecord(&keywords_highlight($subval),$responsetype). |
# &cleanRecord(&keywords_highlight($subval),$responsetype). |
|
&cleanRecord($subval,$responsetype,$symb). |
($responsetype =~ /^(essay|option)$/ ? '</blockquote><br />' : |
($responsetype =~ /^(essay|option)$/ ? '</blockquote><br />' : |
'<br /><br />').$similar."\n" |
'<br /><br />').$similar."\n" |
if ($ENV{'form.lastSub'} eq 'lastonly' || |
if ($ENV{'form.lastSub'} eq 'lastonly' || |
Line 1434 KEYWORDS
|
Line 1480 KEYWORDS
|
$lastsubonly.='</td></tr><tr bgcolor="#ffffff"><td>'."\n"; |
$lastsubonly.='</td></tr><tr bgcolor="#ffffff"><td>'."\n"; |
$request->print($lastsubonly); |
$request->print($lastsubonly); |
} |
} |
} else { |
} elsif ($ENV{'form.lastSub'} eq 'datesub') { |
|
my (undef,$responseType,undef,$parts) = &showResourceInfo($url); |
|
$request->print(&displaySubByDates(\$symb,\%record,$parts,$responseType,$checkIcon)); |
|
} elsif ($ENV{'form.lastSub'} =~ /^(last|all)$/) { |
$request->print(&Apache::loncommon::get_previous_attempt($symb,$uname,$udom, |
$request->print(&Apache::loncommon::get_previous_attempt($symb,$uname,$udom, |
$ENV{'request.course.id'}, |
$ENV{'request.course.id'}, |
$last,'.submission', |
$last,'.submission', |
Line 1794 sub saveHandGrade {
|
Line 1843 sub saveHandGrade {
|
} |
} |
$newrecord{'resource.'.$_.'.submitted_by'} = $submitter |
$newrecord{'resource.'.$_.'.submitted_by'} = $submitter |
if ($submitter && ($record{'resource.'.$_.'.submitted_by'} ne $submitter)); |
if ($submitter && ($record{'resource.'.$_.'.submitted_by'} ne $submitter)); |
$newrecord{'resource.'.$_.'regrader'}="$ENV{'user.name'}:$ENV{'user.domain'}"; |
$newrecord{'resource.'.$_.'.regrader'}="$ENV{'user.name'}:$ENV{'user.domain'}"; |
} |
} |
} |
} |
|
|
Line 2073 sub viewgrades {
|
Line 2122 sub viewgrades {
|
my (@parts) = sort(&getpartlist($url)); |
my (@parts) = sort(&getpartlist($url)); |
foreach my $part (@parts) { |
foreach my $part (@parts) { |
my $display=&Apache::lonnet::metadata($url,$part.'.display'); |
my $display=&Apache::lonnet::metadata($url,$part.'.display'); |
next if ($display =~ /Number of Attempts/); |
$display =~ s/^Number of Attempts/Tries/; # makes the column narrower |
if (!$display) { $display = &Apache::lonnet::metadata($url,$part.'.name'); } |
if (!$display) { $display = &Apache::lonnet::metadata($url,$part.'.name'); } |
if ($display =~ /^Partial Credit Factor/) { |
if ($display =~ /^Partial Credit Factor/) { |
my ($partid) = &split_part_type($part); |
my ($partid) = &split_part_type($part); |
Line 2145 sub viewstudentgrade {
|
Line 2194 sub viewstudentgrade {
|
if ($status eq 'excused'); |
if ($status eq 'excused'); |
$result.=$optsel; |
$result.=$optsel; |
$result.="</select></td>\n"; |
$result.="</select></td>\n"; |
# } else { |
} else { |
# $result.='<input type="hidden" name="'. |
$result.='<input type="hidden" name="'. |
# 'GD_'.$student.'_'.$part.'_'.$type.'_s" value="'.$score.'" />'. |
'GD_'.$student.'_'.$part.'_'.$type.'_s" value="'.$score.'" />'. |
# "\n"; |
"\n"; |
# $result.='<td align="middle"><input type="text" name="'. |
$result.='<td align="middle"><input type="text" name="'. |
# 'GD_'.$student.'_'.$part.'_'.$type.'" '. |
'GD_'.$student.'_'.$part.'_'.$type.'" '. |
# 'value="'.$score.'" size="4" /></td>'."\n"; |
'value="'.$score.'" size="4" /></td>'."\n"; |
} |
} |
} |
} |
$result.='</tr>'; |
$result.='</tr>'; |
Line 2275 sub editgrades {
|
Line 2324 sub editgrades {
|
my $awarded = $ENV{'form.GD_'.$user.'_'.$part.'_'.$type}; |
my $awarded = $ENV{'form.GD_'.$user.'_'.$part.'_'.$type}; |
if ($awarded ne '' && $awarded ne $old_aw) { |
if ($awarded ne '' && $awarded ne $old_aw) { |
$newrecord{'resource.'.$part.'.'.$type}= $awarded; |
$newrecord{'resource.'.$part.'.'.$type}= $awarded; |
$newrecord{'resource.'.$part.'regrader'}="$ENV{'user.name'}:$ENV{'user.domain'}"; |
$newrecord{'resource.'.$part.'.regrader'}="$ENV{'user.name'}:$ENV{'user.domain'}"; |
$updateflag=1; |
$updateflag=1; |
} |
} |
$line .= '<td align="center">'.$old_aw.' </td>'. |
$line .= '<td align="center">'.$old_aw.' </td>'. |
Line 2404 sub csvuploadmap_header {
|
Line 2453 sub csvuploadmap_header {
|
$javascript=&csvupload_javascript_forward_associate(); |
$javascript=&csvupload_javascript_forward_associate(); |
} |
} |
|
|
my ($result,$resptype,$hdgrade,$partlist,$handgrade) = &showResourceInfo($url,$ENV{'form.probTitle'}); |
my ($result) = &showResourceInfo($url,$ENV{'form.probTitle'}); |
|
|
$request->print(<<ENDPICK); |
$request->print(<<ENDPICK); |
<form method="post" enctype="multipart/form-data" action="/adm/grades" name="gradesupload"> |
<form method="post" enctype="multipart/form-data" action="/adm/grades" name="gradesupload"> |
Line 2616 sub csvuploadassign {
|
Line 2665 sub csvuploadassign {
|
# |
# |
#------------------------------------------------------------------- |
#------------------------------------------------------------------- |
# |
# |
#-------------- Next few routines handles grading by page/sequence |
#-------------- Next few routines handle grading by page/sequence |
# |
# |
#--- Select a page/sequence and a student to grade |
#--- Select a page/sequence and a student to grade |
sub pickStudentPage { |
sub pickStudentPage { |
Line 2675 LISTJAVASCRIPT
|
Line 2724 LISTJAVASCRIPT
|
|
|
$result.=' <b>Submission Details: </b>'. |
$result.=' <b>Submission Details: </b>'. |
'<input type="radio" name="lastSub" value="none" /> none'."\n". |
'<input type="radio" name="lastSub" value="none" /> none'."\n". |
'<input type="radio" name="lastSub" value="datesub" checked /> dates and submissions'."\n". |
'<input type="radio" name="lastSub" value="datesub" checked /> by dates and submissions'."\n". |
'<input type="radio" name="lastSub" value="all" /> all details'."\n"; |
'<input type="radio" name="lastSub" value="all" /> all details'."\n"; |
|
|
$result.='<input type="hidden" name="section" value="'.$getsec.'" />'."\n". |
$result.='<input type="hidden" name="section" value="'.$getsec.'" />'."\n". |
Line 2836 sub displayPage {
|
Line 2885 sub displayPage {
|
foreach my $partid (@{$parts}) { |
foreach my $partid (@{$parts}) { |
$responseType{$partid} = $curRes->responseType($partid); |
$responseType{$partid} = $curRes->responseType($partid); |
} |
} |
$studentTable.= &displaySubByDates(\%record,$parts,\%responseType,$checkIcon); |
$studentTable.= &displaySubByDates(\$symbx,\%record,$parts,\%responseType,$checkIcon); |
} |
} |
} 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 2871 sub displayPage {
|
Line 2920 sub displayPage {
|
} |
} |
|
|
sub displaySubByDates { |
sub displaySubByDates { |
my ($record,$parts,$responseType,$checkIcon) = @_; |
my ($symbx,$record,$parts,$responseType,$checkIcon) = @_; |
my $studentTable='<table border="0" width="100%"><tr><td bgcolor="#777777">'. |
my $studentTable='<table border="0" width="100%"><tr><td bgcolor="#777777">'. |
'<table border="0" width="100%"><tr bgcolor="#e6ffff">'. |
'<table border="0" width="100%"><tr bgcolor="#e6ffff">'. |
'<td><b>Date/Time</b></td>'. |
'<td><b>Date/Time</b></td>'. |
Line 2880 sub displaySubByDates {
|
Line 2929 sub displaySubByDates {
|
my ($version); |
my ($version); |
my %mark; |
my %mark; |
$mark{'correct_by_student'} = $checkIcon; |
$mark{'correct_by_student'} = $checkIcon; |
|
return '<br /> <font color="red">Nothing submitted - no attempts</font><br />' |
|
if (!exists($$record{'1:timestamp'})); |
for ($version=1;$version<=$$record{'version'};$version++) { |
for ($version=1;$version<=$$record{'version'};$version++) { |
my $timestamp = scalar(localtime($$record{$version.':timestamp'})); |
my $timestamp = scalar(localtime($$record{$version.':timestamp'})); |
$studentTable.='<tr bgcolor="#ffffff" valign="top"><td>'.$timestamp.'</td>'; |
$studentTable.='<tr bgcolor="#ffffff" valign="top"><td>'.$timestamp.'</td>'; |
Line 2887 sub displaySubByDates {
|
Line 2938 sub displaySubByDates {
|
my @displaySub = (); |
my @displaySub = (); |
foreach my $partid (@{$parts}) { |
foreach my $partid (@{$parts}) { |
my @matchKey = grep /^resource\.$partid\..*?\.submission$/,@versionKeys; |
my @matchKey = grep /^resource\.$partid\..*?\.submission$/,@versionKeys; |
next if ($$record{"$version:resource.$partid.solved"} eq ''); |
# next if ($$record{"$version:resource.$partid.solved"} eq ''); |
$displaySub[0].=(exists $$record{$version.':'.$matchKey[0]}) ? |
$displaySub[0].=(exists $$record{$version.':'.$matchKey[0]}) ? |
'<b>Part '.$partid.' '. |
'<b>Part '.$partid.' '. |
($$record{"$version:resource.$partid.tries"} eq '' ? 'Trial not counted' : |
($$record{"$version:resource.$partid.tries"} eq '' ? 'Trial not counted' : |
'Trial '.$$record{"$version:resource.$partid.tries"}).'</b> '. |
'Trial '.$$record{"$version:resource.$partid.tries"}).'</b> '. |
&cleanRecord($$record{$version.':'.$matchKey[0]},$$responseType{$partid}).'<br />' : ''; |
&cleanRecord($$record{$version.':'.$matchKey[0]},$$responseType{$partid},$$symbx).'<br />' : ''; |
$displaySub[1].=(exists $$record{"$version:resource.$partid.award"}) ? |
$displaySub[1].=(exists $$record{"$version:resource.$partid.award"}) ? |
'<b>Part '.$partid.'</b> '. |
'<b>Part '.$partid.'</b> '. |
lc($$record{"$version:resource.$partid.award"}).' '. |
lc($$record{"$version:resource.$partid.award"}).' '. |
$mark{$$record{"$version:resource.$partid.solved"}}.'<br />' : ''; |
$mark{$$record{"$version:resource.$partid.solved"}}.'<br />' : ''; |
# $$record{"$version:resource.$partid.solved"}.'<br />' : ''; |
|
$displaySub[2].=(exists $$record{"$version:resource.$partid.regrader"}) ? |
$displaySub[2].=(exists $$record{"$version:resource.$partid.regrader"}) ? |
$$record{"$version:resource.$partid.regrader"}.' (<b>Part:</b> '.$partid.')' : ''; |
$$record{"$version:resource.$partid.regrader"}.' (<b>Part:</b> '.$partid.')' : ''; |
} |
} |
Line 3412 sub gradingmenu {
|
Line 3462 sub gradingmenu {
|
GRADINGMENUJS |
GRADINGMENUJS |
&commonJSfunctions($request); |
&commonJSfunctions($request); |
my $result='<h3> <font color="#339933">Manual Grading/View Submission</font></h3>'; |
my $result='<h3> <font color="#339933">Manual Grading/View Submission</font></h3>'; |
my ($table,$resptype,$hdgrade) = &showResourceInfo($url,$probTitle); |
my ($table,undef,$hdgrade) = &showResourceInfo($url,$probTitle); |
$result.=$table; |
$result.=$table; |
my (undef,$sections) = &getclasslist('all','0'); |
my (undef,$sections) = &getclasslist('all','0'); |
my $savedState = &savedState(); |
my $savedState = &savedState(); |
Line 3424 GRADINGMENUJS
|
Line 3474 GRADINGMENUJS
|
$result.='<form action="/adm/grades" method="post" name="gradingMenu">'."\n". |
$result.='<form action="/adm/grades" method="post" name="gradingMenu">'."\n". |
'<input type="hidden" name="symb" value="'.$symb.'" />'."\n". |
'<input type="hidden" name="symb" value="'.$symb.'" />'."\n". |
'<input type="hidden" name="url" value="'.$url.'" />'."\n". |
'<input type="hidden" name="url" value="'.$url.'" />'."\n". |
'<input type="hidden" name="response" value="'.$resptype.'" />'."\n". |
|
'<input type="hidden" name="handgrade" value="'.$hdgrade.'" />'."\n". |
'<input type="hidden" name="handgrade" value="'.$hdgrade.'" />'."\n". |
'<input type="hidden" name="probTitle" value="'.$probTitle.'" />'."\n". |
'<input type="hidden" name="probTitle" value="'.$probTitle.'" />'."\n". |
'<input type="hidden" name="command" value="" />'."\n". |
'<input type="hidden" name="command" value="" />'."\n". |
'<input type="hidden" name="saveState" value="" />'."\n". |
'<input type="hidden" name="saveState" value="" />'."\n". |
|
'<input type="hidden" name="gradingMenu" value="1" />'."\n". |
'<input type="hidden" name="showgrading" value="yes" />'."\n"; |
'<input type="hidden" name="showgrading" value="yes" />'."\n"; |
|
|
$result.='<table width="100%" border=0><tr><td bgcolor=#777777>'."\n". |
$result.='<table width="100%" border=0><tr><td bgcolor=#777777>'."\n". |