Diff for /loncom/homework/structuretags.pm between versions 1.57 and 1.62

version 1.57, 2001/08/17 16:50:04 version 1.62, 2001/08/20 15:56:47
Line 2 Line 2
 # definition of tags that give a structure to a document  # definition of tags that give a structure to a document
 # 2/19 Guy  # 2/19 Guy
 # 6/26/2001 fixed extra web display at end of <web></web> tags  # 6/26/2001 fixed extra web display at end of <web></web> tags
 # 8/17 Gerd Kortemeyer  # 8/17,8/18,8/20 Gerd Kortemeyer
   
 package Apache::structuretags;   package Apache::structuretags; 
   
Line 82  sub start_problem { Line 82  sub start_problem {
       &Apache::lonxml::debug("Using default type, problem, :$uri:");        &Apache::lonxml::debug("Using default type, problem, :$uri:");
     }      }
   }    }
   
 #adeed vars to the scripting enviroment  #adeed vars to the scripting enviroment
   my $expression='$external::part='.$Apache::inputtags::part.';';    my $expression='$external::part='.$Apache::inputtags::part.';';
   &Apache::run::run($expression,$safeeval);    &Apache::run::run($expression,$safeeval);
Line 92  sub start_problem { Line 93  sub start_problem {
   my ($result,$head_tag_start,$body_tag_start)=    my ($result,$head_tag_start,$body_tag_start)=
     &page_start($target,$token,$tagstack,$parstack,$parser,$safeeval);      &page_start($target,$token,$tagstack,$parstack,$parser,$safeeval);
   
   if ($target eq 'web') {    if ($Apache::lonhomework::type eq 'exam') {
       if ($ENV{'form.doescheckout'}) {        if ($target eq 'web') {
   $body_tag_start.=&Apache::lonxml::maketoken('web');            my $token=$Apache::lonhomework::history{"resource.0.outtoken"};
             if (($ENV{'form.doescheckout'}) && (!$token)) {
        $token=&Apache::lonxml::maketoken();
                $Apache::lonhomework::history{"resource.0.outtoken"}=$token;
             }
             $body_tag_start.=&Apache::lonxml::printtokenheader($target,$token);
             if ($ENV{'user.adv'}) {
         $body_tag_start.=&Apache::lonxml::tokeninputfield;
             }
         }
         if ($target eq 'meta') {
        
     return (<<ENDSTORES);
   <stores part="0" name="outtoken" type="string" 
    display="Document ID checked out"></stores>
   <stores part="0" name="checkouttime" type="date"
    display="Time checked out"></stores>
   <stores part="0" name="outremote" type="string" 
    display="Client IP checked out from"></stores>
   
   <stores part="0" name="intoken" type="string" 
    display="Document ID checked in"></stores>
   <stores part="0" name="checkintime" type="date"
    display="Time checked in"></stores>
   <stores part="0" name="inremote" type="string" 
    display="Client IP checked in from"></stores>
   ENDSTORES
       }        }
   }    }
   if ($target eq 'web' || $target eq 'grade') {    if ($target eq 'web' || $target eq 'grade') {
Line 123  Checking out resources is subject to cou Line 150  Checking out resources is subject to cou
 credit even if done erroneously.<p />  credit even if done erroneously.<p />
 </font>    </font>  
 <form method=post>  <form method=post>
 <input type=submit name="doescheckout"   <input type=button name="doescheckout" 
 value="Check out Exam for Viewing" />  value="Check out Exam for Viewing" 
   onClick="if (confirm('Check out Exam?')) { this.form.submit(); }" />
 </form>  </form>
 ENDCHECKOUT  ENDCHECKOUT
         }          }

Removed from v.1.57  
changed lines
  Added in v.1.62


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