...
1. When saving the question data if an equation/formula is added to the question ,add a param 'isFormulaAdded' with value true to the create assessment request body as given in below example:
Code Block | ||
---|---|---|
| ||
{ "request": { "assessment_item": { "objectType": "AssessmentItem", "metadata": { "code": "NA", "isShuffleOption": false, "body": "{\"data\":{\"plugin\":{\"id\":\"org.ekstep.questionunit.mtf\",\"version\":\"1.1\",\"templateId\":\"horizontalMTF\"},\"data\":{\"question\":{\"text\":\"<p>gfggf <span<p>gfggf <span advance=\\\"false\\\" class=\\\"math-text\\\" data-math=\\\"A=\\\\pi r^2A=\\\\pi r^2\\\" style=\\\"display: inline-block;\\\">A=\\\\\\\\pi r^2A=\\\\\\\\pi r^2</span></p>\\n\",\"image\":\"\",\"audio\":\"\",\"audioName\":\"\",\"hint\":\"\"},\"option\":{\"optionsLHS\":[{\"text\":\"<p>a</p>\\n\",\"image\":\"\",\"audio\":\"\",\"audioName\":\"\",\"hint\":\"\",\"index\":1,\"$$hashKey\":\"object:1459\"},{\"text\":\"<p>b</p>\\n\",\"image\":\"\",\"audio\":\"\",\"audioName\":\"\",\"hint\":\"\",\"index\":2,\"$$hashKey\":\"object:1460\"},{\"text\":\"<p>c</p>\\n\",\"image\":\"\",\"audio\":\"\",\"audioName\":\"\",\"hint\":\"\",\"index\":3,\"$$hashKey\":\"object:1461\"}],\"optionsRHS\":[{\"text\":\"<p>A</p>\\n\",\"image\":\"\",\"audio\":\"\",\"audioName\":\"\",\"hint\":\"\",\"mapIndex\":1},{\"text\":\"<p>B</p>\\n\",\"image\":\"\",\"audio\":\"\",\"audioName\":\"\",\"hint\":\"\",\"mapIndex\":2},{\"text\":\"<p>C</p>\\n\",\"image\":\"\",\"audio\":\"\",\"audioName\":\"\",\"hint\":\"\",\"mapIndex\":3}],\"questionCount\":0},\"media\":[]},\"config\":{\"metadata\":{\"max_score\":1,\"isShuffleOption\":false,\"isPartialScore\":true,\"evalUnordered\":false,\"templateType\":\"Horizontal\",\"name\":\"gfggf A=\\\\\\\\pi r^2A=\\\\\\\\pi r^2\\n\",\"title\":\"gfggf A=\\\\\\\\pi r^2A=\\\\\\\\pi r^2\\n\",\"board\":\"ICSE\",\"medium\":\"English\",\"subject\":\"English\",\"qlevel\":\"MEDIUM\",\"gradeLevel\":[\"Class 1\"],\"category\":\"MTF\"},\"max_time\":0,\"max_score\":1,\"partial_scoring\":true,\"layout\":\"Horizontal\",\"isShuffleOption\":false,\"questionCount\":1,\"evalUnordered\":false},\"media\":[]}}", "itemType": "UNIT", "version": 2, "category": "MTF", "createdBy": "fd7ef85c-df8f-4504-b502-47d001085e91", "channel": "01231711180382208027", "type": "mtf", "template": "NA", "template_id": "NA", "framework": "NCF", "max_score": 1, "isPartialScore": true, "evalUnordered": false, "templateType": "Horizontal", "name": "gfggf A=\\\\pi r^2A=\\\\pi r^2\n", "title": "gfggf A=\\\\pi r^2A=\\\\pi r^2\n", "board": "ICSE", "medium": "English", "subject": "English", "qlevel": "MEDIUM", "gradeLevel": [ "Class 1" ], "lhs_options": [ { "value": { "type": "mixed", "text": "इक", "image": "", "count": "", "audio": "", "resvalue": "इक", "resindex": 0 }, "index": 0 } ], "rhs_options": [ { "value": { "type": "mixed", "text": "इक", "image": "", "count": "", "audio": "", "resvalue": "इक", "resindex": 0 }, "index": 0 } ] }, "outRelations": [], "isFormulaAdded": true } } } |
2. Now once question is saved ,on the renderer side while generating ECML we should check whether any of the question in the added question sets containing the flag 'isFormulaAdded' and if it is false then all the katex library dependencies should be removed from the 'questionset' plugin manifest dependencies.Hence all the katex library assets will not get bundled to the content.
...