- Adapted more of the design to be more responsive;
- Revamped some of the UserSolutions; - Transformed the homepage chart to use actual dynamic values; - Created an endpoint for the stats;
This commit is contained in:
@@ -7,7 +7,7 @@ import {CommonProps} from ".";
|
||||
import {Fragment, useEffect, useState} from "react";
|
||||
import {toast} from "react-toastify";
|
||||
|
||||
export default function Writing({id, prompt, info, wordCounter, onNext, onBack}: WritingExercise & CommonProps) {
|
||||
export default function Writing({id, prompt, info, type, wordCounter, onNext, onBack}: WritingExercise & CommonProps) {
|
||||
const [inputText, setInputText] = useState("");
|
||||
const [isSubmitEnabled, setIsSubmitEnabled] = useState(false);
|
||||
|
||||
@@ -49,7 +49,7 @@ export default function Writing({id, prompt, info, wordCounter, onNext, onBack}:
|
||||
placeholder="Write your text here..."
|
||||
/>
|
||||
|
||||
<div className="self-end flex gap-8">
|
||||
<div className="self-end flex flex-col-reverse items-center w-full md:justify-between md:items-start md:flex-row gap-8">
|
||||
<button className={clsx("btn btn-wide gap-4 relative text-white", errorButtonStyle)} onClick={onBack}>
|
||||
<div className="absolute left-4">
|
||||
<Icon path={mdiArrowLeft} color="white" size={1} />
|
||||
@@ -61,7 +61,7 @@ export default function Writing({id, prompt, info, wordCounter, onNext, onBack}:
|
||||
<button
|
||||
className={clsx("btn btn-wide gap-4 relative text-white", infoButtonStyle)}
|
||||
disabled={!isSubmitEnabled}
|
||||
onClick={() => onNext({id, solutions: [inputText], score: {correct: 1, total: 1}})}>
|
||||
onClick={() => onNext({exercise: id, solutions: [inputText], score: {correct: 1, total: 1}, type})}>
|
||||
Next
|
||||
</button>
|
||||
</div>
|
||||
@@ -70,7 +70,7 @@ export default function Writing({id, prompt, info, wordCounter, onNext, onBack}:
|
||||
<button
|
||||
className={clsx("btn btn-wide gap-4 relative text-white", infoButtonStyle)}
|
||||
disabled={!isSubmitEnabled}
|
||||
onClick={() => onNext({id, solutions: [inputText], score: {correct: 1, total: 1}})}>
|
||||
onClick={() => onNext({exercise: id, solutions: [inputText], score: {correct: 1, total: 1}, type})}>
|
||||
Next
|
||||
<div className="absolute right-4">
|
||||
<Icon path={mdiArrowRight} color="white" size={1} />
|
||||
|
||||
Reference in New Issue
Block a user