Diff for /loncom/interface/lonpickstudent.pm between versions 1.28 and 1.29

version 1.28, 2009/11/05 14:24:01 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 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());

Removed from v.1.28  
changed lines
  Added in v.1.29


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>