Exam generation rework, batch user tables, fastapi endpoint switch
This commit is contained in:
@@ -18,6 +18,7 @@ export default function Writing({
|
||||
userSolutions,
|
||||
onNext,
|
||||
onBack,
|
||||
enableNavigation = false
|
||||
}: WritingExercise & CommonProps) {
|
||||
const [isModalOpen, setIsModalOpen] = useState(false);
|
||||
const [inputText, setInputText] = useState(userSolutions.length === 1 ? userSolutions[0].solution : "");
|
||||
@@ -73,7 +74,7 @@ export default function Writing({
|
||||
const words = inputText.split(" ").filter((x) => x !== "");
|
||||
|
||||
if (wordCounter.type === "min") {
|
||||
setIsSubmitEnabled(wordCounter.limit <= words.length);
|
||||
setIsSubmitEnabled(wordCounter.limit <= words.length || enableNavigation);
|
||||
} else {
|
||||
setIsSubmitEnabled(true);
|
||||
if (wordCounter.limit < words.length) {
|
||||
@@ -81,7 +82,7 @@ export default function Writing({
|
||||
setInputText(words.slice(0, words.length - 1).join(" "));
|
||||
}
|
||||
}
|
||||
}, [inputText, wordCounter]);
|
||||
}, [enableNavigation, inputText, wordCounter]);
|
||||
|
||||
return (
|
||||
<div className="flex flex-col gap-4 mt-4">
|
||||
|
||||
Reference in New Issue
Block a user