Diff for /loncom/homework/templates/sampleexternal.problem between versions 1.1 and 1.4

version 1.1, 2010/12/20 18:14:18 version 1.4, 2012/02/04 15:12:40
Line 10  sub fact { Line 10  sub fact {
 }  }
   
 $testvalues='0=1';  $testvalues='0=1';
 for ($i=1,3) {  foreach $i (1..3) {
    $rand=&random(3,8,1);     $rand=&random(3,8,1);
    $testvalues.=','.$rand.'='.&fact($rand);     $testvalues.=','.$rand.'='.&fact($rand);
 }  }
   
   %args=('somecode' => (<<'ENDCODE')
   sub negative {
      my ($number)=@_;
      return $number<0;
   }
   ENDCODE
   );
   
   
 </script>  </script>
   
   
 <startouttext />Write a Perl subroutine called <tt>factorial</tt>, which returns the factorial of its argument, e.g. <tt>&amp;factorial(17)=17!</tt>.  <startouttext />Write a Perl subroutine called <tt>factorial</tt>, which returns the factorial of its argument, e.g. <tt>&amp;factorial(17)=17!</tt>. You can use the
   boolean function <tt>&amp;negative(number)</tt>, which returns <tt>true</tt> if the argument is negative.
 <instructorcomment>  <instructorcomment>
 Sample code for an evaluation script can be found <a href="/res/adm/includes/templates/sampleexternal.pl">here.</a></instructorcomment>  Sample code for an evaluation script can be found <a href="/res/adm/includes/templates/sampleexternal.pl">here.</a></instructorcomment>
 <endouttext />  <endouttext />
 <externalresponse url="http://localhost/cgi-bin/sampleexternal.pl" answer="$testvalues">  <externalresponse url="http://localhost/cgi-bin/sampleexternal.pl" answer="$testvalues" form="%args" answerdisplay="The most elegant (and dangerous) solution is recursive.">
 <textfield />  <textfield />
   
 </externalresponse>  </externalresponse>

Removed from v.1.1  
changed lines
  Added in v.1.4


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>