WeBWorK Problems

typeset math in multiple choice items

typeset math in multiple choice items

by Dick Lane -
Number of replies: 1
What techniques are available for having typeset mathematics displayed in the items for a multiple choice problem?

I know of only two easy ways to have typeset alternatives in a multiple choice problem. The first uses new_multiple_choice() [simple adaptation of http://webwork.maa.org/wiki/MultipleChoiceProblems] and the second uses new_checkbox_multiple_choice() [see http://webwork.maa.org/wiki/MultipleSelectProblems and http://webwork.maa.org/wiki/MultipleChoiceCheckbox3]. If one is willing to manage various lists, then setMAAtutorial/simplemultiplechoiceexample.pg (part of the standard modelCourse) shows the key steps, but that is not super-simple.

It appears that RadioButtons() [http://webwork.maa.org/wiki/MultipleChoiceRadio1] and PopUp [http://webwork.maa.org/wiki/MultipleChoicePopup2] can handle only plain text in their alternatives but note that http://webwork.maa.org/wiki/GraphsInTables shows how PopUp can be used in conjunction with explicit management of shuffled lists.

Note: I do not advocate the use of Multiple Choice items in homework, but I would like to understand my alternatives for writing such items --- perhaps for use in a "R U ready 4 ..." test about prerequisites.
In reply to Dick Lane

Re: "graphs" in multiple choice items

by Hedley Pinsent -
This is what I do.
The biggest downside is that the checkboxes are aligned with the bottom of the images.
Perhaps, some day, checkbox_multiple_choice will be generalized to accommodate graph (and perhaps other?) objects.

DOCUMENT();


loadMacros(
"PGstandard.pl",
"PGnauGraphtheory.pl",
"PGunion.pl",
"imageChoice.pl",
);
$showPartialCorrectAnswers = 1;

TEXT(beginproblem());

$correctG = init_graph(-1,-1,11,11,
axes=>[0,0], grid=>[12,12],
size=>[400,400]); # or pixels=>[400,400]
$correctG->lb( new Label(5,5,'correct graph','black','left','top'));

$extra1G = init_graph(-1,-1,11,11,
axes=>[0,0], grid=>[12,12],
size=>[400,400]); # or pixels=>[400,400]
$extra1G->lb( new Label(5,5,'extra #1','black','left','top'));

$extra2G = init_graph(-1,-1,11,11,
axes=>[0,0], grid=>[12,12],
size=>[400,400]); # or pixels=>[400,400]
$extra2G->lb( new Label(5,5,'extra #2','black','left','top'));

$extra3G = init_graph(-1,-1,11,11,
axes=>[0,0], grid=>[12,12],
size=>[400,400]); # or pixels=>[400,400]
$extra3G->lb( new Label(5,5,'extra #3','black','left','top'));

$cmc = new_checkbox_multiple_choice();

$cmc->qa("choose the correct graph",
image( insertGraph($correctG),
width=>400,height=>400,tex_size=>800 ));

$cmc->extra(
image( insertGraph($extra1G),
width=>400,height=>400,tex_size=>800 ),
image( insertGraph($extra2G),
width=>400,height=>400,tex_size=>800 ),
image( insertGraph($extra3G),
width=>400,height=>400,tex_size=>800 ));

BEGIN_TEXT

\{$cmc->print_q\}$BR
\{$cmc->print_a\}
END_TEXT


ANS(checkbox_cmp($cmc->correct_ans));