Diff for /loncom/homework/inputtags.pm between versions 1.154 and 1.156

version 1.154, 2004/11/06 01:11:38 version 1.156, 2005/01/31 22:00:40
Line 439  sub decideoutput { Line 439  sub decideoutput {
  $bgcolor=$possiblecolors{'not_charged_try'};   $bgcolor=$possiblecolors{'not_charged_try'};
  $button=1;   $button=1;
     } elsif ($award eq 'UNIT_INVALID_STUDENT') {      } elsif ($award eq 'UNIT_INVALID_STUDENT') {
  $message = &mt('Unable to interpret units. Computer reads units as "[_1]".','<tt>'.$awardmsg.'</tt>');   $message = &mt('Unable to interpret units. Computer reads units as "[_1]".',&markup_unit($awardmsg,$target));
  if ($target ne 'tex') {$message.=&Apache::loncommon::help_open_topic('Physical_Units');}    if ($target ne 'tex') {$message.=&Apache::loncommon::help_open_topic('Physical_Units');} 
  $bgcolor=$possiblecolors{'not_charged_try'};   $bgcolor=$possiblecolors{'not_charged_try'};
  $button=1;   $button=1;
     } elsif ($award eq 'UNIT_FAIL' || $award eq 'UNIT_IRRECONCIBLE') {      } elsif ($award eq 'UNIT_FAIL' || $award eq 'UNIT_IRRECONCIBLE') {
  $message = &mt('Incompatible units. No conversion found between "[_1]" and the required units.','<tt>'.$awardmsg.'</tt>');   $message = &mt('Incompatible units. No conversion found between "[_1]" and the required units.',&markup_unit($awardmsg,$target));
  if ($target ne 'tex') {$message.=&Apache::loncommon::help_open_topic('Physical_Units');}    if ($target ne 'tex') {$message.=&Apache::loncommon::help_open_topic('Physical_Units');} 
  $bgcolor=$possiblecolors{'not_charged_try'};   $bgcolor=$possiblecolors{'not_charged_try'};
  $button=1;   $button=1;
     } elsif ($award eq 'UNIT_NOTNEEDED') {      } elsif ($award eq 'UNIT_NOTNEEDED') {
  $message = &mt('Only a number required. Computer reads units of "[_1]".','<tt>'.$awardmsg.'</tt>');   $message = &mt('Only a number required. Computer reads units of "[_1]".',&markup_unit($awardmsg,$target));
  $bgcolor=$possiblecolors{'not_charged_try'};   $bgcolor=$possiblecolors{'not_charged_try'};
  $button=1;   $button=1;
     } elsif ($award eq 'NO_UNIT') {      } elsif ($award eq 'NO_UNIT') {
Line 502  sub decideoutput { Line 502  sub decideoutput {
     return ($button,$bgcolor,$message,$previousmsg);      return ($button,$bgcolor,$message,$previousmsg);
 }  }
   
   sub markup_unit {
       my ($unit,$target)=@_;
       if ($target eq 'tex') {
    return '\texttt{'.&Apache::lonxml::latex_special_symbols($unit).'}'; 
       } else {
    return "<tt>".$unit."</tt>";
       }
   }
   
 sub removealldata {  sub removealldata {
     my ($id)=@_;      my ($id)=@_;
     foreach my $key (keys(%Apache::lonhomework::results)) {      foreach my $key (keys(%Apache::lonhomework::results)) {
Line 751  sub gradestatus { Line 760  sub gradestatus {
  if ( $status eq 'SHOW_ANSWER' || $status eq 'CANNOT_ANSWER') {$showbutton = 0;}   if ( $status eq 'SHOW_ANSWER' || $status eq 'CANNOT_ANSWER') {$showbutton = 0;}
  if ( $showbutton ) {    if ( $showbutton ) { 
     if ($target ne 'tex') {      if ($target ne 'tex') {
  $button = '<input type="submit" name="submit" value="'.&mt('Submit Answer').'" />';   $button = '<input type="submit" name="submit_'.$id.'" value="'.&mt('Submit Answer').'" />';
     }      }
  }   }
  if ($Apache::lonhomework::history{"resource.$id.afterduedate"}) {   if ($Apache::lonhomework::history{"resource.$id.afterduedate"}) {

Removed from v.1.154  
changed lines
  Added in v.1.156


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