storeAnswer | R Documentation |
Stores answer to item k to the Cat
object's answers
slot.
## S4 method for signature 'Cat' storeAnswer(catObj, item, answer, returnJSON = FALSE) ## S4 method for signature 'character' storeAnswer(catObj, item, answer, returnJSON = FALSE)
catObj |
An object of class |
item |
An integer indicating the index of the question item |
answer |
The answer to the |
returnJSON |
Boolean indicating whether the updated |
The function storeAnswer
updates the Cat
object, but the updated object must be assigned to an object for the changes to be stored. See Examples.
The function storeAnswer
returns an updated object of class Cat
with the answers
slot reflecting the newly stored answer
to the indicated item
. All previously stored answers remain the same, and all unanswered questions remain NA
.
Haley Acevedo, Ryden Butler, Josh W. Cutler, Matt Malis, Jacob M. Montgomery, Tom Wilkinson, Erin Rossiter, Min Hee Seo, Alex Weil
## Loading ltm Cat object data(ltm_cat) ## Printing current answers slot getAnswers(ltm_cat) ## Storing answer of 0 to item 1 ltm_cat <- storeAnswer(ltm_cat, item = 1, answer = 0) ## Now object reflects answer to item 1 getAnswers(ltm_cat)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.