mirror of
https://github.com/ets-cfuhrman-pfe/EvalueTonSavoir.git
synced 2025-08-11 21:23:54 -04:00
Réponse à une question non enregistrée lorsque Étudiant reviens en arrière dans le quiz
Fixes #200
This commit is contained in:
parent
1c2d4134af
commit
ec2de888ec
3 changed files with 5 additions and 7 deletions
|
|
@ -11,11 +11,7 @@ const mockGiftQuestions = parse(
|
|||
`::Question:: Sample Question {=Option A ~Option B}`);
|
||||
|
||||
|
||||
describe('TeacherModeQuiz', () => {
|
||||
it ('renders the initial question as MultipleChoiceQuestion', () => {
|
||||
expect(mockGiftQuestions[0].type).toBe('MC');
|
||||
});
|
||||
|
||||
describe('TeacherModeQuiz', () => {
|
||||
const mockQuestion = mockGiftQuestions[0] as MultipleChoiceQuestion;
|
||||
mockQuestion.id = '1';
|
||||
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ const TeacherModeQuiz: React.FC<TeacherModeQuizProps> = ({
|
|||
}) => {
|
||||
const [isAnswerSubmitted, setIsAnswerSubmitted] = useState(false);
|
||||
const [isFeedbackDialogOpen, setIsFeedbackDialogOpen] = useState(false);
|
||||
const [answer, setAnswer] = useState<string | number | boolean>('');
|
||||
const [answer, setAnswer] = useState<string | number | boolean>();
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
|
|
@ -28,7 +28,8 @@ const TeacherModeQuiz: React.FC<TeacherModeQuizProps> = ({
|
|||
handleFeedbackDialogClose();
|
||||
setIsAnswerSubmitted(false);
|
||||
setAnswer(JSON.parse(localStorage.getItem(`Answer${questionInfos.question.id}`)||'null'));
|
||||
if (typeof answer !== "object") {
|
||||
console.log("LA REP",typeof answer);
|
||||
if (typeof answer !== "object" && typeof answer !== "undefined") {
|
||||
setIsAnswerSubmitted(true);
|
||||
setIsFeedbackDialogOpen(true);
|
||||
}
|
||||
|
|
|
|||
1
server/package-lock.json
generated
1
server/package-lock.json
generated
|
|
@ -2498,6 +2498,7 @@
|
|||
"resolved": "https://registry.npmjs.org/cross-env/-/cross-env-7.0.3.tgz",
|
||||
"integrity": "sha512-+/HKd6EgcQCJGh2PSjZuUitQBQynKor4wrFbRg4DtAgS1aWO+gU52xpH7M9ScGgXSYmAVS9bIJ8EzuaGw0oNAw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"cross-spawn": "^7.0.1"
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in a new issue