[LON-CAPA-users] comparing submitted answer with ..

Guy Albertelli II lon-capa-users@mail.lon-capa.org
Wed, 12 May 2004 09:13:35 -0400 (EDT)

Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset=US-ASCII

Hi Jim,

> Thanks for the question about &EXT and the added documentation.  This is 
> useful. 
> My question:  Is it possible to use the &EXT subroutine to set up a 
> conditional answer (i. e. if the first answer is A, the second and third 
> are B and C, but if the first answer is B, the second and third are C 
> and D?  --jim



Source is attached.

More complex example:

guy@albertelli.com  LON-CAPA Developer  0-7-4-3-

Content-Transfer-Encoding: 7bit
Content-Type: text/plain
Content-Disposition: attachment; filename=submission_example.problem

  <script type="loncapa/perl">

    #Enter the computations here

    if (!$submission) {
    } else {
  <block condition="$status!~/^correct/">
    <part id="Enter_A_Number">
      <startouttext />Please enter a number between 1 and 10<endouttext />
      <numericalresponse id="1" answer="5.5">
        <responseparam description="Numerical Tolerance" default="4.5"
                       type="tolerance" name="tol" />	
	<textline />	

  <block condition="$status=~/^correct/">
    <part id="Find_The_Product">
      <startouttext />
         You entered $submission, calculate the product of $submission
         and $randnum.
      <endouttext />
      <numericalresponse id="2" answer="$answer">
        <textline />