[LON-CAPA-cvs] cvs: loncom /homework grades.pm
wenzelju
wenzelju@source.lon-capa.org
Wed, 07 Apr 2010 15:32:32 -0000
wenzelju Wed Apr 7 15:32:32 2010 EDT
Modified files:
/loncom/homework grades.pm
Log:
Changed the order of "Specify file and which Folder/Sequence to grade" and "Specify a bubblesheet data file to upload.". The normal workflow would be: first upload the data an then use this uploaded data for grading. If you already uploaded a bubblesheet data, just skip the first box where to upload the data.
Index: loncom/homework/grades.pm
diff -u loncom/homework/grades.pm:1.605 loncom/homework/grades.pm:1.606
--- loncom/homework/grades.pm:1.605 Tue Apr 6 14:56:37 2010
+++ loncom/homework/grades.pm Wed Apr 7 15:32:32 2010
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# The LON-CAPA Grading handler
#
-# $Id: grades.pm,v 1.605 2010/04/06 14:56:37 www Exp $
+# $Id: grades.pm,v 1.606 2010/04/07 15:32:32 wenzelju Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -5190,6 +5190,52 @@
$ssi_error = 0;
+ if (&Apache::lonnet::allowed('usc',$env{'request.role.domain'}) ||
+ &Apache::lonnet::allowed('usc',$env{'request.course.id'})) {
+
+ # Chunk of form to prompt for a scantron file upload.
+
+ $r->print('
+ <br />
+ '.&Apache::loncommon::start_data_table('LC_scantron_action').'
+ '.&Apache::loncommon::start_data_table_header_row().'
+ <th>
+ '.&mt('Specify a bubblesheet data file to upload.').'
+ </th>
+ '.&Apache::loncommon::end_data_table_header_row().'
+ '.&Apache::loncommon::start_data_table_row().'
+ <td>
+');
+ my $default_form_data=&defaultFormData(&get_symb($r,1));
+ my $cdom= $env{'course.'.$env{'request.course.id'}.'.domain'};
+ my $cnum= $env{'course.'.$env{'request.course.id'}.'.num'};
+ $r->print(&Apache::lonhtmlcommon::scripttag('
+ function checkUpload(formname) {
+ if (formname.upfile.value == "") {
+ alert("'.&mt('Please use the browse button to select a file from your local directory.').'");
+ return false;
+ }
+ formname.submit();
+ }'));
+ $r->print('
+ <form enctype="multipart/form-data" action="/adm/grades" name="rules" method="post">
+ '.$default_form_data.'
+ <input name="courseid" type="hidden" value="'.$cnum.'" />
+ <input name="domainid" type="hidden" value="'.$cdom.'" />
+ <input name="command" value="scantronupload_save" type="hidden" />
+ '.&mt('File to upload: [_1]','<input type="file" name="upfile" size="50" />').'
+ <br />
+ <input type="button" onclick="javascript:checkUpload(this.form);" value="'.&mt('Upload Bubblesheet Data').'" />
+ </form>
+');
+
+ $r->print('
+ </td>
+ '.&Apache::loncommon::end_data_table_row().'
+ '.&Apache::loncommon::end_data_table().'
+');
+ }
+
# Chunk of form to prompt for a file to grade and how:
$result.= '
@@ -5237,51 +5283,7 @@
$r->print($result);
- if (&Apache::lonnet::allowed('usc',$env{'request.role.domain'}) ||
- &Apache::lonnet::allowed('usc',$env{'request.course.id'})) {
-
- # Chunk of form to prompt for a scantron file upload.
- $r->print('
- <br />
- '.&Apache::loncommon::start_data_table('LC_scantron_action').'
- '.&Apache::loncommon::start_data_table_header_row().'
- <th>
- '.&mt('Specify a bubblesheet data file to upload.').'
- </th>
- '.&Apache::loncommon::end_data_table_header_row().'
- '.&Apache::loncommon::start_data_table_row().'
- <td>
-');
- my $default_form_data=&defaultFormData(&get_symb($r,1));
- my $cdom= $env{'course.'.$env{'request.course.id'}.'.domain'};
- my $cnum= $env{'course.'.$env{'request.course.id'}.'.num'};
- $r->print(&Apache::lonhtmlcommon::scripttag('
- function checkUpload(formname) {
- if (formname.upfile.value == "") {
- alert("'.&mt('Please use the browse button to select a file from your local directory.').'");
- return false;
- }
- formname.submit();
- }'));
- $r->print('
- <form enctype="multipart/form-data" action="/adm/grades" name="rules" method="post">
- '.$default_form_data.'
- <input name="courseid" type="hidden" value="'.$cnum.'" />
- <input name="domainid" type="hidden" value="'.$cdom.'" />
- <input name="command" value="scantronupload_save" type="hidden" />
- '.&mt('File to upload: [_1]','<input type="file" name="upfile" size="50" />').'
- <br />
- <input type="button" onclick="javascript:checkUpload(this.form);" value="'.&mt('Upload Bubblesheet Data').'" />
- </form>
-');
-
- $r->print('
- </td>
- '.&Apache::loncommon::end_data_table_row().'
- '.&Apache::loncommon::end_data_table().'
-');
- }
# Chunk of the form that prompts to view a scoring office file,
# corrected file, skipped records in a file.