feat: added markdown editor for editing problems in markdown format (#1805)
This commit is contained in:
18
src/editors/data/constants/basicProblemTemplates/dropdown.js
Normal file
18
src/editors/data/constants/basicProblemTemplates/dropdown.js
Normal file
@@ -0,0 +1,18 @@
|
||||
/* eslint-disable */
|
||||
const olx = `<problem>
|
||||
<optionresponse>
|
||||
<optioninput>
|
||||
<option correct="True"></option>
|
||||
<option correct="False"></option>
|
||||
<option correct="False"></option>
|
||||
</optioninput>
|
||||
</optionresponse>
|
||||
</problem>`
|
||||
|
||||
const markdown = `[[
|
||||
an incorrect answer
|
||||
(the correct answer)
|
||||
an incorrect answer
|
||||
]]`
|
||||
|
||||
export default { olx, markdown };
|
||||
10
src/editors/data/constants/basicProblemTemplates/index.js
Normal file
10
src/editors/data/constants/basicProblemTemplates/index.js
Normal file
@@ -0,0 +1,10 @@
|
||||
import { StrictDict } from '../../../utils';
|
||||
import dropdown from './dropdown';
|
||||
import multiSelect from './multiSelect';
|
||||
import numeric from './numeric';
|
||||
import singleSelect from './singleSelect';
|
||||
import textInput from './textInput';
|
||||
|
||||
export default StrictDict({
|
||||
dropdown, multiSelect, numeric, singleSelect, textInput,
|
||||
});
|
||||
@@ -0,0 +1,18 @@
|
||||
/* eslint-disable */
|
||||
const olx= `<problem>
|
||||
<choiceresponse>
|
||||
<checkboxgroup>
|
||||
<choice correct="true"></choice>
|
||||
<choice correct="false"></choice>
|
||||
<choice correct="false"></choice>
|
||||
</checkboxgroup>
|
||||
</choiceresponse>
|
||||
</problem>`
|
||||
|
||||
const markdown = `[x] a correct answer
|
||||
[ ] an incorrect answer
|
||||
[ ] an incorrect answer
|
||||
[x] a correct answer
|
||||
`
|
||||
|
||||
export default { olx, markdown };
|
||||
11
src/editors/data/constants/basicProblemTemplates/numeric.js
Normal file
11
src/editors/data/constants/basicProblemTemplates/numeric.js
Normal file
@@ -0,0 +1,11 @@
|
||||
/* eslint-disable */
|
||||
const olx = `<problem>
|
||||
<numericalresponse>
|
||||
<responseparam type="tolerance" default="5"/>
|
||||
<formulaequationinput/>
|
||||
</numericalresponse>
|
||||
</problem>`
|
||||
|
||||
const markdown = `= 100 +-5`
|
||||
|
||||
export default { olx, markdown };
|
||||
@@ -0,0 +1,17 @@
|
||||
/* eslint-disable */
|
||||
const olx = `<problem>
|
||||
<multiplechoiceresponse>
|
||||
<choicegroup>
|
||||
<choice correct="true"></choice>
|
||||
<choice correct="false"></choice>
|
||||
<choice correct="false"></choice>
|
||||
</choicegroup>
|
||||
</multiplechoiceresponse>
|
||||
</problem>`
|
||||
|
||||
const markdown = `( ) an incorrect answer
|
||||
(x) the correct answer
|
||||
( ) an incorrect answer
|
||||
`
|
||||
|
||||
export default { olx, markdown };
|
||||
@@ -0,0 +1,13 @@
|
||||
/* eslint-disable */
|
||||
const olx =`<problem>
|
||||
<stringresponse type="ci">
|
||||
<additional_answer />
|
||||
<textline size="20"/>
|
||||
</stringresponse>
|
||||
</problem>`
|
||||
|
||||
const markdown = `= the correct answer
|
||||
or= optional acceptable variant of the correct answer
|
||||
`
|
||||
|
||||
export default { olx, markdown };
|
||||
Reference in New Issue
Block a user