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

albertel lon-capa-cvs@mail.lon-capa.org
Tue, 01 Mar 2005 03:21:58 -0000


albertel		Mon Feb 28 22:21:58 2005 EDT

  Modified files:              
    /loncom/xml	lonxml.pm londefdef.pm 
    /loncom/homework	structuretags.pm 
  Log:
  - jsMath mode works on HW problems in a course
  - jsMath works in FDBK
  
  
Index: loncom/xml/lonxml.pm
diff -u loncom/xml/lonxml.pm:1.359 loncom/xml/lonxml.pm:1.360
--- loncom/xml/lonxml.pm:1.359	Mon Feb 28 17:21:40 2005
+++ loncom/xml/lonxml.pm	Mon Feb 28 22:21:58 2005
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # XML Parser Module 
 #
-# $Id: lonxml.pm,v 1.359 2005/02/28 22:21:40 albertel Exp $
+# $Id: lonxml.pm,v 1.360 2005/03/01 03:21:58 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -184,7 +184,7 @@
 	&Apache::lonxml::newparser($parser,\$discussion,'');
 	return '';
     } else {
-	return $discussion.'</html>';
+	return $discussion.&Apache::loncommon::endbodytag();
     }
 }
 
Index: loncom/xml/londefdef.pm
diff -u loncom/xml/londefdef.pm:1.258 loncom/xml/londefdef.pm:1.259
--- loncom/xml/londefdef.pm:1.258	Fri Feb 25 00:54:01 2005
+++ loncom/xml/londefdef.pm	Mon Feb 28 22:21:58 2005
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Tags Default Definition Module 
 #
-# $Id: londefdef.pm,v 1.258 2005/02/25 05:54:01 albertel Exp $
+# $Id: londefdef.pm,v 1.259 2005/03/01 03:21:58 albertel Exp $
 # 
 #
 # Copyright Michigan State University Board of Trustees
@@ -184,7 +184,7 @@
     my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_;
     my $currentstring = '';
     if ($target eq 'web') {
-	$currentstring = &Apache::lonxml::xmlend($target,$parser);
+	$currentstring = '</html>';
     }
     return $currentstring;
 }
@@ -564,10 +564,10 @@
 }
 
 sub end_body {
-    my ($target,$token) = @_;
+    my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_;
     my $currentstring = '';
     if ($target eq 'web') {
-	$currentstring = $token->[2];     
+	$currentstring = &Apache::lonxml::xmlend($target,$parser);
     } elsif ($target eq 'tex') {
 	$currentstring = '\strut\newline\noindent\makebox[\textwidth/$number_of_columns][b]{\hrulefill}\newline\noindent \end{document}';  
     } 
Index: loncom/homework/structuretags.pm
diff -u loncom/homework/structuretags.pm:1.280 loncom/homework/structuretags.pm:1.281
--- loncom/homework/structuretags.pm:1.280	Thu Feb 24 23:56:05 2005
+++ loncom/homework/structuretags.pm	Mon Feb 28 22:21:58 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.280 2005/02/25 04:56:05 albertel Exp $
+# $Id: structuretags.pm,v 1.281 2005/03/01 03:21:58 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -115,6 +115,12 @@
 	    $body_tag_start.=' style="font-size: x-large;" ';
 	}
 	$body_tag_start.='>'.&Apache::lonmenu::menubuttons(undef,$target,1);
+	if ($ENV{'environment.texengine'} eq 'jsMath') {
+	    $body_tag_start.='<script type="text/javascript">
+                     function NoFontMessage () {}
+                   </script>'."\n".
+		       '<script src="/adm/jsMath/jsMath.js"></script>'."\n";
+	}
 	if ($target eq 'web' && $ENV{'request.state'} ne 'construct') {
 	    my ($symb,undef,undef,undef,$publicuser)=
 		&Apache::lonxml::whichuser();
@@ -128,7 +134,7 @@
     }
     my $form_tag_start;
     if (!defined($found{'form'})) {
-	$form_tag_start='<form name="lonhomework" enctype="multipart/form-data" method="post" action="';
+	$form_tag_start='<form name="lonhomework" enctype="multipart/form-data" method="POST" action="';
 	my $uri=$ENV{'request.uri'};
 	if ($ENV{'request.enc'}) { $uri=&Apache::lonenc::encrypted($uri); }
 	$form_tag_start.=$uri.'">';
@@ -241,11 +247,11 @@
               <input type="text" name="rndseed" size="10" value="'.
 	       $rndseed.'"
            onchange="javascript:document.lonhomework.changerandseed.click()" /></nobr>
-             <input type="checkbox" name="showallfoils" ';
+             <label><input type="checkbox" name="showallfoils" ';
     if (defined($ENV{'form.showallfoils'})) { $result.='checked="on"'; }
     $result.= ' />'.&mt('&nbsp;Show&nbsp;All&nbsp;Foils').
 	&Apache::loncommon::help_open_topic('Problem_Editor_Testing_Area','Testing Problems').
-	'<hr />';
+	'</label><hr />';
     $result.="
 <nobr>
 Problem Status:
@@ -343,7 +349,7 @@
 <font color="red">
 <p>$lt{'warning'}</p>
 </font>
-<form name="checkout" method="post" action="$ENV{'request.uri'}">
+<form name="checkout" method="POST" action="$ENV{'request.uri'}">
 <input type="hidden" name="doescheckout" value="yes" />
 <input type="button" name="checkoutbutton" value="$lt{'checkout'}" onClick="javascript:if (confirm('$lt{'checkout?'}')) { document.checkout.submit(); }" />
 </form>
@@ -357,7 +363,7 @@
     &Apache::lonxml::debug("map is $map title is $foldertitle");
     return (<<ENDCHECKOUT);
 <h2>The resources in "$foldertitle" are open for a limited time. Once you click the 'Show Resource' button below you have $time to complete all resources "$foldertitle".</h2>
-<form name="markaccess" method="post" action="$ENV{'request.uri'}">
+<form name="markaccess" method="POST" action="$ENV{'request.uri'}">
 <input type="hidden" name="markaccess" value="yes" />
 <input type="button" name="accessbutton" value="Show Resource" onClick="javascript:if (confirm('Start Timer?')) { document.markaccess.submit(); }" />
 </form>
@@ -666,10 +672,9 @@
 		$ENV{'form.answer_output_mode'} ne 'tex') {
 		$result.="</form>";
 		$result.=&Apache::lonhtmlcommon::htmlareaselectactive(@Apache::lonxml::htmlareafields);
-		$result.=&Apache::loncommon::endbodytag();
 	    }
 	    if ($target eq 'web') {
-		$result.=&Apache::lonxml::xmlend();
+		$result.=&Apache::lonxml::xmlend().'</html>';
 	    } elsif ($target eq 'tex') {
 		my $endminipage = '';
 		if (not $ENV{'form.problem_split'}=~/yes/) {