Diff for /loncom/homework/lonhomework.pm between versions 1.298.2.1 and 1.309

version 1.298.2.1, 2009/03/20 20:36:41 version 1.309, 2009/03/30 04:49:35
Line 297  sub check_slot_access { Line 297  sub check_slot_access {
  return ('WAITING_FOR_GRADE');   return ('WAITING_FOR_GRADE');
     }      }
   
     # no slot is currently open, and has been checked in for this version      # Previously used slot is no longer open, and has been checked in for this version.
     # previous slot is therefore CLOSED, so therefore the problem is      # However, the problem is not closed, and potentially, another slot might be
       # used to gain access to it to work on it, until the due date is reached, and the
       # problem then becomes CLOSED.  Therefore return the slotstatus - 
       # (which will be NOT_IN_SLOT).
     if (!defined($slot_name)      if (!defined($slot_name)
  && $checkedin    && $checkedin 
  && $type eq 'problem') {   && $type eq 'problem') {
  return ('CLOSED',$datemsg);          return ($slotstatus);
     }      }
   
     if ($slotstatus eq 'NOT_IN_A_SLOT'       if ($slotstatus eq 'NOT_IN_A_SLOT' 
Line 777  sub analyze { Line 780  sub analyze {
     }      }
     &Apache::lonhtmlcommon::Update_PrgWin($request,\%prog_state,      &Apache::lonhtmlcommon::Update_PrgWin($request,\%prog_state,
   &mt('Analyzing Results'));    &mt('Analyzing Results'));
     $request->print('<hr class="LC_edit_problem_divide" />'.&mt('List of possible answers').': ');      $request->print('<hr class="LC_edit_problem_divide" />'
                      .'<h3>'
                      .&mt('List of possible answers')
                      .'</h3>'
       );
     foreach my $part (sort(keys(%allparts))) {      foreach my $part (sort(keys(%allparts))) {
  if (defined(@{ $overall{$part.'.answer'} })) {   if (defined(@{ $overall{$part.'.answer'} })) {
     for (my $i=0;$i<scalar(@{ $overall{$part.'.answer'} });$i++) {      for (my $i=0;$i<scalar(@{ $overall{$part.'.answer'} });$i++) {
  my $num_cols=scalar(@{ $overall{$part.'.answer'}[$i][0] });   my $num_cols=scalar(@{ $overall{$part.'.answer'}[$i][0] });
  $request->print('<table class="thinborder"><tr><th colspan="'.($num_cols+1).'">'.&mt('Part').' '.$part);                  $request->print(&Apache::loncommon::start_data_table()
                                  .&Apache::loncommon::start_data_table_header_row()
                                  .'<th colspan="'.($num_cols+1).'">'
                                  .&mt('Part').' '.$part
                   );
  if (scalar(@{ $overall{$part.'.answer'} }) > 1) {   if (scalar(@{ $overall{$part.'.answer'} }) > 1) {
     $request->print(&mt(' Answer [_1]',$i+1));      $request->print(' '.&mt('Answer [_1]',$i+1));
  }   }
  $request->print('</th></tr>');   $request->print('</th>'
                                  .&Apache::loncommon::end_data_table_header_row()
                   );
  my %frequency;   my %frequency;
  foreach my $answer (sort {$a->[0] <=> $b->[0]} (@{ $overall{$part.'.answer'}[$i] })) {   foreach my $answer (sort {$a->[0] <=> $b->[0]} (@{ $overall{$part.'.answer'}[$i] })) {
     $frequency{join("\0",@{ $answer })}++;      $frequency{join("\0",@{ $answer })}++;
  }   }
  $request->print('<tr><th colspan="'.($num_cols).'">'.&mt('Answer').'</th><th>'.&mt('Frequency').'<br />('                  $request->print(&Apache::loncommon::start_data_table_header_row()
  .&mt('click for example').')</th></tr>');                                 .'<th colspan="'.($num_cols).'">'.&mt('Answer').'</th>'
                                  .'<th>'.&mt('Frequency').'<br />'
                                  .'('.&mt('click for example').')</th>'
                                  .&Apache::loncommon::end_data_table_header_row()
                   );
  foreach my $answer (sort {(split("\0",$a))[0] <=> (split("\0",$b))[0]} (keys(%frequency))) {   foreach my $answer (sort {(split("\0",$a))[0] <=> (split("\0",$b))[0]} (keys(%frequency))) {
     $request->print('<tr><td class="center">'.                      $request->print(&Apache::loncommon::start_data_table_row()
     join('</td><td class="center">',split("\0",$answer)).                                     .'<td>'
     '</td><td class="center"><a href="'.$request->uri.'?rndseed='.$seedexample{join("\0",$part,$i,$answer)}.'">'.$frequency{$answer}.                                     .join('</td><td>',split("\0",$answer))
     '</a></td></tr>');     .'</td>'
                                      .'<td>'
                                      .'<a href="'.$request->uri.'?rndseed='.$seedexample{join("\0",$part,$i,$answer)}.'">'.$frequency{$answer}.'</a>'
      .'</td>'
                                      .&Apache::loncommon::end_data_table_row()
                       );
  }   }
  $request->print('</table>');                  $request->print(&Apache::loncommon::end_data_table());
     }      }
  } else {   } else {
     $request->print('<p>'.&mt('Response').' '.$part.' '.              $request->print('<p class="LC_warning">'
     &mt('is not analyzable at this time').'</p>');                             .&mt('Response [_1] is not analyzable at this time.',$part)
      .'</p>'
               );
  }   }
     }      }
     if (scalar(keys(%allparts)) == 0 ) {      if (scalar(keys(%allparts)) == 0 ) {
  $request->print('<p>'.&mt('Found no analyzable responses in this problem, currently only Numerical, Formula and String response styles are supported.').'</p>');          $request->print('<p class="LC_warning">'
                          .&mt('Found no analyzable responses in this problem.'
                              .' Currently only Numerical, Formula and String response styles are supported.')
                          .'</p>'
           );
     }      }
     &Apache::lonhtmlcommon::Close_PrgWin($request,\%prog_state);      &Apache::lonhtmlcommon::Close_PrgWin($request,\%prog_state);
     &analyze_footer($request);      &analyze_footer($request);
Line 855  sub editxmlmode { Line 883  sub editxmlmode {
     my $result;      my $result;
     my $problem=&Apache::lonnet::getfile($file);      my $problem=&Apache::lonnet::getfile($file);
     if ($problem eq -1) {      if ($problem eq -1) {
         &Apache::lonxml::error(   &Apache::lonxml::error(
             '<b> '              '<b> '
            .&mt('Unable to find [_1]',             .&mt('Unable to find [_1]',
                 '<span class="LC_filename">'.$file.'</span>')                  '<span class="LC_filename">'.$file.'</span>')
            .'</b>');             .'</b>');
   
  $problem='';   $problem='';
     }      }
     if (defined($env{'form.editxmltext'}) || defined($env{'form.Undo'})) {      if (defined($env{'form.editxmltext'}) || defined($env{'form.Undo'})) {
Line 966  sub renderpage { Line 995  sub renderpage {
     my $filename=(split('/',$file))[-1];      my $filename=(split('/',$file))[-1];
     my $error =      my $error =
  "<b> ".&mt('Unable to find [_1]',   "<b> ".&mt('Unable to find [_1]',
                            '<span class="LC_filename">'.$filename.'</span>')     '<span class="LC_filename">'.$filename.'</span>')
  ."</b>";   ."</b>";
     $result.=      $result.=
  &Apache::loncommon::simple_error_page($request,'Not available',   &Apache::loncommon::simple_error_page($request,'Not available',
Line 1112  $start_page Line 1141  $start_page
 <h1>".&mt("Creating a new $extension resource.")."</h1>  <h1>".&mt("Creating a new $extension resource.")."</h1>
 $errormsg  $errormsg
 ".&mt("The requested file [_1] currently does not exist.",  ".&mt("The requested file [_1] currently does not exist.",
       "<tt>$shownurl</tt>")."        '<span class="LC_filename">'.$shownurl.'</span>')."
 <p>  <p>
 <b>  <b>
 ".&mt("To create a new $extension, select a template from the".  ".&mt("To create a new $extension, select a template from the".

Removed from v.1.298.2.1  
changed lines
  Added in v.1.309


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