[system] / trunk / pg / macros / parserRadioButtons.pl Repository:
ViewVC logotype

Diff of /trunk/pg/macros/parserRadioButtons.pl

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 5372 Revision 5373
2 2
3sub _parserRadioButtons_init {}; # don't reload this file 3sub _parserRadioButtons_init {}; # don't reload this file
4 4
5=head1 DESCRIPTION 5=head1 DESCRIPTION
6 6
7#################################################################### 7 ####################################################################
8# 8 #
9# This file implements a radio button group object that is compatible 9 # This file implements a radio button group object that is compatible
10# with Value objects, and in particular, with the MultiPart object. 10 # with Value objects, and in particular, with the MultiPart object.
11# 11 #
12# To create a RadioButtons object, use 12 # To create a RadioButtons object, use
13# 13 #
14# $radio = RadioButtons([choices,...],correct,options); 14 # $radio = RadioButtons([choices,...],correct,options);
15# 15 #
16# where "choices" are the strings for the items in the radio buttons, 16 # where "choices" are the strings for the items in the radio buttons,
17# "correct" is the choice that is the correct answer for the group, 17 # "correct" is the choice that is the correct answer for the group,
18# and options are chosen from among: 18 # and options are chosen from among:
19# 19 #
20# labels => [label1,...] Specifies the text to be used 20 # labels => [label1,...] Specifies the text to be used
21# as the student answer for each 21 # as the student answer for each
22# entry in the radio group. 22 # entry in the radio group.
23# This can also be set to the string 23 # This can also be set to the string
24# "ABC" to get lettered labels or 24 # "ABC" to get lettered labels or
25# "123" to get numbered labels. 25 # "123" to get numbered labels.
26# The default is to use a few words 26 # The default is to use a few words
27# from the text string for each button. 27 # from the text string for each button.
28# 28 #
29# separator => string text to put between the radio 29 # separator => string text to put between the radio
30# buttons. 30 # buttons.
31# Default: $BR 31 # Default: $BR
32# 32 #
33# checked => choice the text or index (starting at zero) 33 # checked => choice the text or index (starting at zero)
34# of the button to be checked 34 # of the button to be checked
35# Default: none checked 35 # Default: none checked
36# 36 #
37# maxLabelSize => n the approximate largest size that should 37 # maxLabelSize => n the approximate largest size that should
38# be used for the answer strings to be 38 # be used for the answer strings to be
39# generated by the radio buttons (if 39 # generated by the radio buttons (if
40# the choice strings are too long, they 40 # the choice strings are too long, they
41# will be trimmed and "..." inserted) 41 # will be trimmed and "..." inserted)
42# Default: 25 42 # Default: 25
43# 43 #
44# uncheckable => 0 or 1 determines whether the radio buttons can 44 # uncheckable => 0 or 1 determines whether the radio buttons can
45# or "shift" be unchecked (requires JavaScript). 45 # or "shift" be unchecked (requires JavaScript).
46# To uncheck, click a second time; when 46 # To uncheck, click a second time; when
47# set to "shift", unchecking requires the 47 # set to "shift", unchecking requires the
48# shift key to be pressed. 48 # shift key to be pressed.
49# Default: 0 49 # Default: 0
50# 50 #
51# 51 #
52# To insert the radio buttons into the problem text, use 52 # To insert the radio buttons into the problem text, use
53# 53 #
54# BEGIN_TEXT 54 # BEGIN_TEXT
55# \{$radio->buttons\} 55 # \{$radio->buttons\}
56# END_TEXT 56 # END_TEXT
57# 57 #
58# and then 58 # and then
59# 59 #
60# ANS($radio->cmp); 60 # ANS($radio->cmp);
61# 61 #
62# to get the answer checker for the radion buttons. 62 # to get the answer checker for the radion buttons.
63# 63 #
64# You can use the RadioButtons object in MultiPart objects. This is 64 # You can use the RadioButtons object in MultiPart objects. This is
65# the reason for the RadioButton's ans_rule method (since that is what 65 # the reason for the RadioButton's ans_rule method (since that is what
66# MultiPart calls to get answer rules). 66 # MultiPart calls to get answer rules).
67# 67 #
68 68
69=cut 69=cut
70 70
71sub RadioButtons {parserRadioButtons->new(@_)} 71sub RadioButtons {parserRadioButtons->new(@_)}
72 72

Legend:
Removed from v.5372  
changed lines
  Added in v.5373

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9