--- loncom/homework/grades.pm 2012/12/10 01:13:08 1.677
+++ loncom/homework/grades.pm 2013/05/30 05:04:31 1.688
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# The LON-CAPA Grading handler
#
-# $Id: grades.pm,v 1.677 2012/12/10 01:13:08 raeburn Exp $
+# $Id: grades.pm,v 1.688 2013/05/30 05:04:31 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -3101,7 +3101,7 @@ sub handback_files {
&Apache::lonnet::dirlist($portfolio_root.$portfolio_path,
$domain,$stuname,$getpropath);
my $version = &get_next_version($answer_name,$answer_ext,$dir_list);
- # fix file name
+ # fix filename
my ($save_file_name) = (($directory.$answer_name.".$version.".$answer_ext) =~ /^.+\/${stuname}\/(.*)/);
my $result=&Apache::lonnet::finishuserfileupload($stuname,$domain,
$newflg.'_'.$part_resp.'_returndoc'.$counter,
@@ -3120,7 +3120,7 @@ sub handback_files {
$$newrecord{"resource.$new_part.$resp_id.handback"} .= $save_file_name;
$file_msg.= ''.$save_file_name."
";
}
- $request->print('
'.&mt('[_1] will be the uploaded file name [_2]',''.$fname.'',''.$env{'form.'.$newflg.'_'.$part_resp.'_origdoc'.$counter}.''));
+ $request->print('
'.&mt('[_1] will be the uploaded filename [_2]',''.$fname.'',''.$env{'form.'.$newflg.'_'.$part_resp.'_origdoc'.$counter}.''));
}
}
}
@@ -4650,8 +4650,8 @@ sub displayPage {
&Apache::loncommon::start_data_table_row().
'
'.&mt('If this information is correct, please click on \'[_1]\'.',&mt($button_text)).'
+
'.&mt("If this information is correct, please click on '[_1]'.",&mt($button_text)).'
'.&mt('If something is incorrect, please return to [_1]Grade/Manage/Review Bubblesheets[_2] to start over.','','').'
' .&mt('Some resources in the sequence currently are not set to' - .' exam mode. Grading these resources currently may not' + .' bubblesheet exam mode. Grading these resources currently may not' .' work correctly.') .'
' ); @@ -7140,7 +7140,7 @@ sub scantron_get_correction { $r->print(&Apache::loncommon::selectstudent_link('scantronupload', 'scantron_username','scantron_domain')); $r->print(": "); - $r->print("\n@". + $r->print("\n:\n". &Apache::loncommon::select_dom_form($env{'request.role.domain'},'scantron_domain')); $r->print(''); @@ -7400,7 +7400,16 @@ sub prompt_for_corrections { ($responsetype_per_response{$question-1} eq 'imageresponse') || ($responsetype_per_response{$question-1} eq 'reactionresponse') || ($responsetype_per_response{$question-1} eq 'organicresponse')) { - $r->print(&mt("Although this particular question type requires handgrading, the instructions for this question in the exam directed students to leave [quant,_1,line] blank on their bubblesheets.",$lines).'- '.&mt('The requested file name was invalid.').' + '.&mt('The requested filename was invalid.').'
'); return; @@ -8495,11 +8539,18 @@ sub checkscantron_results { return ''; } my $map=$navmap->getResourceByUrl($sequence); - my $randomorder; + my ($randomorder,@master_seq,%symb_to_resource); if (ref($map)) { $randomorder=$map->randomorder(); } my @resources=$navmap->retrieveResources($map,\&scantron_filter,1,0); + foreach my $resource (@resources) { + if (ref($resource)) { + my $ressymb = $resource->symb(); + push(@master_seq,$ressymb); + $symb_to_resource{$ressymb} = $resource; + } + } my (%grader_partids_by_symb,%grader_randomlists_by_symb); &graders_resources_pass(\@resources,\%grader_partids_by_symb, \%grader_randomlists_by_symb,$bubbles_per_row); @@ -8513,7 +8564,7 @@ sub checkscantron_results { my $count=&Apache::grades::get_todo_count($scanlines,$scan_data); my %prog_state=&Apache::lonhtmlcommon::Create_PrgWin($r,$count); - my ($username,$domain,$started); + my ($username,$domain,$started,%ordered); my $nav_error; &scantron_get_maxbubble(\$nav_error,\%scantron_config); # Need the bubble lines array to parse. if ($nav_error) { @@ -8555,9 +8606,11 @@ sub checkscantron_results { $scandata{$pid} = substr($line,$scantron_config{'Qstart'}-1,$lastpos); chomp($scandata{$pid}); $scandata{$pid} =~ s/\r$//; + my $usec = $classlist->{$uname}->[&Apache::loncoursedata::CL_SECTION]; + my $user = $uname.':'.$usec; ($username,$domain)=split(/:/,$uname); - my ($scancode,%ordered); + my $scancode; if ((exists($scan_record->{'scantron.CODE'})) && (&Apache::lonnet::validCODE($scan_record->{'scantron.CODE'}))) { $scancode = $scan_record->{'scantron.CODE'}; @@ -8566,18 +8619,10 @@ sub checkscantron_results { } my @mapresources = @resources; - if ($randomorder && $scancode) { - unless (ref($ordered{$scancode}) eq 'ARRAY') { - $env{'form.CODE'} = $scancode; - $ordered{$scancode} = - &Apache::lonprintout::master_seq_to_person_seq($sequence, - \@resources, - $uname,$scancode); - delete($env{'form.CODE'}); - } - if (ref($ordered{$scancode}) eq 'ARRAY') { - @mapresources = @{$ordered{$scancode}}; - } + if ($randomorder) { + @mapresources = + &users_order($user,$scancode,$sequence,\@master_seq,\%ordered, + \%symb_to_resource); } my $counter = -1; foreach my $resource (@mapresources) { @@ -8642,7 +8687,12 @@ sub checkscantron_results { $env{'form.scantron_maxbubble'}) .'' ); - $r->print(''.&mt('Exact matches for [quant,_1,student].',$passed).'
'.&mt('Discrepancies detected for [quant,_1,student].',$failed).'
'
+ .&mt('Exact matches for [_1][quant,_2,student][_3].','',$passed,'')
+ .'
'
+ .&mt('Discrepancies detected for [_1][quant,_2,student][_3].','',$failed,'')
+ .'