View source: R/NumericalQuestions.R
GIFTNQ | R Documentation |
This function prints a Numeric Question in GIFT format.
GIFTNQ(qtxt, ans, err=0)
qtxt |
Text of the question. |
ans |
Numeric answer. |
err |
Error allowed. |
These functions use the cat()
function to print a Numerical
Question
in the GIFT format. In this question, the user is asked to write down
a number. Use of the sink()
function is adviced to send the ouput to a text
file.
The range of answers allows is 'ans' plus/minus 'err' unless 'ans' is of length 2. In that case, the range of valid answers is ans[1] to ans[2].
No value is returned but some text in printed.
#Question 1
GIFTNQ("What's the mean of vector c(.4, .4, .5, .3)",
as.character(mean(c(.4, .4, .5, .3))), .01)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.