version 1.27, 2009/04/24 05:28:55
|
version 1.29, 2011/01/23 01:04:26
|
Line 50 sub handler {
|
Line 50 sub handler {
|
|
|
&Apache::loncommon::get_unprocessed_cgi |
&Apache::loncommon::get_unprocessed_cgi |
($ENV{'QUERY_STRING'},['filter','form','unameelement','udomelement', |
($ENV{'QUERY_STRING'},['filter','form','unameelement','udomelement', |
'roles','courseadvonly']); |
'roles','courseadvonly','clicker']); |
# Allowed? |
# Allowed? |
my $allowed; |
my $allowed; |
my $scope = $env{'request.course.id'}; |
my $scope = $env{'request.course.id'}; |
Line 97 HIDDEN
|
Line 97 HIDDEN
|
$r->print(<<ENDSCRIPT); |
$r->print(<<ENDSCRIPT); |
<script type="text/javascript"> |
<script type="text/javascript"> |
function gochoose(uname,udom) { |
function gochoose(uname,udom) { |
opener.document.$env{'form.form'}.$env{'form.unameelement'}.value=uname; |
opener.document.$env{'form.form'}.elements['$env{'form.unameelement'}'].value=uname; |
var slct=opener.document.$env{'form.form'}.$env{'form.udomelement'}; |
var slct=opener.document.$env{'form.form'}.elements['$env{'form.udomelement'}']; |
var i; |
var i; |
for (i=0;i<slct.length;i++) { |
for (i=0;i<slct.length;i++) { |
if (slct.options[i].value==udom) { slct.selectedIndex=i; } |
if (slct.options[i].value==udom) { slct.selectedIndex=i; } |
Line 136 ENDSCRIPT
|
Line 136 ENDSCRIPT
|
unless ($env{'form.courseadvonly'}) { |
unless ($env{'form.courseadvonly'}) { |
|
|
# ------------------------------------------------------------------ Students |
# ------------------------------------------------------------------ Students |
|
|
|
# Do we have a clicker? |
|
|
|
my $clicker=$env{'form.clicker'}; |
|
my @fragments=(); |
|
if ($clicker) { |
|
$r->print('<h1>'.&mt('Clicker: [_1]',$clicker).'</h1>'); |
|
my $clicklength=length($clicker); |
|
my $maxlength=$clicklength-1; |
|
if ($maxlength>2) { |
|
my $minlength=$maxlength-2; |
|
if ($minlength<2) { $minlength=2; } |
|
for (my $length=$maxlength;$length>=$minlength;$length--) { |
|
for (my $startidx=0; $startidx<=$clicklength-$length; $startidx++) { |
|
push(@fragments,substr($clicker,$startidx,$length)); |
|
} |
|
} |
|
} |
|
} |
|
|
my $result; |
my $result; |
my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'}; |
my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'}; |
my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'}; |
my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'}; |
Line 164 ENDSCRIPT
|
Line 184 ENDSCRIPT
|
} |
} |
} |
} |
$grouplist =~ s/,$//; |
$grouplist =~ s/,$//; |
|
my $markedupclicker; |
|
if ($clicker) { |
|
$markedupclicker=(&Apache::lonnet::userenvironment($udom,$uname,'clickers'))[1]; |
|
if ($markedupclicker!~/\w/) { |
|
$markedupclicker='-'; |
|
} else { |
|
foreach my $frag (@fragments) { |
|
if ($markedupclicker=~/\Q$frag\E/is) { |
|
$markedupclicker=~s/(\Q$frag\E)/<font color=\"green\" size=\"\+1\"><b>$1<\/b><\/font>/gis; |
|
last; |
|
} |
|
} |
|
} |
|
} |
$result .=&Apache::loncommon::start_data_table_row(). |
$result .=&Apache::loncommon::start_data_table_row(). |
'<td>'. |
'<td>'. |
'<input type="button" value="'.&mt('Select').'" onClick="gochoose('. |
'<input type="button" value="'.&mt('Select').'" onClick="gochoose('. |
Line 174 ENDSCRIPT
|
Line 208 ENDSCRIPT
|
$uname,$udom). |
$uname,$udom). |
'</td><td>'.$id.'</td><td>'.$section. |
'</td><td>'.$id.'</td><td>'.$section. |
'</td><td>'.$grouplist.'</td>'. |
'</td><td>'.$grouplist.'</td>'. |
|
($clicker?'<td>'.$markedupclicker.'</td>':''). |
&Apache::loncommon::end_data_table_row(); |
&Apache::loncommon::end_data_table_row(); |
} |
} |
} |
} |
Line 191 ENDSCRIPT
|
Line 226 ENDSCRIPT
|
'<th>'.&mt('ID').'</th>'. |
'<th>'.&mt('ID').'</th>'. |
'<th>'.&mt('section').'</th>'. |
'<th>'.&mt('section').'</th>'. |
'<th>'.&mt('active group(s)').'</th>'. |
'<th>'.&mt('active group(s)').'</th>'. |
|
($clicker?'<th>'.&mt('clicker').'</th>':''). |
&Apache::loncommon::end_data_table_header_row(). |
&Apache::loncommon::end_data_table_header_row(). |
$result. |
$result. |
&Apache::loncommon::end_data_table()); |
&Apache::loncommon::end_data_table()); |