version 1.681, 2012/12/18 18:00:14
|
version 1.690, 2013/06/16 16:46:48
|
Line 3101 sub handback_files {
|
Line 3101 sub handback_files {
|
&Apache::lonnet::dirlist($portfolio_root.$portfolio_path, |
&Apache::lonnet::dirlist($portfolio_root.$portfolio_path, |
$domain,$stuname,$getpropath); |
$domain,$stuname,$getpropath); |
my $version = &get_next_version($answer_name,$answer_ext,$dir_list); |
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 ($save_file_name) = (($directory.$answer_name.".$version.".$answer_ext) =~ /^.+\/${stuname}\/(.*)/); |
my $result=&Apache::lonnet::finishuserfileupload($stuname,$domain, |
my $result=&Apache::lonnet::finishuserfileupload($stuname,$domain, |
$newflg.'_'.$part_resp.'_returndoc'.$counter, |
$newflg.'_'.$part_resp.'_returndoc'.$counter, |
Line 3120 sub handback_files {
|
Line 3120 sub handback_files {
|
$$newrecord{"resource.$new_part.$resp_id.handback"} .= $save_file_name; |
$$newrecord{"resource.$new_part.$resp_id.handback"} .= $save_file_name; |
$file_msg.= '<span class="LC_filename"><a href="/uploaded/'."$domain/$stuname/".$save_file_name.'">'.$save_file_name."</a></span> <br />"; |
$file_msg.= '<span class="LC_filename"><a href="/uploaded/'."$domain/$stuname/".$save_file_name.'">'.$save_file_name."</a></span> <br />"; |
} |
} |
$request->print('<br />'.&mt('[_1] will be the uploaded file name [_2]','<span class="LC_info">'.$fname.'</span>','<span class="LC_filename">'.$env{'form.'.$newflg.'_'.$part_resp.'_origdoc'.$counter}.'</span>')); |
$request->print('<br />'.&mt('[_1] will be the uploaded filename [_2]','<span class="LC_info">'.$fname.'</span>','<span class="LC_filename">'.$env{'form.'.$newflg.'_'.$part_resp.'_origdoc'.$counter}.'</span>')); |
} |
} |
} |
} |
} |
} |
Line 5174 sub restore_bubble_lines {
|
Line 5174 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 |
=pod |
|
|
=item scantron_filenames |
=item scantron_filenames |
Line 7006 sub scantron_validate_sequence {
|
Line 6988 sub scantron_validate_sequence {
|
$r->print( |
$r->print( |
'<p class="LC_warning">' |
'<p class="LC_warning">' |
.&mt('Some resources in the sequence currently are not set to' |
.&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.') |
.' work correctly.') |
.'</p>' |
.'</p>' |
); |
); |
Line 7140 sub scantron_get_correction {
|
Line 7122 sub scantron_get_correction {
|
$r->print(&Apache::loncommon::selectstudent_link('scantronupload', |
$r->print(&Apache::loncommon::selectstudent_link('scantronupload', |
'scantron_username','scantron_domain')); |
'scantron_username','scantron_domain')); |
$r->print(": <input type='text' name='scantron_username' value='' />"); |
$r->print(": <input type='text' name='scantron_username' value='' />"); |
$r->print("\n@". |
$r->print("\n:\n". |
&Apache::loncommon::select_dom_form($env{'request.role.domain'},'scantron_domain')); |
&Apache::loncommon::select_dom_form($env{'request.role.domain'},'scantron_domain')); |
|
|
$r->print('</li>'); |
$r->print('</li>'); |
Line 7400 sub prompt_for_corrections {
|
Line 7382 sub prompt_for_corrections {
|
($responsetype_per_response{$question-1} eq 'imageresponse') || |
($responsetype_per_response{$question-1} eq 'imageresponse') || |
($responsetype_per_response{$question-1} eq 'reactionresponse') || |
($responsetype_per_response{$question-1} eq 'reactionresponse') || |
($responsetype_per_response{$question-1} eq 'organicresponse')) { |
($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).'<br /><br />'.&mt('A non-zero score can be assigned to the student during bubblesheet grading by selecting a bubble in at least one line.').'<br />'.&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.').'<br />'.&mt("To assign a score of zero for this question, mark all lines as 'No bubble'.").'<br /><br />'); |
$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) |
|
.'<br /><br />' |
|
.&mt('A non-zero score can be assigned to the student during bubblesheet grading by selecting a bubble in at least one line.') |
|
.'<br />' |
|
.&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.') |
|
.'<br />' |
|
.&mt("To assign a score of zero for this question, mark all lines as 'No bubble'.") |
|
.'<br /><br />' |
|
); |
} else { |
} else { |
$r->print(&mt("Select at most one bubble in a single line and select 'No Bubble' in all the other lines. ")."<br />"); |
$r->print(&mt("Select at most one bubble in a single line and select 'No Bubble' in all the other lines. ")."<br />"); |
} |
} |
Line 7914 sub scantron_process_students {
|
Line 7905 sub scantron_process_students {
|
return ''; |
return ''; |
} |
} |
my $map=$navmap->getResourceByUrl($sequence); |
my $map=$navmap->getResourceByUrl($sequence); |
my $randomorder; |
my ($randomorder,$randompick); |
if (ref($map)) { |
if (ref($map)) { |
$randomorder = $map->randomorder(); |
$randomorder = $map->randomorder(); |
|
$randompick = $map->randompick(); |
} |
} |
my @resources=$navmap->retrieveResources($map,\&scantron_filter,1,0); |
my @resources=$navmap->retrieveResources($map,\&scantron_filter,1,0); |
my (%grader_partids_by_symb,%grader_randomlists_by_symb,%ordered); |
my (%grader_partids_by_symb,%grader_randomlists_by_symb,%ordered); |
Line 8025 SCANTRONFORM
|
Line 8017 SCANTRONFORM
|
} |
} |
|
|
my @mapresources = @resources; |
my @mapresources = @resources; |
if ($randomorder) { |
if ($randomorder || $randompick) { |
@mapresources = |
@mapresources = |
&users_order($user,$scancode,$sequence,\@master_seq,\%ordered, |
&users_order($user,$scancode,$sequence,\@master_seq,\%ordered, |
\%symb_to_resource); |
\%symb_to_resource); |
Line 8205 sub users_order {
|
Line 8197 sub users_order {
|
my $actual_seq = |
my $actual_seq = |
&Apache::lonprintout::master_seq_to_person_seq($mapurl, |
&Apache::lonprintout::master_seq_to_person_seq($mapurl, |
$master_seq, |
$master_seq, |
$user,$scancode); |
$user,$scancode,1); |
if (ref($actual_seq) eq 'ARRAY') { |
if (ref($actual_seq) eq 'ARRAY') { |
@{$ordered->{$scancode}} = |
@{$ordered->{$scancode}} = |
map { $symb_to_resource->{$_}; } @{$actual_seq}; |
map { $symb_to_resource->{$_}; } @{$actual_seq}; |
Line 8216 sub users_order {
|
Line 8208 sub users_order {
|
my $actual_seq = |
my $actual_seq = |
&Apache::lonprintout::master_seq_to_person_seq($mapurl, |
&Apache::lonprintout::master_seq_to_person_seq($mapurl, |
$master_seq, |
$master_seq, |
$user); |
$user,undef,1); |
if (ref($actual_seq) eq 'ARRAY') { |
if (ref($actual_seq) eq 'ARRAY') { |
@mapresources = |
@mapresources = |
map { $symb_to_resource->{$_}; } @{$actual_seq}; |
map { $symb_to_resource->{$_}; } @{$actual_seq}; |
Line 8480 sub scantron_download_scantron_data {
|
Line 8472 sub scantron_download_scantron_data {
|
if (! &valid_file($file)) { |
if (! &valid_file($file)) { |
$r->print(' |
$r->print(' |
<p> |
<p> |
'.&mt('The requested file name was invalid.').' |
'.&mt('The requested filename was invalid.').' |
</p> |
</p> |
'); |
'); |
return; |
return; |
Line 8530 sub checkscantron_results {
|
Line 8522 sub checkscantron_results {
|
return ''; |
return ''; |
} |
} |
my $map=$navmap->getResourceByUrl($sequence); |
my $map=$navmap->getResourceByUrl($sequence); |
my ($randomorder,@master_seq,%symb_to_resource); |
my ($randomorder,$randompick,@master_seq,%symb_to_resource); |
if (ref($map)) { |
if (ref($map)) { |
$randomorder=$map->randomorder(); |
$randomorder=$map->randomorder(); |
|
$randompick=$map->randompick(); |
} |
} |
my @resources=$navmap->retrieveResources($map,\&scantron_filter,1,0); |
my @resources=$navmap->retrieveResources($map,\&scantron_filter,1,0); |
foreach my $resource (@resources) { |
foreach my $resource (@resources) { |
Line 8610 sub checkscantron_results {
|
Line 8603 sub checkscantron_results {
|
} |
} |
|
|
my @mapresources = @resources; |
my @mapresources = @resources; |
if ($randomorder) { |
if ($randomorder || $randompick) { |
@mapresources = |
@mapresources = |
&users_order($user,$scancode,$sequence,\@master_seq,\%ordered, |
&users_order($user,$scancode,$sequence,\@master_seq,\%ordered, |
\%symb_to_resource); |
\%symb_to_resource); |
Line 8678 sub checkscantron_results {
|
Line 8671 sub checkscantron_results {
|
$env{'form.scantron_maxbubble'}) |
$env{'form.scantron_maxbubble'}) |
.'</p>' |
.'</p>' |
); |
); |
$r->print('<p>'.&mt('Exact matches for <b>[quant,_1,student]</b>.',$passed).'<br />'.&mt('Discrepancies detected for <b>[quant,_1,student]</b>.',$failed).'</p>'); |
$r->print('<p>' |
|
.&mt('Exact matches for [_1][quant,_2,student][_3].','<b>',$passed,'</b>') |
|
.'<br />' |
|
.&mt('Discrepancies detected for [_1][quant,_2,student][_3].','<b>',$failed,'</b>') |
|
.'</p>' |
|
); |
if ($passed) { |
if ($passed) { |
$r->print(&mt('Students with exact correspondence between bubblesheet data and submissions are as follows:').'<br /><br />'); |
$r->print(&mt('Students with exact correspondence between bubblesheet data and submissions are as follows:').'<br /><br />'); |
$r->print(&Apache::loncommon::start_data_table()."\n". |
$r->print(&Apache::loncommon::start_data_table()."\n". |
Line 9743 sub handler {
|
Line 9741 sub handler {
|
} |
} |
} elsif (!%perm) { |
} elsif (!%perm) { |
$request->internal_redirect('/adm/quickgrades'); |
$request->internal_redirect('/adm/quickgrades'); |
|
return OK; |
} |
} |
&Apache::loncommon::content_type($request,'text/html'); |
&Apache::loncommon::content_type($request,'text/html'); |
$request->send_http_header; |
$request->send_http_header; |