Single Sourcing: Question Set Editor Integration

Objective

  1. The aim is that objects of type questionSet be used as target objects for sourcing projects without having to create them elsewhere.

  2. Objects of type question be contributed and reviewed individually to such sourcing projects.

Background

  1. Product requirements document. (Confluence Document)

  2. Product mockups. (Google Slides)

Proposed Implementation

1. Sourcing

- Create Program

We will use the sunbird-collection-editor to create question sets as target objects.

  1. We will add an enableQuestionCreation attribute to the editor configuration

  2. We will implement changes to be able to emit question set metadata on exiting the question set creation page

  3. We will use a target_type of questionSets to show/hide the changed UI for creating a program with a target questionSet.

2. Contribution

- Question Creation

We will use the sunbird-collection-editor to create new questions inside question sets.

  1. We will add a new object type to editor configuration: Question

  2. We will implement requisite changes:

    • Editor: Accepting a question ID to initialise the editor

    • Header: Adding Send for review, Publish, Reject etc. buttons

    • Question: Only saving question and not updating the collection hierarchy on save etc.

- Add from Library

We will create a new add-from-library Angular library to add questions from library to question sets.
Scope:

- In release-4.4.0
1. We will add one new attribute to the collection and questionSet KP schemas: reusedContributions, which will contain the list of identifiers added to the collection via library

3. We will use this list of identifiers to detect whether a question has been added from library or not


- In release-4.3.0

  1. We will invoke this library from the portal for an existing question set.

  2. The question set and unit identifiers will be passed to the library, which will use the existing library and player components

  3. On returning/saving, the library will emit the question identifiers that have been added

  4. The portal will then make an update hierarchy call for the given section

  5. Caveat: We will only add questions to the section that was passed to the library to begin with.

  6. We will use the following components of the existing collection editor:

    • Library: We will need to enable the existing library components for objects of type Question

    • Quml Player: We will need to support previewing QuML questions in the library component etc.

- In future releases, we will integrate this library with mvc-library and sunbird-collection-editor

In the creation-portal, we will have to enable changes to invoke the sunbird-collection-editor and handle events emitted by it.

  1. Only for projects with target objects of type QuestionSet, we will implement opening the new library on "Add from Library" being clicked - for the rest, the existing mvc-library component will continue to be used.

3. Question Set Publish

We will use the sunbird-collection-editor to publish question sets.

  1. We will have to use a combination of the enableQuestionCreation attribute and sessionContext variables to display/hide the "Publish" option

We will make changes to the knowledge-platform to modify the publish pipeline for question sets.

  1. We will have to modify this logic to be able to publish question sets only with "Approved" questions, and not re-create questions when the question set is re-published.

  2. We will add acceptedContributions and rejectedContributions attributes in creation-portal question-set schema.

  3. If sourcing reviewer approves the question, we will add its identifier to acceptedContributions array and if question is rejected it will be added to rejectedContributions array.

  4. We are using autoCreatorV2 flink job to copy contents from sourcing to consumption. Here we will add a check condition to validate if acceptedContributions attribute exists or not in question-set metadata.
    - If attribute exist, we follow the new flow, in which we will remove the rejected questions from
    question-set hierarchy and save only with approved questions to consumption.
    - If attribute does not exist, we will use the existing flow and save all questions in question-set to
    consumption irrespective of questions approval and rejection.

DB Changes: Program Table

column_name

datatype

postgresql command

column_name

datatype

postgresql command

targetcollectionprimarycategories

jsonb

ALTER TABLE program ADD COLUMN targetCollectionPrimaryCategories jsonb;

DB Changes: Configuration Table

INSERT INTO "public"."configuration" ("key", "value", "status") VALUES ('programTargetObjectMap', '[ { "identifier":"obj-cat:content-playlist_collection_all", "name":"Content Playlist", "targetObjectType":"Collection", "associatedAssetTypes":["Content"], "contentAdditionMode":["Search"] }, { "identifier":"obj-cat:demo-practice-question-set_questionset_all", "name":"Demo Practice Question `Set", "targetObjectType":"QuestionSet", "associatedAssetTypes":["Question","QuestionSet"], "contentAdditionMode":["New"] }, { "identifier":"obj-cat:digital-textbook_collection_all", "name":"Digital Textbook", "targetObjectType":"Collection", "associatedAssetTypes":["Content"], "contentAdditionMode":["Search"] }, { "identifier":"obj-cat:professional-development-course_collection_all", "name":"Course", "targetObjectType":"Collection", "associatedAssetTypes":["Content"], "contentAdditionMode":["Search"] }, { "identifier":"obj-cat:question-paper_collection_all", "name":"Question paper", "targetObjectType":"Collection", "associatedAssetTypes":["Content"], "contentAdditionMode":["Search"] } ]', 'active');`

Â