--- loncom/homework/grades.pm 2017/08/11 18:58:17 1.742 +++ loncom/homework/grades.pm 2017/12/14 17:37:07 1.743 @@ -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 @@ sub split_part_type { # #--- 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 @@ sub csvupload_javascript_reverse_associa 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 @@ ENDPICK } 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 @@ sub csvupload_javascript_forward_associa 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 @@ sub csvupload_fields { } 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)) {