[LON-CAPA-cvs] cvs: loncom /homework structuretags.pm

albertel lon-capa-cvs@mail.lon-capa.org
Tue, 20 Sep 2005 06:40:33 -0000


albertel		Tue Sep 20 02:40:33 2005 EDT

  Modified files:              
    /loncom/homework	structuretags.pm 
  Log:
  - adding a <label>
  - <preduedate> is true when scantronmode is on adn <postanswerdate> is false
  
  
Index: loncom/homework/structuretags.pm
diff -u loncom/homework/structuretags.pm:1.299 loncom/homework/structuretags.pm:1.300
--- loncom/homework/structuretags.pm:1.299	Thu Sep  1 14:21:47 2005
+++ loncom/homework/structuretags.pm	Tue Sep 20 02:40:30 2005
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA 
 # definition of tags that give a structure to a document
 #
-# $Id: structuretags.pm,v 1.299 2005/09/01 18:21:47 albertel Exp $
+# $Id: structuretags.pm,v 1.300 2005/09/20 06:40:30 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -566,11 +566,12 @@
                              value="'.$env{'form.username'}.'" />';
 	    if ($env{'user.adv'}) {
 		$form_tag_start.=
-		    ' <input type="checkbox" name="showallfoils" ';
+		    ' <label><input type="checkbox" name="showallfoils" ';
 		if (defined($env{'form.showallfoils'})) {
 		    $form_tag_start.='checked="on"';
 		}
-		$form_tag_start.= ' />'.&mt('&nbsp;Show&nbsp;All&nbsp;Foils');
+		$form_tag_start.= ' />'.&mt('&nbsp;Show&nbsp;All&nbsp;Foils').
+		    '</label>';
 	    }
 	    $form_tag_start.='<hr />';
 	}
@@ -1271,7 +1272,8 @@
     my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_;
     if ($target eq 'web' || $target eq 'grade' || $target eq 'answer' || $target eq 'tex') {
 	&Apache::lonxml::debug("State in preduedate is ". $Apache::inputtags::status['-1']);
-	if ($Apache::inputtags::status['-1'] ne 'CAN_ANSWER' &&
+	if (!$Apache::lonhomework::scantronmode &&
+	    $Apache::inputtags::status['-1'] ne 'CAN_ANSWER' &&
 	    $Apache::inputtags::status['-1'] ne 'CANNOT_ANSWER') {
 	    &Apache::lonxml::debug("Wha? ". ($Apache::inputtags::status['-1'] ne 'SHOW_ANSWER'));
 	    &Apache::lonxml::get_all_text("/preduedate",$parser);
@@ -1287,7 +1289,8 @@
 sub start_postanswerdate {
     my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_;
     if ($target eq 'web' || $target eq 'grade') {
-	if ($Apache::inputtags::status['-1'] ne 'SHOW_ANSWER') {
+	if ($Apache::lonhomework::scantronmode ||
+	    $Apache::inputtags::status['-1'] ne 'SHOW_ANSWER') {
 	    &Apache::lonxml::get_all_text("/postanswerdate",$parser);
 	}
     } elsif ($target eq 'tex') {