mirror of
https://github.com/ets-cfuhrman-pfe/EvalueTonSavoir.git
synced 2025-08-11 21:23:54 -04:00
Compare commits
5 commits
f1375d8e10
...
c55baed45c
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c55baed45c | ||
|
|
e51551ec9b | ||
|
|
bc0d2b1f14 | ||
|
|
688869188c | ||
|
|
1f241a45fe |
7 changed files with 195 additions and 98 deletions
|
|
@ -1,4 +1,4 @@
|
|||
console.log('constantsMock.tsx is loaded');
|
||||
// console.log('constantsMock.tsx is loaded');
|
||||
|
||||
// constants.tsx
|
||||
const ENV_VARIABLES = {
|
||||
|
|
@ -7,7 +7,7 @@ const ENV_VARIABLES = {
|
|||
VITE_BACKEND_SOCKET_URL: process.env.VITE_BACKEND_SOCKET_URL || "",
|
||||
};
|
||||
|
||||
console.log(`ENV_VARIABLES.VITE_BACKEND_URL=${ENV_VARIABLES.VITE_BACKEND_URL}`);
|
||||
console.log(`ENV_VARIABLES.VITE_BACKEND_SOCKET_URL=${ENV_VARIABLES.VITE_BACKEND_SOCKET_URL}`);
|
||||
// console.log(`ENV_VARIABLES.VITE_BACKEND_URL=${ENV_VARIABLES.VITE_BACKEND_URL}`);
|
||||
// console.log(`ENV_VARIABLES.VITE_BACKEND_SOCKET_URL=${ENV_VARIABLES.VITE_BACKEND_SOCKET_URL}`);
|
||||
|
||||
export { ENV_VARIABLES };
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ const moodleMock: TemplateOptions & NumericalQuestion =
|
|||
|
||||
const imageMock: TemplateOptions & NumericalQuestion =
|
||||
parse(`
|
||||
::Sample Numerical Title with Image::[markdown]Sample Stem with Image {#=42#Correct!=43#Incorrect! ####Sample Global Feedback with Image}
|
||||
::Sample Numerical Title with Image::[markdown]Sample Stem with Image {#=42#Correct!=43#Incorrect!=44#Also Incorrect! ####Sample Global Feedback with Image}
|
||||
`)[0] as NumericalQuestion;
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -38,9 +38,19 @@ exports[`Numerical snapshot test with html 1`] = `
|
|||
">Numérique</span>
|
||||
</span>
|
||||
</div>
|
||||
<p style="
|
||||
|
||||
<div style="
|
||||
display: flex;
|
||||
">
|
||||
<span>
|
||||
<p style="
|
||||
color: hsl(0, 0%, 0%);
|
||||
"><span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mfrac><mrow><mi>z</mi><mi>z</mi><mi>z</mi></mrow><mrow><mi>y</mi><mi>y</mi><mi>y</mi></mrow></mfrac></mrow><annotation encoding="application/x-tex">\\frac{zzz}{yyy}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1.988em;vertical-align:-0.8804em;"></span><span class="mord"><span class="mopen nulldelimiter"></span><span class="mfrac"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.1076em;"><span style="top:-2.314em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.03588em;">yyy</span></span></span><span style="top:-3.23em;"><span class="pstrut" style="height:3em;"></span><span class="frac-line" style="border-bottom-width:0.04em;"></span></span><span style="top:-3.677em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.04398em;">zzz</span></span></span></span><span class="vlist-s"></span></span><span class="vlist-r"><span class="vlist" style="height:0.8804em;"><span></span></span></span></span></span><span class="mclose nulldelimiter"></span></span></span></span></span></span></p>
|
||||
" class="present-question-stem">
|
||||
<span class="katex-display"><span class="katex"><span class="katex-mathml"><math display="block" xmlns="http://www.w3.org/1998/Math/MathML"><mrow><mfrac><mrow><mi>z</mi><mi>z</mi><mi>z</mi></mrow><mrow><mi>y</mi><mi>y</mi><mi>y</mi></mrow></mfrac></mrow>\\frac{zzz}{yyy}</math></span><span aria-hidden="true" class="katex-html"><span class="base"><span style="height:1.988em;vertical-align:-0.8804em;" class="strut"></span><span class="mord"><span class="mopen nulldelimiter"></span><span class="mfrac"><span class="vlist-t vlist-t2"><span class="vlist-r"><span style="height:1.1076em;" class="vlist"><span style="top:-2.314em;"><span style="height:3em;" class="pstrut"></span><span class="mord"><span style="margin-right:0.03588em;" class="mord mathnormal">yyy</span></span></span><span style="top:-3.23em;"><span style="height:3em;" class="pstrut"></span><span style="border-bottom-width:0.04em;" class="frac-line"></span></span><span style="top:-3.677em;"><span style="height:3em;" class="pstrut"></span><span class="mord"><span style="margin-right:0.04398em;" class="mord mathnormal">zzz</span></span></span></span><span class="vlist-s"></span></span><span class="vlist-r"><span style="height:0.8804em;" class="vlist"><span></span></span></span></span></span><span class="mclose nulldelimiter"></span></span></span></span></span></span>
|
||||
</p>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<span style="
|
||||
color: hsl(0, 0%, 0%);
|
||||
|
|
@ -58,7 +68,7 @@ exports[`Numerical snapshot test with html 1`] = `
|
|||
font-size: inherit;
|
||||
line-height: inherit;
|
||||
width: 90%;
|
||||
" placeholder="42, 43">
|
||||
" placeholder="42 (Correct), 43 (Incorrect!)">
|
||||
</div>
|
||||
<div style="
|
||||
position: relative;
|
||||
|
|
@ -113,9 +123,20 @@ exports[`Numerical snapshot test with image 1`] = `
|
|||
">Numérique</span>
|
||||
</span>
|
||||
</div>
|
||||
<p style="
|
||||
|
||||
<div style="
|
||||
display: flex;
|
||||
">
|
||||
<span>
|
||||
<p style="
|
||||
color: hsl(0, 0%, 0%);
|
||||
">Sample Stem with Image</p>
|
||||
" class="present-question-stem">
|
||||
Sample Stem with Image <img alt="" src="https://example.com/cat.jpg">
|
||||
|
||||
</p>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<span style="
|
||||
color: hsl(0, 0%, 0%);
|
||||
|
|
@ -133,7 +154,10 @@ exports[`Numerical snapshot test with image 1`] = `
|
|||
font-size: inherit;
|
||||
line-height: inherit;
|
||||
width: 90%;
|
||||
" placeholder="42, 43, 44">
|
||||
" placeholder="42 (Correct!
|
||||
), 43 (Incorrect!
|
||||
), 44 (Also Incorrect! <img alt="" src="https://example.com/cat.jpg">
|
||||
)">
|
||||
</div>
|
||||
<div style="
|
||||
position: relative;
|
||||
|
|
@ -145,7 +169,8 @@ exports[`Numerical snapshot test with image 1`] = `
|
|||
border-radius: 6px;
|
||||
box-shadow: 0px 2px 5px hsl(0, 0%, 74%);
|
||||
">
|
||||
<p>Sample Global Feedback with Image</p>
|
||||
<p>Sample Global Feedback with Image
|
||||
</p>
|
||||
</div></section>
|
||||
</DocumentFragment>
|
||||
`;
|
||||
|
|
@ -188,9 +213,19 @@ exports[`Numerical snapshot test with moodle 1`] = `
|
|||
">Numérique</span>
|
||||
</span>
|
||||
</div>
|
||||
<p style="
|
||||
|
||||
<div style="
|
||||
display: flex;
|
||||
">
|
||||
<span>
|
||||
<p style="
|
||||
color: hsl(0, 0%, 0%);
|
||||
">Sample Stem</p>
|
||||
" class="present-question-stem">
|
||||
Sample Stem
|
||||
</p>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<span style="
|
||||
color: hsl(0, 0%, 0%);
|
||||
|
|
@ -208,7 +243,7 @@ exports[`Numerical snapshot test with moodle 1`] = `
|
|||
font-size: inherit;
|
||||
line-height: inherit;
|
||||
width: 90%;
|
||||
" placeholder="42, 43">
|
||||
" placeholder="42 (Correct!), 43 (Incorrect!)">
|
||||
</div>
|
||||
<div style="
|
||||
position: relative;
|
||||
|
|
@ -263,9 +298,19 @@ exports[`Numerical snapshot test with plain text 1`] = `
|
|||
">Numérique</span>
|
||||
</span>
|
||||
</div>
|
||||
<p style="
|
||||
|
||||
<div style="
|
||||
display: flex;
|
||||
">
|
||||
<span>
|
||||
<p style="
|
||||
color: hsl(0, 0%, 0%);
|
||||
">Sample Stem</p>
|
||||
" class="present-question-stem">
|
||||
Sample Stem
|
||||
</p>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<span style="
|
||||
color: hsl(0, 0%, 0%);
|
||||
|
|
@ -283,7 +328,7 @@ exports[`Numerical snapshot test with plain text 1`] = `
|
|||
font-size: inherit;
|
||||
line-height: inherit;
|
||||
width: 90%;
|
||||
" placeholder="42, 43">
|
||||
" placeholder="42 (Correct!), 43 (Incorrect!)">
|
||||
</div>
|
||||
<div style="
|
||||
position: relative;
|
||||
|
|
|
|||
|
|
@ -38,10 +38,20 @@ exports[`ShortAnswer snapshot test with image 1`] = `
|
|||
">Réponse courte</span>
|
||||
</span>
|
||||
</div>
|
||||
<p style="
|
||||
|
||||
<div style="
|
||||
display: flex;
|
||||
">
|
||||
<span>
|
||||
<p style="
|
||||
color: hsl(0, 0%, 0%);
|
||||
">Sample Stem with Image <img src="https://example.com/cat.jpg" alt="">
|
||||
</p>
|
||||
" class="present-question-stem">
|
||||
Sample Stem with Image <img alt="" src="https://example.com/cat.jpg">
|
||||
|
||||
</p>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<span style="
|
||||
color: hsl(0, 0%, 0%);
|
||||
|
|
@ -115,9 +125,19 @@ exports[`ShortAnswer snapshot test with katex 1`] = `
|
|||
">Réponse courte</span>
|
||||
</span>
|
||||
</div>
|
||||
<p style="
|
||||
|
||||
<div style="
|
||||
display: flex;
|
||||
">
|
||||
<span>
|
||||
<p style="
|
||||
color: hsl(0, 0%, 0%);
|
||||
"><span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mfrac><mrow><mi>z</mi><mi>z</mi><mi>z</mi></mrow><mrow><mi>y</mi><mi>y</mi><mi>y</mi></mrow></mfrac></mrow><annotation encoding="application/x-tex">\\frac{zzz}{yyy}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1.988em;vertical-align:-0.8804em;"></span><span class="mord"><span class="mopen nulldelimiter"></span><span class="mfrac"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.1076em;"><span style="top:-2.314em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.03588em;">yyy</span></span></span><span style="top:-3.23em;"><span class="pstrut" style="height:3em;"></span><span class="frac-line" style="border-bottom-width:0.04em;"></span></span><span style="top:-3.677em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.04398em;">zzz</span></span></span></span><span class="vlist-s"></span></span><span class="vlist-r"><span class="vlist" style="height:0.8804em;"><span></span></span></span></span></span><span class="mclose nulldelimiter"></span></span></span></span></span></span></p>
|
||||
" class="present-question-stem">
|
||||
<span class="katex-display"><span class="katex"><span class="katex-mathml"><math display="block" xmlns="http://www.w3.org/1998/Math/MathML"><mrow><mfrac><mrow><mi>z</mi><mi>z</mi><mi>z</mi></mrow><mrow><mi>y</mi><mi>y</mi><mi>y</mi></mrow></mfrac></mrow>\\frac{zzz}{yyy}</math></span><span aria-hidden="true" class="katex-html"><span class="base"><span style="height:1.988em;vertical-align:-0.8804em;" class="strut"></span><span class="mord"><span class="mopen nulldelimiter"></span><span class="mfrac"><span class="vlist-t vlist-t2"><span class="vlist-r"><span style="height:1.1076em;" class="vlist"><span style="top:-2.314em;"><span style="height:3em;" class="pstrut"></span><span class="mord"><span style="margin-right:0.03588em;" class="mord mathnormal">yyy</span></span></span><span style="top:-3.23em;"><span style="height:3em;" class="pstrut"></span><span style="border-bottom-width:0.04em;" class="frac-line"></span></span><span style="top:-3.677em;"><span style="height:3em;" class="pstrut"></span><span class="mord"><span style="margin-right:0.04398em;" class="mord mathnormal">zzz</span></span></span></span><span class="vlist-s"></span></span><span class="vlist-r"><span style="height:0.8804em;" class="vlist"><span></span></span></span></span></span><span class="mclose nulldelimiter"></span></span></span></span></span></span>
|
||||
</p>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<span style="
|
||||
color: hsl(0, 0%, 0%);
|
||||
|
|
@ -190,9 +210,19 @@ exports[`ShortAnswer snapshot test with moodle 1`] = `
|
|||
">Réponse courte</span>
|
||||
</span>
|
||||
</div>
|
||||
<p style="
|
||||
|
||||
<div style="
|
||||
display: flex;
|
||||
">
|
||||
<span>
|
||||
<p style="
|
||||
color: hsl(0, 0%, 0%);
|
||||
">Sample Stem</p>
|
||||
" class="present-question-stem">
|
||||
Sample Stem
|
||||
</p>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<span style="
|
||||
color: hsl(0, 0%, 0%);
|
||||
|
|
@ -265,9 +295,19 @@ exports[`ShortAnswer snapshot test with plain text 1`] = `
|
|||
">Réponse courte</span>
|
||||
</span>
|
||||
</div>
|
||||
<p style="
|
||||
|
||||
<div style="
|
||||
display: flex;
|
||||
">
|
||||
<span>
|
||||
<p style="
|
||||
color: hsl(0, 0%, 0%);
|
||||
">Sample Stem</p>
|
||||
" class="present-question-stem">
|
||||
Sample Stem
|
||||
</p>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<span style="
|
||||
color: hsl(0, 0%, 0%);
|
||||
|
|
|
|||
|
|
@ -35,66 +35,43 @@ exports[`TrueFalse snapshot test with image 1`] = `
|
|||
border-radius: 4px;
|
||||
background-color: hsl(0, 0%, 100%);
|
||||
color: hsl(180, 15%, 41%);
|
||||
">Vrai/Faux</span>
|
||||
">Réponse courte</span>
|
||||
</span>
|
||||
</div>
|
||||
<p style="
|
||||
color: hsl(0, 0%, 0%);
|
||||
">Sample Stem with Image</p><span style="
|
||||
color: hsl(0, 0%, 0%);
|
||||
">Choisir une réponse:</span>
|
||||
<div class='multiple-choice-answers-container'>
|
||||
<input class="gift-input" type="radio" id="idmocked-id" name="idmocked-id">
|
||||
|
||||
<label style="
|
||||
display: inline-block;
|
||||
padding: 0.2em 0 0.2em 0;
|
||||
|
||||
<div style="
|
||||
display: flex;
|
||||
">
|
||||
<span>
|
||||
<p style="
|
||||
color: hsl(0, 0%, 0%);
|
||||
" for="idmocked-id">
|
||||
Vrai
|
||||
</label>
|
||||
<svg style="
|
||||
vertical-align: text-bottom;
|
||||
" class="present-question-stem">
|
||||
Sample Stem with Image <img alt="" src="https://example.com/cat.gif">
|
||||
|
||||
</p>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<span style="
|
||||
color: hsl(0, 0%, 0%);
|
||||
">Réponse: </span><input class="gift-input" type="text" style="
|
||||
display: inline-block;
|
||||
margin-left: 0.1rem;
|
||||
margin-right: 0.2rem;
|
||||
|
||||
width: 1em;
|
||||
color: hsl(120, 39%, 54%);
|
||||
" role="img" aria-hidden="true" focusable="false" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentColor" d="M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z"></path></svg>
|
||||
<span style="
|
||||
color: hsl(180, 15%, 41%);
|
||||
">Correct!</span>
|
||||
</input>
|
||||
padding: 0.375rem 0.75rem;
|
||||
line-height: 1.5;
|
||||
color: hsl(0, 0%, 16%);
|
||||
background-color: hsl(0, 0%, 100%);
|
||||
border: 1px solid hsl(0, 0%, 81%);
|
||||
border-radius: 0.25rem;
|
||||
box-shadow: rgba(0, 0, 0, 0.05) 0px 1px 2px 0px;
|
||||
margin: 0;
|
||||
font-family: inherit;
|
||||
font-size: inherit;
|
||||
line-height: inherit;
|
||||
width: 90%;
|
||||
" placeholder="A, B, C">
|
||||
</div>
|
||||
|
||||
<div class='multiple-choice-answers-container'>
|
||||
<input class="gift-input" type="radio" id="idmocked-id" name="idmocked-id">
|
||||
|
||||
<label style="
|
||||
display: inline-block;
|
||||
padding: 0.2em 0 0.2em 0;
|
||||
|
||||
color: hsl(0, 0%, 0%);
|
||||
" for="idmocked-id">
|
||||
Faux
|
||||
</label>
|
||||
<svg style="
|
||||
vertical-align: text-bottom;
|
||||
display: inline-block;
|
||||
margin-left: 0.1rem;
|
||||
margin-right: 0.2rem;
|
||||
|
||||
width: 0.75em;
|
||||
color: hsl(2, 64%, 58%);
|
||||
" role="img" aria-hidden="true" focusable="false" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 352 512"><path fill="currentColor" d="M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19 0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48 0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48 0L9.21 111.45c-12.28 12.28-12.28 32.19 0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19 0 44.48l22.24 22.24c12.28 12.28 32.2 12.28 44.48 0L176 322.72l100.07 100.07c12.28 12.28 32.2 12.28 44.48 0l22.24-22.24c12.28-12.28 12.28-32.19 0-44.48L242.72 256z"></path></svg>
|
||||
<span style="
|
||||
color: hsl(180, 15%, 41%);
|
||||
">Incorrect!</span>
|
||||
</input>
|
||||
</div>
|
||||
<div style="
|
||||
<div style="
|
||||
position: relative;
|
||||
margin-top: 1rem;
|
||||
padding: 0 1rem;
|
||||
|
|
@ -104,7 +81,7 @@ exports[`TrueFalse snapshot test with image 1`] = `
|
|||
border-radius: 6px;
|
||||
box-shadow: 0px 2px 5px hsl(0, 0%, 74%);
|
||||
">
|
||||
<p><img src="https://via.placeholder.com/150" alt="Sample Image" /></p>
|
||||
<p><img alt="Sample Image" src="https://via.placeholder.com/150"></p>
|
||||
</div></section>
|
||||
</DocumentFragment>
|
||||
`;
|
||||
|
|
@ -147,9 +124,19 @@ exports[`TrueFalse snapshot test with katex 1`] = `
|
|||
">Vrai/Faux</span>
|
||||
</span>
|
||||
</div>
|
||||
<p style="
|
||||
|
||||
<div style="
|
||||
display: flex;
|
||||
">
|
||||
<span>
|
||||
<p style="
|
||||
color: hsl(0, 0%, 0%);
|
||||
"><span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mfrac><mrow><mi>z</mi><mi>z</mi><mi>z</mi></mrow><mrow><mi>y</mi><mi>y</mi><mi>y</mi></mrow></mfrac></mrow><annotation encoding="application/x-tex">\\frac{zzz}{yyy}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1.988em;vertical-align:-0.8804em;"></span><span class="mord"><span class="mopen nulldelimiter"></span><span class="mfrac"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.1076em;"><span style="top:-2.314em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.03588em;">yyy</span></span></span><span style="top:-3.23em;"><span class="pstrut" style="height:3em;"></span><span class="frac-line" style="border-bottom-width:0.04em;"></span></span><span style="top:-3.677em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.04398em;">zzz</span></span></span></span><span class="vlist-s"></span></span><span class="vlist-r"><span class="vlist" style="height:0.8804em;"><span></span></span></span></span></span><span class="mclose nulldelimiter"></span></span></span></span></span></span></p><span style="
|
||||
" class="present-question-stem">
|
||||
<span class="katex-display"><span class="katex"><span class="katex-mathml"><math display="block" xmlns="http://www.w3.org/1998/Math/MathML"><mrow><mfrac><mrow><mi>z</mi><mi>z</mi><mi>z</mi></mrow><mrow><mi>y</mi><mi>y</mi><mi>y</mi></mrow></mfrac></mrow>\\frac{zzz}{yyy}</math></span><span aria-hidden="true" class="katex-html"><span class="base"><span style="height:1.988em;vertical-align:-0.8804em;" class="strut"></span><span class="mord"><span class="mopen nulldelimiter"></span><span class="mfrac"><span class="vlist-t vlist-t2"><span class="vlist-r"><span style="height:1.1076em;" class="vlist"><span style="top:-2.314em;"><span style="height:3em;" class="pstrut"></span><span class="mord"><span style="margin-right:0.03588em;" class="mord mathnormal">yyy</span></span></span><span style="top:-3.23em;"><span style="height:3em;" class="pstrut"></span><span style="border-bottom-width:0.04em;" class="frac-line"></span></span><span style="top:-3.677em;"><span style="height:3em;" class="pstrut"></span><span class="mord"><span style="margin-right:0.04398em;" class="mord mathnormal">zzz</span></span></span></span><span class="vlist-s"></span></span><span class="vlist-r"><span style="height:0.8804em;" class="vlist"><span></span></span></span></span></span><span class="mclose nulldelimiter"></span></span></span></span></span></span>
|
||||
</p>
|
||||
</span>
|
||||
</div>
|
||||
<span style="
|
||||
color: hsl(0, 0%, 0%);
|
||||
">Choisir une réponse:</span>
|
||||
<div class='multiple-choice-answers-container'>
|
||||
|
|
@ -213,8 +200,7 @@ exports[`TrueFalse snapshot test with katex 1`] = `
|
|||
border-radius: 6px;
|
||||
box-shadow: 0px 2px 5px hsl(0, 0%, 74%);
|
||||
">
|
||||
<p>Sample Global Feedback
|
||||
</p>
|
||||
<p>Sample Global Feedback</p>
|
||||
</div></section>
|
||||
</DocumentFragment>
|
||||
`;
|
||||
|
|
@ -257,9 +243,19 @@ exports[`TrueFalse snapshot test with moodle 1`] = `
|
|||
">Vrai/Faux</span>
|
||||
</span>
|
||||
</div>
|
||||
<p style="
|
||||
|
||||
<div style="
|
||||
display: flex;
|
||||
">
|
||||
<span>
|
||||
<p style="
|
||||
color: hsl(0, 0%, 0%);
|
||||
">Sample Stem</p><span style="
|
||||
" class="present-question-stem">
|
||||
Sample Stem
|
||||
</p>
|
||||
</span>
|
||||
</div>
|
||||
<span style="
|
||||
color: hsl(0, 0%, 0%);
|
||||
">Choisir une réponse:</span>
|
||||
<div class='multiple-choice-answers-container'>
|
||||
|
|
@ -366,9 +362,19 @@ exports[`TrueFalse snapshot test with plain text 1`] = `
|
|||
">Vrai/Faux</span>
|
||||
</span>
|
||||
</div>
|
||||
<p style="
|
||||
|
||||
<div style="
|
||||
display: flex;
|
||||
">
|
||||
<span>
|
||||
<p style="
|
||||
color: hsl(0, 0%, 0%);
|
||||
">Sample Stem</p><span style="
|
||||
" class="present-question-stem">
|
||||
Sample Stem
|
||||
</p>
|
||||
</span>
|
||||
</div>
|
||||
<span style="
|
||||
color: hsl(0, 0%, 0%);
|
||||
">Choisir une réponse:</span>
|
||||
<div class='multiple-choice-answers-container'>
|
||||
|
|
|
|||
|
|
@ -4,9 +4,10 @@ import Title from './TitleTemplate';
|
|||
import GlobalFeedback from './GlobalFeedbackTemplate';
|
||||
import { ParagraphStyle, InputStyle } from '../constants';
|
||||
import { state } from '.';
|
||||
import { NumericalAnswer, NumericalQuestion } from 'gift-pegjs';
|
||||
import { isHighLowNumericalAnswer, isRangeNumericalAnswer, isSimpleNumericalAnswer } from 'gift-pegjs/typeGuards';
|
||||
import { MultipleNumericalAnswer, NumericalAnswer, NumericalQuestion, TextFormat } from 'gift-pegjs';
|
||||
import { isHighLowNumericalAnswer, isMultipleNumericalAnswer, isRangeNumericalAnswer, isSimpleNumericalAnswer } from 'gift-pegjs/typeGuards';
|
||||
import StemTemplate from './StemTemplate';
|
||||
import { FormattedTextTemplate } from './TextTypeTemplate';
|
||||
|
||||
type NumericalOptions = TemplateOptions & NumericalQuestion;
|
||||
type NumericalAnswerOptions = TemplateOptions & Pick<NumericalQuestion, 'choices'>;
|
||||
|
|
@ -31,8 +32,12 @@ export default function NumericalTemplate({
|
|||
}
|
||||
|
||||
function NumericalAnswers({ choices }: NumericalAnswerOptions): string {
|
||||
const placeholder = choices.length > 1
|
||||
? choices.map(choice => {Answer(choice)}).join(', ')
|
||||
const placeholder = isMultipleNumericalAnswer(choices[0])
|
||||
? choices.map(choice => {
|
||||
console.log(JSON.stringify(choice));
|
||||
const c = choice as MultipleNumericalAnswer;
|
||||
return Answer(c.answer, c.formattedFeedback)
|
||||
}).join(', ')
|
||||
: Answer(choices[0]);
|
||||
|
||||
return `
|
||||
|
|
@ -46,14 +51,15 @@ function NumericalAnswers({ choices }: NumericalAnswerOptions): string {
|
|||
`;
|
||||
}
|
||||
|
||||
function Answer(choice: NumericalAnswer): string {
|
||||
function Answer(choice: NumericalAnswer, formattedFeedback?: TextFormat): string {
|
||||
const formattedFeedbackString = formattedFeedback ? ` (${FormattedTextTemplate(formattedFeedback)})` : '';
|
||||
switch (true) {
|
||||
case isSimpleNumericalAnswer(choice):
|
||||
return `${choice.number}`;
|
||||
return `${choice.number}${formattedFeedbackString}`;
|
||||
case isRangeNumericalAnswer(choice):
|
||||
return `${choice.number} ± ${choice.range}`;
|
||||
return `${choice.number} ± ${choice.range}${formattedFeedbackString}`;
|
||||
case isHighLowNumericalAnswer(choice):
|
||||
return `${choice.numberLow}..${choice.numberHigh}`;
|
||||
return `${choice.numberLow}..${choice.numberHigh}${formattedFeedbackString}`;
|
||||
default:
|
||||
return ``;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ class WebSocketService {
|
|||
private socket: Socket | null = null;
|
||||
|
||||
connect(backendUrl: string): Socket {
|
||||
console.log(`WebSocketService.connect('${backendUrl}')`);
|
||||
// console.log(`WebSocketService.connect('${backendUrl}')`);
|
||||
|
||||
// // Ensure the URL uses wss: if the URL starts with https:
|
||||
// const protocol = backendUrl.startsWith('https:') ? 'wss:' : 'ws:';
|
||||
|
|
|
|||
Loading…
Reference in a new issue