--- loncom/homework/grades.pm 2012/12/18 18:03:40 1.682 +++ loncom/homework/grades.pm 2013/06/16 16:46:48 1.690 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # The LON-CAPA Grading handler # -# $Id: grades.pm,v 1.682 2012/12/18 18:03:40 raeburn Exp $ +# $Id: grades.pm,v 1.690 2013/06/16 16:46:48 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}.'')); } } } @@ -5174,24 +5174,6 @@ sub restore_bubble_lines { } } -# Given the parsed scanline, get the response for -# 'answer' number n: - -sub get_response_bubbles { - my ($parsed_line, $response) = @_; - - my $bubble_line = $first_bubble_line{$response-1} +1; - my $bubble_lines= $bubble_lines_per_response{$response-1}; - - my $selected = ""; - - for (my $bline = 0; $bline < $bubble_lines; $bline++) { - $selected .= $$parsed_line{"scantron.$bubble_line.answer"}.":"; - $bubble_line++; - } - return $selected; -} - =pod =item scantron_filenames @@ -7006,7 +6988,7 @@ sub scantron_validate_sequence { $r->print( '

' .&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 +7122,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 +7382,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('A non-zero score can be assigned to the student during bubblesheet grading by selecting a bubble in at least one line.').'
'.&mt('The score for this question will be a sum of the numeric values for the selected bubbles from each line, where A=1 point, B=2 points etc.').'
'.&mt("To assign a score of zero for this question, mark all lines as 'No bubble'.").'

'); + $r->print( + &mt("Although this particular question type requires handgrading, the instructions for this question in the bubblesheet exam directed students to leave [quant,_1,line] blank on their bubblesheets.",$lines) + .'

' + .&mt('A non-zero score can be assigned to the student during bubblesheet grading by selecting a bubble in at least one line.') + .'
' + .&mt('The score for this question will be a sum of the numeric values for the selected bubbles from each line, where A=1 point, B=2 points etc.') + .'
' + .&mt("To assign a score of zero for this question, mark all lines as 'No bubble'.") + .'

' + ); } else { $r->print(&mt("Select at most one bubble in a single line and select 'No Bubble' in all the other lines. ")."
"); } @@ -7914,9 +7905,10 @@ sub scantron_process_students { return ''; } my $map=$navmap->getResourceByUrl($sequence); - my $randomorder; + my ($randomorder,$randompick); if (ref($map)) { $randomorder = $map->randomorder(); + $randompick = $map->randompick(); } my @resources=$navmap->retrieveResources($map,\&scantron_filter,1,0); my (%grader_partids_by_symb,%grader_randomlists_by_symb,%ordered); @@ -8025,7 +8017,7 @@ SCANTRONFORM } my @mapresources = @resources; - if ($randomorder) { + if ($randomorder || $randompick) { @mapresources = &users_order($user,$scancode,$sequence,\@master_seq,\%ordered, \%symb_to_resource); @@ -8205,7 +8197,7 @@ sub users_order { my $actual_seq = &Apache::lonprintout::master_seq_to_person_seq($mapurl, $master_seq, - $user,$scancode); + $user,$scancode,1); if (ref($actual_seq) eq 'ARRAY') { @{$ordered->{$scancode}} = map { $symb_to_resource->{$_}; } @{$actual_seq}; @@ -8216,7 +8208,7 @@ sub users_order { my $actual_seq = &Apache::lonprintout::master_seq_to_person_seq($mapurl, $master_seq, - $user); + $user,undef,1); if (ref($actual_seq) eq 'ARRAY') { @mapresources = map { $symb_to_resource->{$_}; } @{$actual_seq}; @@ -8480,7 +8472,7 @@ sub scantron_download_scantron_data { if (! &valid_file($file)) { $r->print('

- '.&mt('The requested file name was invalid.').' + '.&mt('The requested filename was invalid.').'

'); return; @@ -8530,9 +8522,10 @@ sub checkscantron_results { return ''; } my $map=$navmap->getResourceByUrl($sequence); - my ($randomorder,@master_seq,%symb_to_resource); + my ($randomorder,$randompick,@master_seq,%symb_to_resource); if (ref($map)) { $randomorder=$map->randomorder(); + $randompick=$map->randompick(); } my @resources=$navmap->retrieveResources($map,\&scantron_filter,1,0); foreach my $resource (@resources) { @@ -8610,7 +8603,7 @@ sub checkscantron_results { } my @mapresources = @resources; - if ($randomorder) { + if ($randomorder || $randompick) { @mapresources = &users_order($user,$scancode,$sequence,\@master_seq,\%ordered, \%symb_to_resource); @@ -8679,7 +8672,7 @@ sub checkscantron_results { .'

' ); $r->print('

' - .&mt('Exact matches for [_1][quant,_2,student][_3].','',$passed,''). + .&mt('Exact matches for [_1][quant,_2,student][_3].','',$passed,'') .'
' .&mt('Discrepancies detected for [_1][quant,_2,student][_3].','',$failed,'') .'

' @@ -9748,6 +9741,7 @@ sub handler { } } elsif (!%perm) { $request->internal_redirect('/adm/quickgrades'); + return OK; } &Apache::loncommon::content_type($request,'text/html'); $request->send_http_header;