version 1.39, 2002/07/18 21:27:57
|
version 1.40, 2002/07/19 20:42:18
|
Line 167 sub listStudents {
|
Line 167 sub listStudents {
|
<b>View Problem: </b><input type="radio" name="vProb" value="no" checked> no |
<b>View Problem: </b><input type="radio" name="vProb" value="no" checked> no |
<input type="radio" name="vProb" value="yes"> yes <br /> |
<input type="radio" name="vProb" value="yes"> yes <br /> |
<b>Submissions: </b> |
<b>Submissions: </b> |
<input type="radio" name="lastSub" value="lastonly" checked /> last sub only |
<input type="radio" name="lastSub" value="hdgrade" checked /> handgrade only |
|
<input type="radio" name="lastSub" value="lastonly" /> last sub only |
<input type="radio" name="lastSub" value="last" /> last sub & parts info |
<input type="radio" name="lastSub" value="last" /> last sub & parts info |
<input type="radio" name="lastSub" value="all" /> all details |
<input type="radio" name="lastSub" value="all" /> all details |
<input type="hidden" name="section" value="$getsec" /> |
<input type="hidden" name="section" value="$getsec" /> |
Line 486 KEYWORDS
|
Line 487 KEYWORDS
|
# Student info |
# Student info |
$request->print(($counter == 0 ? '' : '<br />')); |
$request->print(($counter == 0 ? '' : '<br />')); |
my $fullname = ($ENV{'form.fullname'} ne '' ? $ENV{'form.fullname'} : &get_fullname($uname,$udom)); |
my $fullname = ($ENV{'form.fullname'} ne '' ? $ENV{'form.fullname'} : &get_fullname($uname,$udom)); |
my $result.='<table border="0" width=100%><tr><td bgcolor="#777777">'. |
my $result='<table border="0" width=100%><tr><td bgcolor="#777777">'. |
'<table border="0" width=100%><tr bgcolor="#ffffff"><td>'; |
'<table border="0" width=100%><tr bgcolor="#ffffff"><td>'; |
|
|
$result.='<table border="0"><tr bgcolor="#ffffff"><td><b>Fullname: </b>'.$fullname. |
$result.='<table border="0"><tr bgcolor="#ffffff"><td><b>Fullname: </b>'.$fullname. |
'</td><td> <b>Username: </b>'.$uname. |
'</td><td> <b>Username: </b>'.$uname. |
'</td><td> <b>Domain: </b>'.$udom.'</td></tr>'; |
'</td><td> <b>Domain: </b>'.$udom.'</td></tr>'; |
if ($ENV{'form.handgrade'} eq 'yes') { |
if ($ENV{'form.handgrade'} eq 'yes') { |
# my $subonly = &get_last_submission($symb,$uname,$udom,$ENV{'request.course.id'}); |
# my $subonly = &get_last_submission($symb,$uname,$udom,$ENV{'request.course.id'}); |
my ($classlist) = &getclasslist('all','0'); |
# my ($classlist) = &getclasslist('all','0'); |
|
my ($classlist,$seclist,$ids,$stusec,$fullname) = &getclasslist('all','0'); |
my @collaborators; |
my @collaborators; |
# foreach ( sort(@{ $$classlist{'all'} }) ) { |
# foreach ( sort(@{ $$classlist{'all'} }) ) { |
# my ($uname,$udom) = split(/:/); |
# my ($uname,$udom) = split(/:/); |
Line 503 KEYWORDS
|
Line 506 KEYWORDS
|
if (scalar(@collaborators) != 0) { |
if (scalar(@collaborators) != 0) { |
$result.='<tr bgcolor="#ffffff"><td colspan=3><b>Collaborators: </b>'; |
$result.='<tr bgcolor="#ffffff"><td colspan=3><b>Collaborators: </b>'; |
foreach (@collaborators) { |
foreach (@collaborators) { |
$result.=$_.' ('.&get_fullname($_,$udom).') '; |
$result.=$_.' ('.$$fullname{$_.':'.$udom}.') '; |
|
# $result.=$_.' ('.&get_fullname($_,$udom).') '; |
} |
} |
$result.='</td></tr>'."\n"; |
$result.='</td></tr>'."\n"; |
$result.='<input type="hidden" name="collaborator'.$counter. |
$result.='<input type="hidden" name="collaborator'.$counter. |
'" value="'.(join ':',@collaborators).'" />'."\n"; |
'" value="'.(join ':',@collaborators).'" />'."\n"; |
} |
} |
} |
} |
$result.='</table>'."\n"; |
$request->print($result.'</table>'."\n"); |
$request->print($result); |
|
|
|
my ($partlist,$handgrade) = &response_type($url); |
my ($partlist,$handgrade) = &response_type($url); |
|
|
# print student answer |
# print student answer |
if ($ENV{'form.lastSub'} eq 'lastonly') { |
if ($ENV{'form.lastSub'} =~ /^(lastonly|hdgrade)$/) { |
my ($string,$timestamp)=&get_last_submission ($symb,$uname,$udom,$ENV{'request.course.id'}); |
my ($string,$timestamp)=&get_last_submission ($symb,$uname,$udom,$ENV{'request.course.id'}); |
my $lastsubonly='<table border="0" width=100%><tr><td bgcolor="#777777">'; |
my $lastsubonly.='</td></tr><tr><td bgcolor="#e6ffff"><b>Last Submission Only</b>'. |
$lastsubonly.='<table border="0" width=100%><tr bgcolor="#ddffff">'; |
|
$lastsubonly.='<td><b>Last Submission Only</b>'. |
|
($$timestamp eq '' ? '' : ' <b>Date Submitted:</b> '.$$timestamp).'</td></tr>'; |
($$timestamp eq '' ? '' : ' <b>Date Submitted:</b> '.$$timestamp).'</td></tr>'; |
if ($$timestamp eq '') { |
if ($$timestamp eq '') { |
$lastsubonly.='<tr><td bgcolor="#ffffe6">'.$$string[0].'</td></tr>'; |
$lastsubonly.='<tr><td bgcolor="#ffffe6">'.$$string[0].'</td></tr>'; |
Line 532 KEYWORDS
|
Line 533 KEYWORDS
|
my ($ressub,$subval) = split(/:/,$_,2); |
my ($ressub,$subval) = split(/:/,$_,2); |
$lastsubonly.='<tr><td bgcolor="#ffffe6"><b>Part ID</b> '. |
$lastsubonly.='<tr><td bgcolor="#ffffe6"><b>Part ID</b> '. |
$partid.' <b>Response ID</b> '.$respid. |
$partid.' <b>Response ID</b> '.$respid. |
' <b>Submission</b> '.&keywords_highlight($subval).'</td></tr>'; |
' <b>Submission</b> '.&keywords_highlight($subval).'</td></tr>' |
|
if ($ENV{'form.lastSub'} eq 'lastonly' || |
|
($ENV{'form.lastSub'} eq 'hdgrade' && $$handgrade{$part} =~ /:yes$/)); |
} |
} |
} |
} |
} |
} |
} |
} |
$lastsubonly.='</td></tr></table></td></tr></table>'."\n"; |
$lastsubonly.='</td></tr><tr><td bgcolor="#ffffff">'."\n"; |
$request->print($lastsubonly); |
$request->print($lastsubonly); |
} else { |
} else { |
$request->print(&Apache::loncommon::get_previous_attempt($symb,$uname,$udom, |
$request->print(&Apache::loncommon::get_previous_attempt($symb,$uname,$udom, |
Line 554 KEYWORDS
|
Line 557 KEYWORDS
|
|
|
my %seen = (); |
my %seen = (); |
my @partlist; |
my @partlist; |
|
my %record = &Apache::lonnet::restore($symb,$ENV{'request.course.id'},$udom,$uname); |
|
# while (my ($k,$v) = each (%record)){ |
|
# print "key=$k ==> value=$v<br>"; |
|
# } |
for (sort keys(%$handgrade)) { |
for (sort keys(%$handgrade)) { |
my ($partid,$respid) = split(/_/); |
my ($partid,$respid) = split(/_/); |
next if ($seen{$partid} > 0); |
next if ($seen{$partid} > 0); |
Line 563 KEYWORDS
|
Line 570 KEYWORDS
|
my $wgt = &Apache::lonnet::EXT('resource.'.$partid.'.weight',$symb,$udom,$uname); |
my $wgt = &Apache::lonnet::EXT('resource.'.$partid.'.weight',$symb,$udom,$uname); |
my $wgtmsg = ($wgt > 0 ? '(problem weight)' : '<font color="red">problem weight assigned by computer</font>'); |
my $wgtmsg = ($wgt > 0 ? '(problem weight)' : '<font color="red">problem weight assigned by computer</font>'); |
$wgt = ($wgt > 0 ? $wgt : '1'); |
$wgt = ($wgt > 0 ? $wgt : '1'); |
my %record = &Apache::lonnet::restore($symb,$ENV{'request.course.id'},$udom,$uname); |
my $score = ($record{'resource.'.$partid.'.awarded'} eq '' ? '' : $record{'resource.'.$partid.'.awarded'}*$wgt); |
my $score = ($record{'resource.0.awarded'} eq '' ? '' : $record{'resource.0.awarded'}*$wgt); |
|
|
|
# display grading options |
# display grading options |
$result='<input type="hidden" name="WGT'.$counter.'_'.$partid.'" value="'.$wgt.'" />'; |
$result='<input type="hidden" name="WGT'.$counter.'_'.$partid.'" value="'.$wgt.'" />'; |
|
|
$result.='<table border="0"><tr><td><b>Part </b>'.$partid.' <b>Points</b></td><td>'; |
$result.='<table border="0"><tr><td><b>Part </b>'.$partid.' <b>Points</b></td><td>'; |
|
|
my $ctr = 0; |
my $ctr = 0; |
Line 612 KEYWORDS
|
Line 617 KEYWORDS
|
my $endform.='<table border="0"><tr><td><input type="submit" name="gradeOpt" value="Save & Next" />'; |
my $endform.='<table border="0"><tr><td><input type="submit" name="gradeOpt" value="Save & Next" />'; |
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) '. |
$endform.='<input type="submit" name="gradeOpt" value="Next" /> '; |
'<input type="submit" name="gradeOpt" value="Next" /> '. |
$endform.='<input type="submit" name="gradeOpt" value="Previous" /> '; |
'<input type="submit" name="gradeOpt" value="Previous" /> '. |
$endform.='(Next and Previous do not save the scores.)'; |
'(Next and Previous do not save the scores.)'. |
$endform.='</td><tr></table></form>'; |
'</td><tr></table></form>'; |
$request->print($endform); |
$request->print($endform); |
} |
} |
|
|
return ''; |
return ''; |
} |
} |
|
|
Line 672 sub processHandGrade {
|
Line 676 sub processHandGrade {
|
|
|
my $loginuser = $ENV{'user.name'}.':'.$ENV{'user.domain'}; |
my $loginuser = $ENV{'user.name'}.':'.$ENV{'user.domain'}; |
my %keyhash = (); |
my %keyhash = (); |
$ENV{'form.keywords'} =~ s/,\s{0,}|\s+/ /g; |
$ENV{'form.keywords'} =~ s/,\s{0,}|\s+/ /g; |
$ENV{'form.keywords'} =~ s/^\s+|\s+$//; |
$ENV{'form.keywords'} =~ s/^\s+|\s+$//; |
$keyhash{$symb.'_keywords'} = $ENV{'form.keywords'}; |
$keyhash{$symb.'_keywords'} = $ENV{'form.keywords'}; |
$keyhash{$symb.'_subject'} = $ENV{'form.msgsub'}; |
$keyhash{$symb.'_subject'} = $ENV{'form.msgsub'}; |
$keyhash{$loginuser.'_kwclr'} = $ENV{'form.kwclr'}; |
$keyhash{$loginuser.'_kwclr'} = $ENV{'form.kwclr'}; |
$keyhash{$loginuser.'_kwsize'} = $ENV{'form.kwsize'}; |
$keyhash{$loginuser.'_kwsize'} = $ENV{'form.kwsize'}; |
$keyhash{$loginuser.'_kwstyle'} = $ENV{'form.kwstyle'}; |
$keyhash{$loginuser.'_kwstyle'} = $ENV{'form.kwstyle'}; |
|
|
my ($ctr,$idx) = (1,1); |
my ($ctr,$idx) = (1,1); |
Line 706 sub processHandGrade {
|
Line 710 sub processHandGrade {
|
|
|
if ($ENV{'form.refresh'} eq 'on') { |
if ($ENV{'form.refresh'} eq 'on') { |
my $ctr = 0; |
my $ctr = 0; |
while ($ctr < $ntstu) { |
$ENV{'form.NTSTU'}=$ngrade; |
|
while ($ctr < $ngrade) { |
($ENV{'form.student'},my $udom) = split(/:/,$ENV{'form.unamedom'.$ctr}); |
($ENV{'form.student'},my $udom) = split(/:/,$ENV{'form.unamedom'.$ctr}); |
&submission($request,$ctr,$ntstu-1); |
&submission($request,$ctr,$ngrade-1); |
$ctr++; |
$ctr++; |
} |
} |
return ''; |
return ''; |
Line 745 sub processHandGrade {
|
Line 750 sub processHandGrade {
|
} |
} |
} |
} |
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 ($classlist) = &getclasslist($ENV{'form.section'},'0'); |
while ($laststu eq '') { |
my (@nextlist,@prevlist); |
$laststu = $ENV{'form.unamedom'.($ngrade-$ctr)}; |
my ($nextflg,$ctr,$ctprev) = (0,0,0); |
$ctr++; |
my ($partlist,$handgrade) = &response_type($ENV{'form.url'}); |
$laststu = $firststu if ($ctr > $ngrade); |
foreach my $student ( sort(@{ $$classlist{$ENV{'form.section'}} }) ) { |
} |
my ($uname,$udom) = split(/:/,$student); |
my ($classlist,$seclist,$ids,$stusec,$fullname) = &getclasslist($ENV{'form.section'},'0'); |
my (%status) = &student_gradeStatus($ENV{'form.url'},$udom,$uname,$partlist); |
|
my $statusflg = ''; |
|
foreach (keys(%status)) { |
|
$statusflg = 1 if ($status{$_} ne 'nothing'); |
|
} |
|
next if ($statusflg eq '' && $ENV{'form.submitonly'} eq 'yes'); |
|
|
|
|
my (@parsedlist,@nextlist); |
|
my ($nextflg) = 0; |
|
foreach ( sort(@{ $$classlist{$ENV{'form.section'}} }) ) { |
if ($nextflg == 1 && $button =~ /Next$/) { |
if ($nextflg == 1 && $button =~ /Next$/) { |
push @nextlist,$uname if ($ctr < $ntstu); |
push @parsedlist,$_; |
$ctr++; |
|
last if ($ctr == $ntstu); |
|
} |
} |
$nextflg = 1 if ($student eq $laststu); |
$nextflg = 1 if ($_ eq $laststu); |
if ($button eq 'Previous') { |
if ($button eq 'Previous') { |
last if ($student eq $firststu); |
last if ($_ eq $firststu); |
push @prevlist,$uname; |
push @parsedlist,$_; |
$ctprev++; |
|
} |
} |
} |
} |
|
$ctr = 0; |
if ($button eq 'Previous') { |
my ($partlist,$handgrade) = &response_type($ENV{'form.url'}); |
if ($ctprev <= $ntstu) { |
@parsedlist = reverse @parsedlist if ($button eq 'Previous'); |
@nextlist = @prevlist; |
foreach my $student (@parsedlist) { |
} else { |
my ($uname,$udom) = split(/:/,$student); |
my $idx = 0; |
if ($ENV{'form.submitonly'} eq 'yes') { |
my $start = $ctprev - $ntstu; |
my (%status) = &student_gradeStatus($ENV{'form.url'},$udom,$uname,$partlist) ; |
while ($idx < $ntstu) { |
my $statusflg = ''; |
$nextlist[$idx] = $prevlist[$start+$idx]; |
foreach (keys(%status)) { |
$idx++; |
$statusflg = 1 if ($status{$_} ne 'nothing'); |
} |
} |
|
next if ($statusflg eq ''); |
} |
} |
|
push @nextlist,$student if ($ctr < $ntstu); |
|
$ctr++; |
} |
} |
|
|
$ctr = 0; |
$ctr = 0; |
my $total = scalar(@nextlist)-1; |
my $total = scalar(@nextlist)-1; |
foreach my $student (@nextlist) { |
foreach (sort @nextlist) { |
$ENV{'form.student'} = $student; |
my ($uname,$udom) = split(/:/); |
|
$ENV{'form.student'} = $uname; |
|
$ENV{'form.fullname'} = $$fullname{$_}; |
&submission($request,$ctr,$total); |
&submission($request,$ctr,$total); |
$ctr++; |
$ctr++; |
} |
} |
Line 830 sub saveHandGrade {
|
Line 834 sub saveHandGrade {
|
|
|
if ( scalar(keys(%newrecord)) > 0 ) { |
if ( scalar(keys(%newrecord)) > 0 ) { |
$newrecord{'resource.regrader'}="$ENV{'user.name'}:$ENV{'user.domain'}"; |
$newrecord{'resource.regrader'}="$ENV{'user.name'}:$ENV{'user.domain'}"; |
while (my ($k,$v) = each %newrecord) { |
# while (my ($k,$v) = each %newrecord) { |
print "k=$k:v=$v:<br>\n"; |
# print "k=$k:v=$v:<br>\n"; |
} |
# } |
# &Apache::lonnet::cstore(\%newrecord,$symb,$ENV{'request.course.id'},$domain,$stuname); |
&Apache::lonnet::cstore(\%newrecord,$symb,$ENV{'request.course.id'},$domain,$stuname); |
} |
} |
return ''; |
return ''; |
} |
} |
Line 974 sub viewGradeaStu_form {
|
Line 978 sub viewGradeaStu_form {
|
$result.=' <b>View/Grade an Individual Student\'s Submission</b></td></tr>'."\n"; |
$result.=' <b>View/Grade an Individual Student\'s Submission</b></td></tr>'."\n"; |
$result.='<tr bgcolor=#ffffe6><td>'."\n"; |
$result.='<tr bgcolor=#ffffe6><td>'."\n"; |
$result.='<form action="/adm/grades" method="post">'."\n". |
$result.='<form action="/adm/grades" method="post">'."\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="'.$response.'" />'."\n". |
'<input type="hidden" name="response" value="'.$response.'" />'."\n". |
'<input type="hidden" name="handgrade" value="'.$handgrade.'" />'."\n". |
'<input type="hidden" name="handgrade" value="'.$handgrade.'" />'."\n". |
'<input type="hidden" name="command" value="submission" />'."\n"; |
'<input type="hidden" name="command" value="submission" />'."\n"; |
|
|
$result.=' <b>Select section:</b> <select name="section">'."\n"; |
$result.=' <b>Select section:</b> <select name="section">'."\n"; |
foreach (sort (@$sections)) { |
foreach (sort (@$sections)) { |
Line 987 sub viewGradeaStu_form {
|
Line 991 sub viewGradeaStu_form {
|
$result.= '<option selected="on">all</select>'."\n"; |
$result.= '<option selected="on">all</select>'."\n"; |
$result.=' <b>Display students who has: </b>'. |
$result.=' <b>Display students who has: </b>'. |
'<input type="radio" name="submitonly" value="yes" checked> submitted'. |
'<input type="radio" name="submitonly" value="yes" checked> submitted'. |
'<input type="radio" name="submitonly" value="all"> everybody <br />'; |
'<input type="radio" name="submitonly" value="all"> everybody <br />'; |
$result.=' (Section "no" implies the students were not assigned a section.)<br />' |
$result.=' (Section "no" implies the students were not assigned a section.)<br />' |
if (grep /no/,@$sections); |
if (grep /no/,@$sections); |
|
|
Line 1341 function displaySavedMsg(ctr,msg,shwsel)
|
Line 1345 function displaySavedMsg(ctr,msg,shwsel)
|
hwdWin.document.write(" opener.document.SCORE.kwclr.value = radioSelection(document.hlCenter.kwdclr);"); |
hwdWin.document.write(" opener.document.SCORE.kwclr.value = radioSelection(document.hlCenter.kwdclr);"); |
hwdWin.document.write(" opener.document.SCORE.kwsize.value = radioSelection(document.hlCenter.kwdsize);"); |
hwdWin.document.write(" opener.document.SCORE.kwsize.value = radioSelection(document.hlCenter.kwdsize);"); |
hwdWin.document.write(" opener.document.SCORE.kwstyle.value = radioSelection(document.hlCenter.kwdstyle);"); |
hwdWin.document.write(" opener.document.SCORE.kwstyle.value = radioSelection(document.hlCenter.kwdstyle);"); |
|
// hwdWin.document.write(" var kwords=opener.document.SCORE.keywords.value;"); |
|
// hwdWin.document.write(" alert(\\"keywords=\\"+opener.document.SCORE.keywords.value);"); |
|
// hwdWin.document.write(" return;"); |
|
|
hwdWin.document.write(" if (flag==1){"); |
hwdWin.document.write(" if (flag==1){"); |
hwdWin.document.write(" opener.document.SCORE.refresh.value = \\"on\\";"); |
hwdWin.document.write(" opener.document.SCORE.refresh.value = \\"on\\";"); |
hwdWin.document.write(" opener.document.SCORE.submit();"); |
hwdWin.document.write(" if (opener.document.SCORE.keywords.value!=\\"\\"){"); |
|
hwdWin.document.write(" opener.document.SCORE.submit();"); |
|
hwdWin.document.write(" }"); |
hwdWin.document.write(" }"); |
hwdWin.document.write(" }"); |
hwdWin.document.write(" self.close()"); |
hwdWin.document.write(" self.close()"); |
hwdWin.document.write("}"); |
hwdWin.document.write("}"); |
Line 1385 function displaySavedMsg(ctr,msg,shwsel)
|
Line 1395 function displaySavedMsg(ctr,msg,shwsel)
|
function highlightend() { |
function highlightend() { |
hwdWin.document.write("</table>"); |
hwdWin.document.write("</table>"); |
hwdWin.document.write("</td></tr></table> "); |
hwdWin.document.write("</td></tr></table> "); |
hwdWin.document.write("<input type=\\"button\\" value=\\"Refresh\\" onClick=\\"javascript:updateChoice(1)\\"> "); |
hwdWin.document.write("<input type=\\"button\\" value=\\"Save\\" onClick=\\"javascript:updateChoice(0)\\"> "); |
hwdWin.document.write("<input type=\\"button\\" value=\\"Set Options\\" onClick=\\"javascript:updateChoice(0)\\"> "); |
hwdWin.document.write("<input type=\\"button\\" value=\\"Save & Refresh\\" onClick=\\"javascript:updateChoice(1)\\"> "); |
hwdWin.document.write("<input type=\\"button\\" value=\\"Cancel\\" onClick=\\"self.close()\\"><br><br>"); |
hwdWin.document.write("<input type=\\"button\\" value=\\"Cancel\\" onClick=\\"self.close()\\"><br><br>"); |
hwdWin.document.write("</form>"); |
hwdWin.document.write("</form>"); |
hwdWin.document.write("</body></html>"); |
hwdWin.document.write("</body></html>"); |