Description Usage Arguments Value Author(s) Examples
Returns a vector of scores, given a vector of responses to a specific item, a vector with the correct response(s) ("key") and the item id.
1 | scoreResponses(responses, key, item_id)
|
responses |
A numeric vector with the responses to an item |
key |
A numeric vector with the correct response to the item. If the response format is Multiple Choice, this will be a single integer value. If the response format is Free (such as some items in Athena), this will be two values representing the lower and the upper bounds of the range of acceptable responses. |
item_id |
A character vector with the item id |
A numeric score vector with 1 for correct responses, 0 for incorrect responses and NA for missing values
Morgan Strom
1 2 3 4 5 6 7 8 9 | responses <- c(1, 0, 1.05, 0.99, 2)
#Multiple choice with 2 as the correct answer
key <- 2
scoreResponses(responses, key, "test_item")
#Free response with lower bound 1 and upper bound 1.1
key <- c(1, 1.1)
scoreResponses(responses, key, "test_item")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.