RGIFT (version 0.1-5)

GIFTNQ: Numeric Question in GIFT format

Description

This function prints a Numeric Question in GIFT format.

Usage

GIFTNQ(qtxt, ans, err=0)

Arguments

qtxt
Text of the question.
ans
Numeric answer.
err
Error allowed.

Value

No value is returned but some text in printed.

Details

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].

Examples

Run this code
#Question 1
GIFTNQ("What's the mean of vector c(.4, .4, .5, .3)",
   as.character(mean(c(.4, .4, .5, .3))), .01)

Run the code above in your browser using DataLab