Hi,
is it possible to give a hint (which reduces points) before giving the answer in a cloze-type question?
Like here:
The task above is STACK-type question, but I would like to implement giving a tip in a similar way in a cloze-type question, if it is somehow possible.
The question above is implemented like this:
<questiontext format="html">
<text><![CDATA[<p>Derive the function \[g(x)={@f2@}.\]</p>
<p style="text-align:center"><a href="#" id="deriv2-show-step">Show hint (-0.33p)</a></p>
<div id="deriv2-step" style="display:none;opacity:0.7">
<p> \[\frac{\mathrm{d}}{\mathrm{d}x}x^a = ax^{a-1}.\]</p>
\[g(x) = x^{@b1@} + x^{\frac{1}{2}} + {@b4@}x^{{@-b5@}}+{@a3@}\]
\[g'(x) = {@b1@}x^{@b1-1@} + \ldots\]
</div>
<p>\( g'(x)= \) input:ans1</p>
<div>validation:ans1</div>
<div style="display:none;">input:deriv2_stepstatevalidation:deriv2_stepstate</div>
<script>
(function() {<br /><br /> function stepify(prefix) {<br /> var stepState = document.querySelector("input[id*='" + prefix + "_stepstate']");<br /> var stepShower = document.querySelector("#" + prefix + "-show-step");<br /> var stepEl = document.querySelector("#" + prefix + "-step");<br /><br /> stepState.value = stepState.value === "" ? "false" : stepState.value;<br /> stepShower.addEventListener("click", showStep);<br /><br /> if (stepState.value === "true") {<br /> stepShower.style.display = "none";<br /> stepEl.style.display = "block";<br /> }
function showStep(e) {<br /> e.preventDefault();<br /> e.target.style.display = "none";<br /> stepEl.style.display = "block";<br /> stepState.value = "true";<br /> }
}
stepify("deriv2");
})();
</script>]]></text>
</questiontext>
<text><![CDATA[<p>Derive the function \[g(x)={@f2@}.\]</p>
<p style="text-align:center"><a href="#" id="deriv2-show-step">Show hint (-0.33p)</a></p>
<div id="deriv2-step" style="display:none;opacity:0.7">
<p> \[\frac{\mathrm{d}}{\mathrm{d}x}x^a = ax^{a-1}.\]</p>
\[g(x) = x^{@b1@} + x^{\frac{1}{2}} + {@b4@}x^{{@-b5@}}+{@a3@}\]
\[g'(x) = {@b1@}x^{@b1-1@} + \ldots\]
</div>
<p>\( g'(x)= \) input:ans1</p>
<div>validation:ans1</div>
<div style="display:none;">input:deriv2_stepstatevalidation:deriv2_stepstate</div>
<script>
(function() {<br /><br /> function stepify(prefix) {<br /> var stepState = document.querySelector("input[id*='" + prefix + "_stepstate']");<br /> var stepShower = document.querySelector("#" + prefix + "-show-step");<br /> var stepEl = document.querySelector("#" + prefix + "-step");<br /><br /> stepState.value = stepState.value === "" ? "false" : stepState.value;<br /> stepShower.addEventListener("click", showStep);<br /><br /> if (stepState.value === "true") {<br /> stepShower.style.display = "none";<br /> stepEl.style.display = "block";<br /> }
function showStep(e) {<br /> e.preventDefault();<br /> e.target.style.display = "none";<br /> stepEl.style.display = "block";<br /> stepState.value = "true";<br /> }
}
stepify("deriv2");
})();
</script>]]></text>
</questiontext>
Version 4.1 of Moodle is used