Question Set Editor is an angular library built with Angular, and it exports some modules and components.
Component: editor
This is the main editor Component that accepts some configuration (here editorConfig
) based on it loads the editor.
Let's deep dive into the player input configuration:
Copy export interface questionSetEditorConfig = {
context: Context;
config: Config;
}
Input:
1. Context - Required
This Required property from the questionSetEditorConfig
provides the context to the questionset editor mostly in terms of the telemetry.
Along with this it also provides the channel level config, if available.
Copy export interface Context {
env: string;
sid: string;
did: string;
uid: string;
channel: string;
pdata: Pdata;
contextRollup: ContextRollup;
tags: string[];
identifier?: string;
authToken?: string;
cdata?: Cdata[];
timeDiff?: number;
objectRollup?: ObjectRollup;
host?: string;
endpoint?: string;
userData?: {
firstName: string;
lastName: string;
};
framework: string;
user: User;
programId?: string;
contributionOrgId?: string;
defaultLicense?: any;
cloudStorageUrls?: string[];
labels?: any;
targetFWIds?: string[];
board?: any;
medium?: any;
gradeLevel?: any;
subject?: any;
topic?: any;
additionalCategories?: any[];
actor?: any;
channelData?: any;
correctionComments?: any;
sourcingResourceStatus?: string;
sourcingResourceStatusClass?: string;
collectionIdentifier?: string;
unitIdentifier?: string;
collectionObjectType?: string;
collectionPrimaryCategory?: string;
cloudStorage?: any;
}
The context has been classified into two parts as below:
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:
2. Editor Context:
The editor context is used while launching the editor. Let's understand the description of the following properties:
2. Config - Required
This Required property from the questionsetEditorConfig provides the configuration for the questionset editor to enable/disable some functionalities.
Copy config: {
mode: 'string', //ex: 'edit'/'review'/'read'/'sourcingReview'/'orgReview'
editableFields: {
sourcingreview: string[],
orgreview: string[],
review: string[],
},
maxDepth: number, //ex: 1
objectType: 'QuestionSet',
primaryCategory: 'Practice Question Set',
isRoot: boolean, //ex: true
iconClass: 'string', //ex: 'fa fa-book'
children: {
Question: [
'Multiple Choice Question',
'Subjective Question'
]
},
hierarchy: {
level1: {
name: '', //ex: 'Section'
type: '', //ex: 'Unit'
mimeType: 'application/vnd.sunbird.questionset',
primaryCategory: 'string', //ex: 'Practice Question Set'
iconClass: 'string' //ex: 'fa fa-folder-o',
children: {}
},
level2: {
name: 'string', //ex: 'Sub Section'
...
...
},
level3: {
...
...
}
},
assetProxyUrl: 'string' //ex: '/assets/public/'
commonFrameworkLicenseUrl: 'string' //ex: 'https://creativecommons.org/licenses/'
contentPolicyUrl: 'string' //ex: '/term-of-use.html'
}
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:
Here is the sample configuration for Practise Question Set:
Practise Question Set
Recommended Configuration for 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:
Copy {
"sourcingSettings": {
"collection": {
"maxDepth": 0,
"objectType": "QuestionSet",
"primaryCategory": "Practice Question Set",
"isRoot": true,
"iconClass": "fa fa-book",
"children": {
"Question": [
"Multiple Choice Question"
]
},
"hierarchy": {}
}
}
}
For enabling creation of "Subjective Question" (non-interactive question) in Question Set, objectCategoryDefinition.objectMetadata.config is to be set as:
Copy {
"sourcingSettings": {
"collection": {
"maxDepth": 0,
"objectType": "QuestionSet",
"primaryCategory": "Practice Question Set",
"isRoot": true,
"iconClass": "fa fa-book",
"children": {
"Question": [
"Subjective Question"
]
},
"hierarchy": {}
}
}
}
2.) Configuration for Question Set with Sections.
For enabling creation of "Multiple Choice Question" (interactive question) in the Section of Question Set, objectCategoryDefinition.objectMetadata.config is to be set as:
Copy {
"sourcingSettings": {
"collection": {
"maxDepth": 1,
"objectType": "QuestionSet",
"primaryCategory": "Practice Question Set",
"isRoot": true,
"iconClass": "fa fa-book",
"children": {},
"hierarchy": {
"level1": {
"name": "Section",
"type": "Unit",
"mimeType": "application/vnd.sunbird.questionset",
"primaryCategory": "Practice Question Set",
"iconClass": "fa fa-folder-o",
"children": {
"Question": [
"Multiple Choice Question"
]
}
}
}
}
}
}
For enabling creation of "Subjective Question" (non-interactive question) in the Section of Question Set, objectCategoryDefinition.objectMetadata.config is to be set as:
Copy {
"sourcingSettings": {
"collection": {
"maxDepth": 1,
"objectType": "QuestionSet",
"primaryCategory": "Practice Question Set",
"isRoot": true,
"iconClass": "fa fa-book",
"children": {},
"hierarchy": {
"level1": {
"name": "Section",
"type": "Unit",
"mimeType": "application/vnd.sunbird.questionset",
"primaryCategory": "Practice Question Set",
"iconClass": "fa fa-folder-o",
"children": {
"Question": [
"Subjective Question"
]
}
}
}
}
}
}
Note:- It is recommended to add children as either of these (and not to mix "Multiple Choice Question" and "Subjective Question" questions).
Copy "children": {
"Question": [
"Multiple Choice Question"
]
}
or
Copy "children": {
"Question": [
"Subjective Question"
]
}