GIFTMC: Multiple Choice Question in GIFT format

View source: R/MultipleChoice.R

GIFTMCR Documentation

Multiple Choice Question in GIFT format

Description

This function prints a Multiple Choice Question in GIFT format.

Usage

GIFTMC(qtxt, anstxt, rightans=1, wright=NULL, wwrong=NULL)

Arguments

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.

Details

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!).

Value

No value is returned but some text in printed.

Examples

#Question 1
GIFTMC("What's the mean of 1, 2, and 3?", c("1", "2", "3"), rightans=2,
   wwrong="-33.333")




RGIFT documentation built on Nov. 17, 2023, 3:01 p.m.