...
data-choice-interaction: For multiple choice questions which can have more than one option as the correct answer
data-text-interaction: For fill in the blank questions where user has to input a text as the response
data-select-interaction: For questions where user has to select one or more options from a list
data-match-interaction: For match the following question types where user matches the options
Code Block | ||
---|---|---|
| ||
<!-- Sample usage of simple choice interaction -->
<div data-simple-choice-interaction data-response-variable='response1' value=0 class='mcq-option'>
<p>option 1</p>
</div>
<div data-simple-choice-interaction data-response-variable='response1' value=1 class='mcq-option'>
<p>option 2</p>
</div>
<div data-simple-choice-interaction data-response-variable='response1' value=2 class='mcq-option'>
<p>option 3</p>
</div>
<div data-simple-choice-interaction data-response-variable='response1' value=3 class='mcq-option'>
<p>option 4</p>
</div>
<!-- new format -->
<div data-choice-interaction='response1' class='mcq-horizontal'>
</div>
<div data-match-interaction='response1' class='mtf-horizontal'>
</div>
|
Code Block | ||
---|---|---|
| ||
<!-- Sample usage of text interaction --> <input type="text" name="element" data-text-interaction data-response-variable="response_01" /> -- old format <input type="text" name="element" data-text-interaction="response_01" /> <!-- Sample usage of select interaction --> <select name="element" multiple data-select-interaction="response_02" > </select> |
...
Code Block |
---|
{ "interactions": { "<response_variable_01>": { // one declaration for each response variable "type": "data type of the response variable - one of choice, text, select" "options": [ // if type is "choice" or "select" { "label": "option 1 HTML body", "value": 0 }, { "label": "option 2 HTML body", "value": 1 }, ... ], “validations”: { // optional validations can be provided for the response variable "range": { // range will have min/max or an enum "max": "<allowed_max_value>", "min": "<allowed_min_value>", "enum": ["array of values"] }, "limits": { "maxlength": "<max_length_of_the_response>", "minlength": "<min_length_of_the_response>" }, "pattern": "<regex_pattern_to_validate_the_format>" } } } } |
responseDeclaration
A “responseDeclaration” contains information about the response to a question: When is it correct, and (optionally) how is it scored?
Response Declaration should have declaration for every response variable in the question body. Optionally, the declaration can have the following details:
Correct Response: Correct (or optimal) values for the response variable
Mapping to Score: Map different values to score so that a response can have more nuances than plain right or wrong, e.g.: a multiple choice question with more than one correct answer can support partial scoring
Hints: hints to be shown for this response variable. Hints are shown only if they are allowed in the context where the question is being used.
Code Block | ||
---|---|---|
| ||
{ "responseDeclaration": { "<response_variable_01>": { // one declaration for each response variable // interactions for MTF type will be like below { "Interactions": { "<response_variable_01>": { "type": "match", "optionsSet": { "left": [ // left side of the options to display and should be shiffled while rendering { "label": "The option HTML body", //can be "Apple" "value": "<value>" // Can be any type example: "apple" }, { "label": "The option HTML body", "value": "<value>" } ], "right": [ // right side of the options to display { "label": "The option HTML body", "value": "<value>" }, { "label": "Yellow", "value": "<value>" } ] } } } } |
responseDeclaration
A “responseDeclaration” contains information about the response to a question: When is it correct, and (optionally) how is it scored?
Response Declaration should have declaration for every response variable in the question body. Optionally, the declaration can have the following details:
Correct Response: Correct (or optimal) values for the response variable
Mapping to Score: Map different values to score so that a response can have more nuances than plain right or wrong, e.g.: a multiple choice question with more than one correct answer can support partial scoring
Hints: hints to be shown for this response variable. Hints are shown only if they are allowed in the context where the question is being used.
Code Block | ||
---|---|---|
| ||
{
"responseDeclaration": {
"<response_variable_01>": { // one declaration for each response variable
"type": "data type of the response variable - one of string, integer, float, boolean"
"cardinality": "single, multiple, or ordered",
"correctResponse": {
"value": "<expected response value>",
"caseSensitive": "true/false", // default is false
"outcomes": {
"SCORE": "<score_value>" // set the SCORE to the specified value. default to maxScore/<number of response variables>
}
},
"mapping": [ // configure SCORE for different responses
{
"response": "<expected response value>", // if user provides this response
"outcomes": {
"SCORE": "<score_value>" // set the SCORE to the specified value
}
"caseSensitive": "true/false" // if response value check should be case sensitive or not
}
]
}
}
}
// MTF response declaration
{
"responseDeclaration": {
"<response_variable_01>": {
"response_1": {
"type": "data type of the response variable - one of string, integer, float, boolean",
"cardinality": "multiple",
"correctResponse": {
"value": {
"<left side option value>": "<matching right side option value>", // Example: "apple": "red",
"<left side option value>": "<matching right side option value>", // This below outcome score is given if the values are matched otherwise check with mappings
},
"outcomes": {
"SCORE": "<score_value>"
}
},
"mapping": [
{
"response": {
"value": {
"<left side option value>": "<matching right side option value>", // Example: "apple": "red"
}
},
"outcomes": {
"SCORE": "1"
}
}
]
}
}
} |
Examples:
Code Block |
---|
{ "responseDeclaration1": { // question with two fill-in-the-blanks, each having different scores "maxScore": 1, "response1": { "type": "integer", "cardinality": "single", "correctResponse": { "value": 4, "typeoutcomes": {"SCORE"data type of the response variable - one of string, integer, float, boolean": 0.75} // score of 0.75 for correct response to the first blank } "cardinality": "single, multiple, or ordered", }, "correctResponseresponse2": { "valuetype": "<expected response value>integer", "caseSensitivecardinality": "true/falsesingle", // default is false "correctResponse": { "outcomesvalue": {2, "outcomes": {"SCORE": "<score_value>"0.25} // set the SCORE score of 0.25 for correct response to the first specifiedblank value. default to maxScore/<number of response variables>} } }, }"responseDeclaration2": { // question with one fill-in-the-blank. }, "maxScore": 1, "mappingresponse1": { [ // configure SCORE for different responses"type": "string", "cardinality": "single", { "correctResponse": { "responsevalue": "<expectedNew response value>Delhi", // if user provides this response "outcomes": { "SCORE": 1 } // score of 1 "outcomes": { for correct response }, "SCOREmapping": "<score_value>" // set the SCORE to the specified value [ { }"response": "Delhi", "outcomes": { "caseSensitiveSCORE": "true/false" 0.5 } // ifpartial responsescore valueof check0.5 should be case sensitive or not for a relevant response } ] } } } |
Examples:
Code Block |
---|
{, "responseDeclaration1responseDeclaration3": { // question with twoa fill-in-the-blanks, each having different scoresmulti-select dropdown. "maxScore": 1, "response1": { "type": "integerstring", "cardinality": "singlemultiple", "correctResponse": { "value": 4 [ "New Delhi", "Chennai" ], "outcomes": { "SCORE": 0.75} // score of 0.75 for correct response to the first blank } }, "response2": { 1 } // score of 1 for correct response, i.e when both the correct answers are selected "type": "integer" }, "cardinalitymapping": "single",[ "correctResponse": { "valueresponse": 2 ["New Delhi"], "outcomes": {"SCORE": 0.5} // partial score of 0.25} // score of 0.25 for correct response to the first blank5 for selecting one correct option }, }{ } }, "responseDeclaration2response": { // question with one fill-in-the-blank.["Chennai"], "maxScoreoutcomes": 1, "response1": { "type": "string",{"SCORE": 0.5} // partial score of 0.5 for selecting other correct option "cardinality": "single",} ] "correctResponse": { } }, "valueresponseDeclaration4": "New Delhi", "outcomes": { "SCORE { // question with two fill-in-the-blanks, both having same scores "maxScore": 1, } // score of 1 for correct response"response1": { }"type": "integer", "mappingcardinality": ["single", "correctResponse": { "responsevalue": "Delhi"4, "outcomes": { "SCORE": 0.5 } // partial score of 0.5 for a relevantcorrect response to the first blank } ]} } }, "responseDeclaration3": { // question with a multi-select dropdown. "maxScore": 1, "response1response2": { "type": "stringinteger", "cardinality": "multiplesingle", "correctResponse": { "value": [ "New Delhi", "Chennai" ]": 2, "outcomes": { "SCORE": 1 0.5} // score of 10.5 for correct response, i.e when both the correct answers are selected to the second blank } }, }, "mappingresponseDeclaration5": [ { // question with a simple MCQ "responsemaxScore": ["New Delhi"], 1, "outcomes": {"SCORE": 0.5} // partial score of 0.5 for selecting one correct optionresponse1": { "type": "integer", }"cardinality": "single", "correctResponse": { "responsevalue": ["Chennai"], 1, "outcomes": {"SCORE": 0.51} // partial score of 0.51 for selecting other correct option } ] } }, "responseDeclaration4responseDeclaration6": { // question with two fill-in-the-blanks, both having same scores/ question with a MMCQ "maxScore": 1, "response1": { "type": "integer", "cardinality": "singlemultiple", "correctResponse": { "value": 4 [2, 3], "outcomes": {"SCORE": 0.51} // score of 0.51 for correctselecting response toboth the firstcorrect blankoptions }, }, "response2mapping": {[ "type": "integer", { "cardinality": "single", "correctResponseresponse": { "value": 2,[2], "outcomes": {"SCORE": 0.5} // partial score of 0.5 for correctselecting responseoption to the2 second blank }, } }, "responseDeclaration5": { // question with a simple MCQ "maxScoreresponse": 1[3], "response1 "outcomes": {"SCORE": 0.5} // partial score of 0.5 for selecting option "type": "integer",3 "cardinality": "single" }, "correctResponse": { "valueresponse": 1,[3, 4], "outcomes": {"SCORE": 10.5} // partial score of 10.5 for correctselecting optionoptions 3 & 4 } } }, "responseDeclaration6":] { // question with a} MMCQ } "maxScoreresponseDeclaration7": 1, { // MTF "response1response_1": { "type": "integer", "cardinality": "multiple", "correctResponse": { "value": { "apple": [2"red", 3], "outcomes1": {"SCORE": 1} // score of 1 for selecting both the correct options 3" }, "outcomes": { }, "mappingSCORE": [ "<score_value>" } { }, "responsemapping": [2], { "outcomes": {"SCORE": 0.5} // partial score of 0.5 for selecting option 2"response": { }, "value": { { "responseapple": [3],"red", "outcomes1": {"SCORE3": 0.5} // partial score of 0.5 for selecting option 3 } }, }, { "responseoutcomes": [3, 4],{ "outcomesSCORE": {"SCORE1": 0.5} // partial score of 0.5 for selecting options 3 & 4} } ] } } } |
scoringMode
Scoring mode of the question:
...