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

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

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

Revision 5073 Revision 5074
139 showEndTypeHints => 0, 139 showEndTypeHints => 0,
140); 140);
141 141
142sub new { 142sub new {
143 my $self = shift; my $class = ref($self) || $self; 143 my $self = shift; my $class = ref($self) || $self;
144 my $context = (Value::isContext($_[0]) ? shift : $self->context);
144 my @data = @_; my @cmp; 145 my @data = @_; my @cmp;
145 Value::Error("%s lists can't be empty",$class) if scalar(@data) == 0; 146 Value::Error("%s lists can't be empty",$class) if scalar(@data) == 0;
146 foreach my $x (@data) { 147 foreach my $x (@data) {
147 $x = Value::makeValue($x) unless Value::isValue($x); 148 $x = Value::makeValue($x,context=>$context) unless Value::isValue($x);
148 push(@cmp,$x->cmp(@ans_defaults)); 149 push(@cmp,$x->cmp(@ans_defaults));
149 } 150 }
150 bless { 151 bless {
151 data => [@data], cmp => [@cmp], ans => [], 152 data => [@data], cmp => [@cmp], ans => [],
152 part => 0, singleResult => 0, namedRules => 0, 153 part => 0, singleResult => 0, namedRules => 0,
153 checkTypes => 1, allowBlankAnswers => 0, 154 checkTypes => 1, allowBlankAnswers => 0,
154 tex_separator => $separator.'\,', separator => $separator.' ', 155 tex_separator => $separator.'\,', separator => $separator.' ',
155 context => $$Value::context, id => $answerPrefix.($count++), 156 context => $context, id => $answerPrefix.($count++),
156 }, $class; 157 }, $class;
157} 158}
158 159
159# 160#
160# Creates an answer checker (or array of same) to be passed 161# Creates an answer checker (or array of same) to be passed

Legend:
Removed from v.5073  
changed lines
  Added in v.5074

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9