Background

We want to implement Arrange Sequence Question in the Questionset Editor and the QuML Player.

Before starting the implementation we need to decide Arrange sequence Question data model which is to be as per the QuML spec.

Proposed Data Model of Arrange Sequence Question

body

1<div class='question-body' tabindex='-1'> 2 <div class='asq-title' tabindex='0'> 3 <p>Arrange the fruits in alphabetic order</p> 4 </div> 5 <div data-order-interaction='response1' class='asq-vertical/asq-horizontal'></div> 6</div>

responseDeclaration

Proposed format1 (Recommended)

1{ 2 "response1": { 3 "cardinality": "ordered", 4 "type": "integer", 5 "correctResponse": { 6 "value": [ 7 0, 8 1, 9 2, 10 3 11 ] 12 }, 13 "mapping": [ 14 { 15 "value": 0, 16 "score": 0.25 17 }, 18 { 19 "value": 1, 20 "score": 0.25 21 }, 22 { 23 "value": 2, 24 "score": 0.25 25 }, 26 { 27 "value": 3, 28 "score": 0.25 29 } 30 ] 31 } 32}

Pros: We will not have to save long options text in the responseDeclaration, when the options will be having images the text of options will become to long and data will become un-readble.

Cons: We will not get to see the options value in the responseDeclaration

Proposed format2

1"responseDeclaration": { 2 "response1": { 3 "cardinality": "ordered", 4 "type": "integer", 5 "correctResponse": { 6 "value": ["<p>Apple</p>","<p>Banana</p>","<p>Grapes</p>","<p>Orange</p>"] 7 }, 8 "mapping": [ 9 { 10 "value": "<p>Apple</p>", 11 "score": 0.25 12 }, 13 { 14 "value": "<p>Banana</p>", 15 "score": 0.25 16 }, 17 { 18 "value": "<p>Grapes</p>", 19 "score": 0.25 20 }, 21 { 22 "value": "<p>Orange</p>", 23 "score": 0.25 24 } 25 ] 26 } 27 }

outcomeDeclaration

1{ 2 "maxScore": { 3 "cardinality": "ordered", 4 "type": "integer", 5 "defaultValue": 1 6 } 7}

interactions

1{ 2 "response1": { 3 "type": "order", 4 "options": [ 5 { 6 "label": "<p>Apple</p>", 7 "value": 0 8 }, 9 { 10 "label": "<p>Banana</p>", 11 "value": 1 12 }, 13 { 14 "label": "<p>Grapes</p>", 15 "value": 2 16 }, 17 { 18 "label": "<p>Orange</p>", 19 "value": 3 20 } 21 ], 22 "validation": { 23 "required": "Yes" 24 } 25 } 26}

answer

1<div class='answer-container'> 2 <div class='answer-body'> 3 <p>Apple</p> 4 </div> 5 <div class='answer-body'> 6 <p>Banana</p> 7 </div> 8 <div class='answer-body'> 9 <p>Grapes</p> 10 </div> 11 <div class='answer-body'> 12 <p>Orange</p> 13 </div> 14</div>

editorState

1{ 2 "options": [ 3 { 4 "value": { 5 "body": "<p>Apple</p>", 6 "value": 0 7 } 8 }, 9 { 10 "value": { 11 "body": "<p>Banana</p>", 12 "value": 1 13 } 14 }, 15 { 16 "value": { 17 "body": "<p>Grapes</p>", 18 "value": 2 19 } 20 }, 21 { 22 "value": { 23 "body": "<p>Orange</p>", 24 "value": 3 25 } 26 } 27 ], 28 "question": "<p>Arrange the fruits names in alphabetical order</p>", 29 "solutions": [ 30 { 31 "id": "71efa845-2856-4a82-b493-101facfddd26", 32 "type": "html", 33 "value": "<p>Proper order is Apple, Banana, Grapes, Orange</p>" 34 } 35 ] 36}

templateId

1"templateId": "asq-horizontal" / "asq-vertical"

primaryCategory

1"primaryCategory": "Arrange Sequence Question"

qType

1"qType": "ASQ" // This will need spec change

interactionTypes

1"interactionTypes": ["order"] // This will need spec change

Let’s Compare ASQ with MCQ data

Compare MCQ body with ASQ body

MCQ Body

ASQ Body

1<div class='question-body' tabindex='-1'> 2 <div class='mcq-title' tabindex='0'> 3 <p>Which of the fruits is red in colour?</p> 4 </div> 5 <div data-choice-interaction='response1' class='mcq-vertical'></div> 6</div>
1<div class='question-body' tabindex='-1'> 2 <div class='asq-title' tabindex='0'> 3 <p>Arrange the fruits in alphabetic order</p> 4 </div> 5 <div data-order-interaction='response1' class='asq-vertical/asq-horizontal'></div> 6</div>

Compare MCQ interactions with ASQ interactions

MCQ interactions

ASQ interactions

1{ 2 "response1": { 3 "type": "choice", 4 "options": [ 5 { 6 "label": "<p>Apple</p>", 7 "value": 0 8 }, 9 { 10 "label": "<p>Banana</p>", 11 "value": 1 12 }, 13 { 14 "label": "<p>Grapes</p>", 15 "value": 2 16 }, 17 { 18 "label": "<p>Orange</p>", 19 "value": 3 20 } 21 ], 22 "validation": { 23 "required": "Yes" 24 } 25 } 26}
1{ 2 "response1": { 3 "type": "order", 4 "options": [ 5 { 6 "label": "<p>Apple</p>", 7 "value": 0 8 }, 9 { 10 "label": "<p>Banana</p>", 11 "value": 1 12 }, 13 { 14 "label": "<p>Grapes</p>", 15 "value": 2 16 }, 17 { 18 "label": "<p>Orange</p>", 19 "value": 3 20 } 21 ], 22 "validation": { 23 "required": "Yes" 24 } 25 } 26}

Compare MCQ responseDeclaration with MTF responseDeclaration

MCQ responseDeclaration (multi choice)

ASQ responseDeclaration

1{ 2 "response1": { 3 "cardinality": "multiple", 4 "type": "integer", 5 "correctResponse": { 6 "value": [0,3] 7 }, 8 "mapping": [ 9 { 10 "value": 0, 11 "score": 0.5 12 }, 13 { 14 "value": 3, 15 "score": 0.5 16 } 17 ] 18 } 19}
1{ 2 "response1": { 3 "cardinality": "ordered", 4 "type": "integer", 5 "correctResponse": { 6 "value": [0,1,2,3] 7 }, 8 "mapping": [ 9 { 10 "value": 0, 11 "score": 0.25 12 }, 13 { 14 "value": 1, 15 "score": 0.25 16 }, 17 { 18 "value": 2, 19 "score": 0.25 20 }, 21 { 22 "value": 3, 23 "score": 0.25 24 } 25 ] 26 } 27}

Compare MCQ outcomeDeclaration with ASQ outcomeDeclaration

MCQ outcomeDeclaration

ASQ outcomeDeclaration

1{ 2 "maxScore": { 3 "cardinality": "multiple", 4 "type": "integer", 5 "defaultValue": 1 6 } 7 }
1{ 2 "maxScore": { 3 "cardinality": "ordered", 4 "type": "integer", 5 "defaultValue": 1 6 } 7 }

Compare MCQ editorState with MTF editorState

MCQ editorState

MTF editorState

1{ 2 "options": [ 3 { 4 "answer": true, 5 "value": { 6 "body": "<p>Apple</p>", 7 "value": 0 8 } 9 }, 10 { 11 "answer": false, 12 "value": { 13 "body": "<p>Banana</p>", 14 "value": 1 15 } 16 }, 17 { 18 "answer": false, 19 "value": { 20 "body": "<p>Grapes</p>", 21 "value": 2 22 } 23 }, 24 { 25 "answer": true, 26 "value": { 27 "body": "<p>Strawberry</p>", 28 "value": 3 29 } 30 } 31 ], 32 "question": "<p>Which of the fruits is red in colour?</p>", 33 "solutions": [ 34 { 35 "id": "71efa845-2856-4a82-b493-101facfddd26", 36 "type": "html", 37 "value": "<p>Apple is red in colour</p>" 38 } 39 ] 40}
1{ 2 "options": [ 3 { 4 "value": { 5 "body": "<p>Apple</p>", 6 "value": 0 7 } 8 }, 9 { 10 "value": { 11 "body": "<p>Banana</p>", 12 "value": 1 13 } 14 }, 15 { 16 "value": { 17 "body": "<p>Grapes</p>", 18 "value": 2 19 } 20 }, 21 { 22 "value": { 23 "body": "<p>Orange</p>", 24 "value": 3 25 } 26 } 27 ], 28 "question": "<p>Arrange the fruits names in alphabetical order</p>", 29 "solutions": [ 30 { 31 "id": "71efa845-2856-4a82-b493-101facfddd26", 32 "type": "html", 33 "value": "<p>Proper order is Apple, Banana, Grapes, Orange</p>" 34 } 35 ] 36}



Complete ASQ Question Metadata Example:
1{ 2 "mimeType": "application/vnd.sunbird.question", 3 "media": [], 4 "editorState": { 5 "options": [ 6 { 7 "value": { 8 "body": "<p>One</p>", 9 "value": 0 10 } 11 }, 12 { 13 "value": { 14 "body": "<p>Two</p>", 15 "value": 1 16 } 17 }, 18 { 19 "value": { 20 "body": "<p>Three</p>", 21 "value": 2 22 } 23 }, 24 { 25 "value": { 26 "body": "<p>Four</p>", 27 "value": 3 28 } 29 } 30 ], 31 "question": "<p>Arrange the numbers in ascending order</p>", 32 "solutions": [ 33 { 34 "id": "81938f25-62b2-458d-8e23-dc0223a6c3x7", 35 "type": "html", 36 "value": "<p>One</p><p>Two</p><p>Three</p><p>Four</p>" 37 } 38 ] 39 }, 40 "templateId": "asq-vertical", 41 "complexityLevel": [], 42 "maxScore": 1, 43 "name": "ASQ Number", 44 "qumlVersion": 1.1, 45 "responseDeclaration": { 46 "response1": { 47 "cardinality": "ordered", 48 "type": "integer", 49 "correctResponse": { 50 "value": [ 51 0, 52 1, 53 2, 54 3 55 ] 56 }, 57 "mapping": [ 58 { 59 "value": 0, 60 "score": 0.25 61 }, 62 { 63 "value": 1, 64 "score": 0.25 65 }, 66 { 67 "value": 2, 68 "score": 0.25 69 }, 70 { 71 "value": 3, 72 "score": 0.25 73 } 74 ] 75 } 76 }, 77 "outcomeDeclaration": { 78 "maxScore": { 79 "cardinality": "ordered", 80 "type": "integer", 81 "defaultValue": 1 82 } 83 }, 84 "interactionTypes": [ 85 "order" 86 ], 87 "interactions": { 88 "response1": { 89 "type": "order", 90 "options": [ 91 { 92 "label": "<p>One</p>", 93 "value": 0 94 }, 95 { 96 "label": "<p>Two</p>", 97 "value": 1 98 }, 99 { 100 "label": "<p>Three</p>", 101 "value": 2 102 }, 103 { 104 "label": "<p>Four</p>", 105 "value": 3 106 } 107 ], 108 "validation": { 109 "required": "Yes" 110 } 111 } 112 }, 113 "qType": "ASQ", 114 "primaryCategory": "Arrange Sequence Question", 115 "body": "<div class='question-body' tabindex='-1'><div class='asq-title' tabindex='0'><p>Match the following colour with the fruits</p></div><div data-match-interaction='response1' class='asq-vertical'></div></div>", 116 "answer": "<div class='arrange-sequence-container'><div class='options'><div class='option'><p>One</p></div><div class='option'><p>Two</p></div><div class='option'><p>Three</p></div><div class='option'><p>Four</p></div></div></div>", 117 "solutions": { 118 "81938f25-62b2-458d-8e23-dc0223a6c3x7": "<p>Numbers in ascending order is One,Two, Three, Four</p>" 119 } 120}