[LON-CAPA-cvs] cvs: loncom(version_1_0_2_scantron) /homework grades.pm

albertel lon-capa-cvs@mail.lon-capa.org
Mon, 13 Oct 2003 22:36:59 -0000


albertel		Mon Oct 13 18:36:59 2003 EDT

  Modified files:              (Branch: version_1_0_2_scantron)
    /loncom/homework	grades.pm 
  Log:
  - start of Scantron upload support, course picking shuold work now
  
  
Index: loncom/homework/grades.pm
diff -u loncom/homework/grades.pm:1.130.2.1.2.7 loncom/homework/grades.pm:1.130.2.1.2.8
--- loncom/homework/grades.pm:1.130.2.1.2.7	Tue Sep 30 02:35:20 2003
+++ loncom/homework/grades.pm	Mon Oct 13 18:36:59 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # The LON-CAPA Grading handler
 #
-# $Id: grades.pm,v 1.130.2.1.2.7 2003/09/30 06:35:20 albertel Exp $
+# $Id: grades.pm,v 1.130.2.1.2.8 2003/10/13 22:36:59 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -3917,6 +3917,18 @@
     
     $navmap->untieHashes();
 }
+
+sub scantron_upload_scantron_data {
+    my ($r)=@_;
+    $r->print(&Apache::loncommon::coursebrowser_javascript($ENV{'request.role.domain'}));
+    $r->print(&Apache::loncommon::selectcourse_link('rules',
+			  'courseid','domain'));
+    $r->print("Course: <input name='courseid' type='text'/>");
+    $r->print("Domain: <input name='domain' type='text'/>");
+
+    return '';
+
+}
 #-------- end of section for handling grading scantron forms -------
 #
 #-------------------------------------------------------------------
@@ -4144,7 +4156,6 @@
 		delete($perm{'mgr'});
 	    }
 	}
-
 	if ($command eq 'submission' && $perm{'vgr'}) {
 	    ($ENV{'form.student'} eq '' ? &listStudents($request) : &submission($request,0,0));
 	} elsif ($command eq 'pickStudentPage' && $perm{'vgr'}) {
@@ -4188,6 +4199,8 @@
 	    $request->print(&scantron_validate_file($request));
 	} elsif ($command eq 'scantron_process' && $perm{'mgr'}) {
 	    $request->print(&scantron_process_students($request));
+	} elsif ($command eq 'scantronupload' && &Apache::lonnet::allowed('usc',$ENV{'request.role.domain'})) {
+	    $request->print(&scantron_upload_scantron_data($request));
 	} elsif ($command) {
 	    $request->print("Access Denied");
 	}