fix: question field uses real placeholder instead of template. fixed blank question handling. TNL-10395, TNL-10411.

This commit is contained in:
Ken Clary
2023-01-27 15:52:13 -05:00
parent 84fe6605c2
commit 80f2689cc2
10 changed files with 65 additions and 32 deletions

View File

@@ -1,13 +1,12 @@
/* eslint-disable */
export const dropdown = `<problem>
<optionresponse>
<p>Enter your question</p>
<optioninput>
<option correct="True"></option>
<option correct="False"></option>
<option correct="False"></option>
</optioninput>
</optionresponse>
<optionresponse>
<optioninput>
<option correct="True"></option>
<option correct="False"></option>
<option correct="False"></option>
</optioninput>
</optionresponse>
</problem>`
export default dropdown;

View File

@@ -1,12 +1,12 @@
/* eslint-disable */
const multiSelect= `<problem>
<choiceresponse>
<p>Enter your question</p>
<checkboxgroup>
<choice correct="true"></choice>
<choice correct="false"></choice>
<choice correct="false"></choice>
</checkboxgroup>
</choiceresponse>
<choiceresponse>
<checkboxgroup>
<choice correct="true"></choice>
<choice correct="false"></choice>
<choice correct="false"></choice>
</checkboxgroup>
</choiceresponse>
</problem>`
export default multiSelect;

View File

@@ -1,10 +1,9 @@
/* eslint-disable */
export const numeric = `<problem>
<numericalresponse>
<p>Enter your question</p>
<responseparam type="tolerance" default="5"/>
<formulaequationinput/>
</numericalresponse>
<numericalresponse>
<responseparam type="tolerance" default="5"/>
<formulaequationinput/>
</numericalresponse>
</problem>`
export default numeric;

View File

@@ -1,12 +1,12 @@
/* eslint-disable */
export const singleSelect = `<problem>
<multiplechoiceresponse>
<p>Enter your question</p>
<multiplechoiceresponse>
<choicegroup>
<choice correct="true"></choice>
<choice correct="false"></choice>
<choice correct="false"></choice>
<choice correct="true"></choice>
<choice correct="false"></choice>
<choice correct="false"></choice>
</choicegroup>
</multiplechoiceresponse>
</multiplechoiceresponse>
</problem>`
export default singleSelect;

View File

@@ -1,9 +1,9 @@
/* eslint-disable */
const textInput =`<problem>
<stringresponse type="ci">
<p>Enter your question</p>
<additional_answer />
<textline size="20"/>
</stringresponse>
<stringresponse type="ci">
<additional_answer />
<textline size="20"/>
</stringresponse>
</problem>`
export default textInput;

View File

@@ -212,6 +212,20 @@ const getStyles = () => (
background: none;
color: #3c3c3c;
padding: 0;
}
.mce-content-body[data-mce-placeholder] {
position: relative;
}
.mce-content-body[data-mce-placeholder]:not(.mce-visualblocks)::before {
color: rgba(34, 47, 62, 0.7);
content: attr(data-mce-placeholder);
position: absolute;
}
.mce-content-body:not([dir=rtl])[data-mce-placeholder]:not(.mce-visualblocks)::before {
margin: 1em 0;
}
.mce-content-body[dir=rtl][data-mce-placeholder]:not(.mce-visualblocks)::before {
margin: 1em 0;
}`
);