version 1.27, 2002/05/24 21:45:22
|
version 1.28, 2002/06/20 21:21:16
|
Line 94 sub listStudents {
|
Line 94 sub listStudents {
|
my $cnum=$ENV{"course.$ENV{'request.course.id'}.num"}; |
my $cnum=$ENV{"course.$ENV{'request.course.id'}.num"}; |
my $hostver=unpack("%32C*",$Apache::lonnet::perlvar{'lonHostID'}); |
my $hostver=unpack("%32C*",$Apache::lonnet::perlvar{'lonHostID'}); |
$request->print(<<ENDHEADER); |
$request->print(<<ENDHEADER); |
<h1>Verify a Submission Receipt Issued by this Server</h1> |
<h2><font color="#339933">Verify a Submission Receipt Issued by this Server</font></h2> |
<form action="/adm/grades" method="post"> |
<form action="/adm/grades" method="post"> |
<tt>$hostver-<input type="text" name="receipt" size="4"></tt> |
<tt>$hostver-<input type="text" name="receipt" size="4"></tt> |
<input type="submit" name="submit" value="Verify"> |
<input type="submit" name="submit" value="Verify"> |
Line 110 ENDHEADER
|
Line 110 ENDHEADER
|
} |
} |
$request->print(<<ENDTABLEST); |
$request->print(<<ENDTABLEST); |
</form> |
</form> |
<h1>Show Student Submissions on Assessment</h1> |
<h2><font color="#339933">Show Student Submissions on Assessment</font></h2> |
<table border="1"> |
|
<tr><th>Username</th><th>Domain</th><th>Name</th><th> </th></tr> |
<table border=0><tr><td bgcolor=#990404> |
|
<table border=0> |
|
<tr bgcolor=#e6ffff><td><b>Username</b></td><td><b>Name</b></td><td><b>Domain</b></td><td> </td></tr> |
ENDTABLEST |
ENDTABLEST |
my (%classlist) = &getclasslist($cdom,$cnum,'0'); |
my (%classlist) = &getclasslist($cdom,$cnum,'0'); |
foreach my $student ( sort(@{ $classlist{'allids'} }) ) { |
foreach my $student ( sort(@{ $classlist{'allids'} }) ) { |
Line 125 ENDTABLEST
|
Line 127 ENDTABLEST
|
my ($tmp) = keys(%name); |
my ($tmp) = keys(%name); |
if ($tmp !~ /^(con_lost|error|no_such_host)/i) { |
if ($tmp !~ /^(con_lost|error|no_such_host)/i) { |
$fullname=$name{'lastname'}.$name{'generation'}; |
$fullname=$name{'lastname'}.$name{'generation'}; |
if ($fullname =~ /[^\s]+/) { $fullname.=','; } |
if ($fullname =~ /[^\s]+/) { $fullname.=', '; } |
$fullname.=$name{'firstname'}.' '.$name{'middlename'}; |
$fullname.=$name{'firstname'}.' '.$name{'middlename'}; |
} |
} |
if ( $Apache::grades::viewgrades eq 'F' ) { |
if ( $Apache::grades::viewgrades eq 'F' ) { |
$request->print("\n".'<tr>'."<td>$sname</td><td>$sdom</td><td>$fullname</td><td>". |
$request->print("\n".'<tr bgcolor=#ffffe6>'."<td>$sname</td><td>$fullname</td><td>$sdom</td><td>". |
'<form action="/adm/grades" method="post">'); |
'<form action="/adm/grades" method="post">'); |
if ($ENV{'form.url'}) { |
if ($ENV{'form.url'}) { |
$request->print( |
$request->print( |
Line 144 ENDTABLEST
|
Line 146 ENDTABLEST
|
$request->print( |
$request->print( |
'<input type="hidden" name="student" value="'.$sname.'" />'); |
'<input type="hidden" name="student" value="'.$sname.'" />'); |
$request->print( |
$request->print( |
|
'<input type="hidden" name="fullname" value="'.$fullname.'" />'); |
|
$request->print( |
'<input type="hidden" name="domain" value="'.$sdom.'" />'); |
'<input type="hidden" name="domain" value="'.$sdom.'" />'); |
$request->print( |
$request->print( |
'<input type="submit" name="submit" value="View" />'); |
'<input type="submit" name="submit" value="View" />'); |
$request->print('</form></td></tr>'); |
$request->print('</td></tr></form>'); |
|
# $request->print('</form></td></tr>'); |
} |
} |
} |
} |
$request->print('</table>'); |
$request->print('</table></td></tr></table>'); |
} |
} |
|
|
|
|
Line 207 sub viewstudentgrade {
|
Line 212 sub viewstudentgrade {
|
my ($url,$symb,$courseid,$student,@parts) = @_; |
my ($url,$symb,$courseid,$student,@parts) = @_; |
my $result =''; |
my $result =''; |
my $cellclr = '"#ffffdd"'; |
my $cellclr = '"#ffffdd"'; |
my ($stuname,$domain) = split(/:/,$student); |
my ($username,$domain) = split(/:/,$student); |
|
|
my %record=&Apache::lonnet::restore($symb,$courseid,$domain,$stuname); |
my (@requests) = ('lastname','firstname','middlename','generation'); |
|
my (%name) = &Apache::lonnet::get('environment',\@requests,$domain,$username); |
|
my %record=&Apache::lonnet::restore($symb,$courseid,$domain,$username); |
|
my $fullname=$name{'lastname'}.$name{'generation'}; |
|
if ($fullname =~ /[^\s]+/) { $fullname.=', '; } |
|
$fullname.=$name{'firstname'}.' '.$name{'middlename'}; |
|
|
$result.="<tr><td bgcolor=$cellclr>$stuname</td><td bgcolor=$cellclr align=\"middle\">$domain</td>\n"; |
$result.="<tr bgcolor=$cellclr><td>$username</td><td>$fullname</td><td align=\"middle\">$domain</td>\n"; |
foreach my $part (@parts) { |
foreach my $part (@parts) { |
my ($temp,$part,$type)=split(/_/,$part); |
my ($temp,$part,$type)=split(/_/,$part); |
#print "resource.$part.$type = ".$record{"resource.$part.$type"}." <br />\n"; |
#print "resource.$part.$type = ".$record{"resource.$part.$type"}." <br />\n"; |
if ($type eq 'awarded') { |
if ($type eq 'awarded') { |
my $score=$record{"resource.$part.$type"}; |
my $score=$record{"resource.$part.$type"}; |
$result.="<td bgcolor=$cellclr align=\"middle\"><input type=\"text\" name=\"GRADE.$student.$part.$type\" value=\"$score\" size=\"4\" /></td>\n"; |
$result.="<td align=\"middle\"><input type=\"text\" name=\"GRADE.$student.$part.$type\" value=\"$score\" size=\"4\" /></td>\n"; |
} elsif ($type eq 'tries') { |
} elsif ($type eq 'tries') { |
my $score=$record{"resource.$part.$type"}; |
my $score=$record{"resource.$part.$type"}; |
$result.="<td bgcolor=$cellclr align=\"middle\"><input type=\"text\" name=\"GRADE.$student.$part.$type\" value=\"$score\" size=\"4\" /></td>\n" |
$result.="<td align=\"middle\"><input type=\"text\" name=\"GRADE.$student.$part.$type\" value=\"$score\" size=\"4\" /></td>\n" |
} elsif ($type eq 'solved') { |
} elsif ($type eq 'solved') { |
my $score=$record{"resource.$part.$type"}; |
my $score=$record{"resource.$part.$type"}; |
$result.="<td bgcolor=$cellclr align=\"middle\"><select name=\"GRADE.$student.$part.$type\">\n"; |
$result.="<td align=\"middle\"><select name=\"GRADE.$student.$part.$type\">\n"; |
if ($score =~ /^correct/) { |
if ($score =~ /^correct/) { |
$result.="<option selected=\"on\">correct</option>\n<option>incorrect</option>\n<option>excused</option>\n<option>ungraded</option>\n<option>nothing</option>\n"; |
$result.="<option selected=\"on\">correct</option>\n<option>incorrect</option>\n<option>excused</option>\n<option>ungraded</option>\n<option>nothing</option>\n"; |
} elsif ($score =~ /^incorrect/) { |
} elsif ($score =~ /^incorrect/) { |
Line 311 sub submission {
|
Line 321 sub submission {
|
if ($symb eq '') { $request->print("Unable to handle ambiguous references:$url:."); return ''; } |
if ($symb eq '') { $request->print("Unable to handle ambiguous references:$url:."); return ''; } |
my $answer=&Apache::loncommon::get_previous_attempt($symb,$uname,$udom, |
my $answer=&Apache::loncommon::get_previous_attempt($symb,$uname,$udom, |
$ENV{'request.course.id'}); |
$ENV{'request.course.id'}); |
my $result="<h2> Submission Record </h2> $uname:$udom for $url <br />".$answer; |
my $result='<h2><font color="#339933">Submission Record</font></h2>'; |
|
$result.='<b>Username : </b>'.$uname.'<br><b>Fullname : </b>'.$ENV{'form.fullname'}.'<br><b>Domain : </b>'.$udom.'<br><b>Resource : </b>'.$url.' <br />'.$answer; |
my $rendered=&Apache::loncommon::get_student_view($symb,$uname,$udom, |
my $rendered=&Apache::loncommon::get_student_view($symb,$uname,$udom, |
$ENV{'request.course.id'}); |
$ENV{'request.course.id'}); |
$result.="Student's view of the problem:<br /> $rendered <br /> Correct answer:<br />"; |
$result.="Student's view of the problem:<br /> $rendered <br /> Correct answer:<br />"; |
Line 336 sub gradingmenu {
|
Line 347 sub gradingmenu {
|
my ($request) = @_; |
my ($request) = @_; |
my ($symb,$url)=&get_symb_and_url($request); |
my ($symb,$url)=&get_symb_and_url($request); |
if (!$symb) {return '';} |
if (!$symb) {return '';} |
my $result='<h2>Select a grading method</h2><br />'; |
|
|
my $result='<h2> <font color="#339933">Select a Grading Method</font></h2><br />'; |
|
$result.='<table width=100% border=0><tr><td bgcolor=#990404>'."\n"; |
|
$result.='<table width=100% border=0><tr><td bgcolor=#e6ffff>'."\n"; |
|
$result.=' <b>Resource :</b> '.$url.'</td></tr>'."\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="command" value="viewgrades" />'."\n". |
'<input type="hidden" name="command" value="viewgrades" />'."\n". |
'<input type="submit" name="submit" value="View/Edit Entire Class" />'."\n". |
'<input type="submit" name="submit" value="View/Edit Entire Class" />'."\n". |
'</form>'; |
'</form>'."\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="command" value="csvupload" />'."\n". |
'<input type="hidden" name="command" value="csvupload" />'."\n". |
'<input type="submit" name="submit" value="Upload Scores" />'."\n". |
'<input type="submit" name="submit" value="Upload Scores" />'."\n". |
'</form>'; |
'</form>'."\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="command" value="submission" />'."\n". |
'<input type="hidden" name="command" value="submission" />'."\n". |
'<input type="submit" name="submit" value="View/Edit Student" />'."\n". |
'<input type="submit" name="submit" value="View/Edit Student" />'."\n". |
'</form>'; |
'</form>'."\n"; |
|
$result.='</td></tr></table>'."\n"; |
|
$result.='</td></tr></table>'."\n"; |
return $result; |
return $result; |
} |
} |
|
|
Line 375 sub viewgrades {
|
Line 393 sub viewgrades {
|
#get list of parts for this problem |
#get list of parts for this problem |
my (@parts) = &getpartlist($url); |
my (@parts) = &getpartlist($url); |
|
|
$request->print ("<h2><font color=\"#339966\">Manual Grading</font></h2>"); |
$request->print ("<h2><font color=\"#339933\">Manual Grading</font></h2>"); |
|
|
#start the form |
#start the form |
$result = '<form action="/adm/grades" method="post">'."\n". |
$result = '<form action="/adm/grades" method="post">'."\n". |
Line 383 sub viewgrades {
|
Line 401 sub viewgrades {
|
'<input type="hidden" name="url" value="'.$url.'" />'."\n". |
'<input type="hidden" name="url" value="'.$url.'" />'."\n". |
'<input type="hidden" name="command" value="editgrades" />'."\n". |
'<input type="hidden" name="command" value="editgrades" />'."\n". |
'<input type="submit" name="submit" value="Submit Changes" />'."\n". |
'<input type="submit" name="submit" value="Submit Changes" />'."\n". |
'<table border=0><tr><td bgcolor="#999999">'."\n". |
'<table border=0><tr><td bgcolor="#990404">'."\n". |
'<table border=0>'."\n". |
'<table border=0>'."\n". |
'<tr><td bgcolor='.$headerclr.'>UserId</td><td bgcolor='.$headerclr.'>Domain</td>'."\n"; |
'<tr bgcolor='.$headerclr.'><td><b>Username</b></td><td><b>Name</b></td><td><b>Domain</b></td>'."\n"; |
foreach my $part (sort(@parts)) { |
foreach my $part (sort(@parts)) { |
my $display=&Apache::lonnet::metadata($url,$part.'.display'); |
my $display=&Apache::lonnet::metadata($url,$part.'.display'); |
if (!$display) { $display = &Apache::lonnet::metadata($url,$part.'.name'); } |
if (!$display) { $display = &Apache::lonnet::metadata($url,$part.'.name'); } |
$result.='<td bgcolor='.$headerclr.'>'.$display.'</td>'."\n"; |
$result.='<td><b>'.$display.'</b></td>'."\n"; |
} |
} |
$result.="</tr>"; |
$result.='</tr>'; |
#get info for each student |
#get info for each student |
foreach my $student ( sort(@{ $classlist{'allids'} }) ) { |
foreach my $student ( sort(@{ $classlist{'allids'} }) ) { |
$result.=&viewstudentgrade($url,$symb,$ENV{'request.course.id'},$student,@parts); |
$result.=&viewstudentgrade($url,$symb,$ENV{'request.course.id'},$student,@parts); |