Contains QuestionSet Editor library components powered by angular. These components are designed to be used in the sunbirdEd portal and coKreat reference web portal to drive reusability, maintainability hence reducing the redundant development effort significantly.
Developer Documentation
Getting Started
For help getting started with a new Angular app, check out the Angular CLI. For existing apps, follow these steps to begin using .
Step 1: Install the packages
...
Contains QuestionSet Editor library components powered by angular. These components are designed to be used in the sunbirdEd portal and coKreat reference web portal to drive reusability, maintainability hence reducing the redundant development effort significantly.
Table of Contents | ||||||
---|---|---|---|---|---|---|
|
Developer Documentation
Getting Started
For help getting started with a new Angular app, check out the Angular CLI. For existing apps, follow these steps to begin using .
Step 1: Install the packages
Code Block |
---|
npm i @project-sunbird/sunbird-collection-editor-v9 --save npm i epubjscommon-form-elements-web-v9 --save npm i videojsng2-contribsemantic-qualityui-levelsv9 --save npm i videojs-http-source-selectorngx-infinite-scroll --save npm i lodash-es --save npm i jquery.fancytree --save npm i express-http-proxyangular2-uuid --save npm i @project-sunbird/client-services --save npm i mathjaxexport-to-fullcsv --save npm i svg2imgmoment --save npm i font-awesome@project-sunbird/ckeditor-build-classic --save npm i @project-sunbird/sb-styles |
Note: As QuestionSet Editor library is build with angular version 9, we are using ngx-bootstrap@6.0.0 and ngx-chips@2.2.0 which are the compatible versions.
For more reference Check compatibility document for ng-bootstrap here
Step 2: Add the required services and QuestionSet editor config
Create a editor-cursor-implementation.service.ts in a project and which will implement the
QuestionCursor
andEditorCursor
abstract class. Refer: editor-cursor-implementation.service.ts
Remember EditorCursor
is to be imported like this
...
sunbird-pdf-player-v9 --save npm i @project-sunbird/sunbird-epub-player-v9 --save npm i @project-sunbird/sunbird- |
...
video- |
...
Create a data.ts file which contains the
questionSetEditorConfig
Refer: data.ts
Note: questionSetEditorConfig
in data.ts contains the mock config used in component to send it as input to QuestionSet Editor. We need only questionSetEditorConfig
...
Create a latexService.js in root folder. Refer: latexService.js
...
Create a proxy.conf.json in root folder. Refer: proxy.conf.json
...
Copy the assets from: assets
Step 3: Include the styles, scripts and assets in angular.json
Code Block |
---|
{ ... "build": { "builder": "@angular-devkit/build-angular:browser", "options": { ... ... "aot": false, "assets": [ ... ... { "glob": "**/*", "input": "node_modules/@project-sunbird/sunbird-pdf-player-v9/lib/assets/", "output": "/assets/" }, { "glob": "**/*", "input": "node_modules/@project-sunbird/sunbird-video-player-v9/lib/assets/", "output": "/assets/" }player-v9 --save npm i @project-sunbird/sunbird-quml-player-v9 --save npm i ngx-bootstrap@6.0.0 --save npm i ng2-cache-service --save npm i fine-uploader --save npm i ngx-chips@2.2.0 --save npm i epubjs --save npm i videojs-contrib-quality-levels --save npm i videojs-http-source-selector --save npm i jquery --save npm i express-http-proxy --save npm i mathjax-full --save npm i svg2img --save npm i font-awesome --save npm i @project-sunbird/sb-styles |
Note: As QuestionSet Editor library is build with angular version 9, we are using ngx-bootstrap@6.0.0 and ngx-chips@2.2.0 which are the compatible versions.
For more reference Check compatibility document for ng-bootstrap here
Step 2: Add the required services and QuestionSet editor config
Create a editor-cursor-implementation.service.ts in a project and which will implement the
QuestionCursor
andEditorCursor
abstract class. Refer: editor-cursor-implementation.service.ts
Remember EditorCursor
is to be imported like this
import { EditorCursor } from '@project-sunbird/sunbird-collection-editor-v9';
Create a data.ts file which contains the
questionSetEditorConfig
Refer: data.ts
Note: questionSetEditorConfig
in data.ts contains the mock config used in component to send it as input to QuestionSet Editor. We need only questionSetEditorConfig
Create a latexService.js in root folder. Refer: latexService.js
Create a proxy.conf.json in root folder. Refer: proxy.conf.json
Create server.js in root folder. Refer: server.js
Copy the assets from: assets
Step 3: Include the styles, scripts and assets in angular.json
Code Block |
---|
{ ... "build": { "builder": "@angular-devkit/build-angular:browser", "options": { ... ... "aot": false, "assets": [ ... ... { "glob": "**/*", "input": "node_modules/@project-sunbird/sunbird-collectionpdf-editorplayer-v9/lib/assets/", "output": "/assets/" }, { "glob": "**/*", "input": "node_modules/@project-sunbird/sunbird-qumlvideo-player-v9/lib/assets/", "output": "/assets/" }, ], "styles": [{ ... "glob": "src/assets/quml-styles/quml-carousel.css",**/*", "input": "node_modules/@project-sunbird/sb-styles/assets/_styles.scss",sunbird-collection-editor-v9/lib/assets", "output": "src/assets/lib/semantic/semantic.min.css"," "src/assets/styles/styles.scss" }, "node_modules/font-awesome/css/font-awesome.css { "glob": "**/*", "node_modules/video.js/dist/video-js.min.css", "input": "node_modules/@project-sunbird/sunbird-videoquml-player-v9/lib/assets/videojs.markers.min.css", "node_modules/videojs-http-source-selector/dist/videojs-http-source-selector.css" "output": "/assets/" } ], "scriptsstyles": [ ... "node_modulessrc/epubjsassets/dist/epub.jsquml-styles/quml-carousel.css", "src/assets/libs/iziToast/iziToast.min.jsnode_modules/@project-sunbird/sb-styles/assets/_styles.scss", "node_modules/jquery/dist/jquerysrc/assets/lib/semantic/semantic.min.jscss", "node_modules/jquery.fancytree/dist/jquery.fancytree-all-deps.min.jssrc/assets/styles/styles.scss", "src/assets/lib/dimmer.min.jsnode_modules/font-awesome/css/font-awesome.css", "src/assets/lib/transitionnode_modules/video.js/dist/video-js.min.jscss", "src/assetsnode_modules/@project-sunbird/sunbird-video-player-v9/lib/modalassets/videojs.markers.min.jscss", "src/assets/lib/semantic-ui-tree-picker.js",node_modules/videojs-http-source-selector/dist/videojs-http-source-selector.css" "node_modules/@project-sunbird/client-services/index.js",], "scripts": [ ... "node_modules/video.jsepubjs/dist/videoepub.js", "node_modules/@project-sunbird/sunbird-video-player-v9/lib/assets/videojs-markerssrc/assets/libs/iziToast/iziToast.min.js", "node_modules/videojs-contrib-quality-levelsjquery/dist/videojs-contrib-quality-levelsjquery.min.js", "node_modules/videojs-http-source-selectorjquery.fancytree/dist/videojsjquery.fancytree-httpall-source-selectordeps.min.js", ] "src/assets/lib/dimmer.min.js", } } "src/assets/lib/transition.min..js", ... } |
Step 4: Change in package.json
Code Block |
---|
{ "src/assets/lib/modal.min..js", ... "scripts": {src/assets/lib/semantic-ui-tree-picker.js", "ng": "ngnode_modules/@project-sunbird/client-services/index.js", "start": "ng serve --proxy-config proxy.conf.json "node_modules/video.js/dist/video.js", ... "node_modules/@project-sunbird/sunbird-video-player-v9/lib/assets/videojs-markers.js", ... }"node_modules/videojs-contrib-quality-levels/dist/videojs-contrib-quality-levels.min.js", ... "dependencies": {"node_modules/videojs-http-source-selector/dist/videojs-http-source-selector.min.js" ... ] ... } } }, ... "devDependencies": ... } |
Step 4: Change in package.json
Code Block |
---|
{ ... ... "scripts": { } } |
Step 5: Import the modules and components
Import the required modules such as below:
Code Block |
---|
import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { CollectionEditorLibraryModule, EditorCursor } from '@project-sunbird/sunbird-collection-editor-v9'; import { RouterModule } from '@angular/router'; import { QuestionCursor } from '@project-sunbird/sunbird-quml-player-v9'; import { EditorCursorImplementationService } from './editor-cursor-implementation.service'; @NgModule({ "ng": "ng", "start": "ng serve --proxy-config proxy.conf.json", ... ... }, ... imports"dependencies": [{ ... CollectionEditorLibraryModule, ... BrowserAnimationsModule}, "devDependencies": { RouterModule.forRoot([]) ... ], ... providers: [ } {} provide: QuestionCursor, useExisting: EditorCursorImplementationService }, { provide: EditorCursor, useExisting: EditorCursorImplementationService } ] ... }) export class AppModule { } |
Add the questionset editor config in component
Code Block |
---|
... import { questionSetEditorConfig |
Step 5: Import the modules and components
Import the required modules such as below:
Code Block |
---|
import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { CollectionEditorLibraryModule, EditorCursor } from '@project-sunbird/sunbird-collection-editor-v9'; import { RouterModule } from '@angular/router'; import { QuestionCursor } from '@project-sunbird/sunbird-quml-player-v9'; import { EditorCursorImplementationService } from './dataeditor-cursor-implementation.service'; @Component @NgModule({ ... imports: [ ... CollectionEditorLibraryModule, ... }) BrowserAnimationsModule, export class AppComponent { ...RouterModule.forRoot([]) ], public editorConfigproviders: [ any = questionSetEditorConfig; }{ |
...
provide: QuestionCursor, useExisting: EditorCursorImplementationService },
{ provide: EditorCursor, useExisting: EditorCursorImplementationService }
]
...
})
export class AppModule { } |
Add the questionset editor config in component
Code Block |
---|
...
import { questionSetEditorConfig } from './data';
@Component({
...
...
...
})
export class AppComponent {
...
public editorConfig: any = questionSetEditorConfig;
}
|
Step 6: Send input to render QuestionSet Editor
...
The demo app will launch at http://localhost:4200
Set the auth token and questionset identifier
From the root directory - go to server.js
file
...
Code Block |
---|
export interface questionSetEditorConfig = { context: Context; config: Config; } |
Context - Required
This Required property from the questionSetEditorConfig
provides the context to the questionset editor mostly in terms of the telemetry.
...
Property | Required | Description |
---|---|---|
programId | false | program id in which questionset is created. |
contributionOrgId | false | Organisation id of the contributor. |
user | true | User object which contains users id, fullName, lastName, orgIds. |
identifier | false | identifier of questionset |
authToken | false | Authentication token |
sid | true | session id of the requestor stamped by portal |
did | true | uuid of the device |
channel | true | Channel which has produced the event |
pdata | true | Producer of the event |
contextRollup | true | Context Rollups upto level 4 |
tags | true | Encrypted dimension tags passed by respective channels |
cdata | false | Correlation data |
timeDiff | false | Last player duration |
objectRollup | false | Object Rollup up to level 4 |
host | false | Host URL |
endpoint | false | Telemetry API endpoint |
userData.firstName | false | User's first name |
userData.lastName | false | User's last name |
env | true | type of editor , in case of questionset editor its |
defaultLicense | false | default license of questionset |
framework | true | Organisation framework id |
cloudStorageUrls | false | Array of cloud storage urls |
additionalCategories | false | Array of objects of additional categories |
labels | false | Additional labels to be used in editor |
targetFWIds | false | Array of target framework ids |
...
Config - Required
This Required property from the questionsetEditorConfig provides the configuration for the questionset editor to enable/disable some functionalities.
Code Block |
---|
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: { ... ... } }, contentPolicyUrl: 'string' //ex: '/term-of-use.html' } |
Note: If any of 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 | Default Value | Required | Description |
---|---|---|---|
mode | true | Defines the mode in editor is to be loaded loaded. | |
editableFields | { sourcingreview: [], orgreview: [], review: [], } | false | Defines which fields is to be enabled when mode of questionset is review / sourcingReview / orgReview |
enableQuestionCreation | true | false | It enables or disables the creation of question in questionset |
assetConfig | false | asset Config sets the max size limit for image and videos to be uploaded in question in questionset. | |
maxDepth | true | Defines the depth to which the questionset is to be created. If the depth is 1, hierarchy should have level1 described. | |
children | true | If maxdepth is 0 this children inside the root node defines the template of questions. | |
hierarchy | false | If maxdepth is > 0 then hierarchy should have definiton of the levels. | |
objectType | 'QuestionSet' | true | Defines the object type |
primaryCategory | 'Practice Question Set' | true | Defines the primary category |
isRoot | true | true | Defines the node is root node. |
iconClass | 'fa fa-book' | true | Defines the icon of root node |
showAddCollaborator | false | false | This is to enable/disable the functionality of add collaborator in questionset. If it is true add collobrorator button will be enabled and created can add the collolaborator to collaborate in questionset. |
questionSet. maxQuestionsLimit | false | It defines the limit of total number of question to be created inside questionset. | |
contentPolicyUrl | true | It defines where should the content policy link will be redirected. |
mode:
mode: edit (all the fields will be enable to edit for questionset creator)
...
mode: sourcingReview (all those fields will be enabled whatever will be present in editableFields.sourcingreview)
...
Its object for different types of mode based on which some fields get enabled.
Code Block |
---|
editableFields: {
"sourcingreview": [
"instructions"
],
"orgreview": [
"name",
"instructions",
"learningOutcome"
],
"review": [
"name",
"description"
]
} |
In sourcingreview, we have “instructions”, so when the mode of editor is sourcingReview in that case instruction will be only enabled.
...
enableQuestionCreation:
When enableQuestionCreation: false “Create New” button gets disabled
...
assetConfig:
Code Block |
---|
assetConfig: {
"image": {
"size": "1",
"sizeType": "MB",
"accepted": "png, jpeg"
},
"video": {
"size": "50",
"sizeType": "MB",
"accepted": "mp4, webm"
}
} |
asset Config sets the max size limit for image and videos to be uploaded in questionset and the type of image and videos.
maxDepth:
maxDepth defines the level of questionset i.e at which level question to be created. If maxDepth is set as 0, “Create New“ button get enabled to question at root node.
...
Note: children
at root node is to be defined which defines the type of question can be created at root node. Here is the default value for children.
Code Block |
---|
children: {
Question: [
'Multiple Choice Question',
'Subjective Question'
]
} |
If the maxDepth is set as 1, we need to define hierarchy
also.
Here is the default value of hierarchy we are using, you can change the name of level also
Code Block |
---|
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",
"Subjective Question"
]
}
}
} |
Note: If you add more depth you need to add more levels in hierarchy.
iconClass:
This defines the icon which comes in the node and levels, you can set your own icon here by adding the class of icon, in root node for iconClass: 'fa fa-book'
icon is shown as:
...
showAddCollaborator:
When showAddCollaborator is set it to true
it enable the add collaborator option in questionset. With which creator can as select the collaborate to contribute to same questionset.
...
questionSet.maxQuestionsLimit:
This defines the maxiumun number of question to be created in a questionset.
Code Block |
---|
questionSet: {
"maxQuestionsLimit": "500"
} |
Suppose if "maxQuestionsLimit"
is set to “5“ then while trying to create new question it will give error maxlimit message as:
...
contentPolicyUrl:
It defines where should the content policy link should be retirected.
contentPolicyUrl: "/term-of-use.html"
in diksha we are using this config as it redirects to (https://diksha.gov.in/term-of-use.html)
...
Object Category Definition of Questionset and form config
Field Format:
Code Block |
---|
{
"code": "string",
"dataType": "string", // text, list, number, boolean
"description": "string",
"editable": boolean, // true/ false
"inputType": "", // text, richtext, textarea,keywords,nestedselect,select,topicselect,checkbox,timer,
"label": "string",
"name": "string",
"placeholder": "string",
"renderingHints": {
"class": "sb-g-col-lg-2 required"
}, //sb-g-col-lg-2 required, sb-g-col-lg-1 required
"validations": [
{
"type": "required",
"message": "string"
} // required, maxLength,compare
]
}
|
dataType
datatype is the format in which sb-form outputs the data of field in that data type:
text: “string”
list: array[]
number: number
boolean: true/false
renderHints
renderHints defines whether the field should take space of two column(sb-g-col-lg-2) or one column(sb-g-col-lg-1) and to add asterisks(*) in the label of field(required)
validations
validations defines the different types of validations which can be done on fields
We are using required, maxLength,compare
required: for making the field to be required you need to add the required validations as:
Code Block |
---|
"validations": [
{
"type": "required",
"message": "Any message to be shown below the field if field is not filled"
}
] |
maxLength: for adding restriction of length on field text, textarea, richtext.
Code Block |
---|
"validations": [
{
"type": "maxLength",
"value": "120",
"message": "Input is Exceeded"
}
] |
compare: for comparing one field with another.
In the case of timer warningTime should be less than or equal to maxTime so in warning time we can add the compare validation as:
Code Block |
---|
"validations": [
{
"type": "compare",
"criteria": {
"<=": [
"maxTime"
]
},
"message": "warning time should be less than max timer"
}
] |
inputType
inputType defines the different types of field with which some kind of data can be sent to sb-form.
We are using text, richtext, textarea, keywords, nestedselect, select, topicselect, checkbox, timer
"inputType": "text"
Code Block |
---|
{
"code": "name",
"dataType": "text",
"description": "Name of the Practice Question Set",
"editable": true,
"inputType": "text",
"label": "Name",
"name": "Name",
"placeholder": "Enter name of the question set",
"renderingHints": {
"class": "sb-g-col-lg-1 required"
},
"required": true,
"visible": true,
"validations": [
{
"type": "maxLength",
"value": "120",
"message": "Input is Exceeded"
},
{
"type": "required",
"message": "Name is required"
}
]
} |
...
"inputType": "textarea"
Code Block |
---|
{
"code": "description",
"dataType": "text",
"description": "Description of the content",
"editable": true,
"inputType": "textarea",
"label": "Description",
"name": "Description",
"placeholder": "Description",
"renderingHints": {
"class": "sb-g-col-lg-1 required"
},
"required": true,
"visible": true,
"validations": [
{
"type": "required",
"message": "description is required"
}
]
} |
...
"inputType": "richtext"
Code Block |
---|
{
"code": "instructions",
"dataType": "text",
"description": "Instructions for the question set",
"editable": true,
"inputType": "richtext",
"label": "Instructions",
"name": "Instruction",
"placeholder": "Enter Instructions",
"renderingHints": {
"class": "sb-g-col-lg-2 required"
},
"validations": [
{
"type": "required",
"message": "Instruction is required"
}
],
"required": true,
"visible": true
} |
...
“inputType”: “keywords”
Code Block |
---|
{
"code": "keywords",
"visible": true,
"editable": true,
"dataType": "list",
"name": "Keywords",
"renderingHints": {
"class": "sb-g-col-lg-1"
},
"description": "Keywords for the content",
"inputType": "keywords",
"label": "keywords",
"placeholder": "Enter Keywords",
"required": false,
"validations": []
} |
...
"inputType": "nestedselect"
Code Block |
---|
{
"code": "additionalCategories",
"dataType": "list",
"description": "Additonal Category of the Content",
"editable": true,
"inputType": "nestedselect",
"label": "Additional Category",
"name": "Additional Category",
"placeholder": "Select Additional Category",
"renderingHints": {
"class": "sb-g-col-lg-1"
},
"default": "",
"required": false,
"visible": true
} |
...
"inputType": "select"
Code Block |
---|
{
"code": "board",
"default": "",
"visible": true,
"depends": [],
"editable": true,
"dataType": "text",
"renderingHints": {
"class": "sb-g-col-lg-1"
},
"description": "Board",
"label": "Board/Syllabus",
"required": false,
"name": "Board/Syllabus",
"inputType": "select",
"placeholder": "Select Board/Syllabus"
} |
...
"inputType": "topicselector"
Code Block |
---|
{
"code": "topic",
"visible": true,
"editable": true,
"dataType": "list",
"depends": [
"board",
"medium",
"gradeLevel",
"subject"
],
"default": "",
"renderingHints": {
"class": "sb-g-col-lg-1"
},
"name": "Topic",
"description": "Choose a Topics",
"inputType": "topicselector",
"label": "Topics",
"placeholder": "Choose Topics",
"required": false
} |
...
"inputType": "checkbox"
Code Block |
---|
{
"code": "showSolutions",
"dataType": "text",
"description": "Show Solution",
"editable": true,
"inputType": "checkbox",
"label": "Show Solution",
"name": "Show Solution",
"placeholder": "Show Solution",
"renderingHints": {
"class": "sb-g-col-lg-1"
},
"required": false,
"visible": true
} |
...
“inputType”: “timer”
Code Block |
---|
{
"code": "maxTime",
"visible": true,
"editable": true,
"dataType": "text",
"name": "MaxTimer",
"renderingHints": {
"class": "sb-g-col-lg-1 required"
},
"description": "MaxTime for the content",
"inputType": "timer",
"label": "Max Time",
"placeholder": "HH:mm:ss",
"required": true,
"validations": [
{
"type": "required",
"message": "Maxtime is required"
},
{
"type": "maxTime",
"value": "05:30",
"message": "Maxtime should be less than or equal to 05:30"
},
{
"type": "minTime",
"value": "00:01",
"message": "Maxtime should be greater than 00:00"
}
]
} |
...
Root Node form
...
Section Form
...
Publish Check List
This list is shown when questionset is being reviewed and clicked on publish button.
...
objectCategoryDefinition
Code Block |
---|
"objectCategoryDefinition": { "identifier": "obj-cat:practice-question-set_questionset_all", "objectMetadata": { "config": { "sourcingSettings": { "collection": { "objectType": "QuestionSet", "primaryCategory": "Practice Question Set", "maxDepth": 1, "isRoot": true, "iconClass": "fa fa-book", "children": { "Question": [ "Multiple Choice Question", "Subjective Question" ] }, "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", "Subjective Question" ] } } } } } }, "schema": { "properties": { "mimeType": { "type": "string", "enum": [ "application/vnd.sunbird.questionset" ] } } } }, "languageCode": [], "name": "Practice Question Set", "forms": { "create": { "templateName": "", "required": [], "properties": [ { "code": "instructions", "dataType": "text", "description": "Instructions for the question set", "editable": true, "inputType": "richtext", "label": "Instructions", "name": "Instruction", "placeholder": "Enter Instructions", "renderingHints": { "class": "sb-g-col-lg-2 required" }, "validations": [ { "type": "required", "message": "Instruction is required" } ], "required": true, "visible": true }, { "code": "name", "dataType": "text", "description": "Name of the Practice Question Set", "editable": true, "inputType": "text", "label": "Name", "name": "Name", "placeholder": "Enter name of the question set", "renderingHints": { "class": "sb-g-col-lg-1 required" }, "required": true, "visible": true, "validations": [ { "type": "maxLength", "value": "120", "message": "Input is Exceeded" }, { "type": "required", "message": "Name is required" } ] }, { "code": "description", "dataType": "text", "description": "Description of the content", "editable": true, "inputType": "textarea", "label": "Description", "name": "Description", "placeholder": "Description", "renderingHints": { "class": "sb-g-col-lg-1 required" }, "required": true, "visible": true, "validations": [ { "type": "required", "message": "description is required" } ] }, { "code": "keywords", "visible": true, "editable": true, "dataType": "list", "name": "Keywords", "renderingHints": { "class": "sb-g-col-lg-1" }, "description": "Keywords for the content", "inputType": "keywords", "label": "keywords", "placeholder": "Enter Keywords", "required": false, "validations": [] }, { "code": "primaryCategory", "dataType": "text", "description": "Type", "editable": false, "renderingHints": { "class": "sb-g-col-lg-1" }, "inputType": "text", "label": "Type", "name": "Type", "placeholder": "", "required": false, "visible": true }, { "code": "additionalCategories", "dataType": "list", "description": "Additonal Category of the Content", "editable": true, "inputType": "nestedselect", "label": "Additional Category", "name": "Additional Category", "placeholder": "Select Additional Category", "renderingHints": { "class": "sb-g-col-lg-1" }, "default": "", "required": false, "visible": true }, { "code": "board", "default": "", "visible": true, "depends": [], "editable": true, "dataType": "text", "renderingHints": { "class": "sb-g-col-lg-1" }, "description": "Board", "label": "Board/Syllabus", "required": false, "name": "Board/Syllabus", "inputType": "select", "placeholder": "Select Board/Syllabus" }, { "code": "medium", "visible": true, "depends": [ "board" ], "editable": true, "default": "", "dataType": "list", "renderingHints": { "class": "sb-g-col-lg-1" }, "description": "", "label": "Medium", "required": false, "name": "Medium", "inputType": "select", "placeholder": "Select Medium" }, { "code": "gradeLevel", "visible": true, "depends": [ "board", "medium" ], "editable": true, "default": "", "dataType": "list", "renderingHints": { "class": "sb-g-col-lg-1" }, "description": "Class", "label": "Class", "required": false, "name": "Class", "inputType": "select", "placeholder": "Select Class" }, { "code": "subject", "visible": true, "depends": [ "board", "medium", "gradeLevel" ], "editable": true, "default": "", "dataType": "list", "renderingHints": { "class": "sb-g-col-lg-1" }, "description": "", "label": "Subject", "required": false, "name": "Subject", "inputType": "select", "placeholder": "Select Subject" }, { "code": "topic", "visible": true, "editable": true, "dataType": "list", "depends": [ "board", "medium", "gradeLevel", "subject" ], "default": "", "renderingHints": { "class": "sb-g-col-lg-1" }, "name": "Topic", "description": "Choose a Topics", "inputType": "topicselector", "label": "Topics", "placeholder": "Choose Topics", "required": false }, { "code": "audience", "dataType": "list", "description": "Audience", "editable": true, "inputType": "select", "label": "Audience", "name": "Audience", "placeholder": "Select Audience", "renderingHints": { "class": "sb-g-col-lg-1 required" }, "required": true, "visible": true, "range": [ "Student", "Teacher", "Administrator" ], "validations": [ { "type": "required", "message": "Audience is required" } ] }, { "code": "showFeedback", "dataType": "text", "description": "Show Feedback", "editable": true, "default": "", "inputType": "checkbox", "label": "Show Feedback", "name": "showFeedback", "placeholder": "Show Feedback", "renderingHints": { "class": "sb-g-col-lg-1" }, "required": false, "visible": true }, { "code": "showSolutions", "dataType": "text", "description": "Show Solution", "editable": true, "inputType": "checkbox", "label": "Show Solution", "name": "Show Solution", "placeholder": "Show Solution", "renderingHints": { "class": "sb-g-col-lg-1" }, "required": false, "visible": true }, { "code": "shuffle", "dataType": "boolean", "description": "Shuffle Questions", "editable": true, "default": "", "inputType": "checkbox", "label": "Shuffle Questions", "name": "Shuffle Questions", "placeholder": "Shuffle Questions", "renderingHints": { "class": "sb-g-col-lg-1" }, "required": false, "visible": true }, { "code": "maxAttempts", "visible": true, "editable": true, "dataType": "number", "name": "Max Attempts", "renderingHints": { "class": "sb-g-col-lg-1" }, "description": "Max Attempts", "inputType": "select", "label": "Max Attempts", "placeholder": "Max Attempts", "required": false, "range": [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25 ] }, { "code": "maxTime", "visible": true, "editable": true, "dataType": "text", "name": "MaxTimer", "renderingHints": { "class": "sb-g-col-lg-1 required" }, "description": "MaxTime for the content", "inputType": "timer", "label": "Max Time", "placeholder": "HH:mm:ss", "required": true, "validations": [ { "type": "required", "message": "Maxtime is required" }, { "type": "maxTime", "value": "05:30", "message": "Maxtime should be less than or equal to 05:30" }, { "type": "minTime", "value": "00:01", "message": "Maxtime should be greater than 00:00" } ] }, { "code": "warningTime", "visible": true, "editable": true, "dataType": "list", "name": "Warning Time", "renderingHints": { "class": "sb-g-col-lg-1" }, "depends": [ "maxTime" ], "description": "warning for the content", "inputType": "timer", "label": "Warning Time", "placeholder": "hh:mm:ss", "required": false, "validations": [ { "type": "compare", "criteria": { "<=": [ "maxTime" ] }, "message": "warning time should be less than max timer" } ], "default": null }, { "code": "requiresSubmit", "visible": true, "editable": true, "dataType": "text", "name": "Submit Confirmation", "renderingHints": { "class": "sb-g-col-lg-1" }, "description": "Submit Confirmation", "inputType": "checkbox", "label": "Submit Confirmation", "placeholder": "Submit Confirmation", "required": false }, { "code": "maxQuestions", "dataType": "number", "description": "Show Questions", "editable": true, "inputType": "select", "label": "Show Questions", "name": "maxQuestions", "placeholder": "Number of questions to be shown", "renderingHints": { "class": "sb-g-col-lg-1" }, "required": false, "visible": true }, { "code": "author", "dataType": "text", "description": "Author of the content", "editable": true, "inputType": "text", "label": "Author", "name": "Author", "placeholder": "Author", "renderingHints": { "class": "sb-g-col-lg-1 required" }, "required": true, "visible": true, "validations": [ { "type": "required", "message": "Author is required" } ] }, { "code": "attributions", "dataType": "text", "description": "Attributions", "editable": true, "inputType": "text", "label": "Attributions", "name": "Attributions", "placeholder": "Attributions", "renderingHints": { "class": "sb-g-col-lg-1" }, "required": false, "visible": true }, { "code": "copyright", "dataType": "text", "description": "Copyright & year", "editable": true, "inputType": "text", "label": "Copyright & year", "name": "Copyright & year", "placeholder": "Copyright & year", "renderingHints": { "class": "sb-g-col-lg-1" }, "required": false, "visible": true }, { "code": "license", "dataType": "text", "description": "license", "editable": true, "inputType": "select", "label": "license", "name": "license", "placeholder": "Select license", "renderingHints": { "class": "sb-g-col-lg-1" }, "required": false, "visible": true, "range": "" }, { "code": "showTimer", "visible": false, "editable": false, "dataType": "text", "default": "Yes", "depends": [ "maxTime" ], "name": "Show Timer", "renderingHints": { "class": "sb-g-col-lg-1" }, "description": "Show Timer", "inputType": "checkbox", "label": "Show Timer", "placeholder": "Show Timer", "required": false }, { "code": "summaryType", "dataType": "text", "description": "summaryType", "editable": true, "inputType": "select", "label": "Summary Type", "name": "summaryType", "placeholder": "Select Summary Type", "renderingHints": { "class": "sb-g-col-lg-1" }, "required": false, "visible": true, "range": [ "Complete", "Score", "Duration", "Score & Duration" ] } ] }, "delete": {}, "publish": {}, "publishchecklist": { "templateName": "", "required": [], "properties": [ { "name": "Appropriateness", "renderingHints": { "class": "d-grid-inline-3 display-sectionName" }, "fields": [ { "code": "appropriatenessOne", "name": "No Hate speech, Abuse, Violence, Profanity", "label": "No Hate speech, Abuse, Violence, Profanity", "dataType": "boolean", "inputType": "checkbox", "editable": true, "required": false, "visible": true, "validations": [ { "type": "required", "message": "" } ], "renderingHints": { "class": "sb-g-col-lg-1" } }, { "code": "appropriatenessTwo", "name": "No Sexual content, Nudity or Vulgarity", "label": "No Sexual content, Nudity or Vulgarity", "dataType": "boolean", "inputType": "checkbox", "editable": true, "required": false, "visible": true, "validations": [ { "type": "required", "message": "" } ], "renderingHints": { "class": "sb-g-col-lg-1" } }, { "code": "appropriatenessThree", "name": "No Discrimination or Defamation", "label": "No Discrimination or Defamation", "dataType": "boolean", "inputType": "checkbox", "editable": true, "required": false, "visible": true, "validations": [ { "type": "required", "message": "" } ], "renderingHints": { "class": "sb-g-col-lg-1" } }, { "code": "appropriatenessFour", "name": "Is suitable for children", "label": "Is suitable for children", "dataType": "boolean", "inputType": "checkbox", "editable": true, "required": false, "visible": true, "validations": [ { "type": "required", "message": "" } ], "renderingHints": { "class": "sb-g-col-lg-1" } } ] }, { "name": "Content details", "renderingHints": { "class": "d-grid-inline-3 display-sectionName" }, "fields": [ { "code": "contentdetailsOne", "name": "Appropriate Title, Description", "label": "Appropriate Title, Description", "dataType": "boolean", "inputType": "checkbox", "editable": true, "required": false, "visible": true, "validations": [ { "type": "required", "message": "" } ], "renderingHints": { "class": "sb-g-col-lg-1" } }, { "code": "contentdetailsTwo", "name": "Correct Board, Grade, Subject, Medium", "label": "Correct Board, Grade, Subject, Medium", "dataType": "boolean", "inputType": "checkbox", "editable": true, "required": false, "visible": true, "validations": [ { "type": "required", "message": "" } ], "renderingHints": { "class": "sb-g-col-lg-1" } }, { "code": "contentdetailsThree", "name": "Appropriate tags such as Resource Type, Concepts", "label": "Appropriate tags such as Resource Type, Concepts", "dataType": "boolean", "inputType": "checkbox", "editable": true, "required": false, "visible": true, "validations": [ { "type": "required", "message": "" } ], "renderingHints": { "class": "sb-g-col-lg-1" } }, { "code": "contentdetailsFour", "name": "Relevant Keywords", "label": "Relevant Keywords", "dataType": "boolean", "inputType": "checkbox", "editable": true, "required": false, "visible": true, "validations": [ { "type": "required", "message": "" } ], "renderingHints": { "class": "sb-g-col-lg-1" } } ] }, { "name": "Usability", "renderingHints": { "class": "d-grid-inline-3 display-sectionName" }, "fields": [ { "code": "usabilityOne", "name": "Content plays correctly", "label": "Content plays correctly", "dataType": "boolean", "inputType": "checkbox", "editable": true, "required": false, "visible": true, "validations": [ { "type": "required", "message": "" } ], "renderingHints": { "class": "sb-g-col-lg-1" } }, { "code": "usabilityTwo", "name": "Can see the content clearly on Desktop and App", "label": "Can see the content clearly on Desktop and App", "dataType": "boolean", "inputType": "checkbox", "editable": true, "required": false, "visible": true, "validations": [ { "type": "required", "message": "" } ], "renderingHints": { "class": "sb-g-col-lg-1" } }, { "code": "usabilityThree", "name": "Audio (if any) is clear and easy to understand", "label": "Audio (if any) is clear and easy to understand", "dataType": "boolean", "inputType": "checkbox", "editable": true, "required": false, "visible": true, "validations": [ { "type": "required", "message": "" } ], "renderingHints": { "class": "sb-g-col-lg-1" } }, { "code": "usabilityFour", "name": "No Spelling mistakes in the text", "label": "No Spelling mistakes in the text", "dataType": "boolean", "inputType": "checkbox", "editable": true, "required": false, "visible": true, "validations": [ { "type": "required", "message": "" } ], "renderingHints": { "class": "sb-g-col-lg-1" } }, { "code": "usabilityFive", "name": "Language is simple to understand", "label": "Language is simple to understand", "dataType": "boolean", "inputType": "checkbox", "editable": true, "required": false, "visible": true, "validations": [ { "type": "required", "message": "" } ], "renderingHints": { "class": "sb-g-col-lg-1" } } ] } ] }, "unitMetadata": { "templateName": "", "required": [], "properties": [ { "code": "name", "dataType": "text", "description": "Name of the content", "editable": true, "inputType": "text", "label": "Title", "name": "Title", "placeholder": "Title", "renderingHints": { "class": "sb-g-col-lg-1 required" }, "required": true, "visible": true, "validations": [ { "type": "maxLength", "value": "120", "message": "Input is Exceeded" }, { "type": "required", "message": "Title is required" } ] }, { "code": "description", "dataType": "text", "description": "Description of the content", "editable": true, "inputType": "textarea", "label": "Description", "name": "Description", "placeholder": "Description", "renderingHints": { "class": "sb-g-col-lg-1 required" }, "required": true, "visible": true, "validations": [ { "type": "maxLength", "value": "500", "message": "Input is Exceeded" } ] }, { "code": "maxQuestions", "name": "Show Questions", "label": "Show Questions", "placeholder": "Number of questions to be shown", "description": "Number of questions to be shown", "default": "", "dataType": "number", "inputType": "select", "editable": true, "required": false, "visible": true, "renderingHints": { "class": "sb-g-col-lg-1" } }, { "code": "showFeedback", "name": "Show Feedback", "label": "Show Feedback", "placeholder": "Show Correct/Incorrect Feedback", "description": "Show Correct/Incorrect Feedback", "default": "Yes", "dataType": "text", "inputType": "checkbox", "editable": true, "required": false, "visible": true, "renderingHints": { "class": "sb-g-col-lg-1" } }, { "code": "shuffle", "name": "Shuffle Questions", "label": "Shuffle Questions", "placeholder": "Shuffle Questions", "description": "Questions will be Shuffled while playing", "default": "false", "dataType": "boolean", "inputType": "checkbox", "editable": true, "required": false, "visible": true, "renderingHints": { "instructions" ], "orgreviewclass": ["sb-g-col-lg-1" "name", } "instructions", "learningOutcome" ]}, "review": [ "name",{ "description" ] } |
In sourcingreview, we have “instructions”, so when the mode of editor is sourcingReview in that case instruction will be only enabled.
...
enableQuestionCreation:
When enableQuestionCreation: false “Create New” button gets disabled
...
assetConfig:
Code Block |
---|
assetConfig: { "imagecode": { "showSolutions", "sizename": "1Show Solution", "sizeType": "MB", "acceptedlabel": "Show Solution"png, jpeg" }, "video": { "sizeplaceholder": "50Show Solution", "sizeType": "MB", "accepted": "mp4, webm" } } |
asset Config sets the max size limit for image and videos to be uploaded in questionset and the type of image and videos.
maxDepth:
maxDepth defines the level of questionset i.e at which level question to be created. If maxDepth is set as 0, “Create New“ button get enabled to question at root node.
...
Note: children
at root node is to be defined which defines the type of question can be created at root node. Here is the default value for children.
Code Block |
---|
children: {description": "Show Solution", Question: [ 'Multiple Choice Question' "default": "Yes", 'Subjective Question' ] } |
If the maxDepth is set as 1, we need to define hierarchy
also.
Here is the default value of hierarchy we are using, you can change the name of level also
Code Block |
---|
hierarchy: { "level1dataType": { "text", "nameinputType": "Sectioncheckbox", "type "editable": "Unit"true, "mimeType "required": "application/vnd.sunbird.questionset"false, "primaryCategory": "Practice Question Set", "iconClassvisible": "fa fa-folder-o"true, "children": { "QuestionrenderingHints": [{ "Multiple Choice Question", "class": "sb-g-col-lg-1" "Subjective Question" } ] } } } |
Note: If you add more depth you need to add more levels in hierarchy.
iconClass:
This defines the icon which comes in the node and levels, you can set your own icon here by adding the class of icon, in root node for iconClass: 'fa fa-book'
icon is shown as:
...
showAddCollaborator:
When showAddCollaborator is set it to true
it enable the add collaborator option in questionset. With which creator can as select the collaborate to contribute to same questionset.
...
questionSet.maxQuestionsLimit:
This defines the maxiumun number of question to be created in a questionset.
Code Block |
---|
questionSet: { ] }, "maxQuestionsLimitupdate": "500" } |
Suppose if "maxQuestionsLimit"
is set to “5“ then while trying to create new question it will give error maxlimit message as:
...
contentPolicyUrl:
It defines where should the content policy link should be retirected.
contentPolicyUrl: "/term-of-use.html"
in diksha we are using this config as it redirects to (https://diksha.gov.in/term-of-use.html)
...
{}
}
} |