Diff for /loncom/interface/lonpickcode.pm between versions 1.9 and 1.15

version 1.9, 2006/03/15 22:11:04 version 1.15, 2007/11/13 01:47:56
Line 75  sub handler { Line 75  sub handler {
     }      }
     if      ($env{'form.command'} eq 'codelist') {      if      ($env{'form.command'} eq 'codelist') {
  &code_list($r);   &code_list($r);
           $r->print(&Apache::grades::show_grading_menu_form($env{'form.symb'},
         $env{'form.url'}));
     } elsif ($env{'form.command'} eq 'showcodes') {      } elsif ($env{'form.command'} eq 'showcodes') {
  &show_codes($r);   &show_codes($r);
     } else {      } else {
Line 85  sub handler { Line 87  sub handler {
 }  }
   
 sub code_list {  sub code_list {
     my ($r,$secondview)=@_;      my ($r,$context)=@_;
     if (!$secondview) {      # $context = 0 Print page header and enclosing table
  $r->print(&Apache::loncommon::start_page("View CODEs"));      # $context = 1 No page header, print enclosing table
  $r->print("<p>".&mt('Select a set of saved CODEs to view.')."</p>");      # $context = 2 No page header, no enclosing table
     } else {      my $table_head;
  $r->print("<p>".&mt('Select another set of saved CODEs to view.')."</p>");      my $extra_css;
       if (!$context) {
    $r->print(&Apache::loncommon::start_page("View CODEs",undef,
    {'no_nav_bar' => 1}));
    $table_head = &mt('Select a set of saved CODEs to view.');
       } elsif ($context eq 1) {
    $table_head = &mt('Select another set of saved CODEs to view.');
       } elsif ($context eq 2) {
           $table_head = &mt('Select a set of saved CODEs to view.');
    $extra_css = 'LC_scantron_action';
     }      }
     $r->print("<form method='POST' action='/adm/pickcode' name='pickcode'>");      $r->print("<form method='post' action='/adm/pickcode' name='pickcode'>");
       $r->print('
        '.&Apache::loncommon::start_data_table($extra_css).'
          '.&Apache::loncommon::start_data_table_header_row());
       $r->print('<th>');
       $r->print($table_head);
       $r->print('</th>');
       $r->print('
          '.&Apache::loncommon::end_data_table_header_row().'
          '.&Apache::loncommon::start_data_table_row());
       $r->print('<td>');
       $r->print("<input type='submit' name='submit' value='".&mt("View:")."' /> ");
     $r->print(&Apache::grades::scantron_CODElist());      $r->print(&Apache::grades::scantron_CODElist());
       $r->print('</td>');
       $r->print('
          '.&Apache::loncommon::end_data_table_row().'
          '.&Apache::loncommon::end_data_table());
     $r->print("<input type='hidden' name='command' value='showcodes' />");      $r->print("<input type='hidden' name='command' value='showcodes' />");
     $r->print("<input type='hidden' name='symb' value='".$env{'form.symb'}."' />");      $r->print("<input type='hidden' name='symb' value='".$env{'form.symb'}."' />");
     $r->print("<input type='hidden' name='url' value='".$env{'form.url'}."' />");      $r->print("<input type='hidden' name='url' value='".$env{'form.url'}."' />");
     $r->print("<input type='submit' name='submit' value='".&mt("View")."' />");  
     $r->print("</form>");      $r->print("</form>");
     $r->print(&Apache::grades::show_grading_menu_form($env{'form.symb'},      
       $env{'form.url'}));  
 }  }
   
 sub show_codes {  sub show_codes {
     my ($r)=@_;      my ($r)=@_;
     $r->print(&Apache::loncommon::start_page("View CODEs"));      $r->print(&Apache::loncommon::start_page("View CODEs",undef,
        {'no_nav_bar' => 1}));
     my %codes=&Apache::grades::get_codes();      my %codes=&Apache::grades::get_codes();
     $r->print("<h2>".$env{'form.scantron_CODElist'}."</h2>");      $r->print("<h2>".$env{'form.scantron_CODElist'}."</h2>");
     $r->print('<pre>');      $r->print('<pre>');
Line 114  sub show_codes { Line 139  sub show_codes {
     }      }
     $r->print('</pre>');      $r->print('</pre>');
     &code_list($r,1);      &code_list($r,1);
       $r->print(&Apache::grades::show_grading_menu_form($env{'form.symb'},
         $env{'form.url'}));
 }  }
   
 sub picking_a_code {  sub picking_a_code {
     my ($r)=@_;      my ($r)=@_;
     $r->print(&Apache::loncommon::start_page("Selecting a CODE"));      $r->print(&Apache::loncommon::start_page("Selecting a CODE",undef,
        {'no_nav_bar' => 1}));
     $r->print(<<ENDSCRIPT);      $r->print(<<ENDSCRIPT);
 <script>  <script>
 function gochoose(newcode) {  function gochoose(newcode) {
Line 140  ENDSCRIPT Line 168  ENDSCRIPT
     my %code_freq=&get_code_freq($r);      my %code_freq=&get_code_freq($r);
     my $num_matches=length($env{'form.curCODE'});      my $num_matches=length($env{'form.curCODE'});
     for (my $i=$num_matches;$i>=0;$i--) {      for (my $i=$num_matches;$i>=0;$i--) {
  my $to_print="<p> CODEs with $i matches</p>";   my $to_print="<p>".&mt("CODEs with [_1] matching letters",$i)."</p>";
  $to_print.='<table border="1"><tr><td></td><td>CODE</td><td>exams using this CODE</td>';   $to_print.='<table border="1"><tr><td></td><td>CODE</td><td>exams using this CODE</td>';
  my $print;   my $print;
  foreach my $code (sort(keys(%codes))) {   foreach my $code (sort(keys(%codes))) {

Removed from v.1.9  
changed lines
  Added in v.1.15


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