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.
...
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.
...
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)
...
enableQuestionCreation:
When enableQuestionCreation: false “Create New” button gets disabled
...
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 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
inputType defines the different types of field with which some kind of data can be sent to sb-form.
...
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 defines the different types of validations which can be done on fields
We are using required, maxLength,compare
...
Code Block |
---|
"validations": [ { "type": "compare", "criteria": { "<=": [ "maxTime" ] }, "message": "warning time should be less than max timer" } ] |
...
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" } ] } |
...