[LON-CAPA-cvs] cvs: loncom /homework grades.pm /interface lonpreferences.pm
www
lon-capa-cvs-allow@mail.lon-capa.org
Fri, 06 Jul 2007 23:17:31 -0000
www Fri Jul 6 19:17:31 2007 EDT
Modified files:
/loncom/homework grades.pm
/loncom/interface lonpreferences.pm
Log:
interwrite virtual clicker uses MAC address as TransID
Index: loncom/homework/grades.pm
diff -u loncom/homework/grades.pm:1.420 loncom/homework/grades.pm:1.421
--- loncom/homework/grades.pm:1.420 Wed Jul 4 16:28:44 2007
+++ loncom/homework/grades.pm Fri Jul 6 19:17:28 2007
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# The LON-CAPA Grading handler
#
-# $Id: grades.pm,v 1.420 2007/07/04 20:28:44 www Exp $
+# $Id: grades.pm,v 1.421 2007/07/06 23:17:28 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -6133,6 +6133,7 @@
(&Apache::lonnet::userenvironment($domain,$username,'clickers'))[1];
foreach my $id (split(/\,/,$clickers)) {
$id=~s/^[\#0]+//;
+ $id=~s/[\-\:]//g;
if (exists($clicker_ids{$id})) {
$clicker_ids{$id}.=','.$username.':'.$domain;
} else {
@@ -6155,6 +6156,7 @@
(&Apache::lonnet::userenvironment($pudom,$puname,'clickers'))[1];
foreach my $id (split(/\,/,$clickers)) {
$id=~s/^[\#0]+//;
+ $id=~s/[\-\:]//g;
if (exists($clicker_ids{$id})) {
$clicker_ids{$id}.=','.$puname.':'.$pudom;
} else {
@@ -6301,6 +6303,7 @@
$correct_id=~tr/a-z/A-Z/;
$correct_id=~s/\s//gs;
$correct_id=~s/^[\#0]+//;
+ $correct_id=~s/[\-\:]//g;
if ($correct_id) {
$correct_ids{$correct_id}='specified';
}
@@ -6462,6 +6465,8 @@
}
my $id=$entries[4];
$id=~s/^[\#0]+//;
+ $id=~s/^v\d*\://i;
+ $id=~s/[\-\:]//g;
$idresponses{$id}[$number]=$entries[6];
}
foreach my $id (keys %idresponses) {
Index: loncom/interface/lonpreferences.pm
diff -u loncom/interface/lonpreferences.pm:1.107 loncom/interface/lonpreferences.pm:1.108
--- loncom/interface/lonpreferences.pm:1.107 Thu Jul 5 17:37:38 2007
+++ loncom/interface/lonpreferences.pm Fri Jul 6 19:17:30 2007
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Preferences
#
-# $Id: lonpreferences.pm,v 1.107 2007/07/05 21:37:38 www Exp $
+# $Id: lonpreferences.pm,v 1.108 2007/07/06 23:17:30 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -580,7 +580,7 @@
<form name="prefs" action="/adm/preferences" method="post">
<input type="hidden" name="action" value="verify_and_change_clicker" />
<label>$text $helplink<br />
-<textarea name="clickers" rows="5" cols="10">$clickers</textarea>
+<textarea name="clickers" rows="5" cols="20">$clickers</textarea>
</label>
<input type="submit" value="$change" />
</form>
@@ -592,8 +592,10 @@
my $user = $env{'user.name'};
my $domain = $env{'user.domain'};
my $newclickers = $env{'form.clickers'};
- $newclickers=~s/\W+/\,/gs;
+ $newclickers=~s/[^\w\:\-]+/\,/gs;
$newclickers=~tr/a-z/A-Z/;
+ $newclickers=~s/[\:\-]+/\-/g;
+ $newclickers=~s/\,+/\,/g;
$newclickers=~s/^\,//;
$newclickers=~s/\,$//;
&Apache::lonnet::put('environment',{'clickers' => $newclickers});