The context has been classified into two parts as below:
Telemetry Context
Editor Context
1. Telemetry Context:
It provides the context to the editor mostly in terms of the telemetry. Let's understand the description of the following properties:
Property Name
Description
Required
Default Value
env
It is string and Unique environment where the event has occured For example: in case of question set editor its questionset_editor
true
questionset_editor
OR
collection_editor
sid
It is string and session id of the requestor stamped by portal For example:vLpZ1rFl6-sxMVHi4RrmrlHw0HsX9ggC
true
did
It is string and uuid of the device, created during app installation or browser For example:1d8e290dd3c2a6a9eeac58568cdef28d
true
uid
It is string and Current logged in user id For example:5a587cc1-e018-4859-a0a8-e842650b9d64
true
channel
It is string which defines channel identifier to know which channel is currently using. For example:01309282781705830427
true
pdata
It is an object which defines the producer information it should have identifier and version and canvas will log in the telemetry. For example:{ id: 'local.sunbird.portal', ver: '4.1.0', pid: 'sunbird-portal' }
true
contextRollup
It is an object which defines collection roll up data For example: { l1: 'do_1234567890' }
true
tags
It is an object and Encrypted dimension tags passed by respective channels. For example: ['01307938306521497658']
true
identifier
It is string and Identifier of collection.
false
''
authToken
It is string and Auth key to make api calls.
false
''
cdata
It is an array which defines the correlation data
false
[]
timeDiff
It is number and timeDiff (in sec) is diff of server date and local date
false
''
objectRollup
It is an object which defines object rollup data (Only 4 levels are allowed)
false
{}
host
It is string which defines the from which domain collection should be load. For example:https://dev.sunbirded.org
false
''
endpoint
It is string and Telemetry API endpoint. For example:/data/v3/telemetry
false
''
userData
It is object and first and last name of logged in user
false
{}
2. Editor Context:
The editor context is used while launching the editor. Let's understand the description of the following properties:
Property Name
Description
Required
Default Value
framework
It is string and Organisation framework id. For example:ekstep_ncert_k-12
true
user
It is an object which defines user data which contains users id, fullName, lastName, orgIds.
Note: If the property is added in object-category-definition of questionset. It will take the config from there, otherwise questionset editor will take the mock config passed as input to the editor.
Description of the properties for the config:
Property Name
Description
Required
Default Value
isRoot
It is boolen and that defines the node is root node.
true
true
objectType
It is string and that defines the object type of collection
true
'QuestionSet'
primaryCategory
It is string and that defines the primary category of collection
'Practice Question Set'
iconClass
It is string and that defines the icon of root node
true
fa fa-book
children
If maxdepth is 0 this children inside the root node defines the template of questions. For example:children: { "Question": [ "Multiple Choice Question", "Subjective Question" ] }
true
assetProxyUrl
Asset proxy URL is to create a proxy URL of assets such as image/video to be used in editor with the proxy URL instead of making use actual blob storage URL to attach and display assets in questions.
false
'/assets/public/'
commonFrameworkLicenseUrl
It is string and It defines where should the common framework license link will be redirected.
false
'https://creativecommons.org/licenses/'
contentPolicyUrl
It is string and It defines where should the content policy link will be redirected.
false
/term-of-use.html
mode
It is string and that defines the mode in editor is to be loaded. For example:edit / review / read / sourcingReview / orgReview
false
edit
editableFields
It is an object and that defines the mode in editor is to be loaded.
It is number and Defines the depth to which the question set is to be created. If the depth is 1, hierarchy should have level1 described.
false
For example:1
assetConfig
It is an object and assetConfig sets the max size limit and type for image and videos to be uploaded in the editor. For example:{ "image": { "size": "1", "sizeType": "MB", "accepted": "png, jpeg" }, "video": { "size": "50", "sizeType": "MB", "accepted": "mp4, webm" } }
false
{}
hierarchy
It is an object and If maxdepth is > 0 then hierarchy should have definiton of the levels. For example:{ "level1": { "name": "Section", "type": "Unit", "mimeType": "application/vnd.sunbird.questionset", "primaryCategory": "Practice Question Set", "iconClass": "fa fa-folder-o", "children": { "Question": [ "Multiple Choice Question", "Subjective Question" ] } } }
false
{}
enableQuestionCreation
It enables or disables the creation of question in questionset
false
true
questionSet. maxQuestionsLimit
It defines the limit of total number of question to be created inside questionset.
false
500
Here is the sample configuration for Practise Question Set:
We can creation interactive as well as non-interactive type question in the Question Set. And the creation of question in Question Set is possible in "without Sections" as well as "with Sections". It is recommened that we should not enable creation of both interactive and non-interactive type question in a Question Set as both are for different use case.
1.) Configuration for Question Set without Sections:
For enabling creation of "Multiple Choice Question" (interactive question) in Question Set, objectCategoryDefinition.objectMetadata.config is to be set as:
For enabling creation of "Subjective Question" (non-interactive question) in Question Set, objectCategoryDefinition.objectMetadata.config is to be set as:
For enabling creation of "Multiple Choice Question" (interactive question) in the Section of Question Set, objectCategoryDefinition.objectMetadata.config is to be set as:
For enabling creation of "Subjective Question" (non-interactive question) in the Section of Question Set, objectCategoryDefinition.objectMetadata.config is to be set as: