WeBWorKdocs

sq_webwork:


Home
Current UR courses
Visitor page
Intro to WeBWorK
WeBWorK 2 Twiki
WW Community
Grant Support & awards
Discussion group
Problem library
Write/modify problems
Create & manage course
Tutorial on running a course
HowTos
FAQ
WeBWorK2 FAQ
Software Download
How to Install WW server
Feedback
Site Map
Change preferences
Change password





Prev | Next | manpages

Description

Creates one or more answer evaluators which check string answer(s).

Params

str is a string representing the correct answer.

Options

Option keyOption valueDefault
filters[filter1, filter2, ...] where each filter is one of:trim_whitespace removes white space from ends of string

compress_whitespace removes white space from ends and compresses runs of whitespace to a single space.

remove_whitespace removes all white space in string

ignore_case ignores case of letters.

ignore_order ignores the order in which the letters are entered
['compress_whitespace','ignore_case']

Returns

One or more answer evaluators. The second construction creates two answer evaluators. The default behavior ignores case, and treats runs of white spaces as a single space.

Examples

* ANS( str_cmp(['Good bye']) will accept 'good \ \ BYE', but not 'goodbye'
* ANS(str_cmp("Hello", filters => ['ignore_order]) ) will accept 'lloeH', but not 'HEOLL'
* ANS(str_cmp("H ello",'remove_whitespace') ) will accept 'Hello' and 'H e l l o'.
* ANS(str_cmp(['Tweedle dee', 'Tweedle dum']) ) generates answer evaluators for two successive answer blanks.

Notes

If you use only one filter you can use the shortcut
ANS(str_cmp("Hello",'ignore_order')) for
ANS( str_cmp("Hello", filters =>['ignore_order'] ) )

<| Post or View Comments |>


Prev | Next | manpages

Last update: Monday, May 13, 2002 at 10:17:56 AM.
This site maintained using Manila and Frontier software.