WeBWorKdocs

sq_webwork:


Home
Current UR
courses
Visitor
page
Intro to
WeBWorK
WeBWorK 2
Twiki
WW
Community
Grant Support
& awards
Discussion
group
Problem
library
Write/modify
problems
Create &
manage course
Tutorial on
running a course
HowTos
FAQ
WeBWorK2
FAQ
Software
Download
How to
Install WW server
Feedback
Site Map
Change
preferences
Change
password





Prev | Next | tutorial

This page is no longer being maintained. The new URL for this content is http://webwork.maa.org/wiki/MultipleChoiceProblems

'Checkbox Multiple Choice' basic example

(for more advanced comments on Multiple Choice questions see Multiple.pm) To obtain the problem:

Unable to obtain and render setMAAtutorial/checkboxexample.pg from the library rochesterLibrary

Could not find problem setMAAtutorial/checkboxexample.pg in library rochesterLibrary


{viewSource(setMAAtutorial/checkboxexample.pg)}
  1. Since this is a checkbox multiple choice question, we do not want to tell the student which questions are correct and which are wrong because it would lead to constant guessing. To accomplish this we set the following flag $showPartialCorrectAnswers to 0.
  2. Saying that $cmc "contains" the checkbox multiple choice object is not quite true. Actually $cmc is a scalar variable which contains a pointer to the checkbox multiple choice object, but you can think of the checkbox multiple choice object as being shoe horned into the variable $cmc. You need to remember that $cmc contains (a pointer to) an object, and not ordinary data such as a number or string.

    Some people use the convention $o_cmc to remind them that the variable contains an object.

    An object contains both data (in this case the list of questions and answers) and subroutines (called methods) for manipulating that data.

    The construction $cmc->qa(..one question and a list of the answers..) Asks the object $cmc to store the question and answers given in the argument in its private data.

    The construction $cmc->extra(..list of incorrect answers) Asks the object $cmc to store several incorrect answers as possible correct answers for the student to choose from. $out = $ml->print_q() asks the object to store a string of the formatted question in the variable $out. $out = $ml->print_a() asks the object to store a string of the formatted answers in the variable $out.


Prev | Next | tutorial

Last update: Monday, March 3, 2008 at 3:19:01 PM.
This site maintained using Manila and Frontier software.