'
+ .&mt('Unable to accept last correction, an error occurred: [_1]',
+ $errmsg)
+ .'
');
} else {
&scantron_put_line($scanlines,$scan_data,$which,$line,$skip);
&scantron_putfile($scanlines,$scan_data);
@@ -6576,7 +6591,7 @@ sub scantron_warning_screen {
return ('
'.&mt('Sequence to be Graded:').' | '.$title.' |
@@ -6688,7 +6703,7 @@ sub scantron_validate_file {
if (!$symb) {return '';}
my $default_form_data=&defaultFormData($symb);
- # do the detection of only doing skipped records first befroe we delete
+ # do the detection of only doing skipped records first before we delete
# them when doing the corrections reset
if ($env{'form.scantron_options_redo'} ne 'redo_skipped_ready') {
&reset_skipping_status();
@@ -7574,7 +7589,7 @@ sub prompt_for_corrections {
}
} else {
$responsenum = $question-1;
- $first = $first_bubble_line{$responsenum} + 1;
+ $first = $first_bubble_line{$responsenum};
}
$current_line = $first + 1 ;
my @subans = split(/,/,$subdivided_bubble_lines{$responsenum});
@@ -8444,11 +8459,11 @@ SCANTRONFORM
&Apache::loncommon::end_data_table_header_row()."\n".
&Apache::loncommon::start_data_table_row().
''.&mt('Bubblesheet').' | '.
- ''.$studentdata.' | '.
+ ''.$studentdata.' | '.
&Apache::loncommon::end_data_table_row().
&Apache::loncommon::start_data_table_row().
''.&mt('Stored submissions').' | '.
- ''.$studentrecord.' | '."\n".
+ ''.$studentrecord.' | '."\n".
&Apache::loncommon::end_data_table_row().
&Apache::loncommon::end_data_table().'');
} else {
@@ -8683,23 +8698,30 @@ sub scantron_upload_scantron_data_save {
}
my %coursedata=&Apache::lonnet::coursedescription($env{'form.domainid'}.'_'.$env{'form.courseid'});
my $uploadedfile;
- $r->print(''.&mt("Uploading file to [_1]",$coursedata{'description'}).'
');
+ $r->print(''.&mt('Uploading file to [_1]','"'.$coursedata{'description'}.'"').'
');
if (length($env{'form.upfile'}) < 2) {
- $r->print(&mt('[_1]Error:[_2] The file you attempted to upload, [_3] contained no information. Please check that you entered the correct filename.','','',''.&HTML::Entities::encode($env{'form.upfile.filename'},'<>&"').''));
+ $r->print(
+ &Apache::lonhtmlcommon::confirm_success(
+ &mt('The file: [_1] you attempted to upload contained no information. Please check that you entered the correct filename.',
+ ''.&HTML::Entities::encode($env{'form.upfile.filename'},'<>&"').''),1));
} else {
my $result =
&Apache::lonnet::userfileupload('upfile','','scantron','','','',
$env{'form.courseid'},$env{'form.domainid'});
- if ($result =~ m{^/uploaded/}) {
- $r->print(&mt('[_1]Success:[_2] Successfully uploaded [_3] bytes of data into location: [_4]',
- '','',(length($env{'form.upfile'})-1),
- ''.$result.''));
+ if ($result =~ m{^/uploaded/}) {
+ $r->print(
+ &Apache::lonhtmlcommon::confirm_success(&mt('Upload successful')).'
'.
+ &mt('Uploaded [_1] bytes of data into location: [_2]',
+ (length($env{'form.upfile'})-1),
+ ''.$result.''));
($uploadedfile) = ($result =~ m{/([^/]+)$});
$r->print(&validate_uploaded_scantron_file($env{'form.domainid'},
$env{'form.courseid'},$uploadedfile));
- } else {
- $r->print(&mt('[_1]Error:[_2] An error ([_3]) occurred when attempting to upload the file, [_4]',
- '','',$result,
+ } else {
+ $r->print(
+ &Apache::lonhtmlcommon::confirm_success(&mt('Upload failed'),1).'
'.
+ &mt('An error ([_1]) occurred when attempting to upload the file: [_2]',
+ $result,
''.&HTML::Entities::encode($env{'form.upfile.filename'},'<>&"').''));
}
}
@@ -8721,7 +8743,7 @@ sub validate_uploaded_scantron_file {
my $output;
if (@lines) {
my (%counts,$max_match_format);
- my ($max_match_count,$max_match_pct) = (0,0);
+ my ($found_match_count,$max_match_count,$max_match_pct) = (0,0,0);
my $classlist = &Apache::loncoursedata::get_classlist($cdom,$cname);
my %idmap = &username_to_idmap($classlist);
foreach my $key (keys(%idmap)) {
@@ -8764,6 +8786,7 @@ sub validate_uploaded_scantron_file {
if (($max_match_format eq '') || ($percent_match > $max_match_pct)) {
$max_match_pct = $percent_match;
$max_match_format = $key;
+ $found_match_count = $counts{$key}{'found'};
$max_match_count = $counts{$key}{'total'};
}
}
@@ -8782,17 +8805,40 @@ sub validate_uploaded_scantron_file {
}
}
my $showpct = sprintf("%.0f",$max_match_pct).'%';
- $output .= '
'.&mt('Comparison of student IDs in the uploaded file with the course roster found matches for [_1] of the [_2] entries in the file (for the format defined for [_3]).',''.$showpct.'',''.$max_match_count.'',$format_descs).
- '
'.&mt('A low percentage of matches results from one of the following:').''.
- '- '.&mt('The file was uploaded to the wrong course').'
'.
- '- '.&mt('The data are not in the format expected for the domain: [_1]',
- ''.$cdom.'').'
'.
- '- '.&mt('Students did not bubble their IDs, or mis-bubbled them').'
'.
- '- '.&mt('The course roster is not up to date').'
'.
- '
';
+ $output .= '
';
+ if ($found_match_count == $max_match_count) {
+ # 100% matching entries
+ $output .= &Apache::lonhtmlcommon::confirm_success(
+ &mt('Comparison of student IDs: [_1] matching ([quant,_2,entry,entries])',
+ ''.$showpct.'',$found_match_count)).'
'.
+ &mt('Comparison of student IDs in the uploaded file with'.
+ ' the course roster found matches for [_1] of the [_2] entries'.
+ ' in the file (for the format defined for [_3]).',
+ ''.$showpct.'',''.$max_match_count.'',$format_descs);
+ } else {
+ # Not all entries matching? -> Show warning and additional info
+ $output .=
+ &Apache::lonhtmlcommon::confirm_success(
+ &mt('Comparison of student IDs: [_1] matching ([_2]/[quant,_3,entry,entries])',
+ ''.$showpct.'',$found_match_count,$max_match_count).'
'.
+ &mt('Not all entries could be matched!'),1).'
'.
+ &mt('Comparison of student IDs in the uploaded file with'.
+ ' the course roster found matches for [_1] of the [_2] entries'.
+ ' in the file (for the format defined for [_3]).',
+ ''.$showpct.'',''.$max_match_count.'',$format_descs).
+ ''.
+ &mt('A low percentage of matches results from one of the following:').
+ '
'.
+ '- '.&mt('The file was uploaded to the wrong course.').'
'.
+ '- '.&mt('The data is not in the format expected for the domain: [_1]',
+ ''.$cdom.'').'
'.
+ '- '.&mt('Students did not bubble their IDs, or mis-bubbled them').'
'.
+ '- '.&mt('The course roster is not up to date.').'
'.
+ '
';
+ }
}
} else {
- $output = ''.&mt('Uploaded file contained no data').'';
+ $output = ''.&mt('Uploaded file contained no data').'
';
}
return $output;
}
@@ -8827,7 +8873,7 @@ sub scantron_download_scantron_data {
&Apache::lonnet::allowuploaded('/adm/grades',$skipped);
$r->print('
- '.&mt('[_1]Original[_2] file as uploaded by the scantron office.',
+ '.&mt('[_1]Original[_2] file as uploaded by the bubblesheet office.',
'','').'
@@ -8888,7 +8934,7 @@ sub checkscantron_results {
my $count=&get_todo_count($scanlines,$scan_data);
my %prog_state=&Apache::lonhtmlcommon::Create_PrgWin($r,$count);
- my ($username,$domain,$started,%ordered);
+ my ($username,$domain,$started);
&scantron_get_maxbubble(\$nav_error,\%scantron_config); # Need the bubble lines array to parse.
if ($nav_error) {
$r->print(&navmap_errormsg());
@@ -9707,16 +9753,18 @@ sub process_clicker_file {
$number++;
}
$result.="
\n";
- if ($number==0) {
- $result.=''.&mt('No IDs found to determine correct answer').'';
- return $result;
- }
+ if ($number==0) {
+ $result .=
+ &Apache::lonhtmlcommon::confirm_success(
+ &mt('No IDs found to determine correct answer'),1);
+ return $result;
+ }
}
if (length($env{'form.upfile'}) < 2) {
- $result.=&mt('[_1] Error: [_2] The file you attempted to upload, [_3] contained no information. Please check that you entered the correct filename.',
- '',
- '',
- ''.&HTML::Entities::encode($env{'form.upfile.filename'},'<>&"').'');
+ $result .=
+ &Apache::lonhtmlcommon::confirm_success(
+ &mt('The file: [_1] you attempted to upload contained no information. Please check that you entered the correct filename.',
+ ''.&HTML::Entities::encode($env{'form.upfile.filename'},'<>&"').''),1);
return $result;
}