[LON-CAPA-users] regular expression

H. K. Ng lon-capa-users@mail.lon-capa.org
Tue, 16 Aug 2005 10:41:41 -0400

At 10:21 AM 8/16/2005, you wrote:
>Why not use formula response instead of string?

formula response accepts answer such as

2/(4*x) whereas it should be


i.e., any multiple works. The algebra solution requires the student to 
reduce to the lowest denominator.

>On Aug 16, 2005, at 8:48 AM, H. K. Ng wrote:
>>Is there a way to construct the following regular expression? I
>>want the students to enter number1/(number2 * x) where number1 and
>>number2 are known integers. However, number2 can be 1, so that
>>means they can enter as number1/x and also, number1/(x) or number1/ 
>>(1*x). Question: For the last 2 answers, what I like to check is,
>>if they type the left parenthesis '(' then they need to enter the
>>right parenthesis ')'. I look in the Mastering Regular Expressions
>>book but could not find any info on how to check for an character.
>>LON-CAPA-users mailing list
>LON-CAPA-users mailing list