feat: move solution tag inside problem type tag (#248)

This commit is contained in:
Raymond Zhou
2023-02-15 09:53:02 -08:00
committed by GitHub
parent 3f9fc513cf
commit 6156798e02
2 changed files with 16 additions and 12 deletions

View File

@@ -151,9 +151,9 @@ class ReactStateOLXParser {
problem: {
[problemType]: {
[widget]: widgetObject,
...solution,
},
...demandhint,
...solution,
},
};
@@ -189,9 +189,9 @@ class ReactStateOLXParser {
problem: {
[ProblemTypeKeys.TEXTINPUT]: {
...answerObject,
...solution,
},
...demandhint,
...solution,
},
};
@@ -252,9 +252,11 @@ class ReactStateOLXParser {
const problemObject = {
problem: {
[ProblemTypeKeys.NUMERIC]: answerObject,
[ProblemTypeKeys.NUMERIC]: {
...answerObject,
...solution,
},
...demandhint,
...solution,
},
};

View File

@@ -119,19 +119,21 @@ an incorrect answer <choicehint selected="true">You can specify optional
<compoundhint value="A B D">You can specify optional feedback for a combination of answers which appears after the specified set of answers is submitted.</compoundhint>
<compoundhint value="A B C D">You can specify optional feedback for one, several, or all answer combinations.</compoundhint>
</checkboxgroup>
${solution === 'simple'
? '<solution>This is a detailed explanation of the solution.</solution>'
: (
`<solution>
Explanation\n
You can form a voltage divider that evenly divides the input
voltage with two identically valued resistors, with the sampled
voltage taken in between the two.
</solution>`
)}
</choiceresponse>
<demandhint>
<hint>You can add an optional hint like this. Problems that have a hint include a hint button, and this text appears the first time learners select the button.</hint>
<hint>If you add more than one hint, a different hint appears each time learners select the hint button.</hint>
</demandhint>
${solution === 'simple' ? '<solution>This is a detailed explanation of the solution.</solution>' : (
`<solution>
Explanation\n
You can form a voltage divider that evenly divides the input
voltage with two identically valued resistors, with the sampled
voltage taken in between the two.
</solution>`
)}
</problem>
`,
});