Diff for /loncom/homework/structuretags.pm between versions 1.67 and 1.68

version 1.67, 2001/09/14 20:17:35 version 1.68, 2001/09/18 02:21:13
Line 152  sub start_problem { Line 152  sub start_problem {
     &page_start($target,$token,$tagstack,$parstack,$parser,$safeeval);      &page_start($target,$token,$tagstack,$parstack,$parser,$safeeval);
   
   
   if ($target eq 'web' || $target eq 'grade') {    if ($target eq 'web' || $target eq 'grade' || $target eq 'answer') {
     #handle exam checkout      #handle exam checkout
     if ($Apache::lonhomework::type eq 'exam') {      if ($Apache::lonhomework::type eq 'exam') {
       my $token=$Apache::lonhomework::history{"resource.0.outtoken"};        my $token=$Apache::lonhomework::history{"resource.0.outtoken"};
Line 252  sub end_problem { Line 252  sub end_problem {
   my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_;    my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_;
   my $result='';    my $result='';
   my $status=$Apache::inputtags::status['-1'];    my $status=$Apache::inputtags::status['-1'];
   if ($target eq 'grade' || $target eq 'web' ) {    if ($target eq 'grade' || $target eq 'web' || $target eq 'answer' ) {
     if ( $target eq 'grade' && $Apache::inputtags::part eq '0' &&      if ( $target eq 'grade' && $Apache::inputtags::part eq '0' &&
        $status eq 'CAN_ANSWER') {         $status eq 'CAN_ANSWER') {
       # if part is zero, no <part>s existed, so we need to the grading        # if part is zero, no <part>s existed, so we need to the grading
       &Apache::inputtags::grade;        &Apache::inputtags::grade;
     } elsif ($Apache::inputtags::part eq '0') {      } elsif ( $target eq 'web' && $Apache::inputtags::part eq '0') {
       # if part is zero, no <part>s existed, so we need show the current         # if part is zero, no <part>s existed, so we need show the current 
       # grading status        # grading status
       $result.= &Apache::inputtags::gradestatus($Apache::inputtags::part);        $result.= &Apache::inputtags::gradestatus($Apache::inputtags::part);
     }      }
     if ($target eq 'web') {       if (
    ($target eq 'web' && ($ENV{'request.state'} ne 'construct')) ||
    ($target eq 'answer')
          ) {
       if ($status eq 'CAN_ANSWER') {        if ($status eq 'CAN_ANSWER') {
  $result.="</form></body>\n";    $result.="</form></body>\n"; 
       } elsif ($status eq 'SHOW_ANSWER' || $status eq 'CANNOT_ANSWER') {        } elsif ($status eq 'SHOW_ANSWER' || $status eq 'CANNOT_ANSWER') {
Line 321  sub end_library { Line 324  sub end_library {
 sub start_block {  sub start_block {
   my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_;    my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_;
   
   if ($target eq 'web' || $target eq 'grade') {    if ($target eq 'web' || $target eq 'grade' || $target eq 'answer') {
     my $code = @$parstack[$#$parstack];      my $code = @$parstack[$#$parstack];
     $code =~ s/\"//g;      $code =~ s/\"//g;
     $code .=';return $condition;';      $code .=';return $condition;';
Line 435  sub start_part { Line 438  sub start_part {
   @Apache::inputtags::previous=();    @Apache::inputtags::previous=();
   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') {    } elsif ($target eq 'web' || $target eq 'grade' || $target eq 'answer') {
     my ($status,$accessmsg) = &Apache::lonhomework::check_access($id);      my ($status,$accessmsg) = &Apache::lonhomework::check_access($id);
     push (@Apache::inputtags::status,$status);      push (@Apache::inputtags::status,$status);
     my $expression='$external::datestatus="'.$status.'";';      my $expression='$external::datestatus="'.$status.'";';
Line 468  sub end_part { Line 471  sub end_part {
   
 sub start_preduedate {  sub start_preduedate {
   my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_;    my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_;
   if ($target eq 'web' || $target eq 'grade') {    if ($target eq 'web' || $target eq 'grade' || $target eq 'answer') {
     if ($Apache::inputtags::status['-1'] ne 'CAN_ANSWER' &&      if ($Apache::inputtags::status['-1'] ne 'CAN_ANSWER' &&
  $Apache::inputtags::status['-1'] ne 'CANNOT_ANSWER' ) {   $Apache::inputtags::status['-1'] ne 'CANNOT_ANSWER' ) {
       &Apache::lonxml::get_all_text("/preduedate",$$parser[$#$parser]);        &Apache::lonxml::get_all_text("/preduedate",$$parser[$#$parser]);
Line 497  sub end_postanswerdate { Line 500  sub end_postanswerdate {
   
 sub start_notsolved {  sub start_notsolved {
   my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_;    my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_;
   if ($target eq 'web' || $target eq 'grade') {    if ($target eq 'web' || $target eq 'grade' || $target eq 'answer') {
     my $gradestatus=$Apache::lonhomework::history{"resource.$Apache::inputtags::part.solved"};      my $gradestatus=$Apache::lonhomework::history{"resource.$Apache::inputtags::part.solved"};
     &Apache::lonxml::debug("not solved has :$gradestatus:");      &Apache::lonxml::debug("not solved has :$gradestatus:");
     if ($gradestatus =~ /^correct/) {      if ($gradestatus =~ /^correct/) {
Line 514  sub end_notsolved { Line 517  sub end_notsolved {
   
 sub start_solved {  sub start_solved {
   my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_;    my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_;
   if ($target eq 'web' || $target eq 'grade') {    if ($target eq 'web' || $target eq 'grade' || $target eq 'answer') {
     my $gradestatus=$Apache::lonhomework::history{"resource.$Apache::inputtags::part.solved"};      my $gradestatus=$Apache::lonhomework::history{"resource.$Apache::inputtags::part.solved"};
     if ($gradestatus !~ /^correct/) {      if ($gradestatus !~ /^correct/) {
       &Apache::lonxml::get_all_text("/solved",$$parser[$#$parser]);        &Apache::lonxml::get_all_text("/solved",$$parser[$#$parser]);

Removed from v.1.67  
changed lines
  Added in v.1.68


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