# Editor

Sunbird [inQuiry Editor](https://inquiry.sunbird.org/learn/product-and-developer-guide/question-and-question-set-editor/architecture) is used for creating questions and questionSets. The current Editor supports the following question types.&#x20;

This Editor is also known as Question & Question Set Editor or QuML Editor.

* Multiple Choice Question (MCQ)
* Multi-select Multiple Choice Question (MMCQ)
* Subjective Question (SA)

## Question & Question Set Editor (QuML Editor)

Question set editor is a tool offered by inQuiry to help you kickstart your creation of Question Banks.

More details on the editor can be found [here](https://inquiry.sunbird.org/capabilities-1#a-question-set-editor) and [here](https://inquiry.sunbird.org/learn/product-and-developer-guide/question-and-question-set-editor).

Editor architecture is as below,

<figure><img src="https://3506001968-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWu4HIWGkb7dD4y0Kup4W%2Fuploads%2FsPea2P02APFUhbivoqWI%2Fimage.png?alt=media&#x26;token=f4bc6b8c-1afa-46c7-bb04-0d2c8d5cbafb" alt=""><figcaption></figcaption></figure>

Editor Module is as detailed below,

<figure><img src="https://3506001968-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWu4HIWGkb7dD4y0Kup4W%2Fuploads%2FrRBe2HGGojiGU7uJSWv1%2Fimage.png?alt=media&#x26;token=b54d96aa-9533-4d97-bafc-58ed2f410328" alt=""><figcaption></figcaption></figure>

<details>

<summary>Additional details about the internals of the Editor</summary>

* Editor Module - Root module of the editor library where all the components and services are imported
* Editor Component - Base component of the Editor which consists of the sub components
  * Header Components - contains the buttons any header elements
  * Metadata Components - for capturing metadata
  * Player Component - for preview of question and questionSet
  * Fancy Tree Component - for tree view (navigation)
  * Resource Lib Component - for adding question from Library
* Editor Service - service layer that makes the API calls related to Editor. For eg:- save, update
* Telemetry Service - initialise the Telemetry SDK and prepare the telemetry events
  * Telemetry SDK - to sent out the telemetry events to external Telemetry Service

</details>

#### Question / QuestionSet Creation flow

<figure><img src="https://3506001968-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWu4HIWGkb7dD4y0Kup4W%2Fuploads%2Fd08TdhmXRyntySn5OkQv%2Fimage.png?alt=media&#x26;token=a63bc12e-dbc9-4d48-ae9b-86f64b1dadbf" alt=""><figcaption></figcaption></figure>

#### Question / QuestionSet Review process flow

<figure><img src="https://3506001968-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWu4HIWGkb7dD4y0Kup4W%2Fuploads%2F6qcPQzTckEmCRoSAlJbZ%2Fimage.png?alt=media&#x26;token=1c625b42-268d-4b01-84c4-73ec2fd5165a" alt=""><figcaption><p>QuestionSet creation flow</p></figcaption></figure>

<figure><img src="https://3506001968-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWu4HIWGkb7dD4y0Kup4W%2Fuploads%2FXXZHh88e9lDJ0vlrFwQL%2Fimage.png?alt=media&#x26;token=5f3c4881-9e51-49d2-885f-0065e2e76583" alt=""><figcaption><p>QuestionSet Review / Publish flow</p></figcaption></figure>

#### Editor interaction with Knowlg BB Service

<figure><img src="https://3506001968-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWu4HIWGkb7dD4y0Kup4W%2Fuploads%2FJF6GICy0vMXgIrRLwoOj%2Fimage.png?alt=media&#x26;token=63885a27-9568-4685-818f-a1e8f961b3db" alt=""><figcaption></figcaption></figure>

#### Code Structure

* [Repository](https://inquiry.sunbird.org/learn/product-and-developer-guide/question-and-question-set-editor/source-code)
* Important Folder / Package structure

  <pre><code><strong>- projects
  </strong>	- questionset-editor-library-wc [This contains the application for building web component and copy the files into web-component folder]
  	- questionset-editor-library [This contains the actual code of editor library which get build and bundled into editor library npm package]
  - src [This contains the Sample Application for running the editor library]
  - web-component-examples [This contains the code for running editor web component in vanilla js]
  - web-component [This contains the files which get bundled to form npm packge of editor web component]
  </code></pre>

#### Dependencies

Details are listed [here](https://inquiry.sunbird.org/use/learn-more/dependencies) for the below specified dependencies

* [Sunbird QuML Specification](https://quml.sunbird.org/)
* [Sunbird inQuiry Service](https://inquiry.sunbird.org/learn/product-and-developer-guide/quick-starter-guide/inquiry-components/inquiry-service)&#x20;
* [Sunbird Knowlg Service](https://knowlg.sunbird.org/)
* Sunbird Telemetry

## APIs used by Editor

APIs invoked from Editor component is listed [here](https://inquiry.sunbird.org/learn/product-and-developer-guide/question-and-question-set-editor/apis)
