Background:
We have identified some gaps between QuML Spec (v1) and inquiry implementation (api, service & player). In order to make inquiry QuML compliant we need to modify the schema at the inquiry api, editor, player and add/update few items in the spec as well.

Spec Changes for Question:

Attribute Name: answer

  • answer is needed for non interactive question.

Current QuML spec (v1): Not Available

Proposed QuML spec (v1.1):

  • answer also should support multi-lingual data similar to body.

1"answer": { 2 "description": "answer contains the text, graphics, media objects that describe the question’s content.", 3 "oneOf": [ 4 { 5 "type": "string", 6 "description": "Answer as HTML string when the answer is used in only one language." 7 }, 8 { 9 "$ref": "#/definitions/i18nData" 10 } 11 ] 12 }

Sample Data for QuML (V1.1):

1 2"answer": "<p><span style=\"background-color:#ffffff;color:#202124;\">The challenges faced by India after independence were Partition led to arrival of 8 million people to India from Pakistan for whom homes and jobs had to be found. 500 princely states, each of which was ruled by a maharaja or a nawab, had to be convinced to join the new nation. Also, in the long run, the new nation had to adopt a political system which would best serve the hopes and expectations of its population.</span></p>" 3 4OR 5 6"answer":{ 7 "en": "<p><span style=\"background-color:#ffffff;color:#202124;\">The challenges faced by India after independence were Partition led to arrival of 8 million people to India from Pakistan for whom homes and jobs had to be found. 500 princely states, each of which was ruled by a maharaja or a nawab, had to be convinced to join the new nation. Also, in the long run, the new nation had to adopt a political system which would best serve the hopes and expectations of its population.</span></p>" 8} 9

Attribute Name: interactionTypes

  • need to be added for interactive questions.

  • Ref: ​https://project-sunbird.atlassian.net/wiki/spaces/CO/pages/1629356033

Current QuML spec (v1): Not Available

Proposed QuML spec (v1.1):

1"interactionTypes": { 2 "description": "interactionTypes contains the kind of interaction a interactive question can have", 3 "type": "array", 4 "items": { 5 "type": "string", 6 "enum": [ 7 "choice", 8 "text", 9 "select", 10 "date", 11 "file-upload", 12 "canvas" 13 ] 14 } 15 }

Sample Data:

1"interactionTypes": ["choice"]

Attribute Name: media

Current QuML spec (v1):

1"media": { 2 "type": "object", 3 "required": [ 4 "id", 5 "mediaType", 6 "src" 7 ], 8 "properties": { 9 "id": { 10 "type": "string" 11 }, 12 "mimeType": { 13 "enum": [ 14 "image/png", 15 "audio/mp3", 16 "video/mp4", 17 "video/webm" 18 ] 19 }, 20 "mediaType": { 21 "enum": [ 22 "image", 23 "audio", 24 "video" 25 ] 26 }, 27 "src": { 28 "type": "string" 29 }, 30 "baseUrl": { 31 "type": "string" 32 } 33 }, 34 "additionalProperties": false 35 }

Proposed QuML spec (v1.1):

1"media": { 2 "type": "object", 3 "required": [ 4 "id", 5 "type", 6 "src" 7 ], 8 "properties": { 9 "id": { 10 "type": "string" 11 }, 12 "mimeType": { 13 "type": "string" 14 }, 15 "type": { 16 "enum": [ 17 "application", 18 "audio", 19 "font", 20 "example", 21 "image", 22 "message", 23 "model", 24 "multipart", 25 "text", 26 "video" 27 ] 28 }, 29 "src": { 30 "type": "string" 31 }, 32 "baseUrl": { 33 "type": "string" 34 } 35 }, 36 "additionalProperties": true 37 }

Sample Data for QuML(V 1.1):

1"media":[ 2 { 3 "id": "do_2137498365362995201237", 4 "type": "image", 5 "mimeType": "image/jpeg" 6 "src": "/assets/public/content/assets/do_2137498365362995201237/tea.jpeg", 7 "baseUrl": "https://dev.inquiry.sunbird.org" 8 // any additional properties goes here by implementation if needed. 9 } 10]

Attribute Name: responseDeclaration.mapping

  • the mapping spec need to be updated.


Current QuML spec (v1):

1"mappingDef": { 2 "type": "object", 3 "required": ["key", "value"], 4 "properties": { 5 "key": {"$ref": "#/definitions/anyTypeDef"}, 6 "value": {"type": "number"}, 7 "caseSensitive": {"type": "boolean", "default": false} 8 }, 9 "additionalProperties": false 10 }

Proposed QuML spec (v1.1):

1"mappingDef": { 2 "type": "array", 3 "items": { 4 "type": "object", 5 "required": ["value", "score"], 6 "properties": { 7 "value": {"$ref": "#/definitions/anyTypeDef"}, 8 "score": {"type": "number"}, 9 "caseSensitive": {"type": "boolean", "default": false} 10 }, 11 "additionalProperties": false 12 } 13 }


Sample Data for QuML (v1.1):

1"mapping": [ 2 { 3 "value": 2, 4 "score": 0.5 5 }, 6 { 7 "value": 1, 8 "score": 0.25 9 } 10 ]

Attribute Name: interactions

  • In Case of multiple interaction types (e.g: choice & text), the implementation can have multiple variables for each interaction types (e.g: response1 for choice and response2 for text)


Current QuML spec (v1):

1"interactions": { 2 "type": "array", 3 "items": {"type": "string"}, 4 "description": "List of interactions present in the question." 5}


Proposed QuML spec (v1.1):

1"interactions": { 2 "description": "List of interactions present in the question.", 3 "type": "object", 4 "properties": { 5 "validation": { 6 "type": "object", 7 "properties": { 8 "required": { 9 "type": "string" 10 } 11 }, 12 "additionalProperties": false 13 } 14 }, 15 "additionalProperties": { 16 "$ref": "#/definitions/interactionsVariableDef" 17 } 18 } 19 20"interactionsVariableDef": { 21 "type": "object", 22 "required": ["type", "options"], 23 "properties": { 24 "type": { 25 "type": "string" 26 }, 27 "options": { 28 "oneOf": [ 29 { 30 "$ref": "#/definitions/optionsDef" 31 }, 32 { 33 "type": "object", 34 "additionalProperties": { 35 "$ref": "#/definitions/optionsDef" 36 } 37 } 38 ] 39 } 40 }, 41 "additionalProperties": false 42 } 43 44"optionsDef": { 45 "type": "array", 46 "items": { 47 "type": "object", 48 "properties": { 49 "label": { 50 "type": "string" 51 }, 52 "value": { 53 "type": "number" 54 } 55 }, 56 "additionalProperties": false 57 } 58 }

Open Questions:
1. Do we always have options array for all different types of interactions like date, select, canvas, file-upload?


Attribute Name: solutions

  • Current Solutions Spec is not covering internal data structure.

Current QuML spec (v1):

1"solutions": { 2 "description": "Solutions to the question.", 3 "oneOf": [ 4 { 5 "type": "array", 6 "items": { 7 "type": "string" 8 }, 9 "description": "List of solutions without association to any specific language", 10 "minItems": 1 11 }, 12 { 13 "type": "array", 14 "items": { "$ref": "#/definitions/i18nData" }, 15 "description": "Solutions in different languages for multi-lingual questions.", 16 "minItems": 1 17 } 18 ] 19 }

Sample Data for Quml Spec (1.0):

1// for single language 2{ 3 "solutions": [ 4 "solution 1 having html string", 5 "solution 2 having html string", 6 "solution 3 having html string" 7 ] 8} 9 10//for multi language 11{ 12 "solutions": [ 13 { 14 "en": "solution 1 having html string" 15 }, 16 { 17 "hi": "solution 2 having html string" 18 } 19 ] 20}


Proposed QuML spec (v1.1):

1"solutions": { 2 "description": "Solutions to the question.", 3 "type": "object", 4 "additionalProperties": { 5 "oneOf": [ 6 { 7 "type": "string" 8 }, 9 { "$ref": "#/definitions/i18nData" } 10 ] 11 } 12 }

Sample Data for QuML Spec (v1.1):

1// for single language 2 3{ 4 "solutions": { 5 "solution_1": "<div>...</div>", 6 "solution_2": "<div>...</div>" 7 } 8} 9 10//for multi language 11{ 12 "solutions": { 13 "solution_1": { 14 "en": "<div>...</div>", 15 "hi": "<div>...</div>" 16 }, 17 "solution_2": { 18 "en": "<div>...</div>", 19 "hi": "<div>...</div>" 20 } 21 } 22} 23 24solution_1 & solution_2 are unique identifiers for different solution

Attribute Name: bloomsLevel


Current QuML spec (v1):

1"bloomsLevel": { 2 "type": "array", 3 "enum": [""], 4 "description": "Cognitive processes involved to answer the question." 5 }

Proposed QuML spec (v1.1):

1"complexityLevel": { 2 "type": "array", 3 "items": { 4 "type": "string", 5 }, 6 "description": "Cognitive processes involved to answer the question." 7 }

Attribute Name: feedback
Current QuML spec (v1):

1"feedback": { 2 "description": "Feedback shown to the students after response processing.", 3 "type": "array", 4 "items": { 5 "type": "object", 6 "required": [ "id", "body" ], 7 "properties": { 8 "id": { 9 "description": "Identifier of the feedback object.", 10 "type": "string" 11 }, 12 "body": { 13 "description": "Body of the feedback to be rendered for the specified feedback identifier.", 14 "oneOf": [ 15 { 16 "type": "string", 17 "description": "Feedback as HTML string when the question is used in only one language." 18 }, 19 { "$ref": "#/definitions/i18nData" } 20 ] 21 } 22 } 23 } 24 }

Sample Data for QuML (v1.0):

1// single language 2{ 3 "feedback": [ 4 { 5 "id": "feedback_1", 6 "body": "<div>...</div>" 7 }, 8 { 9 "id": "feedback_2", 10 "body": "<div>...</div>" 11 } 12 ] 13} 14 15// multi language: 16 17{ 18 "feedback": [ 19 { 20 "id": "feedback_1", 21 "body": { 22 "en": "<div>...</div>", 23 "hi": "<div>...</div>", 24 "ka": "<div>...</div>" 25 } 26 }, 27 { 28 "id": "feedback_2", 29 "body": { 30 "en": "<div>...</div>", 31 "ka": "<div>...</div>" 32 } 33 } 34 ] 35}


Proposed QuML spec (v1.1):

1"feedback": { 2 "description": "Feedback shown to the students after response processing.", 3 "type": "object", 4 "additionalProperties": { 5 "oneOf": [ 6 { 7 "type": "string" 8 }, 9 { "$ref": "#/definitions/i18nData" } 10 ] 11 } 12 }

Sample Data for QuML (v1.1):

1//single language: 2{ 3 "feedback": { 4 "feedback_1": "<div>...</div>", 5 "feedback_2": "<div>...</div>" 6 } 7} 8 9 10//multi language: 11{ 12 "feedback": { 13 "feedback_1": { 14 "en": "<div>...</div>", 15 "hi": "<div>...</div>" 16 }, 17 "feedback_2": { 18 "en": "<div>...</div>", 19 "hi": "<div>...</div>" 20 } 21 } 22}

Attribute Name: hints
Current QuML spec (v1):

1"hints": { 2 "description": "Hints are shown to the students after response processing or when the student requests for hints.", 3 "type": "array", 4 "items": { 5 "type": "object", 6 "required": [ "id", "body" ], 7 "properties": { 8 "id": { 9 "description": "Identifier of the hint object.", 10 "type": "string" 11 }, 12 "body": { 13 "description": "Body of the hint to be rendered for the specified hint identifier.", 14 "oneOf": [ 15 { 16 "type": "string", 17 "description": "Hint as HTML string when the question is used in only one language." 18 }, 19 { "$ref": "#/definitions/i18nData" } 20 ] 21 } 22 } 23 } 24 }

Sample Data for QuML (v1.0):

1{ 2 "hints": [ 3 { 4 "id": "hint_1", 5 "body": "<div>...</div>" 6 }, 7 { 8 "id": "hint_2", 9 "body": { 10 "en": "<div>...</div>", 11 "hi": "<div>...</div>", 12 "ka": "<div>...</div>" 13 } 14 } 15 ] 16}


Proposed QuML spec (v1.1):

1"hints": { 2 "description": "Hints of the question.", 3 "type": "object", 4 "additionalProperties": { 5 "oneOf": [ 6 { 7 "type": "string" 8 }, 9 { "$ref": "#/definitions/i18nData" } 10 ] 11 } 12 }

Sample Data for QuML (v1.1):

1{ 2 "hints": { 3 4 "hint_1": "<div>...</div>", 5 6 "hint_2": { 7 "en": "<div>...</div>", 8 "hi": "<div>...</div>" 9 } 10 } 11}

Spec Changes for QuestionSet:

  • There are some special characters in line number 27 & 51. So need to re-write these lines.

  • coordinateDef is not available but coordinate definition is available which is being referred from line number 215. So need correction at line number 215.

  • media definition is missing which is being referred from anyTypeDef (line number: 224). So need to add media definition.