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

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

Parent Directory Parent Directory

Links to HEAD: (view) (download) (as text) (annotate)
Sticky Revision:

Revision 5076 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Jun 29 02:02:41 2007 UTC (12 years, 7 months ago) by dpvc
File length: 536 byte(s)
Diff to previous 5074
Renamed the MultiPart object as the MultiAnswer object.  The MultiPart
object now issues a warning indicating that change so that problem
authors will be encouraged to change their code.

Revision 5074 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Jun 28 23:44:45 2007 UTC (12 years, 7 months ago) by dpvc
File length: 15322 byte(s)
Diff to previous 4866
Updated to use new context methods.

Revision 4866 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Sun Mar 11 11:40:46 2007 UTC (12 years, 11 months ago) by dpvc
File length: 15244 byte(s)
Diff to previous 4845
Fixed a deprecated usage of defined(@result)

Revision 4845 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Mar 6 01:52:26 2007 UTC (12 years, 11 months ago) by gage
File length: 15253 byte(s)
Diff to previous 4424
Documenation addition

Revision 4424 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Aug 29 11:14:28 2006 UTC (13 years, 5 months ago) by dpvc
File length: 15154 byte(s)
Diff to previous 3654
Check routine can now return an array rather than an array reference.
(This requires pg/lib/Value/AnswerCheckers.pm to be at least version 1.80).

Revision 3654 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Sat Sep 24 02:38:19 2005 UTC (14 years, 5 months ago) by dpvc
File length: 15141 byte(s)
Diff to previous 3632
Updated to be able to handle empty anwswer blanks.  There is a new
parameter for the MultiPart object (allowBlankAnswers) that controls
whether the checker routine will be called even when there are blank
entries (normally, the checker is not called unless all the entries
are non-blank).  Use

  $mp = MultiPart(1,2)->with(checkTypes=>0,allowBlankAnswers=>0);

to have the checker routine called when answers are left blank.

You can now also include blank answers in the list itself:

  $mp = MultiPart(1,2,"");

(there is no need to include allowBlankAnswers in this case, because
the blank string will take care of itself.

Revision 3632 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Sat Sep 17 13:22:19 2005 UTC (14 years, 5 months ago) by dpvc
File length: 14476 byte(s)
Diff to previous 3371
Improved layout and labeling of error messages.

Revision 3371 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Jul 12 22:39:56 2005 UTC (14 years, 7 months ago) by dpvc
File length: 14077 byte(s)
Diff to previous 3270
Make error messages potentially localizable (by making them use
sprintf-style strings rather than variable subtitution).

Revision 3270 - (view) (download) (as text) (annotate) - [select for diffs]
Added Mon Jun 6 00:01:44 2005 UTC (14 years, 8 months ago) by dpvc
File length: 14075 byte(s)
This file implements a Multi-Part parser object that allows you to tie
several input blanks to a single answer checker that can compare the
student's answers in several blanks in order to determine which are

For example:

      $mp = MultiPart("x^2",1,-1)->with(
        singleResult => 1,
        checker => sub {
          my ($correct,$student,$self) = @_;  # get the parameters
          my ($f,$x1,$x2) = @{$student};      # extract the student answers
          Value::Error("Function can't be the identity") if ($f == 'x');
          Value::Error("Function can't be constant") if ($f->isConstant);
          return $f->eval(x=>$x1) == $f->eval(x=>$x2);
        \(f(x)\) = \{$mp->ans_rule(20)\} produces the same value
        at \(x\) = \{$mp->ans_rule(10)\} as it does at \(x\) = \{$mp->ans_rule(10)\}.


This produces three answer blanks all tied to the same checker, which
is supplied by the user when the MultiPart is specified.  This one
checks if two inputs to a function provide the same output.

The answer blanks can each produce a separate row in the results area
at the top of the page, or they con be combined into a single row, as
in this case.  The checker routine can provide error messages for
individual parts via the setMessage() method, or for the problem as a
whole, as above.  Finally, the ans_array() method can be used to
produce answer blanks for individual entries for those objects that
support such arrays.

See the documentation at the top of the file for additional details.

This form allows you to request diffs between any two revisions of this file. For each of the two "sides" of the diff, enter a numeric revision.

  Diffs between and
  Type of Diff should be a

Sort log by:

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9