[LON-CAPA-users] multiple correct responses

H. K. Ng lon-capa-users@mail.lon-capa.org
Mon, 12 Sep 2005 12:38:25 -0400


--=====================_20372156==.ALT
Content-Type: text/plain; charset="us-ascii"; format=flowed

Yes, you can use stringresponse of type regular expression. In your case try

$re = '/^\s*(\QW1\E|\QN12\E)\s*$/i';

-hk

At 12:09 PM 9/12/2005, you wrote:
>I have a string response question that has several possible correct 
>answers. Is there some way to code this into a loncapa problem?
>For example, I would like to accept either "W1e" or "N12" as correct answers.
>
>Sorry if this is discussed somewhere but I have not found it in the 
>author's manual or help site.
>
>Thnx,
>JMS
>
>James M. Sullivan, Assistant 
>Professor 
><mailto:jmsullivan@vcu.edu>jmsullivan@vcu.edu
>Department of Physics                                    Virginia 
>Commonwealth University
>tel: 
>804/828-6343 
>fax: 804/828-7073
>
>1020 W. Main St.
>PO BOX 842000
>Richmond, VA 23284-2000
>
>*
>"If you can drive a nail, and if you have any nails to drive, drive them."
>           - H. D. Thoureau, 1850
>*
>

--=====================_20372156==.ALT
Content-Type: text/html; charset="us-ascii"

<html>
<body>
Yes, you can use stringresponse of type regular expression. In your case
try<br><br>
$re = '/^\s*(\QW1\E|\QN12\E)\s*$/i';<br><br>
-hk<br><br>
At 12:09 PM 9/12/2005, you wrote:<br>
<blockquote type=cite class=cite cite=""><font face="arial" size=2>I have
a string response question that has several possible correct answers. Is
there some way to code this into a loncapa problem?<br>
For example, I would like to accept either “W1e” or “N12” as correct
answers.<br>
&nbsp;<br>
Sorry if this is discussed somewhere but I have not found it in the
author’s manual or help site.<br>
&nbsp;<br>
Thnx,<br>
JMS<br>
&nbsp;<br>
James M. Sullivan, Assistant
Professor&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<a href="mailto:jmsullivan@vcu.edu">jmsullivan@vcu.edu</a><br>
Department of
Physics&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Virginia Commonwealth University<br>
tel:
804/828-6343&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
fax: 804/828-7073<br>
&nbsp;<br>
1020 W. Main St.<br>
PO BOX 842000<br>
Richmond, VA 23284-2000<br>
&nbsp;<br>
*<br>
&quot;If you can drive a nail, and if you have any nails to drive, drive
them.&quot; <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - H. D. Thoureau,
1850<br>
* <br>
</font><font face="Times New Roman, Times">&nbsp;</font></blockquote>
</body>
</html>

--=====================_20372156==.ALT--