--- loncom/homework/grades.pm 2013/08/23 16:24:33 1.703
+++ loncom/homework/grades.pm 2013/12/20 17:18:42 1.710
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# The LON-CAPA Grading handler
#
-# $Id: grades.pm,v 1.703 2013/08/23 16:24:33 bisitz Exp $
+# $Id: grades.pm,v 1.710 2013/12/20 17:18:42 bisitz Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -1084,7 +1084,7 @@ LISTJAVASCRIPT
if ($submitonly eq 'graded' ) { $submissions = 'ungraded submissions'; }
if ($submitonly eq 'queued' ) { $submissions = 'queued submissions'; }
$gradeTable='
'.
- &mt('No '.$submissions.' found for this resource for any students. ([_1] students checked for '.$submissions.')',
+ &mt('No '.$submissions.' found for this resource for any students. ([quant,_1,student] checked for '.$submissions.')',
$num_students).
'
';
}
@@ -1976,7 +1976,7 @@ sub submission {
$request->print(&show_problem($request,$symb,$uname,$udom,0,1,$mode));
}
- # kwclr is the only variable that is guaranteed to be non-blank
+ # kwclr is the only variable that is guaranteed not to be blank
# if this subroutine has been called once.
my %keyhash = ();
# if ($env{'form.kwclr'} eq '' && $env{'form.handgrade'} eq 'yes') {
@@ -2080,7 +2080,7 @@ KEYWORDS
if ($perm{'vgr'}) {
$request->print(
&Apache::loncommon::track_student_link(
- &mt('View recent activity'),
+ 'View recent activity',
$uname,$udom,'check')
.' '
);
@@ -6445,7 +6445,7 @@ sub scantron_process_corrections {
'
'
.&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);
@@ -6581,7 +6581,7 @@ sub scantron_warning_screen {
return ('
-'.&mt('Please double check the information below before clicking on \'[_1]\'',&mt($button_text)).'
+'.&mt("Please double check the information below before clicking on '[_1]'",&mt($button_text)).'
'.&mt('Sequence to be Graded:').' | '.$title.' |
@@ -8449,11 +8449,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 {
@@ -8688,23 +8688,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'},'<>&"').''));
}
}
@@ -8726,7 +8733,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)) {
@@ -8769,6 +8776,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'};
}
}
@@ -8787,17 +8795,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;
}
@@ -8893,7 +8924,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());
@@ -9712,16 +9743,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;
}