From 56d51ca32f65efef00f2001311aa8e55e499061f Mon Sep 17 00:00:00 2001 From: juanpabloacosta Date: Thu, 30 Nov 2023 19:42:24 -0500 Subject: [PATCH] Included rendering of WrittenVocabularyExercise in lesson. --- frontend/src/pages/Lesson.tsx | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/frontend/src/pages/Lesson.tsx b/frontend/src/pages/Lesson.tsx index 225a8c4..23405d5 100644 --- a/frontend/src/pages/Lesson.tsx +++ b/frontend/src/pages/Lesson.tsx @@ -1,6 +1,7 @@ import { useLocation, useNavigate } from 'react-router-dom'; import { useState } from 'react'; import WrittenQuestionExercise from "../components/WrittenQuestionExercise" +import WrittenVocabularyExercise from "../components/WrittenVocabularyExercise" import Progress from '../components/Progress'; export default function Course() { @@ -22,22 +23,29 @@ export default function Course() { } const renderQuestion = (questionIndex: number) => { - const {question, wordBank, expected, type, exercise} = questions[currQuestion]; - switch (type) { + const question = questions[currQuestion]; + switch (question.type) { case 'written': - switch (exercise) { + switch (question.exercise) { case 'questions': return ; - // case 'vocabulary': - // return ; + case 'vocabulary': + return ; default: return null; }