Diff for /loncom/homework/structuretags.pm between versions 1.136 and 1.141

version 1.136, 2002/11/12 05:05:27 version 1.141, 2002/12/05 14:37:17
Line 118  sub page_start { Line 118  sub page_start {
   return ($result,$head_tag_start,$body_tag_start,$form_tag_start);    return ($result,$head_tag_start,$body_tag_start,$form_tag_start);
 }  }
   
   #use Time::HiRes();
 sub get_resource_name {  sub get_resource_name {
   my ($parstack,$safeeval)=@_;    my ($parstack,$safeeval)=@_;
   my $name=&Apache::lonxml::get_param('name',$parstack,$safeeval);    my $name=&Apache::lonnet::gettitle();
   if ($name eq '') {     &Apache::lonnet::logthis("Got $name");
     if ($name eq '') {
     $name=&Apache::lonnet::EXT('resource.title');      $name=&Apache::lonnet::EXT('resource.title');
     if ($name eq 'con_lost') { $name = ''; }      if ($name eq 'con_lost') { $name = ''; }
   }    }
Line 424  sub end_problem { Line 426  sub end_problem {
       $result.="</body>\n";        $result.="</body>\n";
   }    }
       }        }
       if ($target ne 'tex') {        if ($target eq 'web') {
   $result.=&Apache::lonxml::xmlend();    $result.=&Apache::lonxml::xmlend();
       } else {        } elsif ($target eq 'tex') {
       $result .= '\vskip 0.5mm\noindent\makebox[\textwidth/$number_of_columns][b]{\hrulefill}';    $result .= '\vskip 0.5mm\noindent\makebox[\textwidth/$number_of_columns][b]{\hrulefill}';
       if (not $ENV{'request.symb'} =~ m/\.page_/) {    if (not $ENV{'request.symb'} =~ m/\.page_/) {
   $result .= '\end{minipage}\end{document} ';        $result .= '\end{minipage}\end{document} ';
       } else {    } else {
   $result .= '';        $result .= '';
       }    }
       }        }
     }      }
     if ($target eq 'grade') {       if ($target eq 'grade') { 
Line 502  sub start_block { Line 504  sub start_block {
  if ($code) {   if ($code) {
     $code =~ s/\"//g;      $code =~ s/\"//g;
     $code .=';return $condition;';      $code .=';return $condition;';
       if (!$Apache::lonxml::default_homework_loaded) {
    &Apache::lonxml::default_homework_load($safeeval);
       }
     $result = &Apache::run::run($code,$safeeval);      $result = &Apache::run::run($code,$safeeval);
     &Apache::lonxml::debug("block :$code: returned :$result:");      &Apache::lonxml::debug("block :$code: returned :$result:");
  } else {   } else {
Line 537  sub start_while { Line 542  sub start_while {
   $code .=';return $condition;';    $code .=';return $condition;';
   
   push( @Apache::structuretags::whileconds, $code);     push( @Apache::structuretags::whileconds, $code); 
     if (!$Apache::lonxml::default_homework_loaded) {
         &Apache::lonxml::default_homework_load($safeeval);
     }
   my $result = &Apache::run::run($code,$safeeval);    my $result = &Apache::run::run($code,$safeeval);
   my $bodytext=$$parser[$#$parser]->get_text("/while");    my $bodytext=$$parser[$#$parser]->get_text("/while");
   push( @Apache::structuretags::whilebody, $bodytext);    push( @Apache::structuretags::whilebody, $bodytext);
Line 687  sub end_part { Line 695  sub end_part {
   my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_;    my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_;
   &Apache::lonxml::debug("in end_part $target ");    &Apache::lonxml::debug("in end_part $target ");
   my $status=$Apache::inputtags::status['-1'];    my $status=$Apache::inputtags::status['-1'];
   pop @Apache::inputtags::status;    my $result='';
   if ( $target eq 'meta' ) { return ''; }    if ( $target eq 'meta' ) {
   if ( $target eq 'grade' && $status eq 'CAN_ANSWER') {        $result='';
     return &Apache::inputtags::grade;    } elsif ( $target eq 'grade' && $status eq 'CAN_ANSWER') {
   }      $result=&Apache::inputtags::grade;
   if ($target eq 'web' || $target eq 'tex' ) {    } elsif ($target eq 'web' || $target eq 'tex' ) {
     my $gradestatus=&Apache::inputtags::gradestatus($Apache::inputtags::part,$target);      my $gradestatus=&Apache::inputtags::gradestatus($Apache::inputtags::part,
       $target);
     if ($Apache::lonhomework::type eq 'exam') {$gradestatus='';}      if ($Apache::lonhomework::type eq 'exam') {$gradestatus='';}
     return $gradestatus;      $result=$gradestatus;
   }    }
   return '';    pop @Apache::inputtags::status;
     return $result;
 }  }
   
 sub start_preduedate {  sub start_preduedate {

Removed from v.1.136  
changed lines
  Added in v.1.141


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