Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
{
  "editorState": {
    "options": [
      {
        "answer": true,
        "value": {
          "body": "New Delhi",
          "value": 0
        }
      },
      {
        "answer": true,
        "value": {
          "body": "New York",
          "value": 1
        }
      }
    ],
    "question": "<p>capital of india is [[New Delhi]]. and capital of USA is [[New York]]</p>"
  },
  "body": "<p>capital of india is [[New Delhi]]. and capital of USA is [[New York]]</p>",
  "responseDeclaration": {
    "response1": {
      "cardinality": "single",
      "type": "string",
      "correctResponse": {
        "value": ["New Delhi", "New York"]
      },
      "mapping": [
        {
          "response": "New Delhi",
          "outcomes": {
            "score": 0.5
          }
        },
        {
          "response": "New York",
          "outcomes": {
            "score": 0.5
          }
        }
      ]
    }
  },
  "outcomeDeclaration": {
    "maxScore": 1
  },
  "interactionTypes": [
    "text"
  ],
  "media": [
    {
      "id": "do_2136875567564144641233",
      "type": "image",
      "src": "/assets/public/content/assets/do_2136875567564144641233/download.jpg",
      "baseUrl": "https://dev.inquiry.sunbird.org"
    }
  ],
  "name": "Fill In The Blanks",
  "mimeType": "application/vnd.sunbird.question",
  "objectType": "Question",
  "primaryCategory": "FTB Question",
  "qType": "FTB"
}

In QuML spec https://github.com/sunbird-specs/QuML/blob/master/v1/question-schema.json#L344 the mapping definition does not allow storing of value as string, it’s value type is defined as number

We need to update the spec to support this schema structure.

Pros:

  • This approach requires minimal effort to implement.

  • Creating the views for both editor and player becomes easier with this structure.

  • No need to store the interaction properties as we are storing values as it is.

  • Reduce the payload size compare to solution 1 and solution 2.

  • Players can easily evaluate the question by comparing the user answers against the expected correctResponse array.

...