--- loncom/homework/grades.pm 2009/05/04 22:41:37 1.567
+++ loncom/homework/grades.pm 2009/11/21 16:41:41 1.581
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# The LON-CAPA Grading handler
#
-# $Id: grades.pm,v 1.567 2009/05/04 22:41:37 raeburn Exp $
+# $Id: grades.pm,v 1.581 2009/11/21 16:41:41 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -183,7 +183,8 @@ sub get_display_part {
my ($partID,$symb)=@_;
my $display=&Apache::lonnet::EXT('resource.'.$partID.'.display',$symb);
if (defined($display) and $display ne '') {
- $display.= " (id $partID )";
+ $display.= ' ('
+ .&mt('Part ID: [_1]',$partID).' )';
} else {
$display=$partID;
}
@@ -217,9 +218,9 @@ sub showResourceInfo {
$partsseen{$partID}=1;
}
my $display_part=&get_display_part($partID,$symb);
- $result.='
'.&mt('Part').': '.$display_part.
+ $result.=''.&mt('Part: [_1]',$display_part).' '.
' '.$resID.' '.
- ''.&mt('Type').': '.$responsetype.' ';
+ ''.&mt('Type: [_1]',$responsetype).' ';
# ''.&mt('Handgrade: [_1]',$handgrade).' ';
}
}
@@ -1734,8 +1735,7 @@ sub gradeBox {
#&mt('Part: [_1] Points: [_2] or [_3] ',$display_part,$radio,$line);
$result .=
- ''.&mt('Part').': '.$display_part.' '.&mt('Points').': '.$radio.' '.&mt('or').' '.$line.' '.
-
+ ''.&mt('Part:').' '.$display_part.' '.&mt('Points:').' '.$radio.' '.&mt('or').' '.$line.' ';
$result.=''."\n";
$result.=' '."\n".
' '."\n".
@@ -2113,9 +2113,11 @@ KEYWORDS
}
my $responsetype = $responseType->{$partid}->{$respid};
if (!exists($record{"resource.$partid.$respid.submission"})) {
- $lastsubonly.="\n".'Part: '.
- $display_part.'
( ID '.$respid.
- ' ) '.
+ $lastsubonly.="\n".'
'.
+ ''.&mt('Part: [_1]',$display_part).' '.
+ ' '.
+ '('.&mt('Part ID: [_1]',$respid).')'.
+ ' '.
''.&mt('Nothing submitted - no attempts.').'
';
next;
}
@@ -2135,10 +2137,9 @@ KEYWORDS
{'one_time' => 1});
$similar="
".
- &mt('Essay is [_1]% similar to an essay by [_2] ([_3]:[_4]) in course [_5] (course id [_6]:[_7])',
+ &mt('Essay is [_1]% similar to an essay by [_2] in course [_3] (course id [_4]:[_5])',
$osim,
- &Apache::loncommon::plainname($oname,$odom),
- $oname,$odom,
+ &Apache::loncommon::plainname($oname,$odom).' ('.$oname.':'.$odom.')',
$old_course_desc{'description'},
$old_course_desc{'num'},
$old_course_desc{'domain'}).
@@ -2152,9 +2153,11 @@ KEYWORDS
($env{'form.lastSub'} eq 'hdgrade' &&
$$handgrade{$$part[0].'_'.$$part[1]} eq 'yes')) {
my $display_part=&get_display_part($partid,$symb);
- $lastsubonly.='Part: '.
- $display_part.'
( ID '.$respid.
- ' ) ';
+ $lastsubonly.='
'.
+ '
'.&mt('Part: [_1]',$display_part).' '.
+ '
'.
+ '('.&mt('Part ID: [_1]',$respid).')'.
+ ' ';
my $files=&get_submitted_files($udom,$uname,$partid,$respid,\%record);
if (@$files) {
$lastsubonly.='
'.&mt('Like all files provided by users, this file may contain viruses').' ';
@@ -2297,7 +2300,7 @@ KEYWORDS
'
7 10 '."\n";
my $nsel = ($env{'form.NTSTU'} ne '' ? $env{'form.NTSTU'} : '1');
$ntstu =~ s/
$nsel $nsel;
- $endform.=&mt('[quant,_1,student]',$ntstu);
+ $endform.=&mt('[_1]student(s)',$ntstu);
$endform.=' '."\n".
' print(' '.&mt('Sending message to [_1]:[_2]',$uname,$udom).': '.
+ $request->print(' '.&mt('Sending message to [_1]',$uname.':'.$udom).': '.
$msgstatus);
}
if ($env{'form.collaborator'.$ctr}) {
@@ -3295,7 +3298,7 @@ sub viewgrades {
$result.=
&Apache::loncommon::start_data_table_row()."\n".
- ''.&mt('Part').': '.$display_part.' '.&mt('Points').': '.$radio.' '.&mt('or').' '.$line.' '.
+ ''.&mt('Part:').' '.$display_part.' '.&mt('Points:').' '.$radio.' '.&mt('or').' '.$line.' '.
&Apache::loncommon::end_data_table_row()."\n";
$ctsparts++;
}
@@ -3681,7 +3684,7 @@ sub split_part_type {
#
#--- Javascript to handle csv upload
sub csvupload_javascript_reverse_associate {
- my $error1=&mt('You need to specify the username or ID');
+ my $error1=&mt('You need to specify the username or the student/employee ID');
my $error2=&mt('You need to specify at least one grading field');
return(<print(''.&mt("Saved [_1] students",$countdone)." \n");
+ $request->print(' '.&Apache::lonhtmlcommon::confirm_success(&mt("Saved scores for [quant,_1,student]",$countdone),$countdone==0));
if (@skipped) {
- $request->print(''.&mt('Skipped Students').'
');
- foreach my $student (@skipped) { $request->print("$student \n"); }
+ $request->print(' '.&Apache::lonhtmlcommon::confirm_success(&mt('No scores stored for the following username(s):'),1).' ');
+ $request->print(join(', ',@skipped));
}
if (@notallowed) {
- $request->print(''.&mt('Students Not Allowed to Modify').'
');
- foreach my $student (@notallowed) { $request->print("$student \n"); }
+ $request->print(' '.&Apache::lonhtmlcommon::confirm_success(&mt('Modification of scores not allowed for the following username(s):'),1).' ');
+ $request->print(join(', ',@notallowed));
}
$request->print(" \n");
$request->print(&show_grading_menu_form($symb));
@@ -4467,13 +4470,16 @@ sub displaySubByDates {
my ($responseId)= ($isTask ? ($matchKey=~ /^resource\.(.*?)\.\Q$partid\E\.award$/)
: ($matchKey=~ /^resource\.\Q$partid\E\.(.*?)\.submission$/));
- $displaySub[0].=''.&mt('Part:').' '.$display_part.' ';
- $displaySub[0].='('.&mt('ID').' '.
- $responseId.') ';
+ $displaySub[0].=''.&mt('Part: [_1]',$display_part).' '
+ .' '
+ .'('.&mt('Part ID: [_1]',$responseId).')'
+ .' '
+ .' ';
if ($$record{"$where.$partid.tries"} eq '') {
- $displaySub[0].=&mt('Trial not counted');
+ $displaySub[0].=&mt('Trial not counted');
} else {
- $displaySub[0].=&mt('Trial [_1]',
+ $displaySub[0].=&mt('Trial: [_1]',
$$record{"$where.$partid.tries"});
}
my $responseType=($isTask ? 'Task'
@@ -4484,7 +4490,8 @@ sub displaySubByDates {
&get_order($partid,$responseId,$symb,$uname,$udom,
$no_increment);
}
- $displaySub[0].=' '.
+ $displaySub[0].=''; # /nobreak
+ $displaySub[0].=' '.
&cleanRecord($$record{$version.':'.$matchKey},$responseType,$symb,$partid,$responseId,$record,$orders{$partid}->{$responseId},"$version:",$uname,$udom).' ';
}
}
@@ -4690,7 +4697,7 @@ sub updateGradeByPage {
#
#-------------------------------------------------------------------
-#--------------------Scantron Grading-----------------------------------
+#-------------------- Bubblesheet (Scantron) Grading -------------------
#
#------ start of section for handling grading by page/sequence ---------
@@ -5069,10 +5076,10 @@ sub scantron_selectphase {
'.&mt('Sequence to grade:').' '.$sequence_selector.'
'.&Apache::loncommon::end_data_table_row().'
'.&Apache::loncommon::start_data_table_row().'
- '.&mt('Filename of scoring office file:').' '.$file_selector.'
+ '.&mt('Filename of bubblesheet data file:').' '.$file_selector.'
'.&Apache::loncommon::end_data_table_row().'
'.&Apache::loncommon::start_data_table_row().'
- '.&mt('Format of data file:').' '.$format_selector.'
+ '.&mt('Format of bubblesheet data file:').' '.$format_selector.'
'.&Apache::loncommon::end_data_table_row().'
'.&Apache::loncommon::start_data_table_row().'
'.&mt('Saved CODEs to validate against:').' '.$CODE_selector.'
@@ -5090,7 +5097,7 @@ sub scantron_selectphase {
'.&Apache::loncommon::end_data_table_row().'
'.&Apache::loncommon::start_data_table_row().'
-
+
'.&Apache::loncommon::end_data_table_row().'
'.&Apache::loncommon::end_data_table().'
@@ -5109,7 +5116,7 @@ sub scantron_selectphase {
'.&Apache::loncommon::start_data_table('LC_scantron_action').'
'.&Apache::loncommon::start_data_table_header_row().'
- '.&mt('Specify a Scantron data file to upload.').'
+ '.&mt('Specify a bubblesheet data file to upload.').'
'.&Apache::loncommon::end_data_table_header_row().'
'.&Apache::loncommon::start_data_table_row().'
@@ -5136,7 +5143,7 @@ sub scantron_selectphase {
'.&mt('File to upload: [_1]',' ').'
-
+
');
@@ -5178,7 +5185,7 @@ sub scantron_selectphase {
&Apache::loncommon::start_data_table('LC_scantron_action')."\n".
&Apache::loncommon::start_data_table_header_row()."\n".
'
- '.&mt('Review scantron data and submissions for a previously graded folder/sequence')."\n".
+ '.&mt('Review bubblesheet data and submissions for a previously graded folder/sequence')."\n".
' '."\n".
&Apache::loncommon::end_data_table_header_row()."\n".
&Apache::loncommon::start_data_table_row()."\n".
@@ -5200,7 +5207,7 @@ sub scantron_selectphase {
&Apache::loncommon::start_data_table_row()."\n".
''."\n".
' '."\n".
- ' '."\n".
+ ' '."\n".
' '."\n".
&Apache::loncommon::end_data_table_row()."\n".
&Apache::loncommon::end_data_table()."\n".
@@ -5241,7 +5248,7 @@ sub scantron_selectphase {
CODEstart - (only matter if a CODE exists) column in the line where
the CODE starts
CODElength - length of the CODE
- IDstart - column where the student/employee ID number starts
+ IDstart - column where the student/employee ID starts
IDlength - length of the student/employee ID info
Qstart - column where the information from the bubbled
'questions' start
@@ -5341,7 +5348,7 @@ sub username_to_idmap {
$whichline - line number of the passed in scanline
$field - type of change to process
(either
- 'ID' -> correct the student/employee ID number
+ 'ID' -> correct the student/employee ID
'CODE' -> correct the CODE
'answer' -> fixup the submitted answers)
@@ -6251,7 +6258,7 @@ sub scantron_validate_file {
' '.&mt('No').
' '.
&mt('Grading will take longer if you use verification.').' '.
- &mt("Alternatively, the 'Review scantron data' utility (see grading menu) can be used for all students after grading is complete.").' '.
+ &mt("Alternatively, the 'Review bubblesheet data' utility (see grading menu) can be used for all students after grading is complete.").' '.
' '.
' '."\n");
} else {
@@ -6777,10 +6784,10 @@ sub scantron_get_correction {
if ($closest > 0) {
foreach my $testcode (@{$closest}) {
my $checked='';
- if (!$i) { $checked=' checked="checked" '; }
+ if (!$i) { $checked=' checked="checked"'; }
$r->print("
-
+
".&mt("Use the similar CODE [_1] instead.",
"".$testcode." ")."
@@ -6791,10 +6798,10 @@ sub scantron_get_correction {
}
}
if ($$scan_record{'scantron.CODE'}=~/\S/ ) {
- my $checked; if (!$i) { $checked=' checked="checked" '; }
+ my $checked; if (!$i) { $checked=' checked="checked"'; }
$r->print("
-
+
".&mt("Use the CODE [_1] that is was on the paper, ignoring the error.",
"".$$scan_record{'scantron.CODE'}." ")."
");
@@ -7018,7 +7025,7 @@ 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 scantron sheets.",$lines).' '.&mt('A non-zero score can be assigned to the student during scantron 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 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. ")." ");
}
@@ -7475,8 +7482,8 @@ SCANTRONFORM
my $lock=&Apache::lonnet::set_lock(&mt('Grading bubblesheet exam'));
my $count=&get_todo_count($scanlines,$scan_data);
- my %prog_state=&Apache::lonhtmlcommon::Create_PrgWin($r,'Scantron Status',
- 'Scantron Progress',$count,
+ my %prog_state=&Apache::lonhtmlcommon::Create_PrgWin($r,'Bubblesheet Status',
+ 'Bubblesheet Progress',$count,
'inline',undef,'scantronupload');
&Apache::lonhtmlcommon::Update_PrgWin($r,\%prog_state,
'Processing first student');
@@ -7710,15 +7717,17 @@ sub scantron_upload_scantron_data {
my $syllabuslink = ''.&mt('Syllabus').' '.
(' 'x2).&mt('(shows course personnel)');
my $default_form_data=&defaultFormData(&get_symb($r,1));
+ my $nofile_alert = &mt('Please use the browse button to select a file from your local directory.');
+ my $nocourseid_alert = &mt("Please use the 'Select Course' link to open a separate window where you can search for a course to which a file can be uploaded.");
$r->print('