GIFTSA | R Documentation |
This function prints a Short Answer Question in GIFT format.
GIFTSA(qtxt, anstxt, wright="100")
qtxt |
Text of the question. |
anstxt |
Vector of short answers. |
wright |
Vector of weights for the right questions. |
These functions use the cat()
function to print a Short Answer Question
in the GIFT format. In this questions, the user is asked to write a short anwser
down. 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 and one of the weights should be equal to "100" (i.e., completely right answer).
No value is returned but some text in printed.
#Question 1
GIFTSA("The mean of 1, 2, and 3 is", c("Three", "3"))
#Question 2
GIFTSA("Compute the mean of 1, 2 and 3",
c("mean(c(1,2,3))", "sum(c(1,2,3))/3", "sum(c(1,2,3))/length(c(1,2,3))", "(1+2+3)/3"),
wright=c("100", "75", "75", "50"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.