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

labeled_ans_rule

Description
This enters an answer rule attached to a specific label. This allows more control when matching student answers with answer evaluators

Syntax

labeled_ans_rule(label,width)

Params

The first parameter is the label and is required.
The second parameter is the width of the ans_rule and defaults to 20 (characters) if omitted.

Returns

The HTML (or TeX) code for an answer blank.

Examples


BEGIN_TEXT
Complete the sentence. Hello \{labeled_ans_rule("string_answer",20)\}
4+8 = \{labeled_ans_rule("numerical_answer"\}

END_TEXT
LABELED_ANS("numerical_answer" => num_cmp(12),"string_answer" => str_cmp("World") );

checks that the first answer is "World" and that the second answer is numerically equivalent to 12, despite entering the answer evaluators in an order which does not match the appearance of the answer blanks.

Notes

This is essentially syntactic sugar for "NAMED_ANS_RULE". It provides a default for the width, and labeled_ans_rule seems a more descriptive title than named_answer_rule. The low level (capitalized) subroutines will retain the titles NAMED... for backward compatibility.
The labeled (or NAMED) versions of answer blanks and answer evaluators can be useful in situations where the order of the answer blanks is not obvious.

See Also

LABELED_ANS, "NAMED_ANS_RULE", ans_rule, "NAMED_ANS_BOX", Managing answers

Macro Definition File

PGbasicmacros.pl

<| Post or View Comments |>


Prev | Next | manpages

Last update: Wednesday, January 10, 2007 at 10:20:34 PM.
This site maintained using Manila and Frontier software.