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

albertel lon-capa-cvs@mail.lon-capa.org
Fri, 07 Oct 2005 13:56:21 -0000


albertel		Fri Oct  7 09:56:21 2005 EDT

  Modified files:              
    /loncom/homework	structuretags.pm 
  Log:
  - refactoring out some static strings
  
  
Index: loncom/homework/structuretags.pm
diff -u loncom/homework/structuretags.pm:1.303 loncom/homework/structuretags.pm:1.304
--- loncom/homework/structuretags.pm:1.303	Fri Sep 23 16:39:35 2005
+++ loncom/homework/structuretags.pm	Fri Oct  7 09:56:19 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.303 2005/09/23 20:39:35 albertel Exp $
+# $Id: structuretags.pm,v 1.304 2005/10/07 13:56:19 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -436,6 +436,11 @@
 	@Apache::inputtags::partlist=();
 	$Apache::lonhomework::problemstatus='';	
 	$Apache::lonhomework::ignore_response_errors=1;
+    } elsif ($type eq 'Task') {
+	$Apache::inputtags::part='0';
+	@Apache::inputtags::partlist=('0');
+	$Apache::lonhomework::problemstatus='';	
+	$Apache::lonhomework::ignore_response_errors=1;
     }
     @Apache::inputtags::responselist = ();
     @Apache::inputtags::importlist = ();
@@ -662,14 +667,18 @@
 	    my $due_file_content = $due_file_content[$#due_file_content];
 	    chomp $due_file_content;
 	    my $name_of_resourse= &Apache::lonxml::latex_special_symbols(&get_resource_name($parstack,$safeeval),'header');
+	    my $begin_doc='\begin{document} \typeout{STAMPOFPASSEDRESOURCESTART Resource <h2>"'.$name_of_resourse.'"</h2> located in <br /><small><b>'.$env{'request.uri'}.'</b></small><br /> STAMPOFPASSEDRESOURCEEND} \noindent ';
+	    my $toc_line='\vskip 1 mm\noindent '.$startminipage.
+		'\addcontentsline{toc}{subsection}{'.$name_of_resourse.'}';
 	    if ($due_file_content ne $duedate) {
 		$temp_file = Apache::File->new('>'.$filename);
 		print $temp_file "$duedate\n";
 		if (not $env{'request.symb'} =~ m/\.page_/) {
 		    if(not $duedate=~m/1969/ and $Apache::lonhomework::type ne 'exam') {
-			$result .= '\begin{document} \typeout{STAMPOFPASSEDRESOURCESTART Resource <h2>"'.$name_of_resourse.'"</h2> located in <br /><small><b>'.$env{'request.uri'}.'</b></small><br /> STAMPOFPASSEDRESOURCEEND} \noindent\textit{Due date: '.$duedate.'} \vskip 1 mm\noindent '.$startminipage.'\addcontentsline{toc}{subsection}{'.$name_of_resourse.'}';	
+			$result .= $begin_doc.
+			    '\textit{Due date: '.$duedate.'} '.$toc_line;
 		    } else {
-			$result .= '\begin{document} \typeout{STAMPOFPASSEDRESOURCESTART Resource <h2>"'.$name_of_resourse.'"</h2> located in <br /><small><b>'.$env{'request.uri'}.'</b></small><br /> STAMPOFPASSEDRESOURCEEND} \noindent \vskip 1 mm \noindent'.$startminipage.'\addcontentsline{toc}{subsection}{'.$name_of_resourse.'}';
+			$result .= $begin_doc.$toc_line;
 			if ($Apache::lonhomework::type eq 'exam' and $allow_print_points==1) { $result .= '\fbox{\textit{'.$weight.' pt}}';}
 		    }
 		} else {
@@ -677,7 +686,7 @@
 		}
 	    } else {
 		if (not $env{'request.symb'} =~ m/\.page_/) {
-		    $result .= '\begin{document} \typeout{STAMPOFPASSEDRESOURCESTART Resource <h2>"'.$name_of_resourse.'"</h2> located in <br /><small><b>'.$env{'request.uri'}.'</b></small><br /> STAMPOFPASSEDRESOURCEEND} \noindent \vskip 1 mm\noindent'.$startminipage.'\addcontentsline{toc}{subsection}{'.$name_of_resourse.'}';	
+		    $result .= $begin_doc.$toc_line;
 		    if (($Apache::lonhomework::type eq 'exam') and ($allow_print_points==1)) { $result .= '\fbox{\textit{'.$weight.' pt}}';}
 		} else {
 		    $result .= '\vskip 1mm \\\\\\\\';