Learn R Programming

QAIG (version 0.1.7)

itemgen: Automatic item generator from a parent item model.

Description

itemgen function generates group of sibling items from a parent item model defined by user.

Usage

itemgen(stem_text = stem_text, formulae = formulae, N = N, C,
  options_affix, ans_key, save.csv)

Arguments

stem_text

The stem of the parent item with specified number-variables and character-variables.

formulae

A raw text that contains necessary formulae for the options (response choices) along with necessary values or functions that help to calculate the numeric value for each option.

N

A list of numeric input vector(s) for the number variable(s) in the stem.

C

(Optional) A list of character input vector(s) for the character variable(s) in the stem if there is any.

options_affix

(Optional) A list that consists of vectors with prefixes and suffixes (if there is any) of the numeric values in the options along with any text that can be included as an option of the items.

ans_key

(Optional) A text that indicates the correct response if it is NOT specified within formulae by '~'.

save.csv

(Optional) A name text given by the user for the output .csv file, if user wants to save the newly generated sibling items in working directory as a data.frame.

Value

This function returns a data frame that contains stem, options, answer key etc. for all the generated sibling items within its rows to display in console and within its columns in the saved .csv file if the input for the argument 'save.csv' is given in itemgen function.

Details

User has to develop a short schema for the parent item model that contains formation of stem along with formula for each of the response choices of the parent item as the input. Number-variables and character-variables must be specified in particular manner in the stem. Each formula must be written in new line as text and should be declared together as an object. itemgen function delivers the changes in the positions of the variables in stem and calculates the response choices automatically by taking members from the input vectors given by user in the schema. As a result, several permutations of changes in the variables lead to generation of new group of items. Please see vignette of 'QAIG' for more details.

References

Gierl, M. J., Lai, H. (2011). The Role of Item Models in Automatic Item Generation.

Embretson, S. E., Kingston, N. M. (2018). Automatic Item Generation: A More Efficient Process for Developing Mathematics Achievement Items?

Examples

Run this code
# NOT RUN {
stem_text <- "The sum value of all the odd [C1] between [N1] and [N2] is"

n1 <- c(20, 24, 28, 32)
n2 <- c(48, 52, 56)

c1 <- c("natural numbers", "integers")

N <- list(n1 = n1, n2 = n2)
C <- list(c1 = c1)

formulae <- "Option_A ? sum((n1+1) : (n2-1))/2
Option_B ~ (length(seq(n1+1, n2-1, by = 2)))*(n1+n2)/2
Option_C ? sum(n1 : n2)/2
Option_D ? (length(seq(n1, n2, by = 2)))*(n1+n2)/2
"

options_affix <- list(Option_A = c("", ""), Option_B = c("", ""), Option_C = c("", ""),
Option_D = c("", ""), Difficulty = "MEDIUM")

# itemgen() function can be used as:
itemgen(stem_text = stem_text, formulae = formulae, N = N, C = C, options_affix = options_affix)


# }

Run the code above in your browser using DataLab