View source: R/MultipleChoice.R
GIFTMC | R Documentation |
This function prints a Multiple Choice Question in GIFT format.
GIFTMC(qtxt, anstxt, rightans=1, wright=NULL, wwrong=NULL)
qtxt |
Text of the question. |
anstxt |
Vector of short answers. |
rightans |
Position of right answers in anstxt. |
wright |
Vector of weights for the right answer. |
wwrong |
Vector of weights for the wrong answers. |
These functions use the cat()
function to print a Multiple
Choice Question
in the GIFT format. In this questions, the user is asked to select one or
more answers. Use of the sink()
function is adviced to send the ouput to a text
file.
If there are more than one right answer the length of anstxt and wright must be the same. In addition, it one of the elements in wright is "100" then only one answer can be chosen. Otherwise, the user can select several right answers (in this case remember to use negative weights for the wrong answers!).
No value is returned but some text in printed.
#Question 1
GIFTMC("What's the mean of 1, 2, and 3?", c("1", "2", "3"), rightans=2,
wwrong="-33.333")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.