'
.&mt('Part(s) graded correct by the computer is marked with a [_1] symbol.',$checkIcon)
."
\n";
}
- # If any part of the problem is an essay-response (handgraded), then check for collaborators
+ # If any part of the problem is an essayresponse, then check for collaborators
my $fullname;
my $col_fullnames = [];
-# if ($env{'form.handgrade'} eq 'yes') {
- unless ($is_tool) {
+ if ($numessay) {
(my $sub_result,$fullname,$col_fullnames)=
&check_collaborators($symb,$uname,$udom,\%record,$handgrade,
$counter);
$result.=$sub_result;
}
$request->print($result."\n");
-
+
# print student answer/submission
- # Options are (1) Handgraded submission only
- # (2) Last submission, includes submission that is not handgraded
- # (for multi-response type part)
- # (3) Last submission plus the parts info
- # (4) The whole record for this student
-
- my ($string,$timestamp)= &get_last_submission(\%record,$is_tool);
-
+ # Options are (1) Last submission only
+ # (2) Last submission (with detailed information for that submission)
+ # (3) All transactions (by date)
+ # (4) The whole record (with detailed information for all transactions)
+
+ my ($string,$timestamp,$lastgradetime,$lastsubmittime) =
+ &get_last_submission(\%record,$is_tool);
+
my $lastsubonly;
- if ($$timestamp eq '') {
- $lastsubonly.=''
- .'
'.&mt('Date Submitted:').' '.$$timestamp."\n";
+ .'
'.&mt('Date Submitted:').' '.$shownsubmdate."\n";
+ if ($showngradedate) {
+ $lastsubonly .= '
'.&mt('Date Graded:').' '.$showngradedate."\n";
+ }
my %seenparts;
my @part_response_id = &flatten_responseType($responseType);
foreach my $part (@part_response_id) {
- next if ($env{'form.lastSub'} eq 'hdgrade'
- && $$handgrade{$$part[0].'_'.$$part[1]} ne 'yes');
-
my ($partid,$respid) = @{ $part };
my $display_part=&get_display_part($partid,$symb);
if ($env{"form.$uname:$udom:$partid:submitted_by"}) {
@@ -2394,7 +2603,7 @@ sub submission {
$$fullname{$env{"form.$uname:$udom:$partid:submitted_by"}}.'').
'
');
next;
- }
+ }
my $responsetype = $responseType->{$partid}->{$respid};
if (!exists($record{"resource.$partid.$respid.submission"})) {
$lastsubonly.="\n".'
'.
@@ -2418,8 +2627,8 @@ sub submission {
$rndseed = $record{"resource.$partid.rndseed"};
}
if ($env{'form.checkPlag'}) {
- my ($oname,$odom,$ocrsid,$oessay,$osim)=
- &most_similar($uname,$udom,$symb,$subval);
+ my ($oname,$odom,$ocrsid,$oessay,$osim)=
+ &most_similar($uname,$udom,$symb,$subval);
if ($osim) {
$osim=int($osim*100.0);
if ($hide eq 'anon') {
@@ -2473,8 +2682,9 @@ sub submission {
}
my $order=&get_order($partid,$respid,$symb,$uname,$udom,
undef,$type,$trial,$rndseed);
- if ($env{'form.lastSub'} eq 'lastonly' || $env{'form.lastSub'} eq 'datesub' || $env{'form.lastSub'} =~ /^(last|all)$/ || ($env{'form.lastSub'} eq 'hdgrade' &&
- $$handgrade{$$part[0].'_'.$$part[1]} eq 'yes')) {
+ if (($env{'form.lastSub'} eq 'lastonly') ||
+ ($env{'form.lastSub'} eq 'datesub') ||
+ ($env{'form.lastSub'} =~ /^(last|all)$/)) {
my $display_part=&get_display_part($partid,$symb);
$lastsubonly.='
'.
'
'.&mt('Part: [_1]',$display_part).''.
@@ -2482,7 +2692,6 @@ sub submission {
'('.&mt('Response ID: [_1]',$respid).')'.
' ';
my $files=&get_submitted_files($udom,$uname,$partid,$respid,\%record);
-
if (@$files) {
if ($hide eq 'anon') {
$lastsubonly.='
'.&mt('[quant,_1,file] uploaded to this anonymous survey',scalar(@{$files}));
@@ -2494,7 +2703,7 @@ sub submission {
} else {
$lastsubonly .= &mt('Like all files provided by users, these files may contain viruses!');
}
- $lastsubonly .= '';
+ $lastsubonly .= '';
foreach my $file (@$files) {
&Apache::lonnet::allowuploaded('/adm/grades',$file);
$lastsubonly.='
'.$file.'';
@@ -2505,7 +2714,7 @@ sub submission {
if ($hide eq 'anon') {
$lastsubonly.='
'.&mt('Anonymous Survey').'';
} else {
- $lastsubonly.='
'.&mt('Submitted Answer:').' ';
+ $lastsubonly.='
'.&mt('Submitted Answer:').' ';
if ($draft) {
$lastsubonly.= '
'.&mt('Draft Copy').'';
}
@@ -2517,7 +2726,7 @@ sub submission {
}
$lastsubonly.=$subval."\n";
}
- if ($similar) {$lastsubonly.="
$similar\n";}
+ if ($similar) {$lastsubonly.="
$similar\n";}
$lastsubonly.='
';
}
}
@@ -2528,8 +2737,7 @@ sub submission {
if ($env{'form.lastSub'} eq 'datesub') {
my ($parts,$handgrade,$responseType) = &response_type($symb,\$res_error);
$request->print(&displaySubByDates($symb,\%record,$parts,$responseType,$checkIcon,$uname,$udom));
-
- }
+ }
if ($env{'form.lastSub'} =~ /^(last|all)$/) {
my $identifier = (&canmodify($usec)? $counter : '');
$request->print(&Apache::loncommon::get_previous_attempt($symb,$uname,$udom,
@@ -2548,32 +2756,31 @@ sub submission {
$request->print('
'."\n");
}
- # essay grading message center
-# if ($env{'form.handgrade'} eq 'yes') {
- if (1) {
- my $result='
';
-
- $result.='
';
- my ($lastname,$givenn) = split(/,/,$env{'form.fullname'});
- my $msgfor = $givenn.' '.$lastname;
- if (scalar(@$col_fullnames) > 0) {
- my $lastone = pop(@$col_fullnames);
- $msgfor .= ', '.(join ', ',@$col_fullnames).' and '.$lastone.'.';
- }
- $msgfor =~ s/\'/\\'/g; #' stupid emacs - no! javascript
- $result.='
'."\n".
- '
'."\n";
- $result.='
'.
- &mt('Compose message to student'.(scalar(@$col_fullnames) >= 1 ? 's' : '')).')'.
- '
'."\n".
- '
('.
- &mt('Message will be sent when you click on Save & Next below.').")\n";
- $result.='
';
- $request->print($result);
+ # grading message center
+
+ if ($env{'form.compmsg'}) {
+ my $result='
'.
+ '
'.&mt('Send Message').'
'.
+ '
';
+ my ($lastname,$givenn) = split(/,/,$env{'form.fullname'});
+ my $msgfor = $givenn.' '.$lastname;
+ if (scalar(@$col_fullnames) > 0) {
+ my $lastone = pop(@$col_fullnames);
+ $msgfor .= ', '.(join ', ',@$col_fullnames).' and '.$lastone.'.';
+ }
+ $msgfor =~ s/\'/\\'/g; #' stupid emacs - no! javascript
+ $result.='
'."\n".
+ '
'."\n".
+ '
'.
+ &mt('Compose message to student'.(scalar(@$col_fullnames) >= 1 ? 's' : '')).')'.
+ '
'."\n".
+ '
('.
+ &mt('Message will be sent when you click on Save & Next below.').")\n".
+ '
';
+ $request->print($result);
}
my %seen = ();
@@ -2595,8 +2802,6 @@ sub submission {
my $part_resp = join('_',@{ $part_response_id });
next if ($seen{$partid} > 0);
$seen{$partid}++;
- next if ($$handgrade{$part_resp} ne 'yes'
- && $env{'form.lastSub'} eq 'hdgrade');
push(@partlist,$partid);
push(@gradePartRespid,$partid.'.'.$respid);
$request->print(&gradeBox($request,$symb,$uname,$udom,$counter,$partid,\%record));
@@ -2711,17 +2916,45 @@ sub check_collaborators {
#--- Retrieve the last submission for all the parts
sub get_last_submission {
my ($returnhash,$is_tool)=@_;
- my (@string,$timestamp,%lasthidden);
+ my (@string,$timestamp,$lastgradetime,$lastsubmittime);
if ($$returnhash{'version'}) {
my %lasthash=();
- my ($version);
+ my %prevsolved=();
+ my %solved=();
+ my $version;
for ($version=1;$version<=$$returnhash{'version'};$version++) {
+ my %handgraded = ();
foreach my $key (sort(split(/\:/,
$$returnhash{$version.':keys'}))) {
$lasthash{$key}=$$returnhash{$version.':'.$key};
- $timestamp =
- &Apache::lonlocal::locallocaltime($$returnhash{$version.':timestamp'});
+ if ($key =~ /\.([^.]+)\.regrader$/) {
+ $handgraded{$1} = 1;
+ } elsif ($key =~ /\.portfiles$/) {
+ if (($$returnhash{$version.':'.$key} ne '') &&
+ ($$returnhash{$version.':'.$key} !~ /\.\d+\.\w+$/)) {
+ $lastsubmittime = $$returnhash{$version.':timestamp'};
+ }
+ } elsif ($key =~ /\.submission$/) {
+ if ($$returnhash{$version.':'.$key} ne '') {
+ $lastsubmittime = $$returnhash{$version.':timestamp'};
+ }
+ } elsif ($key =~ /\.([^.]+)\.solved$/) {
+ $prevsolved{$1} = $solved{$1};
+ $solved{$1} = $lasthash{$key};
+ }
+ }
+ foreach my $partid (keys(%handgraded)) {
+ if (($prevsolved{$partid} eq 'ungraded_attempted') &&
+ (($solved{$partid} eq 'incorrect_by_override') ||
+ ($solved{$partid} eq 'correct_by_override'))) {
+ $lastgradetime = $$returnhash{$version.':timestamp'};
+ }
+ if ($solved{$partid} ne '') {
+ $prevsolved{$partid} = $solved{$partid};
+ }
}
+ $timestamp =
+ &Apache::lonlocal::locallocaltime($$returnhash{$version.':timestamp'});
}
my (%typeparts,%randombytry);
my $showsurv =
@@ -2785,7 +3018,7 @@ sub get_last_submission {
$string[0] =
'
'.$msg.'';
}
- return (\@string,\$timestamp);
+ return (\@string,$timestamp,$lastgradetime,$lastsubmittime);
}
#--- High light keywords, with style choosen by user.
@@ -2992,13 +3225,31 @@ sub processHandGrade {
my $ntstu = $env{'form.NTSTU'};
my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'};
my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'};
+ my ($res_error,%queueable);
+ my ($partlist,$handgrade,$responseType,$numresp,$numessay) = &response_type($symb,\$res_error);
+ if ($res_error) {
+ $request->print(&navmap_errormsg());
+ return;
+ } else {
+ foreach my $part (@{$partlist}) {
+ if (ref($responseType->{$part}) eq 'HASH') {
+ foreach my $id (keys(%{$responseType->{$part}})) {
+ if (($responseType->{$part}->{$id} eq 'essay') ||
+ (lc($handgrade->{$part.'_'.$id}) eq 'yes')) {
+ $queueable{$part} = 1;
+ last;
+ }
+ }
+ }
+ }
+ }
if ($button eq 'Save & Next') {
my $ctr = 0;
while ($ctr < $ngrade) {
my ($uname,$udom) = split(/:/,$env{'form.unamedom'.$ctr});
my ($errorflag,$pts,$wgt,$numhidden) =
- &saveHandGrade($request,$symb,$uname,$udom,$ctr);
+ &saveHandGrade($request,$symb,$uname,$udom,$ctr,undef,undef,\%queueable);
if ($errorflag eq 'no_score') {
$ctr++;
next;
@@ -3053,7 +3304,7 @@ sub processHandGrade {
foreach my $collaborator (@collaborators) {
my ($errorflag,$pts,$wgt) =
&saveHandGrade($request,$symb,$collaborator,$udom,$ctr,
- $env{'form.unamedom'.$ctr},$part);
+ $env{'form.unamedom'.$ctr},$part,\%queueable);
if ($errorflag eq 'not_allowed') {
$request->print("
".&mt('Not allowed to modify grades for [_1]',"$collaborator:$udom")."");
next;
@@ -3075,13 +3326,12 @@ sub processHandGrade {
}
}
-# if ($env{'form.handgrade'} eq 'yes') {
- if (1) {
+ my %keyhash = ();
+ if ($numessay) {
# Keywords sorted in alphabatical order
my $loginuser = $env{'user.name'}.':'.$env{'user.domain'};
- my %keyhash = ();
$env{'form.keywords'} =~ s/,\s{0,}|\s+/ /g;
- $env{'form.keywords'} =~ s/^\s+|\s+$//;
+ $env{'form.keywords'} =~ s/^\s+|\s+$//g;
my (@keywords) = sort(split(/\s+/,$env{'form.keywords'}));
$env{'form.keywords'} = join(' ',@keywords);
$keyhash{$symb.'_keywords'} = $env{'form.keywords'};
@@ -3089,7 +3339,9 @@ sub processHandGrade {
$keyhash{$loginuser.'_kwclr'} = $env{'form.kwclr'};
$keyhash{$loginuser.'_kwsize'} = $env{'form.kwsize'};
$keyhash{$loginuser.'_kwstyle'} = $env{'form.kwstyle'};
+ }
+ if ($env{'form.compmsg'}) {
# message center - Order of message gets changed. Blank line is eliminated.
# New messages are saved in env for the next student.
# All messages are saved in nohist_handgrade.db
@@ -3104,17 +3356,20 @@ sub processHandGrade {
$ctr = 0;
while ($ctr < $ngrade) {
if ($env{'form.newmsg'.$ctr} ne '') {
- $keyhash{$symb.'_savemsg'.$idx} = $env{'form.newmsg'.$ctr};
- $env{'form.savemsg'.$idx} = $env{'form.newmsg'.$ctr};
- $idx++;
+ $keyhash{$symb.'_savemsg'.$idx} = $env{'form.newmsg'.$ctr};
+ $env{'form.savemsg'.$idx} = $env{'form.newmsg'.$ctr};
+ $idx++;
}
$ctr++;
}
$env{'form.savemsgN'} = --$idx;
$keyhash{$symb.'_savemsgN'} = $env{'form.savemsgN'};
- my $putresult = &Apache::lonnet::put
- ('nohist_handgrade',\%keyhash,$cdom,$cnum);
}
+ if (($numessay) || ($env{'form.compmsg'})) {
+ my $putresult = &Apache::lonnet::put
+ ('nohist_handgrade',\%keyhash,$cdom,$cnum);
+ }
+
# Called by Save & Refresh from Highlight Attribute Window
my (undef,undef,$fullname) = &getclasslist($env{'form.section'},'1');
if ($env{'form.refresh'} eq 'on') {
@@ -3154,7 +3409,6 @@ sub processHandGrade {
}
return $a cmp $b;
} (keys(%$fullname))) {
-# FIXME: this is fishy, looks like the button label
if ($nextflg == 1 && $button =~ /Next$/) {
push(@parsedlist,$item);
}
@@ -3165,14 +3419,7 @@ sub processHandGrade {
}
}
$ctr = 0;
-# FIXME: this is fishy, looks like the button label
@parsedlist = reverse @parsedlist if ($button eq 'Previous');
- my $res_error;
- my ($partlist) = &response_type($symb,\$res_error);
- if ($res_error) {
- $request->print(&navmap_errormsg());
- return;
- }
foreach my $student (@parsedlist) {
my $submitonly=$env{'form.submitonly'};
my ($uname,$udom) = split(/:/,$student);
@@ -3230,7 +3477,7 @@ sub processHandGrade {
#---- Save the score and award for each student, if changed
sub saveHandGrade {
- my ($request,$symb,$stuname,$domain,$newflg,$submitter,$part) = @_;
+ my ($request,$symb,$stuname,$domain,$newflg,$submitter,$part,$queueable) = @_;
my @version_parts;
my $usec = &Apache::lonnet::getsection($domain,$stuname,
$env{'request.course.id'});
@@ -3342,7 +3589,7 @@ sub saveHandGrade {
&Apache::lonnet::cstore(\%newrecord,$symb,
$env{'request.course.id'},$domain,$stuname);
&check_and_remove_from_queue(\@parts,\%record,\%newrecord,$symb,
- $cdom,$cnum,$domain,$stuname);
+ $cdom,$cnum,$domain,$stuname,$queueable);
}
if ($aggregateflag) {
&Apache::lonnet::cinc('nohist_resourcetracker',\%aggregate,
@@ -3382,7 +3629,7 @@ sub makehidden {
}
sub check_and_remove_from_queue {
- my ($parts,$record,$newrecord,$symb,$cdom,$cnum,$domain,$stuname) = @_;
+ my ($parts,$record,$newrecord,$symb,$cdom,$cnum,$domain,$stuname,$queueable) = @_;
my @ungraded_parts;
foreach my $part (@{$parts}) {
if ( $record->{ 'resource.'.$part.'.awarded'} eq ''
@@ -3390,7 +3637,9 @@ sub check_and_remove_from_queue {
&& $newrecord->{'resource.'.$part.'.awarded'} eq ''
&& $newrecord->{'resource.'.$part.'.solved' } ne 'excused'
) {
- push(@ungraded_parts, $part);
+ if ($queueable->{$part}) {
+ push(@ungraded_parts, $part);
+ }
}
}
if ( !@ungraded_parts ) {
@@ -3425,7 +3674,7 @@ sub handback_files {
&Apache::lonnet::file_name_version_ext($answer_file);
my ($portfolio_path) = ($directory =~ /^.+$stuname\/portfolio(.*)/);
my $getpropath = 1;
- my ($dir_list,$listerror) =
+ my ($dir_list,$listerror) =
&Apache::lonnet::dirlist($portfolio_root.$portfolio_path,
$domain,$stuname,$getpropath);
my $version = &Apache::lonnet::get_next_version($answer_name,$answer_ext,$dir_list);
@@ -3809,7 +4058,26 @@ sub viewgrades {
}
my ($common_header,$specific_header,@sections,$section_display);
- @sections = &Apache::loncommon::get_env_multiple('form.section');
+ if ($env{'request.course.sec'} ne '') {
+ @sections = ($env{'request.course.sec'});
+ } else {
+ @sections = &Apache::loncommon::get_env_multiple('form.section');
+ }
+
+# Check if Save button should be usable
+ my $disabled = ' disabled="disabled"';
+ if ($perm{'mgr'}) {
+ if (grep(/^all$/,@sections)) {
+ undef($disabled);
+ } else {
+ foreach my $sec (@sections) {
+ if (&canmodify($sec)) {
+ undef($disabled);
+ last;
+ }
+ }
+ }
+ }
if (grep(/^all$/,@sections)) {
@sections = ('all');
if ($group_display) {
@@ -3885,7 +4153,6 @@ sub viewgrades {
my $part_resp = join('_',@{ $part_response_id });
next if $seen{$partid};
$seen{$partid}++;
-# my $handgrade=$$handgrade{$part_resp};
my $wgt = &Apache::lonnet::EXT('resource.'.$partid.'.weight',$symb);
$weight{$partid} = $wgt eq '' ? '1' : $wgt;
@@ -4002,7 +4269,7 @@ sub viewgrades {
}
$result.=&Apache::loncommon::end_data_table();
$result.='
'."\n";
- $result.='
'."\n";
if ($ctr == 0) {
my $stu_status = join(' or ',&Apache::loncommon::get_env_multiple('form.Status'));
@@ -4199,7 +4466,7 @@ sub editgrades {
my $section_display = join (", ",&Apache::loncommon::get_env_multiple('form.section'));
my $title='
'.&mt('Current Grade Status').'
';
- $title.='
'.&mt('Section: [_1]',$section_display).'
'."\n";
+ $title.='
'.&mt('Section:').' '.$section_display.'
'."\n";
my $result= &Apache::loncommon::start_data_table().
&Apache::loncommon::start_data_table_header_row().
@@ -4265,6 +4532,7 @@ sub editgrades {
&Apache::loncommon::end_data_table_header_row();
my @noupdate;
my ($updateCtr,$noupdateCtr) = (1,1);
+ my ($got_types,%queueable);
for ($i=0; $i<$env{'form.total'}; $i++) {
my $user = $env{'form.ctr'.$i};
my ($uname,$udom)=split(/:/,$user);
@@ -4364,14 +4632,33 @@ sub editgrades {
$udom,$uname);
my $all_graded = 1;
my $none_graded = 1;
+ unless ($got_types) {
+ my $error;
+ my ($plist,$handgrd,$resptype) = &response_type($symb,\$error);
+ unless ($error) {
+ foreach my $part (@parts) {
+ if (ref($resptype->{$part}) eq 'HASH') {
+ foreach my $id (keys(%{$resptype->{$part}})) {
+ if (($resptype->{$part}->{$id} eq 'essay') ||
+ (lc($handgrd->{$part.'_'.$id}) eq 'yes')) {
+ $queueable{$part} = 1;
+ last;
+ }
+ }
+ }
+ }
+ }
+ $got_types = 1;
+ }
foreach my $part (@parts) {
- if ( $record{'resource.'.$part.'.awarded'} eq '' ) {
- $all_graded = 0;
- } else {
- $none_graded = 0;
+ if ($queueable{$part}) {
+ if ( $record{'resource.'.$part.'.awarded'} eq '' ) {
+ $all_graded = 0;
+ } else {
+ $none_graded = 0;
+ }
}
- }
-
+ }
if ($all_graded || $none_graded) {
&Apache::bridgetask::remove_from_queue('gradingqueue',
$symb,$cdom,$cnum,
@@ -4642,7 +4929,7 @@ ENDUPFORM
sub csvuploadmap {
- my ($request,$symb)= @_;
+ my ($request,$symb) = @_;
if (!$symb) {return '';}
my $datatoken;
@@ -4738,7 +5025,7 @@ sub get_fields {
}
sub csvuploadassign {
- my ($request,$symb)= @_;
+ my ($request,$symb) = @_;
if (!$symb) {return '';}
my $error_msg = '';
my $datatoken = &Apache::loncommon::valid_datatoken($env{'form.datatoken'});
@@ -4854,7 +5141,7 @@ sub csvuploadassign {
$grades{$store_key}=$entries{$fields{$dest}};
}
}
- if (! %grades) {
+ if (! %grades) {
push(@skipped,&mt("[_1]: no data to save","$username:$domain"));
} else {
$grades{"resource.regrader"}="$env{'user.name'}:$env{'user.domain'}";
@@ -5242,10 +5529,14 @@ sub displayPage {
}
$curRes = $iterator->next();
}
+ my $disabled;
+ unless (&canmodify($usec)) {
+ $disabled = ' disabled="disabled"';
+ }
$studentTable.=
''."\n".
- '
'.
''."\n";
$request->print($studentTable);
@@ -5311,11 +5602,11 @@ sub displaySubByDates {
}
my @matchKey;
if ($isTask) {
- @matchKey = sort(grep /^resource\.\d+\.\Q$partid\E\.award$/,@versionKeys);
+ @matchKey = sort(grep(/^resource\.\d+\.\Q$partid\E\.award$/,@versionKeys));
} elsif ($is_tool) {
- @matchKey = sort(grep /^resource\.\Q$partid\E\.awarded$/,@versionKeys);
+ @matchKey = sort(grep(/^resource\.\Q$partid\E\.awarded$/,@versionKeys));
} else {
- @matchKey = sort(grep /^resource\.\Q$partid\E\..*?\.submission$/,@versionKeys);
+ @matchKey = sort(grep(/^resource\.\Q$partid\E\..*?\.submission$/,@versionKeys));
}
# next if ($$record{"$version:resource.$partid.solved"} eq '');
my $display_part=&get_display_part($partid,$symb);
@@ -5481,6 +5772,7 @@ sub updateGradeByPage {
my @displayPts=();
my %aggregate = ();
my $aggregateflag = 0;
+ my %queueable;
if ($env{'form.HIDE'.$prob}) {
my %record = &Apache::lonnet::restore($symbx,$env{'request.course.id'},$udom,$uname);
my ($version,$parts) = split(/:/,$env{'form.HIDE'.$prob},2);
@@ -5490,7 +5782,20 @@ sub updateGradeByPage {
foreach my $partid (@{$parts}) {
my $newpts = $env{'form.GD_BOX'.$question.'_'.$partid};
my $oldpts = $env{'form.oldpts'.$question.'_'.$partid};
-
+ my @types = $curRes->responseType($partid);
+ if (grep(/^essay$/,@types)) {
+ $queueable{$partid} = 1;
+ } else {
+ my @ids = $curRes->responseIds($partid);
+ for (my $i=0; $i < scalar(@ids); $i++) {
+ my $hndgrd = &Apache::lonnet::EXT('resource.'.$partid.'_'.$ids[$i].
+ '.handgrade',$symb);
+ if (lc($hndgrd) eq 'yes') {
+ $queueable{$partid} = 1;
+ last;
+ }
+ }
+ }
my $wgt = $env{'form.WGT'.$question.'_'.$partid} != 0 ?
$env{'form.WGT'.$question.'_'.$partid} : 1;
my $partial = $newpts/$wgt;
@@ -5556,7 +5861,7 @@ sub updateGradeByPage {
$env{'request.course.id'},
$udom,$uname);
&check_and_remove_from_queue($parts,\%record,undef,$symbx,
- $cdom,$cnum,$udom,$uname);
+ $cdom,$cnum,$udom,$uname,\%queueable);
}
if ($aggregateflag) {
@@ -5655,7 +5960,7 @@ the homework problem.
sub defaultFormData {
my ($symb)=@_;
- return '
';
+ return '
';
}
@@ -5898,8 +6203,7 @@ sub scantron_selectphase {
$ssi_error = 0;
- if (&Apache::lonnet::allowed('usc',$env{'request.role.domain'}) ||
- &Apache::lonnet::allowed('usc',$env{'request.course.id'})) {
+ if (&Apache::lonnet::allowed('usc',$env{'request.role.domain'}) || $perm{'usc'}) {
# Chunk of form to prompt for a scantron file upload.
@@ -5907,6 +6211,7 @@ sub scantron_selectphase {
');
my $cdom= $env{'course.'.$env{'request.course.id'}.'.domain'};
my $cnum= $env{'course.'.$env{'request.course.id'}.'.num'};
+ my $csec= $env{'request.course.sec'};
my $alertmsg = &mt('Please use the browse button to select a file from your local directory.');
&js_escape(\$alertmsg);
my ($formatoptions,$formattitle,$formatjs) = &scantron_upload_dataformat($cdom);
@@ -5922,6 +6227,7 @@ sub scantron_selectphase {
-
-