[ww-bugs] Bug 2650: parserRadioButtons causing duplication in mathematics

bugzilla-daemon at webwork.maa.org bugzilla-daemon at webwork.maa.org
Thu Jun 27 18:16:44 EDT 2013


http://bugs.webwork.maa.org/show_bug.cgi?id=2650


Davide P. Cervone <dpvc at union.edu> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |WONTFIX




--- Comment #3 from Davide P. Cervone <dpvc at union.edu>  2013-06-27 18:16:44 ---
Paul:

The problem is that, unless told otherwise, parserRadioButtons.pl tries to use
the choice strings as the answer strings for the student's answer (they are
added as strings to the context) so that they show up in the results table as
the student answers.  But you can't have formatted mathematics in parser
strings, so this messes things up.

The solution is to provide alternative labels that are used as the student
answers.  E.g.

    $radio = RadioButtons(
      ["\( \displaystyle \lim_{x\to $a} f(x) \) cannot exist",
       "\( \displaystyle \lim_{x\to $a} f(x) \) could be zero",
       "\( \displaystyle \lim_{x\to $a} f(x) \) must approach \( \infty \)",
       "None of the above"],
      "could be zero", # correct answer
      labels => ["cannot exist","could be zero","must approach infinity"],
      last => ["None of the above"],
      separator=>"$BR$BR",
    );
    $radio->{correct_ans_latex_string} = "\text{".$radio->string."}";

Note that the correct answer can be given in terms of the labels, which makes
it a bit simpler.  The final line sets the correct_ans_latex_string (which
didn't exist when the RadionButtons macro was created, and so isn't properly
set) to the correct answer so it displays properly.

It is also possible to use labels A, B, C, ... or 1, 2, 3, ... by using

    labels => "ABC",

or

    labels => "123",

but in any case, you should set the labels for this problem.

Davide

-- 
Configure bugmail: http://bugs.webwork.maa.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all bug changes.


More information about the webwork-bugs mailing list