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

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

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

Revision 5372 Revision 5373
90 90
91our $count = 0; # counter for unique identifier for multi-parts 91our $count = 0; # counter for unique identifier for multi-parts
92our $answerPrefix = "MuLtIaNsWeR"; # answer rule prefix 92our $answerPrefix = "MuLtIaNsWeR"; # answer rule prefix
93our $separator = ';'; # separator for singleResult previews 93our $separator = ';'; # separator for singleResult previews
94 94
95# 95=pod
96
97 #
96# Create a new MultiAnswer item from a list of items. 98 # Create a new MultiAnswer item from a list of items.
97# The items are converted if Value items, if they aren't already. 99 # The items are converted if Value items, if they aren't already.
98# You can set the following fields of the resulting item: 100 # You can set the following fields of the resulting item:
99# 101 #
100# checker => code a subroutine to be called to check the 102 # checker => code a subroutine to be called to check the
101# student answers. The routine is passed 103 # student answers. The routine is passed
102# four parameters: a reference to the array 104 # four parameters: a reference to the array
103# or correct answers, a reference to the 105 # or correct answers, a reference to the
104# array of student answers, a reference to the 106 # array of student answers, a reference to the
105# MultiAnswer object itself, and a reference to 107 # MultiAnswer object itself, and a reference to
106# the checker's answer hash. The routine 108 # the checker's answer hash. The routine
107# should return either a score or a reference 109 # should return either a score or a reference
108# to an array of scores (one for each answer). 110 # to an array of scores (one for each answer).
109# 111 #
110# singleResult => 0 or 1 whether to show only one entry in the 112 # singleResult => 0 or 1 whether to show only one entry in the
111# results area at the top of the page, 113 # results area at the top of the page,
112# or one for each answer rule. 114 # or one for each answer rule.
113# (Default: 0) 115 # (Default: 0)
114# 116 #
115# namedRules => 0 or 1 whether to use named rules or default 117 # namedRules => 0 or 1 whether to use named rules or default
116# rule names. Use named rules if you need 118 # rule names. Use named rules if you need
117# to intersperse other rules with the 119 # to intersperse other rules with the
118# ones for the MultiAnswer, in which case 120 # ones for the MultiAnswer, in which case
119# you must use NAMED_ANS not ANS. 121 # you must use NAMED_ANS not ANS.
120# (Default: 0) 122 # (Default: 0)
121# 123 #
122# checkTypes => 0 or 1 whether the types of the student and 124 # checkTypes => 0 or 1 whether the types of the student and
123# professor's answers must match exactly 125 # professor's answers must match exactly
124# or just pass the usual type-match error 126 # or just pass the usual type-match error
125# checking (in which case, you should check 127 # checking (in which case, you should check
126# the types before you use the data). 128 # the types before you use the data).
127# (Default: 1) 129 # (Default: 1)
128# 130 #
129# allowBlankAnswers=>0 or 1 whether to remove the blank-check prefilter 131 # allowBlankAnswers=>0 or 1 whether to remove the blank-check prefilter
130# from the answer checkers for the answer 132 # from the answer checkers for the answer
131# checkers used for type checking the student's 133 # checkers used for type checking the student's
132# answers. 134 # answers.
133# (Default: 0) 135 # (Default: 0)
134# 136 #
135# separator => string the string to use between entries in the 137 # separator => string the string to use between entries in the
136# results area when singleResult is set. 138 # results area when singleResult is set.
137# (Default: semicolon) 139 # (Default: semicolon)
138# 140 #
139# tex_separator => string same, but for the preview area. 141 # tex_separator => string same, but for the preview area.
140# (Default: semicolon followed by thinspace) 142 # (Default: semicolon followed by thinspace)
141# 143 #
142# format => string an sprintf-style string used to format the 144 # format => string an sprintf-style string used to format the
143# students answers for the results area 145 # students answers for the results area
144# when singleResults is true. If undefined, 146 # when singleResults is true. If undefined,
145# the separator parameter (above) is used to 147 # the separator parameter (above) is used to
146# form the string. 148 # form the string.
147# (Default: undef) 149 # (Default: undef)
148# 150 #
149# tex_format => string an sprintf-style string used to format the 151 # tex_format => string an sprintf-style string used to format the
150# students answer previews when singleResults 152 # students answer previews when singleResults
151# mode is in effect. If undefined, the 153 # mode is in effect. If undefined, the
152# tex_separator (above) is used to form the 154 # tex_separator (above) is used to form the
153# string. 155 # string.
154# (Default: undef) 156 # (Default: undef)
155# 157 #
158
159=cut
160
156my @ans_defaults = ( 161my @ans_defaults = (
157 checker => sub {0}, 162 checker => sub {0},
158 showCoordinateHints => 0, 163 showCoordinateHints => 0,
159 showEndpointHints => 0, 164 showEndpointHints => 0,
160 showEndTypeHints => 0, 165 showEndTypeHints => 0,

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

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9