[LON-CAPA-cvs] cvs: loncom /homework externalresponse.pm /homework/templates sampleexternal.problem

www www@source.lon-capa.org
Tue, 21 Dec 2010 01:53:13 -0000


www		Tue Dec 21 01:53:13 2010 EDT

  Modified files:              
    /loncom/homework	externalresponse.pm 
    /loncom/homework/templates	sampleexternal.problem 
  Log:
  answerdisplay-attribute, like with the other custom-type responses
  
  
Index: loncom/homework/externalresponse.pm
diff -u loncom/homework/externalresponse.pm:1.17 loncom/homework/externalresponse.pm:1.18
--- loncom/homework/externalresponse.pm:1.17	Mon Dec 20 20:15:55 2010
+++ loncom/homework/externalresponse.pm	Tue Dec 21 01:53:08 2010
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # external style responses
 #
-# $Id: externalresponse.pm,v 1.17 2010/12/20 20:15:55 www Exp $
+# $Id: externalresponse.pm,v 1.18 2010/12/21 01:53:08 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -130,10 +130,10 @@
     if ($target eq 'web') {
 	&Apache::response::setup_prior_tries_hash(\&format_prior_response);
         if (&Apache::response::show_answer()) {
-           $result.='<table border="1"><tr><th>'.&mt('Your answer:').'</th><th>'.&mt("Computer's answer information").'</th></tr><tr><td><pre>'.
+           $result.='<table border="1"><tr><th>'.&mt('Your answer:').'</th></tr><tr><td><pre>'.
                     $Apache::lonhomework::history{"resource.$part.$id.submission"}.
-                    '</pre></td><td><pre>'.&Apache::lonxml::get_param('answerdisplay',$parstack,$safeeval).
-                    '</pre></td></tr></table>';
+                    '</pre></td></table><br />'.&Apache::lonxml::get_param('answerdisplay',$parstack,$safeeval).
+                    '<br />';
         }
         if ($Apache::externalresponse::message) {
            $result.='<br /><table><tr><td bgcolor="#FFFFAA">'.$Apache::externalresponse::message.'</td></tr></table><br />';
Index: loncom/homework/templates/sampleexternal.problem
diff -u loncom/homework/templates/sampleexternal.problem:1.2 loncom/homework/templates/sampleexternal.problem:1.3
--- loncom/homework/templates/sampleexternal.problem:1.2	Mon Dec 20 19:18:14 2010
+++ loncom/homework/templates/sampleexternal.problem	Tue Dec 21 01:53:13 2010
@@ -21,7 +21,7 @@
 <instructorcomment>
 Sample code for an evaluation script can be found <a href="/res/adm/includes/templates/sampleexternal.pl">here.</a></instructorcomment>
 <endouttext />
-<externalresponse url="http://localhost/cgi-bin/sampleexternal.pl" answer="$testvalues">
+<externalresponse url="http://localhost/cgi-bin/sampleexternal.pl" answer="$testvalues" answerdisplay="The most elegant (and dangerous) solution is recursive.">
 <textfield />
 
 </externalresponse>