Diff for /loncom/homework/bridgetask.pm between versions 1.210 and 1.214

version 1.210, 2006/11/27 23:33:01 version 1.214, 2006/12/07 20:44:55
Line 1061  DONEBUTTON Line 1061  DONEBUTTON
     $start_time=&Apache::lonlocal::locallocaltime($start_time);      $start_time=&Apache::lonlocal::locallocaltime($start_time);
   
     my $status =       my $status = 
  "\n<div class='LC_$bt_status LC_criteria'>\n\t";   "\n<div class='LC_$bt_status LC_criteria LC_task_overall_status'>\n\t";
           
       my $dim = $top;
       my %counts = &get_counts($dim,undef,$parstack,
        $safeeval);
       my $question_status ="\n\t<p>".
    &question_status_message(\%counts,-1).
    "</p>\n";
   
     if ($bt_status eq 'pass')  {      if ($bt_status eq 'pass')  {
  $status.='<h2>You passed the '.$title.' given on '.   $status.='<h2>You passed the '.$title.' given on '.
     $start_time.'</h2>';      $start_time.'</h2>';
    $status.=$question_status;
     }      }
     if ($bt_status eq 'fail')  {      if ($bt_status eq 'fail')  {
  $status.='<h2>You did not pass the '.$title.' given on '.   $status.='<h2>You did not pass the '.$title.' given on '.
     $start_time.'</h2>';      $start_time.'</h2>';
    $status.=$question_status;
  if (!$previous) {   if (!$previous) {
     $status.=&add_request_another_attempt_button();      $status.=&add_request_another_attempt_button();
  }   }
     }      }
     $status.="\n".'</div>'."\n";  
     my $dim = $top;  
     my %counts = &get_counts($dim,undef,$parstack,  
      $safeeval);  
     $status.="\n<div class='LC_$bt_status LC_criteria LC_task_overall_status'>\n\t<p>".  
  &question_status_message(\%counts,-1).  
  "</p>\n</div>\n";  
           
       $status.="\n".'</div>'."\n";
   
     foreach my $id (@{$dimension{$dim}{'criterias'}}) {      foreach my $id (@{$dimension{$dim}{'criterias'}}) {
  my $type = $dimension{$dim}{'criteria.'.$id.'.type'};   my $type = $dimension{$dim}{'criteria.'.$id.'.type'};
Line 1574  sub show_queue { Line 1577  sub show_queue {
  my $ekey=&escape($key);   my $ekey=&escape($key);
  my ($action,$description,$status)=('select',&mt('Select'));   my ($action,$description,$status)=('select',&mt('Select'));
  if (exists($queue{"$key\0locked"})) {   if (exists($queue{"$key\0locked"})) {
       my $locker = $queue{"$key\0locked"};
       my $time;
       if (ref($queue{"$key\0locked"}) eq 'ARRAY') {
    ($locker, $time) = @{$queue{"$key\0locked"}};
    $time = 
       &Apache::lonnavmaps::timeToHumanString($time,
      'start');
       }
     my $me=$env{'user.name'}.':'.$env{'user.domain'};      my $me=$env{'user.name'}.':'.$env{'user.domain'};
     $status=&mt('Locked by <tt>[_1]</tt>',$queue{"$key\0locked"});      $status=&mt('Locked by <tt>[_1]</tt> [_2]',$locker,$time);
     if ($me eq $queue{"$key\0locked"}) {      if ($me eq $queue{"$key\0locked"}) {
  ($action,$description)=('resume',&mt('Resume'));   ($action,$description)=('resume',&mt('Resume'));
     } else {      } else {
Line 1794  sub lock_key { Line 1805  sub lock_key {
     my (undef,$cid)=&Apache::lonnet::whichuser();      my (undef,$cid)=&Apache::lonnet::whichuser();
     my $cnum=$env{'course.'.$cid.'.num'};      my $cnum=$env{'course.'.$cid.'.num'};
     my $cdom=$env{'course.'.$cid.'.domain'};      my $cdom=$env{'course.'.$cid.'.domain'};
     my $success=&Apache::lonnet::newput($queue,{"$todo\0locked"=> $me},      my $success=&Apache::lonnet::newput($queue,{"$todo\0locked"=> [$me,time]},
  $cdom,$cnum);   $cdom,$cnum);
     &Apache::lonxml::debug("success $success $todo");      &Apache::lonxml::debug("success $success $todo");
     if ($success eq 'ok') {      if ($success eq 'ok') {
Line 2250  sub end_Dimension { Line 2261  sub end_Dimension {
  }   }
  my $dim_info=   my $dim_info=
     "\n<div class='LC_$dim_status LC_question_grade'>\n\t";      "\n<div class='LC_$dim_status LC_question_grade'>\n\t";
  my $question = ('sub' x $dimension{$dim}{'depth'}).'question';   my $ucquestion = 
  $question =~ s/^(.)/uc($1)/e;      my $question = 
       ('sub' x $dimension{$dim}{'depth'}).'question';
    $ucquestion =~ s/^(.)/uc($1)/e;
  if ($dim_status eq 'pass') {   if ($dim_status eq 'pass') {
     $dim_info.='<h3>'.$question.' : you passed the above '.$mandatory.' question</h3>';      $dim_info.='<h3>'.$ucquestion.' : you passed the above '.$mandatory.' '.$question.'</h3>';
  }   }
  if ($dim_status eq 'fail') {   if ($dim_status eq 'fail') {
     $dim_info.='<h3>'.$question.' : you did not pass the above '.$mandatory.' question</h3>';      $dim_info.='<h3>'.$ucquestion.' : you did not pass the above '.$mandatory.' '.$question.'</h3>';
  }   }
  my %counts = &get_counts($dim,$instance,$parstack,   my %counts = &get_counts($dim,$instance,$parstack,
  $safeeval);   $safeeval);
Line 2300  sub end_Dimension { Line 2313  sub end_Dimension {
     # those old ones will continue to work.  # It puts the      # those old ones will continue to work.  # It puts the
     # LC_question div to come after any starting closie div      # LC_question div to come after any starting closie div
     # that the dimension produces      # that the dimension produces
     if ($result =~ m{\s*</div>}) {      if ($result =~ m{^\s*</div>}) {
  $result =~ s{(\s*</div>)}   $result =~ s{^(\s*</div>)}
             {$1\n<div id="$dim" class="LC_question">};              {$1\n<div id="$dim" class="LC_question">};
     } else {      } else {
  $result = "\n".'<div id="'.$dim.'" class="LC_question">'.   $result = "\n".'<div id="'.$dim.'" class="LC_question">'.
Line 2429  sub question_status_message { Line 2442  sub question_status_message {
  foreach my $type ('cri','dim') {   foreach my $type ('cri','dim') {
     if ($counts->{$req.'_'.$type}) {      if ($counts->{$req.'_'.$type}) {
  push(@sections,   push(@sections,
      $counts->{$req.'_'.$type.'_passed'}.' of '.       $counts->{$req.'_'.$type.'_passed'}.' of the '.
      $counts->{$req.'_'.$type}.' '.       $counts->{$req.'_'.$type}.' '.
      $req{$req}.' '.$type{$type});       $req{$req}.' '.$type{$type});
     }      }

Removed from v.1.210  
changed lines
  Added in v.1.214


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