Versions Compared

Key

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

https://project-sunbird.atlassian.net/browse/SB-23246

Curl command to run

Code Block
curl -L -X PATCH '{{host}}/object/category/definition/v4/update/obj-cat:practice-question-set_questionset_all' \
-H 'Content-Type: application/json' \
--data-raw '{
  "request": {
    
  }
}'

Pass the below body into the request in the above curl command

Code Block
{
  "request": {
    "objectCategoryDefinition": {
      "objectMetadata": {
        "config": {
          "sourcingSettings": {
            "collection": {
              "maxDepth": 0,
              "objectType": "QuestionSet",
              "primaryCategory": "Practice Question Set",
              "isRoot": true,
              "iconClass": "",
              "children": {
                "Question": []
              },
              "hierarchy": {}
            }
          }
        },
        "schema": {
          "properties": {
            "mimeType": {
              "type": "string",
              "enum": [
                "application/vnd.sunbird.questionset"
              ]
            }
          }
        }
      },
      "forms": {
        "childMetadata": {
          "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": "max",
                  "value": "100",
                  "message": "Input is Exceeded"
                },
                {
                  "type": "required",
                  "message": "Title is required"
                }
              ]
            },
            {
              "code": "bloomsLevel",
              "dataType": "text",
              "description": "Learning level",
              "editable": true,
              "inputType": "select",
              "label": "Learning level",
              "name": "Learning level",
              "placeholder": "Select Learning level",
              "renderingHints": {
                "class": "sb-g-col-lg-1"
              },
              "required": false,
              "visible": true,
              "range": [
                "remember",
                "understand",
                "apply",
                "analyse",
                "evaluate",
                "create"
              ],
              "validations": []
            },
            {
              "code": "board",
              "default": "",
              "visible": true,
              "editable": false,
              "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,
              "editable": false,
              "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,
              "editable": false,
              "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,
              "editable": false,
              "default": "",
              "dataType": "list",
              "renderingHints": {
                "class": "sb-g-col-lg-1"
              },
              "description": "",
              "label": "Subject",
              "required": false,
              "name": "Subject",
              "inputType": "select",
              "placeholder": "Select Subject"
            }
          ]
        },
        "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": "maxLength",
                  "value": "500",
                  "message": "Input is Exceeded"
                },
                {
                  "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": "max",
                  "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",
              "default": "3600",
              "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": "time",
                  "message": "Please enter in hh:mm:ss",
                  "value": "HH:mm:ss"
                },
                {
                  "type": "max",
                  "value": "05:59:59",
                  "message": "max time should be less than 05:59:59"
                }
              ]
            },
            {
              "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": "time",
                  "message": "Please enter hh:mm:ss",
                  "value": "HH:mm:ss"
                },
                {
                  "type": "compare",
                  "criteria": {
                    "<=": [
                      "maxTime"
                    ]
                  },
                  "message": "warning time should be less than max timer"
                }
              ]
            },
            {
              "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
            }
          ]
        },
        "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": "max",
                  "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": "max",
                  "value": "500",
                  "message": "Input is Exceeded"
                }
              ]
            },
            {
              "code": "keywords",
              "visible": true,
              "editable": true,
              "dataType": "list",
              "name": "Keywords",
              "renderingHints": {
                "class": "sb-g-col-lg-1 required"
              },
              "description": "Keywords for the content",
              "inputType": "keywords",
              "label": "keywords",
              "placeholder": "Enter Keywords",
              "required": false,
              "validations": [
                {
                  "type": "required",
                  "message": "Keyword is required"
                }
              ]
            },
            {
              "code": "topic",
              "visible": true,
              "depends": [],
              "editable": true,
              "dataType": "list",
              "renderingHints": {},
              "name": "Topic",
              "description": "Choose a Topics",
              "inputType": "topicselector",
              "label": "Topics",
              "placeholder": "Choose Topics",
              "required": false
            }
          ]
        }
      }
    }
  }
}