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

bisitz bisitz at source.lon-capa.org
Mon Jan 13 10:29:10 EST 2014


bisitz		Mon Jan 13 15:29:10 2014 EDT

  Modified files:              
    /loncom/homework	inputtags.pm externalresponse.pm 
  Log:
  Proper display of submitted answer in problem view (response types: external, essay)
  
  
Index: loncom/homework/inputtags.pm
diff -u loncom/homework/inputtags.pm:1.322 loncom/homework/inputtags.pm:1.323
--- loncom/homework/inputtags.pm:1.322	Thu Aug 29 13:02:11 2013
+++ loncom/homework/inputtags.pm	Mon Jan 13 15:29:10 2014
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # input  definitons
 #
-# $Id: inputtags.pm,v 1.322 2013/08/29 13:02:11 raeburn Exp $
+# $Id: inputtags.pm,v 1.323 2014/01/13 15:29:10 bisitz Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -254,7 +254,8 @@
 		&& &Apache::londefdef::is_inside_of($tagstack,
 						    'essayresponse') ) {
 		$result='<table class="LC_pastsubmission"><tr><td>'.
-		    $oldresponse.'</td></tr></table>';
+		    &HTML::Entities::encode($oldresponse,'"<>&').
+                    '</td></tr></table>';
 	    }
 	    #get rid of any startup text
 	    &Apache::lonxml::get_all_text("/textfield",$parser,$style);
Index: loncom/homework/externalresponse.pm
diff -u loncom/homework/externalresponse.pm:1.25 loncom/homework/externalresponse.pm:1.26
--- loncom/homework/externalresponse.pm:1.25	Mon Jan 13 13:20:33 2014
+++ loncom/homework/externalresponse.pm	Mon Jan 13 15:29:10 2014
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # external style responses
 #
-# $Id: externalresponse.pm,v 1.25 2014/01/13 13:20:33 kruse Exp $
+# $Id: externalresponse.pm,v 1.26 2014/01/13 15:29:10 bisitz Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -324,7 +324,8 @@
                                                    'uploadedurl']);
         if (&Apache::response::show_answer()) {
            $result.='<table border="1"><tr><th>'.&mt('Your answer:').'</th></tr><tr><td><pre>'.
-                    $Apache::lonhomework::history{"resource.$part.$id.submission"}.
+                    &HTML::Entities::encode(
+                        $Apache::lonhomework::history{"resource.$part.$id.submission"},'"<>&').
                     '</pre></td></table><br />'.&Apache::lonxml::get_param('answerdisplay',$parstack,$safeeval).
                     '<br />';
         }




More information about the LON-CAPA-cvs mailing list