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

albertel lon-capa-cvs@mail.lon-capa.org
Mon, 25 Sep 2006 19:30:59 -0000


albertel		Mon Sep 25 15:30:59 2006 EDT

  Modified files:              
    /loncom/homework	essayresponse.pm 
  Log:
  - BUG#4481, disable draft option in survey mode.
  
  
Index: loncom/homework/essayresponse.pm
diff -u loncom/homework/essayresponse.pm:1.74 loncom/homework/essayresponse.pm:1.75
--- loncom/homework/essayresponse.pm:1.74	Thu Sep 21 17:23:19 2006
+++ loncom/homework/essayresponse.pm	Mon Sep 25 15:30:56 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # essay (ungraded) style responses
 #
-# $Id: essayresponse.pm,v 1.74 2006/09/21 21:23:19 albertel Exp $
+# $Id: essayresponse.pm,v 1.75 2006/09/25 19:30:56 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -52,17 +52,23 @@
 	my $coll= &HTML::Entities::encode($Apache::lonhomework::history{"resource.$part.$id.collaborators"},'<>&"');
 	my $uploadedfiletypes= &Apache::lonnet::EXT("resource.$part".'_'."$id.uploadedfiletypes");
         $uploadedfiletypes=~s/[^\w\,]//g;
-	$result='<br /><table border="1">';
-	$result.='<tr><td>'.
-            '<label>'.
-	    '<input type="radio" name="HWDRAFT'.$part.'_'.$id.'" value="yes" checked="checked" /> '.
-	    &mt('Submit entries below as answer to receive credit').
-            '</label> <br />'.
-	    '<label>'.
-            '<input type="radio" name="HWDRAFT'.$part.'_'.$id.'" value="no" /> '.
-	    &mt('Save entries below as a draft answer (not submitting them for credit yet)').
-	    '</label>'.
-            ' </td></tr>';
+	if ( $Apache::lonhomework::type eq 'survey' ) {
+	    $result.= '<input type="hidden" name="HWDRAFT'.$part.'_'.$id.'" value="yes" /> ';
+	}
+	$result.='<br /><table border="1">';
+	if ( $Apache::lonhomework::type ne 'survey' ) {
+	    $result.= '<tr><td>'.
+		'<label>'.
+		'<input type="radio" name="HWDRAFT'.$part.'_'.$id.'" value="yes" checked="checked" /> '.
+		&mt('Submit entries below as answer to receive credit').
+		'</label> <br />'.
+		'<label>'.
+		'<input type="radio" name="HWDRAFT'.$part.'_'.$id.'" value="no" /> '.
+		&mt('Save entries below as a draft answer (not submitting them for credit yet)').
+		'</label>'.
+		'</td></tr>';
+	}
+
 	if ($ncol > 0) {
 	    $result .='<tr><td>'.'<label>'.
 		'Collaborators: <input type="text" size="70" max="80" name="HWCOL'.