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

sakharuk lon-capa-cvs@mail.lon-capa.org
Thu, 27 Feb 2003 21:20:48 -0000


sakharuk		Thu Feb 27 16:20:48 2003 EDT

  Modified files:              
    /loncom/homework	essayresponse.pm 
  Log:
   Atomated the printing of "Leave blank on scoring form" message (it's number)
  for the bubble exam.
  
  
Index: loncom/homework/essayresponse.pm
diff -u loncom/homework/essayresponse.pm:1.24 loncom/homework/essayresponse.pm:1.25
--- loncom/homework/essayresponse.pm:1.24	Thu Feb 27 12:00:08 2003
+++ loncom/homework/essayresponse.pm	Thu Feb 27 16:20:48 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # essay (ungraded) style responses
 #
-# $Id: essayresponse.pm,v 1.24 2003/02/27 17:00:08 sakharuk Exp $
+# $Id: essayresponse.pm,v 1.25 2003/02/27 21:20:48 sakharuk Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -132,10 +132,16 @@
 	$result.=&Apache::edit::end_table();
     } elsif ($target eq 'tex') {
 	if ($Apache::lonhomework::type eq 'exam') {
-	    $result.='\begin{enumerate}\item[\textbf{'.$Apache::lonxml::counter.'}.]\textit{Leave blank on scoring form}\vskip 0 mm';
-	    &Apache::lonxml::increment_counter();
-	    $result.= '\item[\textbf{'.$Apache::lonxml::counter.'}.]\textit{Leave blank on scoring form}\vskip 0 mm \end{enumerate}';
-	    &Apache::lonxml::increment_counter();
+	    my $id = $Apache::inputtags::part;
+	    my $weight = &Apache::lonnet::EXT("resource.$id.weight");
+            my $repetition = int $weight/9;
+	    if ($weight % 9 != 0) {$repetition++;} 
+	    $result.='\begin{enumerate}';
+	    for (my $i=0;$i<$repetition;$i++) {
+		$result.='\item[\textbf{'.$Apache::lonxml::counter.'}.]\textit{Leave blank on scoring form}\vskip 0 mm';
+		&Apache::lonxml::increment_counter();
+	    }
+	    $result.= '\end{enumerate}';
 	}
     }