--- loncom/homework/grades.pm 2013/08/15 14:10:09 1.702
+++ 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.702 2013/08/15 14:10:09 kruse 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')
.' '
);
@@ -4143,11 +4143,12 @@ sub csvupload_fields {
sub csvuploadmap_footer {
my ($request,$i,$keyfields) =@_;
+ my $buttontext = &mt('Assign Grades');
$request->print(<
-
+
ENDPICK
}
@@ -4268,7 +4269,7 @@ ENDPICK
}
# FIXME do a check for any duplicated user ids...
# FIXME do a check for any invalid user ids?...
- $request->print('
+ $request->print(' '."\n");
return '';
}
@@ -5086,7 +5087,7 @@ like.
Next each scanline is checked for any errors of either 'missing
bubbles' (it's an error because it may have been mis-scanned
because too light bubbling), 'double bubble' (each bubble line should
-have no more that one letter picked), invalid or duplicated CODE,
+have no more than one letter picked), invalid or duplicated CODE,
invalid student/employee ID
If the CODE option is used that determines the randomization of the
@@ -6440,7 +6441,11 @@ sub scantron_process_corrections {
}
}
if ($err) {
- $r->print("Unable to accept last correction, an error occurred :$errmsg:");
+ $r->print(
+ '
'
+ .&mt('Unable to accept last correction, an error occurred: [_1]',
+ $errmsg)
+ .'
-'.&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.'
@@ -6688,7 +6693,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();
@@ -8444,11 +8449,11 @@ SCANTRONFORM
&Apache::loncommon::end_data_table_header_row()."\n".
&Apache::loncommon::start_data_table_row().
'
'."\n".
&Apache::loncommon::end_data_table_row().
&Apache::loncommon::end_data_table().'');
} else {
@@ -8683,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'},'<>&"').''));
}
}
@@ -8721,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)) {
@@ -8764,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'};
}
}
@@ -8782,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').'
';
}
return $output;
}
@@ -8888,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());
@@ -9707,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;
}