1) {
+ push(@skipped,&mt("[_1]: point value larger than weight","$username:$domain"));
+ }
$grades{"resource.$part.awarded"}=$pcr;
$grades{"resource.$part.solved"}=$award;
$points{$part}=1;
@@ -4362,8 +4400,8 @@ sub displayPage {
&Apache::loncommon::start_data_table_row().
''.$prob.
(scalar(@{$parts}) == 1 ? ''
- : ' ('.&mt('[_1] parts)',
- scalar(@{$parts}))
+ : ' ('.&mt('[_1]parts)',
+ scalar(@{$parts}).' ')
).
' | ';
$studentTable.='';
@@ -4457,6 +4495,7 @@ sub displaySubByDates {
my $interaction;
my $no_increment = 1;
+ my %lastrndseed;
for ($version=1;$version<=$$record{'version'};$version++) {
my $timestamp =
&Apache::lonlocal::locallocaltime($$record{$version.':timestamp'});
@@ -4474,9 +4513,9 @@ sub displaySubByDates {
my @versionKeys = split(/\:/,$$record{$version.':keys'});
my @displaySub = ();
foreach my $partid (@{$parts}) {
- my $hidden;
- if (($$record{$version.':resource.'.$partid.'.type'} eq 'anonsurvey') ||
- ($$record{$version.':resource.'.$partid.'.type'} eq 'anonsurveycred')) {
+ my ($hidden,$type);
+ $type = $$record{$version.':resource.'.$partid.'.type'};
+ if (($type eq 'anonsurvey') || ($type eq 'anonsurveycred')) {
$hidden = 1;
}
my @matchKey = ($isTask ? sort(grep /^resource\.\d+\.\Q$partid\E\.award$/,@versionKeys)
@@ -4499,23 +4538,34 @@ sub displaySubByDates {
if ($hidden) {
$displaySub[0].= &mt('Anonymous Survey').'';
} else {
+ my ($trial,$rndseed,$newvariation);
+ if ($type eq 'randomizetry') {
+ $trial = $$record{"$where.$partid.tries"};
+ $rndseed = $$record{"$where.$partid.rndseed"};
+ }
if ($$record{"$where.$partid.tries"} eq '') {
$displaySub[0].=&mt('Trial not counted');
} else {
$displaySub[0].=&mt('Trial: [_1]',
$$record{"$where.$partid.tries"});
+ if ($rndseed || $lastrndseed{$partid}) {
+ if ($rndseed ne $lastrndseed{$partid}) {
+ $newvariation = ' ('.&mt('New variation this try').')';
+ }
+ }
+ $lastrndseed{$partid} = $rndseed;
}
my $responseType=($isTask ? 'Task'
: $responseType->{$partid}->{$responseId});
if (!exists($orders{$partid})) { $orders{$partid}={}; }
- if (!exists($orders{$partid}->{$responseId})) {
+ if ((!exists($orders{$partid}->{$responseId})) || ($trial)) {
$orders{$partid}->{$responseId}=
&get_order($partid,$responseId,$symb,$uname,$udom,
- $no_increment);
+ $no_increment,$type,$trial,$rndseed);
}
- $displaySub[0].=''; # /nobreak
+ $displaySub[0].=''.$newvariation.''; # /nobreak
$displaySub[0].=' '.
- &cleanRecord($$record{$version.':'.$matchKey},$responseType,$symb,$partid,$responseId,$record,$orders{$partid}->{$responseId},"$version:",$uname,$udom).' ';
+ &cleanRecord($$record{$version.':'.$matchKey},$responseType,$symb,$partid,$responseId,$record,$orders{$partid}->{$responseId},"$version:",$uname,$udom,$type,$trial,$rndseed).' ';
}
}
}
@@ -4614,7 +4664,7 @@ sub updateGradeByPage {
&Apache::loncommon::start_data_table_row().
' | '.$prob.
(scalar(@{$parts}) == 1 ? ''
- : ' ('.&mt('[quant,_1, part]',scalar(@{$parts}))
+ : ' ('.&mt('[quant,_1,part]',scalar(@{$parts}))
.')').' | ';
$studentTable.=' '.$title.' | ';
@@ -6149,15 +6199,15 @@ sub scantron_do_warning {
if ( $env{'form.selectpage'} eq '' ||
$env{'form.scantron_selectfile'} eq '' ||
$env{'form.scantron_format'} eq '' ) {
- $r->print("".&mt('You have forgetten to specify some information. Please go Back and try again.')."
");
+ $r->print("".&mt('You have forgotten to specify some information. Please go Back and try again.')."
");
if ( $env{'form.selectpage'} eq '') {
$r->print(''.&mt('You have not selected a Sequence to grade').'
');
}
if ( $env{'form.scantron_selectfile'} eq '') {
- $r->print(''.&mt('You have not selected a file that contains the student\'s response data.').'
');
+ $r->print(''.&mt("You have not selected a file that contains the student's response data.").'
');
}
if ( $env{'form.scantron_format'} eq '') {
- $r->print(''.&mt('You have not selected a the format of the student\'s response data.').'
');
+ $r->print(''.&mt("You have not selected the format of the student's response data.").'
');
}
} else {
my $warning=&scantron_warning_screen('Grading: Validate Records');
@@ -8380,32 +8430,32 @@ sub grading_menu {
{ linktext => 'Select individual students to grade',
url => $url1a,
permission => 'F',
- icon => 'edit-find-replace.png',
+ icon => 'grade_students.png',
linktitle => 'Grade current resource for a selection of students.'
},
{ linktext => 'Grade ungraded submissions.',
url => $url1b,
permission => 'F',
- icon => 'edit-find-replace.png',
+ icon => 'ungrade_sub.png',
linktitle => 'Grade all submissions that have not been graded yet.'
},
{ linktext => 'Grading table',
url => $url1c,
permission => 'F',
- icon => 'edit-find-replace.png',
+ icon => 'grading_table.png',
linktitle => 'Grade current resource for all students.'
},
{ linktext => 'Grade page/folder for one student',
url => $url1d,
permission => 'F',
- icon => 'edit-find-replace.png',
+ icon => 'grade_PageFolder.png',
linktitle => 'Grade all resources in current page/sequence/folder for one student.'
},
{ linktext => 'Download submissions',
url => $url1e,
permission => 'F',
- icon => 'edit-find-replace.png',
+ icon => 'download_sub.png',
linktitle => 'Download all students submissions.'
}]},
{ categorytitle=>'Automated Grading',
@@ -8426,13 +8476,13 @@ sub grading_menu {
{ linktext => 'Grade/Manage/Review Bubblesheets',
url => $url4,
permission => 'F',
- icon => 'stat.png',
+ icon => 'bubblesheet.png',
linktitle => 'Grade scantron exams, upload/download scantron data files, and review previously graded scantron exams.'
},
{ linktext => 'Verify Receipt Number',
url => $url5,
permission => 'F',
- icon => 'edit-find-replace.png',
+ icon => 'receipt_number.png',
linktitle => 'Verify a system-generated receipt number for correct problem solution.'
}
@@ -8537,6 +8587,14 @@ sub submit_options {
sub selectfield {
my ($full)=@_;
+ my %options =
+ (&Apache::lonlocal::texthash(
+ 'yes' => 'with submissions',
+ 'queued' => 'in grading queue',
+ 'graded' => 'with ungraded submissions',
+ 'incorrect' => 'with incorrect submissions',
+ 'all' => 'with any status'),
+ 'select_form_order' => ['yes','queued','graded','incorrect','all']);
my $result='
';
}
$result.='
';
@@ -8697,8 +8748,8 @@ sub process_clicker {
my $pcorrect=&mt("Percentage points for correct solution");
my $pincorrect=&mt("Percentage points for incorrect solution");
my $selectform=&Apache::loncommon::select_form($env{'form.upfiletype'},'upfiletype',
- ('iclicker' => 'i>clicker',
- 'interwrite' => 'interwrite PRS'));
+ {'iclicker' => 'i>clicker',
+ 'interwrite' => 'interwrite PRS'});
$symb = &Apache::lonenc::check_encrypt($symb);
$result.= &Apache::lonhtmlcommon::scripttag(< ".
"\n".&mt("Domain").": ".
&Apache::loncommon::select_dom_form($env{'course.'.$env{'request.course.id'}.'.domain'},'udom'.$id).' '.
- &Apache::loncommon::selectstudent_link('clickeranalysis','uname'.$id,'udom'.$id);
+ &Apache::loncommon::selectstudent_link('clickeranalysis','uname'.$id,'udom'.$id,0,$id);
$unknown_count++;
}
}
@@ -8968,6 +9019,7 @@ sub iclicker_eval {
$id=~s/^[\#0]+//;
for (my $i=0;$i<$number;$i++) {
my $idx=3+$i*6;
+ $entries[$idx]=~s/[^a-zA-Z0-9\.\*\-\+]+//g;
push(@idresponses,$entries[$idx]);
}
$$responses{$id}=join(',',@idresponses);
@@ -9039,20 +9091,20 @@ sub assign_clicker_grades {
$result.='
'.
&mt('More than one correct result given for question "[_1]": [_2] versus [_3].',
$env{'form.question:'.$i},$correct[$i],$input[$i]).'';
- } elsif ($input[$i]) {
+ } elsif (($input[$i]) || ($input[$i] eq '0')) {
$correct[$i]=$input[$i];
}
}
}
}
for (my $i=0;$i<$number;$i++) {
- if (!$correct[$i]) {
+ if ((!$correct[$i]) && ($correct[$i] ne '0')) {
$result.='
'.
&mt('No correct result given for question "[_1]"!',
$env{'form.question:'.$i}).'';
}
}
- $result.='
'.&mt("Correct answer: [_1]",join(', ',map { ($_?$_:'-') } @correct));
+ $result.='
'.&mt("Correct answer: [_1]",join(', ',map { ((($_) || ($_ eq '0'))?$_:'-') } @correct));
}
# Start grading
my $pcorrect=$env{'form.pcorrect'};
@@ -9085,17 +9137,29 @@ sub assign_clicker_grades {
for (my $i=0;$i<$number;$i++) {
if ($correct[$i] eq '-') {
$realnumber--;
- } elsif ($answer[$i]) {
+ } elsif (($answer[$i]) || ($answer[$i]=~/^[0\.]+$/)) {
if ($gradingmechanism eq 'attendance') {
$sum+=$pcorrect;
} elsif ($correct[$i] eq '*') {
$sum+=$pcorrect;
} else {
- if ($answer[$i] eq $correct[$i]) {
- $sum+=$pcorrect;
- } else {
- $sum+=$pincorrect;
+# We actually grade if correct or not
+ my $increment=$pincorrect;
+# Special case: numerical answer "0"
+ if ($correct[$i] eq '0') {
+ if ($answer[$i]=~/^[0\.]+$/) {
+ $increment=$pcorrect;
+ }
+# General numerical answer, both evaluate to something non-zero
+ } elsif ((1.0*$correct[$i]!=0) && (1.0*$answer[$i]!=0)) {
+ if (1.0*$correct[$i]==1.0*$answer[$i]) {
+ $increment=$pcorrect;
+ }
+# Must be just alphanumeric
+ } elsif ($answer[$i] eq $correct[$i]) {
+ $increment=$pcorrect;
}
+ $sum+=$increment;
}
}
}
@@ -9136,7 +9200,7 @@ sub startpage {
unshift(@$crumbs,{href=>&href_symb_cmd($symb,'gradingmenu'),text=>"Grading"});
$r->print(&Apache::loncommon::start_page('Grading',undef,
{'bread_crumbs' => $crumbs}));
- $r->print(''.$$crumbs[-1]{'text'}.'
');
+ &Apache::lonquickgrades::startGradeScreen($r,($env{'form.symb'}?'probgrading':'grading'));
unless ($nodisplayflag) {
$r->print(&Apache::lonhtmlcommon::resource_info_box($symb,$onlyfolderflag));
}
@@ -9181,9 +9245,9 @@ sub handler {
&Apache::lonenc::check_decrypt(\$symb);
$ssi_error = 0;
- if ($symb eq '' || $command eq '') {
+ if (($symb eq '' || $command eq '') && ($env{'request.course.id'})) {
#
-# Not called from a resource
+# Not called from a resource, but inside a course
#
&startpage($request,undef,[],1,1);
&select_problem($request);
@@ -9329,6 +9393,7 @@ sub handler {
if ($ssi_error) {
&ssi_print_error($request);
}
+ &Apache::lonquickgrades::endGradeScreen($request);
$request->print(&Apache::loncommon::end_page());
&reset_caches();
return '';