Diff for /loncom/homework/structuretags.pm between versions 1.127 and 1.132

version 1.127, 2002/10/15 14:37:59 version 1.132, 2002/11/06 23:05:02
Line 141  sub problem_edit_header { Line 141  sub problem_edit_header {
        <input type="submit" name="problemmode" value="EditXML" />         <input type="submit" name="problemmode" value="EditXML" />
        <input type="submit" name="Undo" value="undo" /> <hr />         <input type="submit" name="Undo" value="undo" /> <hr />
        <input type="submit" name="submit" value="Submit Changes" />         <input type="submit" name="submit" value="Submit Changes" />
        <input type="submit" name="submit" value="Submit Changes and View" /><br />         <input type="submit" name="submit" value="Submit Changes and View" /><br /><p>&nbsp;</p>
       ';        ';
 }  }
   
Line 169  sub problem_web_to_edit_header { Line 169  sub problem_web_to_edit_header {
   #$result.= '<input type="submit" name="problemmode" value="Answer Distribution" />    #$result.= '<input type="submit" name="problemmode" value="Answer Distribution" />
 #             <input type="text" name="numtoanalyze" value="'.  #             <input type="text" name="numtoanalyze" value="'.
 # $numtoanalyze.'" size="5" /> <hr />';  # $numtoanalyze.'" size="5" /> <hr />';
     return $result;
 }  }
   
 sub initialize_storage {  sub initialize_storage {
Line 289  sub start_problem { Line 290  sub start_problem {
     my $expression='$external::datestatus="'.$status.'";';      my $expression='$external::datestatus="'.$status.'";';
     $expression.='$external::gradestatus="'.$Apache::lonhomework::history{"resource.0.solved"}.'";';      $expression.='$external::gradestatus="'.$Apache::lonhomework::history{"resource.0.solved"}.'";';
     &Apache::run::run($expression,$safeeval);      &Apache::run::run($expression,$safeeval);
       &Apache::lonxml::debug("Got $status");
     if (( $status eq 'CLOSED' ) ||      if (( $status eq 'CLOSED' ) ||
         ( $status eq 'UNCHECKEDOUT') ||          ( $status eq 'UNCHECKEDOUT') ||
         ( $status eq 'BANNED')) {          ( $status eq 'BANNED')) {
       my $bodytext=&Apache::lonxml::get_all_text("/problem",$$parser[$#$parser]);        my $bodytext=&Apache::lonxml::get_all_text("/problem",$parser);
       if ( $target eq "web" ) {        if ( $target eq "web" ) {
  $result.= $head_tag_start.'</head>';   $result.= $head_tag_start.'</head>';
         my $msg=$body_tag_start.          my $msg=$body_tag_start.
Line 480  sub end_library { Line 482  sub end_library {
 }  }
   
 sub start_block {  sub start_block {
   my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_;      my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_;
   
       my $result;
   
   if ($target eq 'web' || $target eq 'grade' || $target eq 'answer' || $target eq 'tex' || $target eq 'analyze') {      if ($target eq 'web' || $target eq 'grade' || $target eq 'answer' || 
     my $code = @$parstack[$#$parstack];   $target eq 'tex' || $target eq 'analyze') {
     $code =~ s/\"//g;   my $code = @$parstack[$#$parstack];
     $code .=';return $condition;';   if ($code) {
     #  print "<br />$code<br />";      $code =~ s/\"//g;
     my $result = &Apache::run::run($code,$safeeval);      $code .=';return $condition;';
     &Apache::lonxml::debug("block :$code: returned :$result:");      $result = &Apache::run::run($code,$safeeval);
     if ( ! $result ) {       &Apache::lonxml::debug("block :$code: returned :$result:");
       my $skip=&Apache::lonxml::get_all_text("/block",$$parser[$#$parser]);   } else {
       &Apache::lonxml::debug("skipping ahead :$skip: $$parser[$#$parser]");      $result='1';
    }
    if ( ! $result ) {
       my $skip=&Apache::lonxml::get_all_text("/block",$$parser[-1]);
       &Apache::lonxml::debug("skipping ahead :$skip: $$parser[-1]");
    }
    $result='';
       } elsif ($target eq 'edit') {
    $result .=&Apache::edit::tag_start($target,$token);
    $result .=&Apache::edit::text_arg('Test Condition:','condition',
     $token,40);
    $result .=&Apache::edit::end_row().&Apache::edit::start_spanning_row();
       } elsif ($target eq 'modified') {
    my $constructtag=&Apache::edit::get_new_args($token,$parstack,
        $safeeval,'condition');
    if ($constructtag) { $result = &Apache::edit::rebuild_tag($token); }
     }      }
   }      return $result;
   return "";  
 }  }
   
 sub end_block {  sub end_block {
Line 633  sub start_part { Line 651  sub start_part {
       }        }
     } else {      } else {
       if ($target eq 'tex') {        if ($target eq 'tex') {
  $result='\noindent \end{minipage}\vskip 0 mm \noindent \begin{minipage}{\textwidth}\noindent';   if ($$tagstack[-2] ne 'problem') {
     $result.='\noindent \end{minipage}\vskip 0 mm \noindent \begin{minipage}{\textwidth}\noindent';
    }
       }        }
     }      }
   }    }
Line 755  sub start_endouttext { Line 775  sub start_endouttext {
   my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_;    my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_;
   my $result='';    my $result='';
   if ($target eq "edit" ) { $result="</td></tr>".&Apache::edit::end_table()."\n"; }    if ($target eq "edit" ) { $result="</td></tr>".&Apache::edit::end_table()."\n"; }
   if ($target eq "modified") { $result='<endouttext />'; }    if ($target eq "modified") { 
        $result='<endouttext />'.
        &Apache::edit::handle_insertafter('startouttext'); }
   return $result;    return $result;
 }  }
 sub end_endouttext {  sub end_endouttext {

Removed from v.1.127  
changed lines
  Added in v.1.132


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