Created a Finish screen for when a user finishes an exam
This commit is contained in:
@@ -17,6 +17,7 @@ import Listening from "@/exams/Listening";
|
||||
import Writing from "@/exams/Writing";
|
||||
import {ToastContainer} from "react-toastify";
|
||||
import Link from "next/link";
|
||||
import Finish from "@/exams/Finish";
|
||||
|
||||
export default function Home() {
|
||||
const [selectedModules, setSelectedModules] = useState<Module[]>([]);
|
||||
@@ -67,20 +68,15 @@ export default function Home() {
|
||||
|
||||
if (moduleIndex >= selectedModules.length) {
|
||||
return (
|
||||
<>
|
||||
Finished!{" "}
|
||||
<button
|
||||
className="btn btn-wide"
|
||||
onClick={() => {
|
||||
setShowSolutions(true);
|
||||
setModuleIndex(0);
|
||||
}}>
|
||||
View Solutions
|
||||
</button>
|
||||
<Link href="/">
|
||||
<button className="btn btn-wide">Go Home</button>
|
||||
</Link>
|
||||
</>
|
||||
<Finish
|
||||
user={JSON_USER}
|
||||
modules={selectedModules}
|
||||
onViewResults={() => {
|
||||
setShowSolutions(true);
|
||||
setModuleIndex(0);
|
||||
}}
|
||||
scores={userSolutions.map((x) => ({...x.score, module: x.module}))}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user