version 1.46, 2002/08/06 20:46:30
|
version 1.49, 2002/09/20 23:35:30
|
Line 111 sub getclasslist {
|
Line 111 sub getclasslist {
|
my %classlist=&Apache::lonnet::dump('classlist', |
my %classlist=&Apache::lonnet::dump('classlist', |
$ENV{'course.'.$ENV{'request.course.id'}.'.domain'}, |
$ENV{'course.'.$ENV{'request.course.id'}.'.domain'}, |
$ENV{'course.'.$ENV{'request.course.id'}.'.num'}); |
$ENV{'course.'.$ENV{'request.course.id'}.'.num'}); |
|
my ($tmp) = keys(%classlist); |
|
# Bail out if we were unable to get the classlist |
|
return if ($tmp =~ /^(con_lost|error|no_such_host)/i); |
|
|
# codes to check for fields in the classlist |
# codes to check for fields in the classlist |
# should contain end:start:id:section:fullname |
# should contain end:start:id:section:fullname |
for (keys %classlist) { |
for (keys %classlist) { |
Line 297 sub verifyreceipt {
|
Line 301 sub verifyreceipt {
|
# on the problem page. |
# on the problem page. |
sub listStudents { |
sub listStudents { |
my ($request) = shift; |
my ($request) = shift; |
|
|
|
my ($symb,$url) = &get_symb_and_url(); |
|
my $cdom = $ENV{"course.$ENV{'request.course.id'}.domain"}; |
|
my $cnum = $ENV{"course.$ENV{'request.course.id'}.num"}; |
|
my $getsec = $ENV{'form.section'} eq '' ? 'all' : $ENV{'form.section'}; |
|
my $submitonly= $ENV{'form.submitonly'} eq '' ? 'all' : $ENV{'form.submitonly'}; |
|
|
|
my $result; |
|
my ($partlist,$handgrade) = &response_type($url); |
|
for (sort keys(%$handgrade)) { |
|
my ($responsetype,$handgrade)=split(/:/,$$handgrade{$_}); |
|
$ENV{'form.handgrade'} = 'yes' if ($handgrade eq 'yes'); |
|
$result.='<tr><td><b>Part </b>'.(split(/_/))[0].'</td>'. |
|
'<td><b>Type: </b>'.$responsetype.'</td>'. |
|
'<td><b>Handgrade: </b>'.$handgrade.'</font></td></tr>'; |
|
} |
|
$result.='</table>'; |
|
|
|
my $viewgrade; |
|
if ($ENV{'form.handgrade'} eq 'yes') { |
|
$viewgrade = 'View/Grade'; |
|
} else { |
|
$viewgrade = 'View'; |
|
} |
|
|
|
$result='<h3><font color="#339933"> '. |
|
$viewgrade. |
|
' Submissions for a Student or a Group of Students</font></h3>'. |
|
'<table border="0"><tr><td colspan=3><font size=+1>'. |
|
'<b>Resource: </b>'.$url.'</font></td></tr>'.$result; |
|
|
$request->print(<<LISTJAVASCRIPT); |
$request->print(<<LISTJAVASCRIPT); |
<script type="text/javascript" language="javascript"> |
<script type="text/javascript" language="javascript"> |
function checkSelect(checkBox) { |
function checkSelect(checkBox) { |
Line 316 sub listStudents {
|
Line 351 sub listStudents {
|
sense = "the student"; |
sense = "the student"; |
} |
} |
if (ctr == 0) { |
if (ctr == 0) { |
alert("Please select "+sense+" before clicking on the View/Grade button."); |
alert("Please select "+sense+" before clicking on the $viewgrade button."); |
return false; |
return false; |
} |
} |
document.gradesub.submit(); |
document.gradesub.submit(); |
Line 324 sub listStudents {
|
Line 359 sub listStudents {
|
</script> |
</script> |
LISTJAVASCRIPT |
LISTJAVASCRIPT |
|
|
my $cdom = $ENV{"course.$ENV{'request.course.id'}.domain"}; |
|
my $cnum = $ENV{"course.$ENV{'request.course.id'}.num"}; |
|
my $getsec = $ENV{'form.section'} eq '' ? 'all' : $ENV{'form.section'}; |
|
my $submitonly= $ENV{'form.submitonly'} eq '' ? 'all' : $ENV{'form.submitonly'}; |
|
|
|
my $result='<h3><font color="#339933"> '. |
|
'View/Grade Submissions for a Student or a Group of Students</font></h3>'; |
|
$result.='<table border="0">'; |
|
$result.='<tr><td colspan=3><font size=+1>'. |
|
'<b>Resource: </b>'.$ENV{'form.url'}.'</font></td></tr>'; |
|
my ($partlist,$handgrade) = &response_type($ENV{'form.url'}); |
|
for (sort keys(%$handgrade)) { |
|
my ($responsetype,$handgrade)=split(/:/,$$handgrade{$_}); |
|
$ENV{'form.handgrade'} = 'yes' if ($handgrade eq 'yes'); |
|
$result.='<tr><td><b>Part </b>'.(split(/_/))[0].'</td>'. |
|
'<td><b>Type: </b>'.$responsetype.'</td>'. |
|
'<td><b>Handgrade: </b>'.$handgrade.'</font></td></tr>'; |
|
} |
|
$result.='</table>'; |
|
$request->print($result); |
$request->print($result); |
|
|
my $checkhdgrade = $ENV{'form.handgrade'} eq 'yes' ? 'checked' : ''; |
my $checkhdgrade = $ENV{'form.handgrade'} eq 'yes' ? 'checked' : ''; |
Line 351 LISTJAVASCRIPT
|
Line 367 LISTJAVASCRIPT
|
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: </b><input type="radio" name="vProb" value="no" checked> no '."\n". |
' <b>View Problem: </b><input type="radio" name="vProb" value="no" checked> no '."\n". |
'<input type="radio" name="vProb" value="yes"> yes <br />'."\n". |
'<input type="radio" name="vProb" value="yes"> yes <br />'."\n". |
' <b>Submissions: </b>'."\n". |
' <b>Submissions: </b>'."\n"; |
'<input type="radio" name="lastSub" value="hdgrade" '.$checkhdgrade.' /> handgrade only'."\n". |
if ($ENV{'form.handgrade'} eq 'yes') { |
'<input type="radio" name="lastSub" value="lastonly" '.$checklastsub.' /> last sub only'."\n". |
$gradeTable.='<input type="radio" name="lastSub" value="hdgrade" '.$checkhdgrade.' /> handgrade 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="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". |
Line 361 LISTJAVASCRIPT
|
Line 379 LISTJAVASCRIPT
|
'<input type="hidden" name="response" value="'.$ENV{'form.response'}.'" />'."\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="url" value="'.$ENV{'form.url'}.'" />'."\n". |
'<input type="hidden" name="url" value="'.$url.'" />'."\n". |
'<input type="hidden" name="symb" value="'.$ENV{'form.symb'}.'" />'."\n". |
'<input type="hidden" name="symb" value="'.$symb.'" />'."\n". |
'To view/grade a submission, click on the check box next to the student\'s name. Then '."\n". |
'To '.lc($viewgrade).' a submission, click on the check box next to the student\'s name. Then '."\n". |
'click on the View/Grade 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". |
' on the check boxes for the group of students.<br />'."\n". |
' on the check boxes for the group of students.<br />'."\n". |
'<input type="hidden" name="command" value="processGroup" />'."\n". |
'<input type="hidden" name="command" value="processGroup" />'."\n". |
'<input type="button" '."\n". |
'<input type="button" '."\n". |
'onClick="javascript:checkSelect(this.form.stuinfo);" '."\n". |
'onClick="javascript:checkSelect(this.form.stuinfo);" '."\n". |
'value="View/Grade" />'."\n"; |
'value="'.$viewgrade.'" />'."\n"; |
|
|
my ($classlist,$seclist,$ids,$stusec,$fullname) = &getclasslist($getsec,'0'); |
my ($classlist,$seclist,$ids,$stusec,$fullname) = &getclasslist($getsec,'0'); |
|
|
Line 385 LISTJAVASCRIPT
|
Line 403 LISTJAVASCRIPT
|
my $ctr = 0; |
my $ctr = 0; |
foreach my $student (sort {$$fullname{$a} cmp $$fullname{$b} } keys %$fullname) { |
foreach my $student (sort {$$fullname{$a} cmp $$fullname{$b} } keys %$fullname) { |
my ($uname,$udom) = split(/:/,$student); |
my ($uname,$udom) = split(/:/,$student); |
my (%status) = &student_gradeStatus($ENV{'form.url'}, |
my (%status) =&student_gradeStatus($url,$symb,$udom,$uname,$partlist); |
$ENV{'form.symb'},$udom,$uname,$partlist); |
|
my $statusflg = ''; |
my $statusflg = ''; |
foreach (keys(%status)) { |
foreach (keys(%status)) { |
$statusflg = 1 if ($status{$_} ne 'nothing'); |
$statusflg = 1 if ($status{$_} ne 'nothing'); |
Line 419 LISTJAVASCRIPT
|
Line 436 LISTJAVASCRIPT
|
$gradeTable.='</table></td></tr></table>'. |
$gradeTable.='</table></td></tr></table>'. |
'<input type="button" '. |
'<input type="button" '. |
'onClick="javascript:checkSelect(this.form.stuinfo);" '. |
'onClick="javascript:checkSelect(this.form.stuinfo);" '. |
'value="View/Grade" /><form />'."\n"; |
'value="'.$viewgrade.'" /><form />'."\n"; |
if ($ctr == 0) { |
if ($ctr == 0) { |
$gradeTable='<br /> <font color="red">'. |
$gradeTable='<br /> <font color="red">'. |
'No submission found for this resource.</font><br />'; |
'No submission found for this resource.</font><br />'; |
$gradeTable.=&show_grading_menu_form ($ENV{'form.symb'},$ENV{'form.url'}); |
$gradeTable.=&show_grading_menu_form($symb,$url); |
} elsif ($ctr == 1) { |
} elsif ($ctr == 1) { |
$gradeTable =~ s/type=checkbox/type=checkbox checked/; |
$gradeTable =~ s/type=checkbox/type=checkbox checked/; |
} |
} |
Line 2105 sub view_edit_entire_class_form {
|
Line 2122 sub view_edit_entire_class_form {
|
'<input type="hidden" name="url" value="'.$url.'" />'."\n". |
'<input type="hidden" name="url" value="'.$url.'" />'."\n". |
'<input type="hidden" name="command" value="viewgrades" />'."\n"; |
'<input type="hidden" name="command" value="viewgrades" />'."\n"; |
$result.=' <b>Select section:</b> <select name="section">'."\n"; |
$result.=' <b>Select section:</b> <select name="section">'."\n"; |
foreach (sort (@$sections)) { |
if (ref($sections)) { |
$result.= '<option>'.$_.'</option>'."\n"; |
foreach (sort (@$sections)) { |
|
$result.= '<option>'.$_.'</option>'."\n"; |
|
} |
} |
} |
$result.='<option selected="on">all</select>'."<br />\n"; |
$result.='<option selected="on">all</select>'."<br />\n"; |
$result.=' <input type="button" onClick="submit();" value="View/Grade" /></form>'."\n"; |
$result.=' <input type="button" onClick="submit();" value="View/Grade" /></form>'."\n"; |
Line 2154 sub viewGradeaStu_form {
|
Line 2173 sub viewGradeaStu_form {
|
my ($classlist,$sections) = &getclasslist('all','0'); |
my ($classlist,$sections) = &getclasslist('all','0'); |
my $result.='<table width=100% border=0><tr><td bgcolor=#777777>'."\n"; |
my $result.='<table width=100% border=0><tr><td bgcolor=#777777>'."\n"; |
$result.='<table width=100% border=0><tr bgcolor="#e6ffff"><td>'."\n"; |
$result.='<table width=100% border=0><tr bgcolor="#e6ffff"><td>'."\n"; |
$result.=' <b>View/Grade an Individual Student\'s Submission</b></td></tr>'."\n"; |
$result.=' <b>'; |
|
if ($handgrade eq 'yes') { |
|
$result.="View/Grade "; |
|
} else { |
|
$result.="View "; |
|
} |
|
$result.='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". |
Line 2165 sub viewGradeaStu_form {
|
Line 2190 sub viewGradeaStu_form {
|
'<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)) { |
if (ref($sections)) { |
$result.= '<option>'.$_.'</option>'."\n"; |
foreach (sort (@$sections)) {$result.='<option>'.$_.'</option>'."\n";} |
} |
} |
$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 />' |
if (ref($sections)) { |
if (grep /no/,@$sections); |
$result.=' (Section "no" implies the students were not assigned a section.)<br />' |
|
if (grep /no/,@$sections); |
$result.='<br /> <input type="button" onClick="submit();" value="View/Grade" />'."\n". |
} |
'</form>'."\n"; |
|
|
|
|
$result.='<br /> <input type="button" onClick="submit();" value="'; |
|
if ($handgrade eq 'yes') { |
|
$result.="View/Grade"; |
|
} else { |
|
$result.="View"; |
|
} |
|
$result.='" />'."\n".'</form>'."\n"; |
$result.='</td></tr></table>'."\n"; |
$result.='</td></tr></table>'."\n"; |
$result.='</td></tr></table>'."\n"; |
$result.='</td></tr></table>'."\n"; |
return $result; |
return $result; |
Line 2316 sub send_header {
|
Line 2349 sub send_header {
|
#remotewindow=open('','homeworkremote'); |
#remotewindow=open('','homeworkremote'); |
#remotewindow.close(); |
#remotewindow.close(); |
#</script>"); |
#</script>"); |
$request->print('<body bgcolor="#FFFFFF">'); |
$request->print(&Apache::loncommon::bodytag('Grading')); |
} |
} |
|
|
sub send_footer { |
sub send_footer { |