'.
''.
- ' No | '.
- ' '.($ENV{'form.vProb'} eq 'no' ? 'Title' : 'Problem View').'/Grade | ';
+ ' Prob. | '.
+ ' '.($ENV{'form.vProb'} eq 'no' ? 'Title' : 'Problem Text').'/Grade | ';
my ($depth,$question) = (1,1);
$iterator->next(); # skip the first BEGIN_MAP
@@ -2779,7 +2806,8 @@ sub displayPage {
if($curRes == $iterator->BEGIN_MAP) { $depth++; }
if($curRes == $iterator->END_MAP) { $depth--; }
- if (ref($curRes) && $curRes->is_problem() && !$curRes->randomout) {
+# if (ref($curRes) && $curRes->is_problem() && !$curRes->randomout) {
+ if (ref($curRes) && $curRes->is_problem()) {
my $parts = $curRes->parts();
my $title = $curRes->compTitle();
my $symbx = $curRes->symb();
@@ -2805,42 +2833,11 @@ sub displayPage {
if ($record{'version'} eq '') {
$studentTable.=' No recorded submission for this problem ';
} else {
- $studentTable.=''.
- ''.
- 'Date/Time | '.
- 'Submission | '.
- 'Status | ';
my %responseType = ();
foreach my $partid (@{$parts}) {
$responseType{$partid} = $curRes->responseType($partid);
}
- my ($version);
- for ($version=1;$version<=$record{'version'};$version++) {
- my $timestamp = scalar(localtime($record{$version.':timestamp'}));
- $studentTable.=''.$timestamp.' | ';
- my @versionKeys = split(/\:/,$record{$version.':keys'});
- my @displaySub = ();
- foreach my $partid (@{$parts}) {
- my @matchKey = grep /^resource\.$partid\..*?\.submission$/,@versionKeys;
- next if ($record{"$version:resource.$partid.solved"} eq '');
- $displaySub[0].=(exists $record{$version.':'.$matchKey[0]}) ?
- 'Part '.$partid.' '.
- ($record{"$version:resource.$partid.tries"} eq '' ? 'Trial not counted' :
- 'Trial '.$record{"$version:resource.$partid.tries"}).' '.
- &cleanRecord($record{$version.':'.$matchKey[0]},$responseType{$partid}).' ' : '';
- $displaySub[1].=(exists $record{"$version:resource.$partid.award"}) ?
- 'Part '.$partid.' '.
- $record{"$version:resource.$partid.award"}.'/'.
- $record{"$version:resource.$partid.solved"}.' ' : '';
- $displaySub[2].=(exists $record{"$version:resource.$partid.regrader"}) ?
- $record{"$version:resource.$partid.regrader"}.' (Part: '.$partid.')' : '';
- }
- $displaySub[2].=(exists $record{"$version:resource.regrader"}) ?
- $record{"$version:resource.regrader"} : '';
- $studentTable.=''.$displaySub[0].' | '.$displaySub[1].
- ($displaySub[2] eq '' ? '' : 'Manually graded by '.$displaySub[2]).' | ';
- }
- $studentTable.='
| ';
+ $studentTable.= &displaySubByDates(\%record,$parts,\%responseType,$checkIcon);
}
} elsif ($ENV{'form.lastSub'} eq 'all') {
my $last = ($ENV{'form.lastSub'} eq 'last' ? 'last' : '');
@@ -2874,24 +2871,44 @@ sub displayPage {
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.'';
- push @ans,$ans;
- }
- my $grayFont = '';
- return ''.
- 'Answer | '.
- (join ' | ',@ans).' | '.
- ''.$grayFont.'Option ID | '.$grayFont.
- (join ' | '.$grayFont,@IDs).' | '.
- ' ';
+sub displaySubByDates {
+ my ($record,$parts,$responseType,$checkIcon) = @_;
+ my $studentTable=''.
+ ''.
+ 'Date/Time | '.
+ 'Submission | '.
+ 'Status | ';
+ my ($version);
+ my %mark;
+ $mark{'correct_by_student'} = $checkIcon;
+ for ($version=1;$version<=$$record{'version'};$version++) {
+ my $timestamp = scalar(localtime($$record{$version.':timestamp'}));
+ $studentTable.=''.$timestamp.' | ';
+ my @versionKeys = split(/\:/,$$record{$version.':keys'});
+ my @displaySub = ();
+ foreach my $partid (@{$parts}) {
+ my @matchKey = grep /^resource\.$partid\..*?\.submission$/,@versionKeys;
+ next if ($$record{"$version:resource.$partid.solved"} eq '');
+ $displaySub[0].=(exists $$record{$version.':'.$matchKey[0]}) ?
+ 'Part '.$partid.' '.
+ ($$record{"$version:resource.$partid.tries"} eq '' ? 'Trial not counted' :
+ 'Trial '.$$record{"$version:resource.$partid.tries"}).' '.
+ &cleanRecord($$record{$version.':'.$matchKey[0]},$$responseType{$partid}).' ' : '';
+ $displaySub[1].=(exists $$record{"$version:resource.$partid.award"}) ?
+ 'Part '.$partid.' '.
+ lc($$record{"$version:resource.$partid.award"}).' '.
+ $mark{$$record{"$version:resource.$partid.solved"}}.' ' : '';
+# $$record{"$version:resource.$partid.solved"}.' ' : '';
+ $displaySub[2].=(exists $$record{"$version:resource.$partid.regrader"}) ?
+ $$record{"$version:resource.$partid.regrader"}.' (Part: '.$partid.')' : '';
+ }
+ $displaySub[2].=(exists $$record{"$version:resource.regrader"}) ?
+ $$record{"$version:resource.regrader"} : '';
+ $studentTable.=''.$displaySub[0].' | '.$displaySub[1].
+ ($displaySub[2] eq '' ? '' : 'Manually graded by '.$displaySub[2]).' | ';
}
- return $answer;
+ $studentTable.='
| ';
+ return $studentTable;
}
sub updateGradeByPage {
@@ -3364,11 +3381,13 @@ sub gradingmenu {
function checkChoice(formname,val,cmdx) {
if (val <= 2) {
var cmd = radioSelection(formname.radioChoice);
+ var cmdsave = cmd;
} else {
cmd = cmdx;
+ cmdsave = 'submission';
}
formname.command.value = cmd;
- formname.saveState.value = "saveCmd="+cmd+":saveSec="+pullDownSelection(formname.section)+
+ formname.saveState.value = "saveCmd="+cmdsave+":saveSec="+pullDownSelection(formname.section)+
":saveSub="+radioSelection(formname.submitonly)+":saveStatus="+pullDownSelection(formname.Status);
if (val < 5) formname.submit();
if (val == 5) {
@@ -3390,57 +3409,17 @@ sub gradingmenu {
}
return true;
}
-
- function radioSelection(radioButton) {
- var selection=null;
- if (radioButton.length > 1) {
- for (var i=0; i 1) {
- for (var i=0; i
GRADINGMENUJS
-
- my $result=' Manual Grading/View Submission'.
- ''.
- 'Problem: '.$probTitle.' | '."\n";
- my ($partlist,$handgrade) = &response_type($url);
- my ($resptype,$hdgrade)=('','no');
- for (sort keys(%$handgrade)) {
- my ($responsetype,$handgrade)=split(/:/,$$handgrade{$_});
- $resptype = $responsetype;
- $hdgrade = $handgrade if ($handgrade eq 'yes');
- $result.='Part '.(split(/_/))[0].' | '.
- 'Type: '.$responsetype.' | ';
-# 'Handgrade: '.$handgrade.' | ';
- }
- $result.=' '."\n";
-
+ &commonJSfunctions($request);
+ my $result=' Manual Grading/View Submission';
+ my ($table,$resptype,$hdgrade) = &showResourceInfo($url,$probTitle);
+ $result.=$table;
my (undef,$sections) = &getclasslist('all','0');
my $savedState = &savedState();
- my $saveCmd = ($$savedState{'saveCmd'} eq '' ? 'pickStudentPage' : $$savedState{'saveCmd'});
+ my $saveCmd = ($$savedState{'saveCmd'} eq '' ? 'submission' : $$savedState{'saveCmd'});
my $saveSec = ($$savedState{'saveSec'} eq '' ? 'all' : $$savedState{'saveSec'});
- my $saveSub = ($$savedState{'saveSub'} eq '' ? 'yes' : $$savedState{'saveSub'});
+ my $saveSub = ($$savedState{'saveSub'} eq '' ? 'all' : $$savedState{'saveSub'});
my $saveStatus = ($$savedState{'saveStatus'} eq '' ? 'Active' : $$savedState{'saveStatus'});
$result.='
|