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

raeburn raeburn at source.lon-capa.org
Thu Dec 14 12:37:07 EST 2017


raeburn		Thu Dec 14 17:37:07 2017 EDT

  Modified files:              
    /loncom/homework	grades.pm 
  Log:
  - Bug 5977.
    - Score upload form support for identification of a user based on clicker ID,
      for Course Coordinators who prefer not to use LON-CAPA's in-built
      "Process Clicker" utility.
  
  
Index: loncom/homework/grades.pm
diff -u loncom/homework/grades.pm:1.742 loncom/homework/grades.pm:1.743
--- loncom/homework/grades.pm:1.742	Fri Aug 11 18:58:17 2017
+++ loncom/homework/grades.pm	Thu Dec 14 17:37:07 2017
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # The LON-CAPA Grading handler
 #
-# $Id: grades.pm,v 1.742 2017/08/11 18:58:17 raeburn Exp $
+# $Id: grades.pm,v 1.743 2017/12/14 17:37:07 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -4199,7 +4199,7 @@
 #
 #--- Javascript to handle csv upload
 sub csvupload_javascript_reverse_associate {
-    my $error1=&mt('You need to specify the username or the student/employee ID');
+    my $error1=&mt('You need to specify the username, the student/employee ID, or the clicker ID');
     my $error2=&mt('You need to specify at least one grading field');
   &js_escape(\$error1);
   &js_escape(\$error2);
@@ -4208,13 +4208,15 @@
     var foundsomething=0;
     var founduname=0;
     var foundID=0;
+    var foundclicker=0;
     for (i=0;i<=vf.nfields.value;i++) {
       tw=eval('vf.f'+i+'.selectedIndex');
       if (i==0 && tw!=0) { foundID=1; }
       if (i==1 && tw!=0) { founduname=1; }
-      if (i!=0 && i!=1 && i!=2 && tw!=0) { foundsomething=1; }
+      if (i==2 && tw!=0) { foundclicker=1; }
+      if (i!=0 && i!=1 && i!=2 && i!=3 && tw!=0) { foundsomething=1; }
     }
-    if (founduname==0 && foundID==0) {
+    if (founduname==0 && foundID==0 && foundclicker==0) {
 	alert('$error1');
 	return;
     }
@@ -4241,7 +4243,7 @@
 }
 
 sub csvupload_javascript_forward_associate {
-    my $error1=&mt('You need to specify the username or the student/employee ID');
+    my $error1=&mt('You need to specify the username, the student/employee ID, or the clicker ID');
     my $error2=&mt('You need to specify at least one grading field');
   &js_escape(\$error1);
   &js_escape(\$error2);
@@ -4250,13 +4252,15 @@
     var foundsomething=0;
     var founduname=0;
     var foundID=0;
+    var foundclicker=0;
     for (i=0;i<=vf.nfields.value;i++) {
       tw=eval('vf.f'+i+'.selectedIndex');
       if (tw==1) { foundID=1; }
       if (tw==2) { founduname=1; }
-      if (tw>3) { foundsomething=1; }
+      if (tw==3) { foundclicker=1; } 
+      if (tw>4) { foundsomething=1; }
     }
-    if (founduname==0 && foundID==0) {
+    if (founduname==0 && foundID==0 && Æ’oundclicker==0) {
 	alert('$error1');
 	return;
     }
@@ -4322,8 +4326,8 @@
     }
 
     my @fields=(['ID','Student/Employee ID'],
-                ['clicker','Clicker ID'],
 		['username','Student Username'],
+		['clicker','Clicker ID'],
 		['domain','Student Domain']);
     my (undef,undef,$url) = &Apache::lonnet::decode_symb($symb);
     foreach my $part (sort(@parts)) {




More information about the LON-CAPA-cvs mailing list