PREP 2014 Question Authoring - Archived

Pop-up list question

Pop-up list question

by Susanna Epp -
Number of replies: 2
Can you have two separate pop-up lists in a problem? If so, how is it done?
In reply to Susanna Epp

Re: Pop-up list question

by Paul Pearson -
Hi Susanna,

Yes, you can have multiple popups -- they just need to have different names, such as $popup1 and $popup2 in the following example.

###### begin code snippet

$popup1 = PopUp(['choose', 'true', 'false'],'true');
$popup2 = PopUp(['choose', 'positive', 'negative', 'zero'],'zero');

BEGIN_TEXT
\{ $popup1->menu \}
\{ $popup2->menu \}
END_TEXT

ANS($popup1->cmp);
ANS($popup2->cmp);

###### end code snippet

Best regards,

Paul Pearson