From b194a9183e22f43f60a735d815f074e444844858 Mon Sep 17 00:00:00 2001 From: Tiago Ribeiro Date: Wed, 21 Jun 2023 16:43:06 +0100 Subject: [PATCH] Updated the text related to the finish screen depending on the level --- src/constants/ielts.ts | 8 ---- src/constants/ielts.tsx | 84 +++++++++++++++++++++++++++++++++++++++++ src/exams/Finish.tsx | 16 ++------ 3 files changed, 87 insertions(+), 21 deletions(-) delete mode 100644 src/constants/ielts.ts create mode 100644 src/constants/ielts.tsx diff --git a/src/constants/ielts.ts b/src/constants/ielts.ts deleted file mode 100644 index 2facb6ea..00000000 --- a/src/constants/ielts.ts +++ /dev/null @@ -1,8 +0,0 @@ -import {Module} from "@/interfaces"; - -export const BAND_SCORES: {[key in Module]: number[]} = { - reading: [0, 2.5, 3, 3.5, 4, 4.5, 5, 5.5, 6, 6.5, 7, 7.5, 8, 8.5, 9], - listening: [0, 2.5, 3, 3.5, 4, 4.5, 5, 5.5, 6, 6.5, 7, 7.5, 8, 8.5, 9], - writing: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], - speaking: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], -}; diff --git a/src/constants/ielts.tsx b/src/constants/ielts.tsx new file mode 100644 index 00000000..ec150744 --- /dev/null +++ b/src/constants/ielts.tsx @@ -0,0 +1,84 @@ +import {Module} from "@/interfaces"; + +export const BAND_SCORES: {[key in Module]: number[]} = { + reading: [0, 2.5, 3, 3.5, 4, 4.5, 5, 5.5, 6, 6.5, 7, 7.5, 8, 8.5, 9], + listening: [0, 2.5, 3, 3.5, 4, 4.5, 5, 5.5, 6, 6.5, 7, 7.5, 8, 8.5, 9], + writing: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], + speaking: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], +}; + +export const LEVEL_TEXT = { + excellent: + "Congratulations on your exam performance! You achieved an impressive {{level}}, demonstrating excellent mastery of the assessed knowledge.\n\nIf you disagree with the result, you can request a review by a qualified teacher. We are committed to the accuracy and transparency of the results.\n\nPlease contact us for further information. Congratulations again on your outstanding achievement! We are here to support you on your academic journey.", + high: "Congratulations on your exam performance! You achieved a commendable {{level}}, demonstrating a good understanding of the assessed knowledge.\n\nIf you have any concerns about the result, you can request a review by a qualified teacher. We are committed to the accuracy and transparency of the results.\n\nPlease contact us for further information. Congratulations again on your achievement! We are here to support you on your academic journey.", + medium: "Congratulations on your exam performance! You achieved a {{level}}, demonstrating a satisfactory understanding of the assessed knowledge.\n\nIf you have any concerns about the result, you can request a review by a qualified teacher. We are committed to the accuracy and transparency of the results.\n\nPlease contact us for further information. Congratulations again on your achievement! We are here to support you on your academic journey.", + low: "Thank you for taking the exam. You achieved a {{level}}, but unfortunately, it did not meet the required standards.\n\nIf you have any concerns about the result, you can request a review by a qualified teacher. We are committed to the accuracy and transparency of the results.\n\nPlease contact us for further information. We encourage you to continue your studies and wish you the best of luck in your future endeavors.", +}; + +export const levelText = (level: number) => { + if (level === 9) { + return ( + <> + Congratulations on your exam performance! You achieved an impressive level {level}, demonstrating + excellent mastery of the assessed knowledge. +
+
+ If you disagree with the result, you can request a review by a qualified teacher. We are committed to the accuracy and transparency of + the results. +
+
+ Please contact us for further information. Congratulations again on your outstanding achievement! We are here to support you on your + academic journey. + + ); + } + + if (level >= 6) { + return ( + <> + Congratulations on your exam performance! You achieved a commendable level {level}, demonstrating a + good understanding of the assessed knowledge. +
+
+ If you have any concerns about the result, you can request a review by a qualified teacher. We are committed to the accuracy and + transparency of the results. +
+
+ Please contact us for further information. Congratulations again on your achievement! We are here to support you on your academic + journey. + + ); + } + + if (level >= 3) { + return ( + <> + Congratulations on your exam performance! You achieved a level of {level}, demonstrating a + satisfactory understanding of the assessed knowledge. +
+
+ If you have any concerns about the result, you can request a review by a qualified teacher. We are committed to the accuracy and + transparency of the results. +
+
+ Please contact us for further information. Congratulations again on your achievement! We are here to support you on your academic + journey. + + ); + } + + return ( + <> + Thank you for taking the exam. You achieved a level {level}, but unfortunately, it did not meet the + required standards. +
+
+ If you have any concerns about the result, you can request a review by a qualified teacher. We are committed to the accuracy and + transparency of the results. +
+
+ Please contact us for further information. We encourage you to continue your studies and wish you the best of luck in your future + endeavors. + + ); +}; diff --git a/src/exams/Finish.tsx b/src/exams/Finish.tsx index 4c45aa82..0bbce8bb 100644 --- a/src/exams/Finish.tsx +++ b/src/exams/Finish.tsx @@ -1,5 +1,6 @@ import Button from "@/components/Low/Button"; import ModuleTitle from "@/components/Medium/ModuleTitle"; +import {levelText, LEVEL_TEXT} from "@/constants/ielts"; import {Module} from "@/interfaces"; import {User} from "@/interfaces/user"; import useExamStore from "@/stores/examStore"; @@ -7,7 +8,7 @@ import {calculateBandScore} from "@/utils/score"; import clsx from "clsx"; import Link from "next/link"; import {useRouter} from "next/router"; -import {useEffect, useState} from "react"; +import {Fragment, useEffect, useState} from "react"; import {BsArrowCounterclockwise, BsBook, BsEyeFill, BsHeadphones, BsMegaphone, BsPen, BsShareFill} from "react-icons/bs"; interface Score { @@ -109,18 +110,7 @@ export default function Finish({user, scores, modules, onViewResults}: Props) {
- Congratulations on your exam performance! You achieved an impressive{" "} - - level {calculateBandScore(selectedScore.correct, selectedScore.total, selectedModule, user.focus)} - - , demonstrating excellent mastery of the assessed knowledge. -
-
- If you disagree with the result, you can request a review by a qualified teacher. We are committed to the accuracy and - transparency of the results. Please contact us for further information. -
-
- Congratulations again on your outstanding achievement! We are here to support you on your academic journey. + {levelText(calculateBandScore(selectedScore.correct, selectedScore.total, selectedModule, user.focus))}