mirror of
https://github.com/ets-cfuhrman-pfe/EvalueTonSavoir.git
synced 2025-08-11 21:23:54 -04:00
Added tests
This commit is contained in:
parent
b46c1c1934
commit
ebc0c64ef4
6 changed files with 1805 additions and 0 deletions
|
|
@ -0,0 +1,126 @@
|
||||||
|
import { render } from '@testing-library/react';
|
||||||
|
import { MultipleChoice } from '../../../../components/GiftTemplate/templates';
|
||||||
|
import { TemplateOptions, MultipleChoice as MultipleChoiceType } from '../../../../components/GiftTemplate/templates/types';
|
||||||
|
|
||||||
|
const mockProps: TemplateOptions & MultipleChoiceType = {
|
||||||
|
type: 'MC',
|
||||||
|
hasEmbeddedAnswers: false,
|
||||||
|
title: 'Sample Title',
|
||||||
|
stem: { format: 'plain' , text: 'Sample Stem'},
|
||||||
|
choices: [
|
||||||
|
{ text: { format: 'plain' , text: 'Choice 1'}, isCorrect: true, feedback: { format: 'plain' , text: 'Correct!'}, weight: 1 },
|
||||||
|
{ text: { format: 'plain', text: 'Choice 2' }, isCorrect: false, feedback: { format: 'plain' , text: 'InCorrect!'}, weight: 1 }
|
||||||
|
],
|
||||||
|
globalFeedback: { format: 'plain', text: 'Sample Global Feedback' }
|
||||||
|
};
|
||||||
|
|
||||||
|
const katekMock: TemplateOptions & MultipleChoiceType = {
|
||||||
|
type: 'MC',
|
||||||
|
hasEmbeddedAnswers: false,
|
||||||
|
title: 'Sample Title',
|
||||||
|
stem: { format: 'plain' , text: '$$\\frac{zzz}{yyy}$$'},
|
||||||
|
choices: [
|
||||||
|
{ text: { format: 'plain' , text: 'Choice 1'}, isCorrect: true, feedback: { format: 'plain' , text: 'Correct!'}, weight: 1 },
|
||||||
|
{ text: { format: 'plain', text: 'Choice 2' }, isCorrect: true, feedback: { format: 'plain' , text: 'Correct!'}, weight: 1 }
|
||||||
|
],
|
||||||
|
globalFeedback: { format: 'plain', text: 'Sample Global Feedback' }
|
||||||
|
};
|
||||||
|
|
||||||
|
const imageMock: TemplateOptions & MultipleChoiceType = {
|
||||||
|
type: 'MC',
|
||||||
|
hasEmbeddedAnswers: false,
|
||||||
|
title: 'Sample Title with Image',
|
||||||
|
stem: { format: 'plain', text: 'Sample Stem with Image' },
|
||||||
|
choices: [
|
||||||
|
{ text: { format: 'plain', text: 'Choice 1' }, isCorrect: true, feedback: { format: 'plain', text: 'Correct!' }, weight: 1 },
|
||||||
|
{ text: { format: 'plain', text: 'Choice 2' }, isCorrect: false, feedback: { format: 'plain', text: 'Incorrect!' }, weight: 1 },
|
||||||
|
{ text: { format: 'plain', text: '<img src="https://via.placeholder.com/150" alt="Sample Image" />' }, isCorrect: false, feedback: { format: 'plain', text: 'Image Feedback' }, weight: 1 }
|
||||||
|
],
|
||||||
|
globalFeedback: { format: 'plain', text: 'Sample Global Feedback with Image' }
|
||||||
|
};
|
||||||
|
|
||||||
|
const mockMoodle: TemplateOptions & MultipleChoiceType = {
|
||||||
|
type: 'MC',
|
||||||
|
hasEmbeddedAnswers: false,
|
||||||
|
title: 'Sample Title',
|
||||||
|
stem: { format: 'moodle' , text: 'Sample Stem'},
|
||||||
|
choices: [
|
||||||
|
{ text: { format: 'moodle' , text: 'Choice 1'}, isCorrect: true, feedback: { format: 'plain' , text: 'Correct!'}, weight: 1 },
|
||||||
|
{ text: { format: 'plain', text: 'Choice 2' }, isCorrect: false, feedback: { format: 'plain' , text: 'InCorrect!'}, weight: 1 }
|
||||||
|
],
|
||||||
|
globalFeedback: { format: 'plain', text: 'Sample Global Feedback' }
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
const mockHTML: TemplateOptions & MultipleChoiceType = {
|
||||||
|
type: 'MC',
|
||||||
|
hasEmbeddedAnswers: false,
|
||||||
|
title: 'Sample Title',
|
||||||
|
stem: { format: 'html' , text: '$$\\frac{zzz}{yyy}$$'},
|
||||||
|
choices: [
|
||||||
|
{ text: { format: 'html' , text: 'Choice 1'}, isCorrect: true, feedback: { format: 'plain' , text: 'Correct!'}, weight: 1 },
|
||||||
|
{ text: { format: 'html', text: 'Choice 2' }, isCorrect: false, feedback: { format: 'plain' , text: 'InCorrect!'}, weight: 1 }
|
||||||
|
],
|
||||||
|
globalFeedback: { format: 'html', text: 'Sample Global Feedback' }
|
||||||
|
};
|
||||||
|
|
||||||
|
const mockMarkdown: TemplateOptions & MultipleChoiceType = {
|
||||||
|
type: 'MC',
|
||||||
|
hasEmbeddedAnswers: false,
|
||||||
|
title: 'Sample Title with Image',
|
||||||
|
stem: { format: 'markdown', text: 'Sample Stem with Image' },
|
||||||
|
choices: [
|
||||||
|
{ text: { format: 'markdown', text: 'Choice 1' }, isCorrect: true, feedback: { format: 'plain', text: 'Correct!' }, weight: 1 },
|
||||||
|
{ text: { format: 'markdown', text: 'Choice 2' }, isCorrect: false, feedback: { format: 'plain', text: 'Incorrect!' }, weight: 1 },
|
||||||
|
{ text: { format: 'markdown', text: '<img src="https://via.placeholder.com/150" alt="Sample Image" />' }, isCorrect: false, feedback: { format: 'plain', text: 'Image Feedback' }, weight: 1 }
|
||||||
|
],
|
||||||
|
globalFeedback: { format: 'markdown', text: 'Sample Global Feedback with Image' }
|
||||||
|
};
|
||||||
|
|
||||||
|
const mockMarkdownTwoImages: TemplateOptions & MultipleChoiceType = {
|
||||||
|
type: 'MC',
|
||||||
|
hasEmbeddedAnswers: false,
|
||||||
|
title: 'Sample Title with Image',
|
||||||
|
stem: { format: 'markdown', text: '<img src="https://via.placeholder.com/150" alt = "Sample Image"/>' },
|
||||||
|
choices: [
|
||||||
|
{ text: { format: 'markdown', text: 'Choice 1' }, isCorrect: true, feedback: { format: 'plain', text: 'Correct!' }, weight: 1 },
|
||||||
|
{ text: { format: 'markdown', text: 'Choice 2' }, isCorrect: false, feedback: { format: 'plain', text: 'Incorrect!' }, weight: 1 },
|
||||||
|
{ text: { format: 'markdown', text: '<img src="https://via.placeholder.com/150" alt="Sample Image" />' }, isCorrect: false, feedback: { format: 'plain', text: 'Image Feedback' }, weight: 1 }
|
||||||
|
],
|
||||||
|
globalFeedback: { format: 'markdown', text: 'Sample Global Feedback with Image' }
|
||||||
|
};
|
||||||
|
|
||||||
|
test('MultipleChoice snapshot test', () => {
|
||||||
|
const { asFragment } = render(<MultipleChoice {...mockProps} />);
|
||||||
|
expect(asFragment()).toMatchSnapshot();
|
||||||
|
});
|
||||||
|
|
||||||
|
test('MultipleChoice snapshot test with katex', () => {
|
||||||
|
const { asFragment } = render(<MultipleChoice {...katekMock} />);
|
||||||
|
expect(asFragment()).toMatchSnapshot();
|
||||||
|
});
|
||||||
|
|
||||||
|
test('MultipleChoice snapshot test with image', () => {
|
||||||
|
const { asFragment } = render(<MultipleChoice {...imageMock} />);
|
||||||
|
expect(asFragment()).toMatchSnapshot();
|
||||||
|
});
|
||||||
|
|
||||||
|
test('MultipleChoice snapshot test with Moodle text format', () => {
|
||||||
|
const { asFragment } = render(<MultipleChoice {...mockMoodle} />);
|
||||||
|
expect(asFragment()).toMatchSnapshot();
|
||||||
|
});
|
||||||
|
|
||||||
|
test('MultipleChoice snapshot test with katex, using html text format', () => {
|
||||||
|
const { asFragment } = render(<MultipleChoice {...mockHTML} />);
|
||||||
|
expect(asFragment()).toMatchSnapshot();
|
||||||
|
});
|
||||||
|
|
||||||
|
test('MultipleChoice snapshot test with image using markdown text format', () => {
|
||||||
|
const { asFragment } = render(<MultipleChoice {...mockMarkdown} />);
|
||||||
|
expect(asFragment()).toMatchSnapshot();
|
||||||
|
});
|
||||||
|
|
||||||
|
test('MultipleChoice snapshot test with 2 images using markdown text format', () => {
|
||||||
|
const { asFragment } = render(<MultipleChoice {...mockMarkdownTwoImages} />);
|
||||||
|
expect(asFragment()).toMatchSnapshot();
|
||||||
|
});
|
||||||
|
|
@ -0,0 +1,54 @@
|
||||||
|
import { render } from '@testing-library/react';
|
||||||
|
import ShortAnswer from '../../../../components/GiftTemplate/templates/ShortAnswer';
|
||||||
|
import { TemplateOptions, ShortAnswer as ShortAnswerType } from '../../../../components/GiftTemplate/templates/types';
|
||||||
|
|
||||||
|
const plainTextMock: TemplateOptions & ShortAnswerType = {
|
||||||
|
type: 'Short',
|
||||||
|
hasEmbeddedAnswers: false,
|
||||||
|
title: 'Sample Short Answer Title',
|
||||||
|
stem: { format: 'plain', text: 'Sample Stem' },
|
||||||
|
choices: [
|
||||||
|
{ text: { format: 'plain' , text: 'Answer 1'}, isCorrect: true, feedback: { format: 'plain' , text: 'Correct!'}, weight: 1 },
|
||||||
|
{ text: { format: 'plain' , text: 'Answer 2'}, isCorrect: true, feedback: { format: 'plain' , text: 'Correct!'}, weight: 1 }
|
||||||
|
],
|
||||||
|
globalFeedback: { format: 'plain', text: 'Sample Global Feedback' }
|
||||||
|
};
|
||||||
|
|
||||||
|
const katexMock: TemplateOptions & ShortAnswerType = {
|
||||||
|
type: 'Short',
|
||||||
|
hasEmbeddedAnswers: false,
|
||||||
|
title: 'Sample Short Answer Title',
|
||||||
|
stem: { format: 'html', text: '$$\\frac{zzz}{yyy}$$' },
|
||||||
|
choices: [
|
||||||
|
{ text: { format: 'html' , text: 'Answer 1'}, isCorrect: true, feedback: { format: 'html' , text: 'Correct!'}, weight: 1 },
|
||||||
|
{ text: { format: 'html' , text: 'Answer 2'}, isCorrect: true, feedback: { format: 'moodle' , text: 'Correct!'}, weight: 1 }
|
||||||
|
],
|
||||||
|
globalFeedback: { format: 'html', text: 'Sample Global Feedback' }
|
||||||
|
};
|
||||||
|
|
||||||
|
const moodleMock: TemplateOptions & ShortAnswerType = {
|
||||||
|
type: 'Short',
|
||||||
|
hasEmbeddedAnswers: false,
|
||||||
|
title: 'Sample Short Answer Title',
|
||||||
|
stem: { format: 'moodle', text: 'Sample Stem' },
|
||||||
|
choices: [
|
||||||
|
{ text: { format: 'plain' , text: 'Answer 1'}, isCorrect: true, feedback: { format: 'plain' , text: 'Correct!'}, weight: 1 },
|
||||||
|
{ text: { format: 'plain' , text: 'Answer 2'}, isCorrect: true, feedback: { format: 'plain' , text: 'Correct!'}, weight: 1 }
|
||||||
|
],
|
||||||
|
globalFeedback: { format: 'moodle', text: 'Sample Global Feedback' }
|
||||||
|
};
|
||||||
|
|
||||||
|
test('ShortAnswer snapshot test with plain text', () => {
|
||||||
|
const { asFragment } = render(<ShortAnswer {...plainTextMock} />);
|
||||||
|
expect(asFragment()).toMatchSnapshot();
|
||||||
|
});
|
||||||
|
|
||||||
|
test('ShortAnswer snapshot test with katex', () => {
|
||||||
|
const { asFragment } = render(<ShortAnswer {...katexMock} />);
|
||||||
|
expect(asFragment()).toMatchSnapshot();
|
||||||
|
});
|
||||||
|
|
||||||
|
test('ShortAnswer snapshot test with moodle', () => {
|
||||||
|
const { asFragment } = render(<ShortAnswer {...moodleMock} />);
|
||||||
|
expect(asFragment()).toMatchSnapshot();
|
||||||
|
});
|
||||||
|
|
@ -0,0 +1,51 @@
|
||||||
|
import { render } from '@testing-library/react';
|
||||||
|
import TrueFalse from '../../../../components/GiftTemplate/templates';
|
||||||
|
import { TemplateOptions, TrueFalse as TrueFalseType } from '../../../../components/GiftTemplate/templates/types';
|
||||||
|
|
||||||
|
const plainTextMock: TemplateOptions & TrueFalseType = {
|
||||||
|
type: 'TF',
|
||||||
|
hasEmbeddedAnswers: false,
|
||||||
|
title: 'Sample True/False Title',
|
||||||
|
stem: { format: 'plain', text: 'Sample Stem' },
|
||||||
|
isTrue: true,
|
||||||
|
trueFeedback: { format: 'plain', text: 'Correct!' },
|
||||||
|
falseFeedback: { format: 'plain', text: 'Incorrect!' },
|
||||||
|
globalFeedback: { format: 'plain', text: 'Sample Global Feedback' }
|
||||||
|
};
|
||||||
|
|
||||||
|
const katexMock: TemplateOptions & TrueFalseType = {
|
||||||
|
type: 'TF',
|
||||||
|
hasEmbeddedAnswers: false,
|
||||||
|
title: 'Sample True/False Title',
|
||||||
|
stem: { format: 'html', text: '$$\\frac{zzz}{yyy}$$' },
|
||||||
|
isTrue: true,
|
||||||
|
trueFeedback: { format: 'moodle', text: 'Correct!' },
|
||||||
|
falseFeedback: { format: 'html', text: 'Incorrect!' },
|
||||||
|
globalFeedback: { format: 'markdown', text: 'Sample Global Feedback' }
|
||||||
|
};
|
||||||
|
|
||||||
|
const moodleMock: TemplateOptions & TrueFalseType = {
|
||||||
|
type: 'TF',
|
||||||
|
hasEmbeddedAnswers: false,
|
||||||
|
title: 'Sample True/False Title',
|
||||||
|
stem: { format: 'moodle', text: 'Sample Stem' },
|
||||||
|
isTrue: true,
|
||||||
|
trueFeedback: { format: 'moodle', text: 'Correct!' },
|
||||||
|
falseFeedback: { format: 'moodle', text: 'Incorrect!' },
|
||||||
|
globalFeedback: { format: 'moodle', text: 'Sample Global Feedback' }
|
||||||
|
};
|
||||||
|
|
||||||
|
test('TrueFalse snapshot test with plain text', () => {
|
||||||
|
const { asFragment } = render(<TrueFalse {...plainTextMock} />);
|
||||||
|
expect(asFragment()).toMatchSnapshot();
|
||||||
|
});
|
||||||
|
|
||||||
|
test('TrueFalse snapshot test with katex', () => {
|
||||||
|
const { asFragment } = render(<TrueFalse {...katexMock} />);
|
||||||
|
expect(asFragment()).toMatchSnapshot();
|
||||||
|
});
|
||||||
|
|
||||||
|
test('TrueFalse snapshot test with moodle', () => {
|
||||||
|
const { asFragment } = render(<TrueFalse {...moodleMock} />);
|
||||||
|
expect(asFragment()).toMatchSnapshot();
|
||||||
|
});
|
||||||
File diff suppressed because it is too large
Load diff
|
|
@ -0,0 +1,226 @@
|
||||||
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||||
|
|
||||||
|
exports[`ShortAnswer snapshot test with katex 1`] = `
|
||||||
|
<DocumentFragment>
|
||||||
|
<section style="
|
||||||
|
flex-wrap: wrap;
|
||||||
|
position: relative;
|
||||||
|
padding: 1rem 1rem;
|
||||||
|
margin-bottom: 0.5rem;
|
||||||
|
background-color: hsl(0, 0%, 100%);
|
||||||
|
border: solid hsl(0, 0%, 100%) 2px;
|
||||||
|
border-radius: 6px;
|
||||||
|
box-shadow: 0px 1px 3px hsl(0, 0%, 74%);
|
||||||
|
">
|
||||||
|
<div style="
|
||||||
|
display: flex;
|
||||||
|
font-weight: bold;
|
||||||
|
">
|
||||||
|
<span>
|
||||||
|
<span style="
|
||||||
|
color: #5271FF;
|
||||||
|
">Sample Short Answer Title</span>
|
||||||
|
</span>
|
||||||
|
<span style="
|
||||||
|
margin-left: auto;
|
||||||
|
padding-left: 0.75rem;
|
||||||
|
flex: none;
|
||||||
|
margin-bottom: 10px;">
|
||||||
|
<span style="
|
||||||
|
box-shadow: 0px 1px 3px hsl(0, 0%, 74%);
|
||||||
|
padding-left: 0.7rem;
|
||||||
|
padding-right: 0.7rem;
|
||||||
|
padding-top: 0.4rem;
|
||||||
|
padding-bottom: 0.4rem;
|
||||||
|
border-radius: 4px;
|
||||||
|
background-color: hsl(0, 0%, 100%);
|
||||||
|
color: hsl(180, 15%, 41%);
|
||||||
|
">Réponse courte</span>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<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>
|
||||||
|
<div>
|
||||||
|
<span style="
|
||||||
|
color: hsl(0, 0%, 0%);
|
||||||
|
">Réponse: </span><input class="gift-input" type="text" style="
|
||||||
|
display: inline-block;
|
||||||
|
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="Answer 1, Answer 2">
|
||||||
|
</div>
|
||||||
|
<div style="
|
||||||
|
position: relative;
|
||||||
|
margin-top: 1rem;
|
||||||
|
padding: 0 1rem;
|
||||||
|
background-color: hsl(43, 100%, 94%);
|
||||||
|
color: hsl(43, 95%, 9%);
|
||||||
|
border: hsl(36, 84%, 93%) 1px solid;
|
||||||
|
border-radius: 6px;
|
||||||
|
box-shadow: 0px 2px 5px hsl(0, 0%, 74%);
|
||||||
|
">
|
||||||
|
<p>Sample Global Feedback</p>
|
||||||
|
</div></section>
|
||||||
|
</DocumentFragment>
|
||||||
|
`;
|
||||||
|
|
||||||
|
exports[`ShortAnswer snapshot test with moodle 1`] = `
|
||||||
|
<DocumentFragment>
|
||||||
|
<section style="
|
||||||
|
flex-wrap: wrap;
|
||||||
|
position: relative;
|
||||||
|
padding: 1rem 1rem;
|
||||||
|
margin-bottom: 0.5rem;
|
||||||
|
background-color: hsl(0, 0%, 100%);
|
||||||
|
border: solid hsl(0, 0%, 100%) 2px;
|
||||||
|
border-radius: 6px;
|
||||||
|
box-shadow: 0px 1px 3px hsl(0, 0%, 74%);
|
||||||
|
">
|
||||||
|
<div style="
|
||||||
|
display: flex;
|
||||||
|
font-weight: bold;
|
||||||
|
">
|
||||||
|
<span>
|
||||||
|
<span style="
|
||||||
|
color: #5271FF;
|
||||||
|
">Sample Short Answer Title</span>
|
||||||
|
</span>
|
||||||
|
<span style="
|
||||||
|
margin-left: auto;
|
||||||
|
padding-left: 0.75rem;
|
||||||
|
flex: none;
|
||||||
|
margin-bottom: 10px;">
|
||||||
|
<span style="
|
||||||
|
box-shadow: 0px 1px 3px hsl(0, 0%, 74%);
|
||||||
|
padding-left: 0.7rem;
|
||||||
|
padding-right: 0.7rem;
|
||||||
|
padding-top: 0.4rem;
|
||||||
|
padding-bottom: 0.4rem;
|
||||||
|
border-radius: 4px;
|
||||||
|
background-color: hsl(0, 0%, 100%);
|
||||||
|
color: hsl(180, 15%, 41%);
|
||||||
|
">Réponse courte</span>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<p style="
|
||||||
|
color: hsl(0, 0%, 0%);
|
||||||
|
">Sample Stem</p>
|
||||||
|
<div>
|
||||||
|
<span style="
|
||||||
|
color: hsl(0, 0%, 0%);
|
||||||
|
">Réponse: </span><input class="gift-input" type="text" style="
|
||||||
|
display: inline-block;
|
||||||
|
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="Answer 1, Answer 2">
|
||||||
|
</div>
|
||||||
|
<div style="
|
||||||
|
position: relative;
|
||||||
|
margin-top: 1rem;
|
||||||
|
padding: 0 1rem;
|
||||||
|
background-color: hsl(43, 100%, 94%);
|
||||||
|
color: hsl(43, 95%, 9%);
|
||||||
|
border: hsl(36, 84%, 93%) 1px solid;
|
||||||
|
border-radius: 6px;
|
||||||
|
box-shadow: 0px 2px 5px hsl(0, 0%, 74%);
|
||||||
|
">
|
||||||
|
<p>Sample Global Feedback</p>
|
||||||
|
</div></section>
|
||||||
|
</DocumentFragment>
|
||||||
|
`;
|
||||||
|
|
||||||
|
exports[`ShortAnswer snapshot test with plain text 1`] = `
|
||||||
|
<DocumentFragment>
|
||||||
|
<section style="
|
||||||
|
flex-wrap: wrap;
|
||||||
|
position: relative;
|
||||||
|
padding: 1rem 1rem;
|
||||||
|
margin-bottom: 0.5rem;
|
||||||
|
background-color: hsl(0, 0%, 100%);
|
||||||
|
border: solid hsl(0, 0%, 100%) 2px;
|
||||||
|
border-radius: 6px;
|
||||||
|
box-shadow: 0px 1px 3px hsl(0, 0%, 74%);
|
||||||
|
">
|
||||||
|
<div style="
|
||||||
|
display: flex;
|
||||||
|
font-weight: bold;
|
||||||
|
">
|
||||||
|
<span>
|
||||||
|
<span style="
|
||||||
|
color: #5271FF;
|
||||||
|
">Sample Short Answer Title</span>
|
||||||
|
</span>
|
||||||
|
<span style="
|
||||||
|
margin-left: auto;
|
||||||
|
padding-left: 0.75rem;
|
||||||
|
flex: none;
|
||||||
|
margin-bottom: 10px;">
|
||||||
|
<span style="
|
||||||
|
box-shadow: 0px 1px 3px hsl(0, 0%, 74%);
|
||||||
|
padding-left: 0.7rem;
|
||||||
|
padding-right: 0.7rem;
|
||||||
|
padding-top: 0.4rem;
|
||||||
|
padding-bottom: 0.4rem;
|
||||||
|
border-radius: 4px;
|
||||||
|
background-color: hsl(0, 0%, 100%);
|
||||||
|
color: hsl(180, 15%, 41%);
|
||||||
|
">Réponse courte</span>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<p style="
|
||||||
|
color: hsl(0, 0%, 0%);
|
||||||
|
">Sample Stem</p>
|
||||||
|
<div>
|
||||||
|
<span style="
|
||||||
|
color: hsl(0, 0%, 0%);
|
||||||
|
">Réponse: </span><input class="gift-input" type="text" style="
|
||||||
|
display: inline-block;
|
||||||
|
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="Answer 1, Answer 2">
|
||||||
|
</div>
|
||||||
|
<div style="
|
||||||
|
position: relative;
|
||||||
|
margin-top: 1rem;
|
||||||
|
padding: 0 1rem;
|
||||||
|
background-color: hsl(43, 100%, 94%);
|
||||||
|
color: hsl(43, 95%, 9%);
|
||||||
|
border: hsl(36, 84%, 93%) 1px solid;
|
||||||
|
border-radius: 6px;
|
||||||
|
box-shadow: 0px 2px 5px hsl(0, 0%, 74%);
|
||||||
|
">
|
||||||
|
<p>Sample Global Feedback</p>
|
||||||
|
</div></section>
|
||||||
|
</DocumentFragment>
|
||||||
|
`;
|
||||||
|
|
@ -0,0 +1,329 @@
|
||||||
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||||
|
|
||||||
|
exports[`TrueFalse snapshot test with katex 1`] = `
|
||||||
|
<DocumentFragment>
|
||||||
|
<section style="
|
||||||
|
flex-wrap: wrap;
|
||||||
|
position: relative;
|
||||||
|
padding: 1rem 1rem;
|
||||||
|
margin-bottom: 0.5rem;
|
||||||
|
background-color: hsl(0, 0%, 100%);
|
||||||
|
border: solid hsl(0, 0%, 100%) 2px;
|
||||||
|
border-radius: 6px;
|
||||||
|
box-shadow: 0px 1px 3px hsl(0, 0%, 74%);
|
||||||
|
">
|
||||||
|
<div style="
|
||||||
|
display: flex;
|
||||||
|
font-weight: bold;
|
||||||
|
">
|
||||||
|
<span>
|
||||||
|
<span style="
|
||||||
|
color: #5271FF;
|
||||||
|
">Sample True/False Title</span>
|
||||||
|
</span>
|
||||||
|
<span style="
|
||||||
|
margin-left: auto;
|
||||||
|
padding-left: 0.75rem;
|
||||||
|
flex: none;
|
||||||
|
margin-bottom: 10px;">
|
||||||
|
<span style="
|
||||||
|
box-shadow: 0px 1px 3px hsl(0, 0%, 74%);
|
||||||
|
padding-left: 0.7rem;
|
||||||
|
padding-right: 0.7rem;
|
||||||
|
padding-top: 0.4rem;
|
||||||
|
padding-bottom: 0.4rem;
|
||||||
|
border-radius: 4px;
|
||||||
|
background-color: hsl(0, 0%, 100%);
|
||||||
|
color: hsl(180, 15%, 41%);
|
||||||
|
">Vrai/Faux</span>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<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="
|
||||||
|
color: hsl(0, 0%, 0%);
|
||||||
|
">Choisir une réponse:</span>
|
||||||
|
<div class='multiple-choice-answers-container'>
|
||||||
|
<input class="gift-input" type="radio" id="idJPS1EM" name="idpM8HEdsR">
|
||||||
|
|
||||||
|
<label style="
|
||||||
|
display: inline-block;
|
||||||
|
padding: 0.2em 0 0.2em 0;
|
||||||
|
|
||||||
|
color: hsl(0, 0%, 0%);
|
||||||
|
" for="idJPS1EM">
|
||||||
|
Vrai
|
||||||
|
</label>
|
||||||
|
<svg style="
|
||||||
|
vertical-align: text-bottom;
|
||||||
|
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>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class='multiple-choice-answers-container'>
|
||||||
|
<input class="gift-input" type="radio" id="id_-5rkc" name="idpM8HEdsR">
|
||||||
|
|
||||||
|
<label style="
|
||||||
|
display: inline-block;
|
||||||
|
padding: 0.2em 0 0.2em 0;
|
||||||
|
|
||||||
|
color: hsl(0, 0%, 0%);
|
||||||
|
" for="id_-5rkc">
|
||||||
|
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="
|
||||||
|
position: relative;
|
||||||
|
margin-top: 1rem;
|
||||||
|
padding: 0 1rem;
|
||||||
|
background-color: hsl(43, 100%, 94%);
|
||||||
|
color: hsl(43, 95%, 9%);
|
||||||
|
border: hsl(36, 84%, 93%) 1px solid;
|
||||||
|
border-radius: 6px;
|
||||||
|
box-shadow: 0px 2px 5px hsl(0, 0%, 74%);
|
||||||
|
">
|
||||||
|
<p>Sample Global Feedback
|
||||||
|
</p>
|
||||||
|
</div></section>
|
||||||
|
</DocumentFragment>
|
||||||
|
`;
|
||||||
|
|
||||||
|
exports[`TrueFalse snapshot test with moodle 1`] = `
|
||||||
|
<DocumentFragment>
|
||||||
|
<section style="
|
||||||
|
flex-wrap: wrap;
|
||||||
|
position: relative;
|
||||||
|
padding: 1rem 1rem;
|
||||||
|
margin-bottom: 0.5rem;
|
||||||
|
background-color: hsl(0, 0%, 100%);
|
||||||
|
border: solid hsl(0, 0%, 100%) 2px;
|
||||||
|
border-radius: 6px;
|
||||||
|
box-shadow: 0px 1px 3px hsl(0, 0%, 74%);
|
||||||
|
">
|
||||||
|
<div style="
|
||||||
|
display: flex;
|
||||||
|
font-weight: bold;
|
||||||
|
">
|
||||||
|
<span>
|
||||||
|
<span style="
|
||||||
|
color: #5271FF;
|
||||||
|
">Sample True/False Title</span>
|
||||||
|
</span>
|
||||||
|
<span style="
|
||||||
|
margin-left: auto;
|
||||||
|
padding-left: 0.75rem;
|
||||||
|
flex: none;
|
||||||
|
margin-bottom: 10px;">
|
||||||
|
<span style="
|
||||||
|
box-shadow: 0px 1px 3px hsl(0, 0%, 74%);
|
||||||
|
padding-left: 0.7rem;
|
||||||
|
padding-right: 0.7rem;
|
||||||
|
padding-top: 0.4rem;
|
||||||
|
padding-bottom: 0.4rem;
|
||||||
|
border-radius: 4px;
|
||||||
|
background-color: hsl(0, 0%, 100%);
|
||||||
|
color: hsl(180, 15%, 41%);
|
||||||
|
">Vrai/Faux</span>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<p style="
|
||||||
|
color: hsl(0, 0%, 0%);
|
||||||
|
">Sample Stem</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="idOPBdFk" name="idoMEBjTDb">
|
||||||
|
|
||||||
|
<label style="
|
||||||
|
display: inline-block;
|
||||||
|
padding: 0.2em 0 0.2em 0;
|
||||||
|
|
||||||
|
color: hsl(0, 0%, 0%);
|
||||||
|
" for="idOPBdFk">
|
||||||
|
Vrai
|
||||||
|
</label>
|
||||||
|
<svg style="
|
||||||
|
vertical-align: text-bottom;
|
||||||
|
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>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class='multiple-choice-answers-container'>
|
||||||
|
<input class="gift-input" type="radio" id="id3lljUu" name="idoMEBjTDb">
|
||||||
|
|
||||||
|
<label style="
|
||||||
|
display: inline-block;
|
||||||
|
padding: 0.2em 0 0.2em 0;
|
||||||
|
|
||||||
|
color: hsl(0, 0%, 0%);
|
||||||
|
" for="id3lljUu">
|
||||||
|
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="
|
||||||
|
position: relative;
|
||||||
|
margin-top: 1rem;
|
||||||
|
padding: 0 1rem;
|
||||||
|
background-color: hsl(43, 100%, 94%);
|
||||||
|
color: hsl(43, 95%, 9%);
|
||||||
|
border: hsl(36, 84%, 93%) 1px solid;
|
||||||
|
border-radius: 6px;
|
||||||
|
box-shadow: 0px 2px 5px hsl(0, 0%, 74%);
|
||||||
|
">
|
||||||
|
<p>Sample Global Feedback</p>
|
||||||
|
</div></section>
|
||||||
|
</DocumentFragment>
|
||||||
|
`;
|
||||||
|
|
||||||
|
exports[`TrueFalse snapshot test with plain text 1`] = `
|
||||||
|
<DocumentFragment>
|
||||||
|
<section style="
|
||||||
|
flex-wrap: wrap;
|
||||||
|
position: relative;
|
||||||
|
padding: 1rem 1rem;
|
||||||
|
margin-bottom: 0.5rem;
|
||||||
|
background-color: hsl(0, 0%, 100%);
|
||||||
|
border: solid hsl(0, 0%, 100%) 2px;
|
||||||
|
border-radius: 6px;
|
||||||
|
box-shadow: 0px 1px 3px hsl(0, 0%, 74%);
|
||||||
|
">
|
||||||
|
<div style="
|
||||||
|
display: flex;
|
||||||
|
font-weight: bold;
|
||||||
|
">
|
||||||
|
<span>
|
||||||
|
<span style="
|
||||||
|
color: #5271FF;
|
||||||
|
">Sample True/False Title</span>
|
||||||
|
</span>
|
||||||
|
<span style="
|
||||||
|
margin-left: auto;
|
||||||
|
padding-left: 0.75rem;
|
||||||
|
flex: none;
|
||||||
|
margin-bottom: 10px;">
|
||||||
|
<span style="
|
||||||
|
box-shadow: 0px 1px 3px hsl(0, 0%, 74%);
|
||||||
|
padding-left: 0.7rem;
|
||||||
|
padding-right: 0.7rem;
|
||||||
|
padding-top: 0.4rem;
|
||||||
|
padding-bottom: 0.4rem;
|
||||||
|
border-radius: 4px;
|
||||||
|
background-color: hsl(0, 0%, 100%);
|
||||||
|
color: hsl(180, 15%, 41%);
|
||||||
|
">Vrai/Faux</span>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<p style="
|
||||||
|
color: hsl(0, 0%, 0%);
|
||||||
|
">Sample Stem</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="id2_2M-E" name="idpl2XIOYb">
|
||||||
|
|
||||||
|
<label style="
|
||||||
|
display: inline-block;
|
||||||
|
padding: 0.2em 0 0.2em 0;
|
||||||
|
|
||||||
|
color: hsl(0, 0%, 0%);
|
||||||
|
" for="id2_2M-E">
|
||||||
|
Vrai
|
||||||
|
</label>
|
||||||
|
<svg style="
|
||||||
|
vertical-align: text-bottom;
|
||||||
|
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>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class='multiple-choice-answers-container'>
|
||||||
|
<input class="gift-input" type="radio" id="idPc16JK" name="idpl2XIOYb">
|
||||||
|
|
||||||
|
<label style="
|
||||||
|
display: inline-block;
|
||||||
|
padding: 0.2em 0 0.2em 0;
|
||||||
|
|
||||||
|
color: hsl(0, 0%, 0%);
|
||||||
|
" for="idPc16JK">
|
||||||
|
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="
|
||||||
|
position: relative;
|
||||||
|
margin-top: 1rem;
|
||||||
|
padding: 0 1rem;
|
||||||
|
background-color: hsl(43, 100%, 94%);
|
||||||
|
color: hsl(43, 95%, 9%);
|
||||||
|
border: hsl(36, 84%, 93%) 1px solid;
|
||||||
|
border-radius: 6px;
|
||||||
|
box-shadow: 0px 2px 5px hsl(0, 0%, 74%);
|
||||||
|
">
|
||||||
|
<p>Sample Global Feedback</p>
|
||||||
|
</div></section>
|
||||||
|
</DocumentFragment>
|
||||||
|
`;
|
||||||
Loading…
Reference in a new issue