'.
''.
- ' 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
@@ -2775,7 +2854,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();
@@ -2785,59 +2865,27 @@ sub displayPage {
if ($ENV{'form.vProb'} eq 'yes') {
$studentTable.=&show_problem($request,$symbx,$uname,$udom,1);
} else {
- my $companswer = &Apache::loncommon::get_student_answers(
- $symbx,$uname,$udom,$ENV{'request.course.id'});
+ my $companswer = &Apache::loncommon::get_student_answers($symbx,$uname,$udom,$ENV{'request.course.id'});
$companswer =~ s|||g;
-
# while ($companswer =~ /()/s) { #\n");
# }
-# $companswer =~ s///g;
+# $companswer =~ s|||g;
$studentTable.=' '.$title.' Correct answer: '.$companswer;
}
my %record = &Apache::lonnet::restore($symbx,$ENV{'request.course.id'},$udom,$uname);
-
if ($ENV{'form.lastSub'} eq 'datesub') {
if ($record{'version'} eq '') {
$studentTable.=' No recorded submission for this problem ';
} else {
- $studentTable.=''.
- ''.
- 'Date/Time | '.
- 'Submission | '.
- 'Status | ';
- 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 '');
-# next if ($record{"$version:resource.$partid.award"} eq 'APPROX_ANS' &&
-# $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"}).' '.
- $record{$version.':'.$matchKey[0]}.' ' : '';
- $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]).' | ';
+ my %responseType = ();
+ foreach my $partid (@{$parts}) {
+ $responseType{$partid} = $curRes->responseType($partid);
}
- $studentTable.='
| ';
+ $studentTable.= &displaySubByDates(\$symbx,\%record,$parts,\%responseType,$checkIcon);
}
} elsif ($ENV{'form.lastSub'} eq 'all') {
my $last = ($ENV{'form.lastSub'} eq 'last' ? 'last' : '');
@@ -2871,6 +2919,47 @@ sub displayPage {
return '';
}
+sub displaySubByDates {
+ my ($symbx,$record,$parts,$responseType,$checkIcon) = @_;
+ my $studentTable=''.
+ ''.
+ 'Date/Time | '.
+ 'Submission | '.
+ 'Status | ';
+ my ($version);
+ my %mark;
+ $mark{'correct_by_student'} = $checkIcon;
+ return ' Nothing submitted - no attempts '
+ if (!exists($$record{'1:timestamp'}));
+ 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},$$symbx).' ' : '';
+ $displaySub[1].=(exists $$record{"$version:resource.$partid.award"}) ?
+ 'Part '.$partid.' '.
+ lc($$record{"$version:resource.$partid.award"}).' '.
+ $mark{$$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.='
| ';
+ return $studentTable;
+}
+
sub updateGradeByPage {
my ($request) = shift;
@@ -3338,12 +3427,19 @@ sub gradingmenu {
$request->print(<
- function checkChoice(formname) {
- var cmd = formname.command;
- formname.saveState.value = "saveCmd="+radioSelection(cmd)+":saveSec="+pullDownSelection(formname.section)+
- ":saveSub="+radioSelection(formname.submitonly)+":saveStatus="+pullDownSelection(formname.status);
- if (cmd[0].checked || cmd[1].checked || cmd[2].checked || cmd[3].checked || cmd[4].checked) formname.submit();
- if (cmd[5].checked) {
+ 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="+cmdsave+":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;}
formname.submit();
}
@@ -3360,142 +3456,96 @@ sub gradingmenu {
formname.receipt.focus();
return false;
}
- formname.command[5].checked = true;
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,undef,$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.='
|