From 89189ca4963133447c11e07260a3e542446aa245 Mon Sep 17 00:00:00 2001
From: louis-antoine-etsmtl
<61054719+louis-antoine-etsmtl@users.noreply.github.com>
Date: Tue, 16 Apr 2024 17:12:20 -0400
Subject: [PATCH] Revert "Melanie ite4"
---
.../GIFTCheatSheet/GiftCheatSheet.tsx | 11 +--
.../GiftTemplate/templates/TextType.ts | 1 -
.../MultipleChoiceQuestion.tsx | 21 +++---
.../NumericalQuestion/NumericalQuestion.tsx | 17 +++--
client/src/components/Questions/Question.tsx | 15 +++--
.../ShortAnswerQuestion.tsx | 17 +++--
.../TrueFalseQuestion/TrueFalseQuestion.tsx | 15 +++--
rapport/H24-iteration2.md | 67 -------------------
8 files changed, 51 insertions(+), 113 deletions(-)
delete mode 100644 rapport/H24-iteration2.md
diff --git a/client/src/components/GIFTCheatSheet/GiftCheatSheet.tsx b/client/src/components/GIFTCheatSheet/GiftCheatSheet.tsx
index 4dc9f1e..179e454 100644
--- a/client/src/components/GIFTCheatSheet/GiftCheatSheet.tsx
+++ b/client/src/components/GIFTCheatSheet/GiftCheatSheet.tsx
@@ -137,19 +137,14 @@ const GiftCheatSheet: React.FC = () => {
-
8. LaTeX et Markdown
+
8. LaTeX
- Les format LaTeX et markdown sont supportés dans cette application. Vous devez cependant penser
+ Le format LaTeX est supporté dans cette application. Vous devez cependant penser
à 'échapper' les caractères spéciaux mentionnés plus haut.
Exemple d'équation:
- {'$$x\\= \\frac\\{y^2\\}\\{4\\}$$'}
- {'\n$x\\= \\frac\\{y^2\\}\\{4\\}$'}
-
-
Exemple de texte Markdown:
-
- {'[markdown]Grâce à la balise markdown, Il est possible d\'insérer du texte *italique*, **gras**, du `code` et bien plus.'}
+ {'$$x\\= \\frac\\{y^2\\}\\{4\\}$$'}
diff --git a/client/src/components/GiftTemplate/templates/TextType.ts b/client/src/components/GiftTemplate/templates/TextType.ts
index b250637..bf9a3a3 100644
--- a/client/src/components/GiftTemplate/templates/TextType.ts
+++ b/client/src/components/GiftTemplate/templates/TextType.ts
@@ -9,7 +9,6 @@ interface TextTypeOptions extends TemplateOptions {
function formatLatex(text: string): string {
return text
.replace(/\$\$(.*?)\$\$/g, (_, inner) => katex.renderToString(inner, { displayMode: true }))
- .replace(/\$(.*?)\$/g, (_, inner) => katex.renderToString(inner, { displayMode: false }))
.replace(/\\\[(.*?)\\\]/g, (_, inner) => katex.renderToString(inner, { displayMode: true }))
.replace(/\\\((.*?)\\\)/g, (_, inner) =>
katex.renderToString(inner, { displayMode: false })
diff --git a/client/src/components/Questions/MultipleChoiceQuestion/MultipleChoiceQuestion.tsx b/client/src/components/Questions/MultipleChoiceQuestion/MultipleChoiceQuestion.tsx
index d3e7a82..54022a3 100644
--- a/client/src/components/Questions/MultipleChoiceQuestion/MultipleChoiceQuestion.tsx
+++ b/client/src/components/Questions/MultipleChoiceQuestion/MultipleChoiceQuestion.tsx
@@ -1,10 +1,8 @@
// MultipleChoiceQuestion.tsx
-import React, { useEffect, useState } from 'react';
+import React, { useState } from 'react';
+import Latex from 'react-latex';
import '../questionStyle.css';
import { Button } from '@mui/material';
-import TextType from '../../GiftTemplate/templates/TextType';
-import { TextFormat } from '../../GiftTemplate/templates/types';
-import Latex from 'react-latex';
type Choices = {
feedback: { format: string; text: string } | null;
@@ -14,7 +12,8 @@ type Choices = {
};
interface Props {
- questionContent: TextFormat;
+ questionTitle: string | null;
+ questionContent: string;
choices: Choices[];
globalFeedback?: string | undefined;
handleOnSubmitAnswer?: (answer: string) => void;
@@ -22,24 +21,22 @@ interface Props {
}
const MultipleChoiceQuestion: React.FC = (props) => {
- const { questionContent, choices, showAnswer, handleOnSubmitAnswer, globalFeedback } = props;
+ const { questionTitle, questionContent, choices, showAnswer, handleOnSubmitAnswer, globalFeedback } = props;
const [answer, setAnswer] = useState();
- useEffect(() => {
- setAnswer(undefined);
- }, [questionContent]);
-
const handleOnClickAnswer = (choice: string) => {
setAnswer(choice);
};
-
const alpha = Array.from(Array(26)).map((_e, i) => i + 65);
const alphabet = alpha.map((x) => String.fromCharCode(x));
return (
+
+ {questionTitle}
+
{choices.map((choice, i) => {
diff --git a/client/src/components/Questions/NumericalQuestion/NumericalQuestion.tsx b/client/src/components/Questions/NumericalQuestion/NumericalQuestion.tsx
index a1bfa9a..0fcc56b 100644
--- a/client/src/components/Questions/NumericalQuestion/NumericalQuestion.tsx
+++ b/client/src/components/Questions/NumericalQuestion/NumericalQuestion.tsx
@@ -1,9 +1,8 @@
// NumericalQuestion.tsx
import React, { useState } from 'react';
+import Latex from 'react-latex';
import '../questionStyle.css';
import { Button, TextField } from '@mui/material';
-import TextType from '../../GiftTemplate/templates/TextType';
-import { TextFormat } from '../../GiftTemplate/templates/types';
type CorrectAnswer = {
numberHigh?: number;
@@ -13,7 +12,8 @@ type CorrectAnswer = {
};
interface Props {
- questionContent: TextFormat;
+ questionTitle: string | null;
+ questionContent: string;
correctAnswers: CorrectAnswer;
globalFeedback?: string | undefined;
handleOnSubmitAnswer?: (answer: number) => void;
@@ -21,7 +21,7 @@ interface Props {
}
const NumericalQuestion: React.FC
= (props) => {
- const { questionContent, correctAnswers, showAnswer, handleOnSubmitAnswer, globalFeedback } =
+ const { questionTitle, questionContent, correctAnswers, showAnswer, handleOnSubmitAnswer, globalFeedback } =
props;
const [answer, setAnswer] = useState();
@@ -33,8 +33,11 @@ const NumericalQuestion: React.FC = (props) => {
return (
+
+ {questionTitle}
+
{showAnswer ? (
<>
@@ -46,8 +49,8 @@ const NumericalQuestion: React.FC
= (props) => {
) => {
setAnswer(e.target.valueAsNumber);
}}
diff --git a/client/src/components/Questions/Question.tsx b/client/src/components/Questions/Question.tsx
index 28e4d9b..ca23679 100644
--- a/client/src/components/Questions/Question.tsx
+++ b/client/src/components/Questions/Question.tsx
@@ -30,7 +30,8 @@ const Question: React.FC = ({
case 'TF':
questionTypeComponent = (
= ({
case 'MC':
questionTypeComponent = (
= ({
if (!Array.isArray(question.choices)) {
questionTypeComponent = (
= ({
} else {
questionTypeComponent = (
= ({
case 'Short':
questionTypeComponent = (
void;
@@ -21,13 +21,16 @@ interface Props {
}
const ShortAnswerQuestion: React.FC = (props) => {
- const { questionContent, choices, showAnswer, handleOnSubmitAnswer, globalFeedback } = props;
+ const { questionTitle, questionContent, choices, showAnswer, handleOnSubmitAnswer, globalFeedback } = props;
const [answer, setAnswer] = useState();
return (
+
+ {questionTitle}
+
{showAnswer ? (
<>
@@ -43,8 +46,8 @@ const ShortAnswerQuestion: React.FC
= (props) => {
{
setAnswer(e.target.value);
}}
diff --git a/client/src/components/Questions/TrueFalseQuestion/TrueFalseQuestion.tsx b/client/src/components/Questions/TrueFalseQuestion/TrueFalseQuestion.tsx
index f3a1357..e56eb4b 100644
--- a/client/src/components/Questions/TrueFalseQuestion/TrueFalseQuestion.tsx
+++ b/client/src/components/Questions/TrueFalseQuestion/TrueFalseQuestion.tsx
@@ -1,12 +1,12 @@
// TrueFalseQuestion.tsx
import React, { useState, useEffect } from 'react';
+import Latex from 'react-latex';
import '../questionStyle.css';
import { Button } from '@mui/material';
-import TextType from '../../GiftTemplate/templates/TextType';
-import { TextFormat } from '../../GiftTemplate/templates/types';
interface Props {
- questionContent: TextFormat;
+ questionTitle: string | null;
+ questionContent: string;
correctAnswer: boolean;
globalFeedback?: string | undefined;
handleOnSubmitAnswer?: (answer: boolean) => void;
@@ -14,20 +14,23 @@ interface Props {
}
const TrueFalseQuestion: React.FC = (props) => {
- const { questionContent, correctAnswer, showAnswer, handleOnSubmitAnswer, globalFeedback } =
+ const { questionTitle, questionContent, correctAnswer, showAnswer, handleOnSubmitAnswer, globalFeedback } =
props;
const [answer, setAnswer] = useState(undefined);
useEffect(() => {
setAnswer(undefined);
- }, [questionContent]);
+ }, [questionTitle]);
const selectedTrue = answer ? 'selected' : '';
const selectedFalse = answer !== undefined && !answer ? 'selected' : '';
return (
+
+ {questionTitle}
+
Une brève description de la façon d'évaluer si les objectifs (définis plus haut) de haut niveau ont été atteints.
-> Vos critères d'évaluation doivent être objectifs (aucun membre de l'équipe ne peut avoir une opinion divergente) et quantifiables (sauf pour ceux évalués par l'auxiliaire d'enseignement). En voici des exemples:
-
-- Accessibilité du serveur
-- Disponibilité des images pour les quizs
-- Modification du processus de connexion pour répondre aux cas utilisateurs
-
-## Évaluation
-
-| Résumé | |
-| ------------------ | ---------------------------------------------------------------------------------------------------------------------------------- |
-| Cible d'évaluation | Itération |
-| Date d'évaluation | 2024/02/27 |
-| Participants | **Équipe** : Louis-Antoine Caron, Samy Waddah, Mathieu Roy, Mélanie St-Hilaire **professeur** : Christopher Fuhrman |
-| État du projet | 🟢 |
-
-### Éléments de travail: prévus vs réalisés
-
-Le serveur a été configuré et la solution est présentement déployée pour débuter l'utilisation en classe. Cela permettra entre autre de tester les performances du serveur et permettra aux professeurs d'utiliser plus souvent la solution. Les quizs sont désormais sauvegardés sur le serveur, mais ils ne sont pas encore associés à un compte, il faut donc se fier au cookies pour récupérer les quizs. Les commentaires ont été temporairement corrigés en majorité, mais quelques problèmes de plus ont été apperçu dans la section d'édition du quiz. Le bug de perte de connexion semble avoir déja été corrigé par l'ancienne équipe et l'importation d'image dans les quiz est maintenant fonctionnelle.
-
-### Évaluation par rapport aux résultats selon les critères d'évaluation
-
-Nos principaux critères d'éavaluation ont été atteints, soit rendre le serveur accessible pour utilisation et autoriser l'importation d'images dans les quizs, qui sont maintenant sauvegardés sur le serveur. Même si de nouveaux problèmes ont fait surfaces, nous estimons que le projet répond à nos critères et est sur la bonne voie.
-
-## Autres préoccupations et écarts
-
-Quelques bugs en plus ont été découverts à la suite de cette itération. Une surveillance doit être effectué pour vérifier la stabilité du serveur.