version 1.111, 2003/07/11 14:45:59
|
version 1.116, 2003/07/15 20:59:53
|
Line 41 use Apache::style;
|
Line 41 use Apache::style;
|
use Apache::lonxml; |
use Apache::lonxml; |
use Apache::lonnet; |
use Apache::lonnet; |
use Apache::loncommon; |
use Apache::loncommon; |
|
use Apache::lonhtmlcommon; |
use Apache::lonnavmaps; |
use Apache::lonnavmaps; |
use Apache::lonhomework; |
use Apache::lonhomework; |
use Apache::loncoursedata; |
use Apache::loncoursedata; |
Line 129 sub getclasslist {
|
Line 130 sub getclasslist {
|
my (undef,undef,$end,$start,$id,$section,$fullname,$status)= |
my (undef,undef,$end,$start,$id,$section,$fullname,$status)= |
@{$classlist->{$_}}; |
@{$classlist->{$_}}; |
# filter students according to status selected |
# filter students according to status selected |
if ($filterlist && $ENV{'form.status'} ne 'Any') { |
if ($filterlist && $ENV{'form.Status'} ne 'Any') { |
if ($ENV{'form.status'} ne $status) { |
if ($ENV{'form.Status'} ne $status) { |
delete ($classlist->{$_}); |
delete ($classlist->{$_}); |
next; |
next; |
} |
} |
Line 391 sub listStudents {
|
Line 392 sub listStudents {
|
} |
} |
|
|
function reLoadList(formname) { |
function reLoadList(formname) { |
if (formname.saveStatusOld.value == pullDownSelection(formname.status)) {return;} |
if (formname.saveStatusOld.value == pullDownSelection(formname.Status)) {return;} |
formname.command.value = 'submission'; |
formname.command.value = 'submission'; |
formname.submit(); |
formname.submit(); |
} |
} |
Line 417 LISTJAVASCRIPT
|
Line 418 LISTJAVASCRIPT
|
my $checklastsub = $ENV{'form.handgrade'} eq 'yes' ? '' : 'checked'; |
my $checklastsub = $ENV{'form.handgrade'} eq 'yes' ? '' : 'checked'; |
|
|
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 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". |
'<input type="radio" name="vProb" value="all" /> all students <br />'."\n". |
'<input type="radio" name="vProb" value="all" /> all students <br />'."\n". |
' <b>Submissions: </b>'."\n"; |
' <b>Submissions: </b>'."\n"; |
Line 425 LISTJAVASCRIPT
|
Line 426 LISTJAVASCRIPT
|
$gradeTable.='<input type="radio" name="lastSub" value="hdgrade" '.$checkhdgrade.' /> handgrade only'."\n"; |
$gradeTable.='<input type="radio" name="lastSub" value="hdgrade" '.$checkhdgrade.' /> handgrade only'."\n"; |
} |
} |
|
|
my $saveStatus = $ENV{'form.status'} eq '' ? 'Active' : $ENV{'form.status'}; |
my $saveStatus = $ENV{'form.Status'} eq '' ? 'Active' : $ENV{'form.Status'}; |
$ENV{'form.status'} = $saveStatus; |
$ENV{'form.Status'} = $saveStatus; |
|
|
$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". |
Line 442 LISTJAVASCRIPT
|
Line 443 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> <select onchange="javascript:reLoadList(this.form);" name="status">'. |
$gradeTable.='<b>Student Status:</b> '. |
'<option value="Active" '.($saveStatus eq 'Active' ? 'selected' : '').'>Active</option>'. |
&Apache::lonhtmlcommon::StatusOptions($saveStatus,undef,1,'javascript:reLoadList(this.form);').'<br />'; |
'<option value="Expired" '.($saveStatus eq 'Expired' ? 'selected' : '').'>Expired</option>'. |
|
'<option value="Any" '.($saveStatus eq 'Any' ? 'selected' : '').'>Any</option>'. |
|
'</select><br />'."\n"; |
|
|
|
$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". |
' on the check boxes for the group of students.<br />'."\n". |
' on the check boxes for the group of students.<br />'."\n". |
Line 1116 sub submission {
|
Line 1114 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 ''; } |
|
|
if (!&canview($usec)) { |
if (!&canview($usec)) { |
$request->print('<font color="red">Unable to view requested student.('.$uname.$udom.$usec.$ENV{'request.course.id'}.')</font>'); |
$request->print('<font color="red">Unable to view requested student.('. |
|
$uname.$udom.$usec.$ENV{'request.course.id'}.')</font>'); |
$request->print(&show_grading_menu_form($symb,$url)); |
$request->print(&show_grading_menu_form($symb,$url)); |
return; |
return; |
} |
} |
Line 1228 KEYWORDS
|
Line 1227 KEYWORDS
|
'<table border="0" width=100%><tr bgcolor="#edffff"><td>'."\n"; |
'<table border="0" width=100%><tr bgcolor="#edffff"><td>'."\n"; |
|
|
$result.='<b>Fullname: </b>'.$ENV{'form.fullname'}. |
$result.='<b>Fullname: </b>'.$ENV{'form.fullname'}. |
'<font color="#999999"> Username: '.$uname.'</font>'. |
'<font color="#999999"> Username: '.$uname. |
'<font color="#999999"> Domain: '.$udom.'</font><br />'."\n"; |
($ENV{'user.domain'} eq $udom ? '' : ' ('.$udom.')').'</font><br />'."\n"; |
|
# '<font color="#999999"> Domain: '.$udom.'</font><br />'."\n"; |
$result.='<input type="hidden" name="name'.$counter. |
$result.='<input type="hidden" name="name'.$counter. |
'" value="'.$ENV{'form.fullname'}.'" />'."\n"; |
'" value="'.$ENV{'form.fullname'}.'" />'."\n"; |
|
|
# If this is handgraded, then check for collaborators |
# If this is an essay-response part(handgraded), then check for collaborators |
my @col_fullnames; |
my @col_fullnames; |
my ($classlist,$fullname); |
my ($classlist,$fullname); |
if ($ENV{'form.handgrade'} eq 'yes') { |
if ($ENV{'form.handgrade'} eq 'yes') { |
Line 1323 KEYWORDS
|
Line 1323 KEYWORDS
|
my ($oname,$odom,$ocrsid,$oessay,$osim)=&most_similar($uname,$udom,$subval); |
my ($oname,$odom,$ocrsid,$oessay,$osim)=&most_similar($uname,$udom,$subval); |
if ($osim) { |
if ($osim) { |
$osim=int($osim*100.0); |
$osim=int($osim*100.0); |
$similar='<hr /><h3><font color="#FF0000">Essay is '.$osim.'% similar to an essay by '.&Apache::loncommon::plainname($oname,$odom). |
$similar='<hr /><h3><font color="#FF0000">Essay is '.$osim. |
|
'% similar to an essay by '.&Apache::loncommon::plainname($oname,$odom). |
'</font></h3><blockquote><i>'. |
'</font></h3><blockquote><i>'. |
&keywords_highlight($oessay).'</i></blockquote><hr />'; |
&keywords_highlight($oessay).'</i></blockquote><hr />'; |
} |
} |
Line 1333 KEYWORDS
|
Line 1334 KEYWORDS
|
($record{"resource.$partid.$respid.uploadedurl"}? |
($record{"resource.$partid.$respid.uploadedurl"}? |
'<a href="'. |
'<a href="'. |
&Apache::lonnet::tokenwrapper($record{"resource.$partid.$respid.uploadedurl"}). |
&Apache::lonnet::tokenwrapper($record{"resource.$partid.$respid.uploadedurl"}). |
'"><img src="/adm/lonIcons/unknown.gif" border=0"> File uploaded by student</a> <font color="red" size="1">Like all files provided by users, this file may contain virusses</font><br />':''). |
'"><img src="/adm/lonIcons/unknown.gif" border=0"> File uploaded by student</a> '. |
|
'<font color="red" size="1">Like all files provided by users, '. |
|
'this file may contain virusses</font><br />':''). |
'<b>Answer: </b><blockquote>'. |
'<b>Answer: </b><blockquote>'. |
&keywords_highlight($subval).'</blockquote><br /> '.$similar.'</td></tr>'."\n" |
&keywords_highlight($subval).'</blockquote><br /> '.$similar.'</td></tr>'."\n" |
if ($ENV{'form.lastSub'} eq 'lastonly' || |
if ($ENV{'form.lastSub'} eq 'lastonly' || |
Line 1354 KEYWORDS
|
Line 1357 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 1390 KEYWORDS
|
Line 1394 KEYWORDS
|
my ($partid,$respid) = split(/_/); |
my ($partid,$respid) = split(/_/); |
next if ($seen{$partid} > 0); |
next if ($seen{$partid} > 0); |
$seen{$partid}++; |
$seen{$partid}++; |
next if ($$handgrade{$_} =~ /:no$/); |
# next if ($$handgrade{$_} =~ /:no$/); |
push @partlist,$partid; |
push @partlist,$partid; |
|
|
$request->print(&gradeBox($request,$symb,$uname,$udom,$counter,$partid,\%record)); |
$request->print(&gradeBox($request,$symb,$uname,$udom,$counter,$partid,\%record)); |
Line 1975 sub viewgrades {
|
Line 1979 sub viewgrades {
|
} |
} |
$result.= '<table border=0><tr><td bgcolor="#777777">'."\n". |
$result.= '<table border=0><tr><td bgcolor="#777777">'."\n". |
'<table border=0><tr bgcolor="#deffff">'. |
'<table border=0><tr bgcolor="#deffff">'. |
'<td><b>Fullname</b></td><td><b>Username</b></td><td><b>Domain</b></td>'."\n"; |
'<td><b>Fullname</b> <font color="#999999">(Username)</font></td>'."\n"; |
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/); |
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 2009 sub viewgrades {
|
Line 2014 sub viewgrades {
|
'onClick="javascript:submit();" TARGET=_self /></form>'."\n"; |
'onClick="javascript:submit();" TARGET=_self /></form>'."\n"; |
if (scalar(%$fullname) eq 0) { |
if (scalar(%$fullname) eq 0) { |
my $colspan=3+scalar(@parts); |
my $colspan=3+scalar(@parts); |
$result='<font color="red">There are no students in section "'.$ENV{'form.section'}.'" with enrollment status "'.$ENV{'form.status'}.'" to modify or grade.</font>'; |
$result='<font color="red">There are no students in section "'.$ENV{'form.section'}. |
|
'" with enrollment status "'.$ENV{'form.Status'}.'" to modify or grade.</font>'; |
} |
} |
$result.=&show_grading_menu_form($symb,$url); |
$result.=&show_grading_menu_form($symb,$url); |
return $result; |
return $result; |
Line 2023 sub viewstudentgrade {
|
Line 2029 sub viewstudentgrade {
|
my %record=&Apache::lonnet::restore($symb,$courseid,$udom,$uname); |
my %record=&Apache::lonnet::restore($symb,$courseid,$udom,$uname); |
my $result='<tr bgcolor="#ffffdd"><td>'. |
my $result='<tr bgcolor="#ffffdd"><td>'. |
'<a href="javascript:viewOneStudent(\''.$uname.'\',\''.$udom. |
'<a href="javascript:viewOneStudent(\''.$uname.'\',\''.$udom. |
'\')"; TARGET=_self>'.$fullname.'</a>'. |
'\')"; TARGET=_self>'.$fullname.'</a> '. |
'</td><td>'.$uname.'</td><td align="middle">'.$udom.'</td>'."\n"; |
'<font color="#999999">('.$uname.($ENV{'user.domain'} eq $udom ? '' : ':'.$udom).')</font></td>'."\n"; |
foreach my $apart (@$parts) { |
foreach my $apart (@$parts) { |
my ($part,$type) = &split_part_type($apart); |
my ($part,$type) = &split_part_type($apart); |
my $score=$record{"resource.$part.$type"}; |
my $score=$record{"resource.$part.$type"}; |
Line 2049 sub viewstudentgrade {
|
Line 2055 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 2609 LISTJAVASCRIPT
|
Line 2615 LISTJAVASCRIPT
|
$result.='<input type="hidden" name="page" />'."\n". |
$result.='<input type="hidden" name="page" />'."\n". |
'<input type="hidden" name="title" />'."\n"; |
'<input type="hidden" name="title" />'."\n"; |
|
|
$result.=' <b>View Problems: </b><input type="radio" name="vProb" value="no" checked /> no '."\n". |
$result.=' <b>View Problems Text: </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"; |
|
|
$result.=' <b>Submission Details: </b>'. |
$result.=' <b>Submission Details: </b>'. |
Line 2618 LISTJAVASCRIPT
|
Line 2624 LISTJAVASCRIPT
|
'<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". |
'<input type="hidden" name="status" value="'.$ENV{'form.status'}.'" />'."\n". |
'<input type="hidden" name="Status" value="'.$ENV{'form.Status'}.'" />'."\n". |
'<input type="hidden" name="command" value="displayPage" />'."\n". |
'<input type="hidden" name="command" value="displayPage" />'."\n". |
'<input type="hidden" name="url" value="'.$url.'" />'."\n". |
'<input type="hidden" name="url" value="'.$url.'" />'."\n". |
'<input type="hidden" name="symb" value="'.$symb.'" />'."\n". |
'<input type="hidden" name="symb" value="'.$symb.'" />'."\n". |
Line 2664 sub getSymbMap {
|
Line 2670 sub getSymbMap {
|
my ($request) = @_; |
my ($request) = @_; |
my $navmap = Apache::lonnavmaps::navmap-> new($ENV{'request.course.fn'}.'.db', |
my $navmap = Apache::lonnavmaps::navmap-> new($ENV{'request.course.fn'}.'.db', |
$ENV{'request.course.fn'}.'_parms.db',1, 1); |
$ENV{'request.course.fn'}.'_parms.db',1, 1); |
|
|
my $res = $navmap->firstResource(); # temp resource to access constants |
|
$navmap->init(); |
$navmap->init(); |
|
|
# End navmap using boilerplate |
# End navmap using boilerplate |
|
|
my $iterator = $navmap->getIterator(undef, undef, undef, 1); |
my $iterator = Apache::lonnavmaps::iterator->new($navmap, undef, undef, undef, undef, 1, undef, 1); |
my $depth = 1; |
my $depth = 1; |
$iterator->next(); # ignore first BEGIN_MAP |
|
my $curRes = $iterator->next(); |
my $curRes = $iterator->next(); |
|
|
my %symbx = (); |
my %symbx = (); |
my @titles = (); |
my @titles = (); |
my $minder=0; |
my $minder=0; |
while ($depth > 0) { |
my $seenBeginMap = 0; |
if ($curRes == $iterator->BEGIN_MAP()) {$depth++;} |
while ($depth > 0 || !$seenBeginMap) { |
|
if ($curRes == $iterator->BEGIN_MAP()) {$depth++; $seenBeginMap = 1; } |
if ($curRes == $iterator->END_MAP()) { $depth--; } |
if ($curRes == $iterator->END_MAP()) { $depth--; } |
|
|
if (ref($curRes) && $curRes->is_map()) { |
if (ref($curRes) && $curRes->is_map()) { |
Line 2785 sub displayPage {
|
Line 2789 sub displayPage {
|
if ($ENV{'form.vProb'} eq 'yes') { |
if ($ENV{'form.vProb'} eq 'yes') { |
$studentTable.=&show_problem($request,$symbx,$uname,$udom,1); |
$studentTable.=&show_problem($request,$symbx,$uname,$udom,1); |
} else { |
} else { |
my $companswer = &Apache::loncommon::get_student_answers( |
my $companswer = &Apache::loncommon::get_student_answers($symbx,$uname,$udom,$ENV{'request.course.id'}); |
$symbx,$uname,$udom,$ENV{'request.course.id'}); |
|
$companswer =~ s|<form(.*?)>||g; |
$companswer =~ s|<form(.*?)>||g; |
$companswer =~ s|</form>||g; |
$companswer =~ s|</form>||g; |
|
|
# while ($companswer =~ /(<a href\=\"javascript:newWindow.*?Script Vars<\/a>)/s) { #<a href="javascript:newWindow</a> |
# while ($companswer =~ /(<a href\=\"javascript:newWindow.*?Script Vars<\/a>)/s) { #<a href="javascript:newWindow</a> |
# $request->print('match='.$1.'<br>'); |
# $companswer =~ s/$1/ /ms; |
# $companswer =~ s/$1/ /s; |
# $request->print('match='.$1."<br>\n"); |
# } |
# } |
# $companswer =~ s/<table border=\"1\">/<table border=\"0\">/g; |
# $companswer =~ s|<table border=\"1\">|<table border=\"0\">|g; |
$studentTable.=' <b>'.$title.'</b> <br> <b>Correct answer:</b><br>'.$companswer; |
$studentTable.=' <b>'.$title.'</b> <br> <b>Correct answer:</b><br>'.$companswer; |
} |
} |
|
|
my %record = &Apache::lonnet::restore($symbx,$ENV{'request.course.id'},$udom,$uname); |
my %record = &Apache::lonnet::restore($symbx,$ENV{'request.course.id'},$udom,$uname); |
|
|
if ($ENV{'form.lastSub'} eq 'datesub') { |
if ($ENV{'form.lastSub'} eq 'datesub') { |
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 />'; |
Line 2809 sub displayPage {
|
Line 2810 sub displayPage {
|
'<td><b>Date/Time</b></td>'. |
'<td><b>Date/Time</b></td>'. |
'<td><b>Submission</b></td>'. |
'<td><b>Submission</b></td>'. |
'<td><b>Status </b></td></tr>'; |
'<td><b>Status </b></td></tr>'; |
|
my %responseType = (); |
|
foreach my $partid (@{$parts}) { |
|
$responseType{$partid} = $curRes->responseType($partid); |
|
} |
my ($version); |
my ($version); |
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'})); |
Line 2818 sub displayPage {
|
Line 2823 sub displayPage {
|
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 ''); |
# next if ($record{"$version:resource.$partid.award"} eq 'APPROX_ANS' && |
|
# $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> '. |
$record{$version.':'.$matchKey[0]}.'<br />' : ''; |
&cleanRecord($record{$version.':'.$matchKey[0]},$responseType{$partid}).'<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> '. |
$record{"$version:resource.$partid.award"}.'/'. |
$record{"$version:resource.$partid.award"}.'/'. |
Line 2871 sub displayPage {
|
Line 2874 sub displayPage {
|
return ''; |
return ''; |
} |
} |
|
|
|
sub cleanRecord { |
|
my ($answer,$response) = @_; |
|
if ($response eq 'option') { |
|
my (@IDs,@ans); |
|
foreach (split(/\&/,&Apache::lonnet::unescape($answer))) { |
|
my ($optionID,$ans) = split(/=/); |
|
push @IDs,$optionID.'</font>'; |
|
push @ans,$ans; |
|
} |
|
my $grayFont = '<font color="#999999">'; |
|
return '<table border="1">'. |
|
'<tr valign="top"><td>Answer</td><td>'. |
|
(join '</td><td>',@ans).'</td></tr>'. |
|
'<tr><td>'.$grayFont.'Option ID</font></td><td>'.$grayFont. |
|
(join '</td><td>'.$grayFont,@IDs).'</font></td></tr>'. |
|
'</table>'; |
|
} |
|
return $answer; |
|
} |
|
|
sub updateGradeByPage { |
sub updateGradeByPage { |
my ($request) = shift; |
my ($request) = shift; |
|
|
Line 3338 sub gradingmenu {
|
Line 3361 sub gradingmenu {
|
|
|
$request->print(<<GRADINGMENUJS); |
$request->print(<<GRADINGMENUJS); |
<script type="text/javascript" language="javascript"> |
<script type="text/javascript" language="javascript"> |
function checkChoice(formname) { |
function checkChoice(formname,val,cmdx) { |
var cmd = formname.command; |
if (val <= 2) { |
formname.saveState.value = "saveCmd="+radioSelection(cmd)+":saveSec="+pullDownSelection(formname.section)+ |
var cmd = radioSelection(formname.radioChoice); |
":saveSub="+radioSelection(formname.submitonly)+":saveStatus="+pullDownSelection(formname.status); |
} else { |
if (cmd[0].checked || cmd[1].checked || cmd[2].checked || cmd[3].checked || cmd[4].checked) formname.submit(); |
cmd = cmdx; |
if (cmd[5].checked) { |
} |
|
formname.command.value = cmd; |
|
formname.saveState.value = "saveCmd="+cmd+":saveSec="+pullDownSelection(formname.section)+ |
|
":saveSub="+radioSelection(formname.submitonly)+":saveStatus="+pullDownSelection(formname.Status); |
|
if (val < 5) formname.submit(); |
|
if (val == 5) { |
if (!checkReceiptNo(formname,'notOK')) { return false;} |
if (!checkReceiptNo(formname,'notOK')) { return false;} |
formname.submit(); |
formname.submit(); |
} |
} |
Line 3360 sub gradingmenu {
|
Line 3388 sub gradingmenu {
|
formname.receipt.focus(); |
formname.receipt.focus(); |
return false; |
return false; |
} |
} |
formname.command[5].checked = true; |
|
return true; |
return true; |
} |
} |
|
|
Line 3404 GRADINGMENUJS
|
Line 3431 GRADINGMENUJS
|
$resptype = $responsetype; |
$resptype = $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>'.(split(/_/))[0].'</td>'. |
'<td><b>Type: </b>'.$responsetype.'</td>'. |
'<td><b>Type: </b>'.$responsetype.'</td></tr>'; |
'<td><b>Handgrade: </b>'.$handgrade.'</font></td></tr>'; |
# '<td><b>Handgrade: </b>'.$handgrade.'</font></td></tr>'; |
} |
} |
$result.='</table>'."\n"; |
$result.='</table>'."\n"; |
|
|
Line 3422 GRADINGMENUJS
|
Line 3449 GRADINGMENUJS
|
'<input type="hidden" name="response" value="'.$resptype.'" />'."\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="saveState" value="" />'."\n". |
'<input type="hidden" name="saveState" value="" />'."\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". |
'<table width=100% border=0><tr bgcolor="#e6ffff"><td>'."\n". |
'<table width=100% border=0><tr bgcolor="#e6ffff"><td colspan="2">'."\n". |
' <b>Select a Grading/Viewing Option</b></td></tr>'."\n". |
' <b>Select a Grading/Viewing Option</b></td></tr>'."\n". |
'<tr bgcolor=#ffffe6><td>'."\n"; |
'<tr bgcolor="#ffffe6" valign="top"><td>'."\n"; |
|
|
|
$result.='<table width="100%" border=0>'; |
|
$result.='<tr bgcolor="#ffffe6" valign="top"><td>'."\n". |
|
' Section: <select name="section">'."\n"; |
|
if (ref($sections)) { |
|
foreach (sort (@$sections)) {$result.='<option value="'.$_.'" '. |
|
($saveSec eq $_ ? 'selected="on"' : '').'>'.$_.'</option>'."\n";} |
|
} |
|
$result.= '<option value="all" '.($saveSec eq 'all' ? 'selected="on"' : ''). '>all</select> '; |
|
|
$result.='<table width=100% border=0>'. |
$result.='Student Status:</b>'.&Apache::lonhtmlcommon::StatusOptions($saveStatus,undef,1,undef); |
'<tr bgcolor="#ffffe6" valign="top"><td colspan="2">'. |
|
'<input type="radio" name="command" value="pickStudentPage" '. |
if (ref($sections)) { |
|
$result.=' (Section "no" implies the students were not assigned a section.)<br />' |
|
if (grep /no/,@$sections); |
|
} |
|
$result.='</td></tr>'; |
|
|
|
$result.='<tr bgcolor="#ffffe6" valign="top"><td>'. |
|
'<input type="radio" name="radioChoice" value="pickStudentPage" '. |
($saveCmd eq 'pickStudentPage' ? 'checked' : '').'> '. |
($saveCmd eq 'pickStudentPage' ? 'checked' : '').'> '. |
'Handgrade/View Submission for a student by page/sequence</td></tr>'."\n". |
'One student for whole page/sequence/folder</td></tr>'."\n"; |
|
|
'<tr bgcolor="#ffffe6"valign="top"><td colspan="2">'. |
$result.='<tr bgcolor="#ffffe6"valign="top"><td>'. |
'<input type="radio" name="command" value="viewgrades" '. |
'<input type="radio" name="radioChoice" value="viewgrades" '. |
($saveCmd eq 'viewgrades' ? 'checked' : '').'> '. |
($saveCmd eq 'viewgrades' ? 'checked' : '').'> '. |
'Grade by section or class</td></tr>'."\n". |
'All students in section/course for current resource</td></tr>'."\n"; |
|
|
'<tr bgcolor="#ffffe6"valign="top"><td><input type="radio" name="command" value="submission" '. |
$result.='<tr bgcolor="#ffffe6"valign="top"><td>'. |
($saveCmd eq 'submission' ? 'checked' : '').'> '. |
'<input type="radio" name="radioChoice" value="submission" '. |
($hdgrade eq 'yes' ? 'View/Grade essay response of' : 'View'). |
($saveCmd eq 'submission' ? 'checked' : '').'> '.'One or more students for current resource'. |
' an individual student </td>'."\n". |
'<br /> -->For students who has: '. |
'<td>--> For students who has: '. |
|
'<input type="radio" name="submitonly" value="yes" '. |
'<input type="radio" name="submitonly" value="yes" '. |
($saveSub eq 'yes' ? 'checked' : '').' /> submitted'. |
($saveSub eq 'yes' ? 'checked' : '').' /> submitted'. |
'<input type="radio" name="submitonly" value="all" '. |
'<input type="radio" name="submitonly" value="all" '. |
($saveSub eq 'all' ? 'checked' : '').' /> everybody</td></tr>'."\n". |
($saveSub eq 'all' ? 'checked' : '').' /> everybody</td></tr>'."\n"; |
|
|
|
$result.='<tr bgcolor="#ffffe6"><td><br />'. |
|
'<input type="button" onClick="javascript:checkChoice(this.form,\'2\');" value="View/Grade/Regrade" />'. |
|
'</td></tr></table>'."\n"; |
|
|
'<tr bgcolor="#ffffe6"valign="top"><td colspan="2">'. |
$result.='</td><td valign="top">'; |
'<input type="radio" name="command" value="csvform" '. |
|
($saveCmd eq 'csvform' ? 'checked' : '').'> '. |
$result.='<table width="100%" border=0>'; |
'Upload scores from file</td></tr>'."\n"; |
$result.='<tr bgcolor="#ffffe6"><td>'. |
|
'<input type="button" onClick="javascript:checkChoice(this.form,\'3\',\'csvform\');" value="Upload" />'. |
|
' scores from file </td></tr>'."\n"; |
|
|
$result.='<tr bgcolor="#ffffe6"valign="top"><td colspan="2">'. |
$result.='<tr bgcolor="#ffffe6"valign="top"><td colspan="2">'. |
'<input type="radio" name="command" value="scantron_selectphase" '. |
'<input type="button" onClick="javascript:checkChoice(this.form,\'4\',\'scantron_selectphase\');'. |
($saveCmd eq 'scantron_selectphase' ? 'checked="on"' : '').' /> '. |
'" value="Grade" /> scantron forms</td></tr>'."\n"; |
'Grade scantron forms</td></tr>'."\n"; |
|
|
|
if ((&Apache::lonnet::allowed('mgr',$ENV{'request.course.id'})) && ($symb)) { |
if ((&Apache::lonnet::allowed('mgr',$ENV{'request.course.id'})) && ($symb)) { |
$result.='<tr bgcolor="#ffffe6"valign="top"><td>'. |
$result.='<tr bgcolor="#ffffe6"valign="top"><td>'. |
'<input type="radio" name="command" value="verify" onChecked="javascript:this.form.receipt.focus()" '. |
'<input type="button" onClick="javascript:checkChoice(this.form,\'5\',\'verify\');" value="Verify" />'. |
($saveCmd eq 'verify' ? 'checked' : '').'> '. |
' submission Receipt no: '.unpack("%32C*",$Apache::lonnet::perlvar{'lonHostID'}). |
'Verify a submission receipt issued by this server</td>'. |
|
'<td>--> Receipt no: '.unpack("%32C*",$Apache::lonnet::perlvar{'lonHostID'}). |
|
'-<input type="text" name="receipt" size="4" onChange="javascript:checkReceiptNo(this.form,\'OK\')">'. |
'-<input type="text" name="receipt" size="4" onChange="javascript:checkReceiptNo(this.form,\'OK\')">'. |
'</td></tr>'."\n"; |
'</td></tr>'."\n"; |
} |
} |
|
|
$result.='<tr bgcolor="#ffffe6"valign="top"><td colspan="2"><br />'."\n". |
$result.='</form></td></tr></table>'."\n". |
' Select section: <select name="section">'."\n"; |
|
if (ref($sections)) { |
|
foreach (sort (@$sections)) {$result.='<option value="'.$_.'" '. |
|
($saveSec eq $_ ? 'selected="on"' : '').'>'.$_.'</option>'."\n";} |
|
} |
|
$result.= '<option value="all" '.($saveSec eq 'all' ? 'selected="on"' : ''). '>all</select> '; |
|
|
|
$result.='Student Status:</b><select name="status">'. |
|
'<option value="Active" '.($saveStatus eq 'Active' ? 'selected' : '').'>Active</option>'. |
|
'<option value="Expired" '.($saveStatus eq 'Expired' ? 'selected' : '').'>Expired</option>'. |
|
'<option value="Any" '.($saveStatus eq 'Any' ? 'selected' : '').'>Any</option>'. |
|
'</select>'; |
|
|
|
$result.=' <font color="red">(Applies to the first three options only.)</font>'."\n"; |
|
|
|
if (ref($sections)) { |
|
$result.=' (Section "no" implies the students were not assigned a section.)<br />' |
|
if (grep /no/,@$sections); |
|
} |
|
$result.='</td></tr>'; |
|
|
|
$result.='<tr bgcolor="#ffffe6"><td colspan="2"><br />'. |
|
'<input type="button" onClick="javascript:checkChoice(this.form);" value="View/Grade" />'."\n". |
|
'</form></td></tr></table>'."\n". |
|
'</td></tr></table>'."\n". |
'</td></tr></table>'."\n". |
'</td></tr></table>'."\n"; |
'</td></tr></table>'."\n"; |
return $result; |
return $result; |