Diff for /loncom/homework/structuretags.pm between versions 1.148 and 1.149

version 1.148, 2003/02/14 21:22:04 version 1.149, 2003/02/25 21:49:45
Line 666  sub start_part { Line 666  sub start_part {
   $Apache::inputtags::part=$id;    $Apache::inputtags::part=$id;
   @Apache::inputtags::responselist = ();    @Apache::inputtags::responselist = ();
   @Apache::inputtags::previous=();    @Apache::inputtags::previous=();
     my $hidden=&Apache::loncommon::check_if_partid_hidden($Apache::inputtags::part);
   
   if ($target eq 'meta') {    if ($target eq 'meta') {
     return &Apache::response::mandatory_part_meta;      return &Apache::response::mandatory_part_meta;
   } elsif ($target eq 'web' || $target eq 'grade' || $target eq 'answer' || $target eq 'tex') {    } elsif ($target eq 'web' || $target eq 'grade' ||
     my ($status,$accessmsg) = &Apache::lonhomework::check_access($id);     $target eq 'answer' || $target eq 'tex') {
     push (@Apache::inputtags::status,$status);        if ($hidden) {
     my $expression='$external::datestatus="'.$status.'";';    my $bodytext=&Apache::lonxml::get_all_text("/part",$parser);
     $expression.='$external::gradestatus="'.$Apache::lonhomework::history{"resource.$id.solved"}.'";';        } else {
     &Apache::run::run($expression,$safeeval);    my ($status,$accessmsg) = &Apache::lonhomework::check_access($id);
     if ( $status eq 'CLOSED' ) {    push (@Apache::inputtags::status,$status);
       my $bodytext=&Apache::lonxml::get_all_text("/part",$parser);    my $expression='$external::datestatus="'.$status.'";';
       if ( $target eq "web" ) {    $expression.='$external::gradestatus="'.$Apache::lonhomework::history{"resource.$id.solved"}.'";';
  $result="<br />Part is not open to be viewed. It $accessmsg<br />";    &Apache::run::run($expression,$safeeval);
       } elsif ( $target eq 'tex' ) {    if ( $status eq 'CLOSED' ) {
  $result="\\end{minipage}\\vskip 0 mm Part is not open to be viewed. It $accessmsg \\\\\\begin{minipage}{\\textwidth}";        my $bodytext=&Apache::lonxml::get_all_text("/part",$parser);
       }        if ( $target eq "web" ) {
     } else {    $result="<br />Part is not open to be viewed. It $accessmsg<br />";
       if ($target eq 'tex') {        } elsif ( $target eq 'tex' ) {
  if ($$tagstack[-2] ne 'problem') {    $result="\\end{minipage}\\vskip 0 mm Part is not open to be viewed. It $accessmsg \\\\\\begin{minipage}{\\textwidth}";
   $result.='\noindent \end{minipage}\vskip 0 mm \noindent \begin{minipage}{\textwidth}\noindent';        }
  }    } else {
         if ($target eq 'tex') {
     if ($$tagstack[-2] ne 'problem') {
         $result.='\noindent \end{minipage}\vskip 0 mm \noindent \begin{minipage}{\textwidth}\noindent';
     }
         }
     }
       }        }
     }  
   } elsif ($target eq 'edit') {    } elsif ($target eq 'edit') {
       $result.=&Apache::edit::tag_start($target,$token);        $result.=&Apache::edit::tag_start($target,$token);
       $result.=&Apache::edit::text_arg('Part ID:','id',$token).        $result.=&Apache::edit::text_arg('Part ID:','id',$token).
Line 709  sub end_part { Line 716  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'];
     my $hidden=&Apache::loncommon::check_if_partid_hidden($Apache::inputtags::part);
   my $result='';    my $result='';
   if ( $target eq 'meta' ) {    if ( $target eq 'meta' ) {
       $result='';        $result='';
   } elsif ( $target eq 'grade' && $status eq 'CAN_ANSWER') {    } elsif ( $target eq 'grade' && $status eq 'CAN_ANSWER' && !$hidden) {
     $result=&Apache::inputtags::grade;      $result=&Apache::inputtags::grade;
   } elsif ($target eq 'web' || $target eq 'tex' ) {    } elsif (($target eq 'web' || $target eq 'tex') && !$hidden ) {
     my $gradestatus=&Apache::inputtags::gradestatus($Apache::inputtags::part,      my $gradestatus=&Apache::inputtags::gradestatus($Apache::inputtags::part,
     $target);      $target);
     if ($Apache::lonhomework::type eq 'exam') {$gradestatus='';}      if ($Apache::lonhomework::type eq 'exam') {$gradestatus='';}

Removed from v.1.148  
changed lines
  Added in v.1.149


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