diff --git a/.vscode/settings.json b/.vscode/settings.json index 9537424..fae1ae1 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -10,6 +10,7 @@ "Groupbutton", "handelnavigate", "Karim", + "Popconfirm", "queryqlent", "registraion", "SENDNOTIFICATION", diff --git a/src/Components/CustomFields/ImageBoxField/ImageBoxField.tsx b/src/Components/CustomFields/ImageBoxField/ImageBoxField.tsx index 7e1b753..e19dd62 100644 --- a/src/Components/CustomFields/ImageBoxField/ImageBoxField.tsx +++ b/src/Components/CustomFields/ImageBoxField/ImageBoxField.tsx @@ -65,7 +65,7 @@ const ImageBoxField = ({ name }: any) => {
{imagePreview ? ( - Preview + Preview ) : ( )} diff --git a/src/Components/ValidationField/View/TextField.tsx b/src/Components/ValidationField/View/TextField.tsx index 95db0f1..ae60405 100644 --- a/src/Components/ValidationField/View/TextField.tsx +++ b/src/Components/ValidationField/View/TextField.tsx @@ -14,10 +14,10 @@ const TextField = ({ placeholder, isDisabled, onChange, - props, no_label, label_icon, className, + ...props }: any) => { const { formik, isError, errorMsg, t } = useFormField(name, props); const TextFilehandleChange = ( @@ -48,6 +48,7 @@ const TextField = ({ onChange={onChange || TextFilehandleChange} style={{ height: 120 }} id={name} + {...props} />
diff --git a/src/Pages/Admin/question/AddPage.tsx b/src/Pages/Admin/question/AddPage.tsx index 7f96a8d..5093148 100644 --- a/src/Pages/Admin/question/AddPage.tsx +++ b/src/Pages/Admin/question/AddPage.tsx @@ -174,7 +174,7 @@ const AddPage: React.FC = () => {
@@ -214,7 +214,7 @@ const AddPage: React.FC = () => {
{ handleSubmit(values); diff --git a/src/Pages/Admin/question/Model/Field/ChoiceFields.tsx b/src/Pages/Admin/question/Model/Field/ChoiceFields.tsx index 74864ea..37630b6 100644 --- a/src/Pages/Admin/question/Model/Field/ChoiceFields.tsx +++ b/src/Pages/Admin/question/Model/Field/ChoiceFields.tsx @@ -67,8 +67,9 @@ const ChoiceFields = ({ index, data }: { index: number; data: Choice }) => { placeholder="_" name={`answers.${index}.hint`} label="hint" - type="text" - style={{ width: "100%" }} + type="TextArea" + style={{ width: "100%" , height: 60,resize:"none" }} + showCount={false} />
diff --git a/src/Pages/Admin/question/Model/Malty/ChoiceField/ChoiceFields.tsx b/src/Pages/Admin/question/Model/Malty/ChoiceField/ChoiceFields.tsx index eb730ea..0640d42 100644 --- a/src/Pages/Admin/question/Model/Malty/ChoiceField/ChoiceFields.tsx +++ b/src/Pages/Admin/question/Model/Malty/ChoiceField/ChoiceFields.tsx @@ -89,8 +89,9 @@ const ChoiceFields = ({ placeholder="_" name={`Questions.${parent_index}.answers.${index}.hint`} label="hint" - type="text" - style={{ width: "100%" }} + type="TextArea" + style={{ width: "100%" , height: 60,resize:"none" }} + showCount={false} />
diff --git a/src/Pages/Admin/question/Model/Malty/Form.tsx b/src/Pages/Admin/question/Model/Malty/Form.tsx index 7bd2d90..62a0839 100644 --- a/src/Pages/Admin/question/Model/Malty/Form.tsx +++ b/src/Pages/Admin/question/Model/Malty/Form.tsx @@ -134,8 +134,9 @@ const Form = () => { placeholder="_" name={`Questions.${parent_index}.hint`} label="hint_question" - type="text" - style={{ width: "100%" }} + type="TextArea" + style={{ width: "100%" , height: 60,resize:"none" }} + showCount={false} /> diff --git a/src/Pages/Admin/question/Model/ModelForm.tsx b/src/Pages/Admin/question/Model/ModelForm.tsx index 2794d0d..b104882 100644 --- a/src/Pages/Admin/question/Model/ModelForm.tsx +++ b/src/Pages/Admin/question/Model/ModelForm.tsx @@ -74,8 +74,10 @@ const Form = () => { placeholder="_" name="hint" label="hint_question" - type="text" - style={{ width: "100%" }} + type="TextArea" + style={{ width: "100%" , height: 60,resize:"none" }} + showCount={false} + /> diff --git a/src/Pages/Admin/question/Model/formUtil.ts b/src/Pages/Admin/question/Model/formUtil.ts index 0c4240a..5122ad5 100644 --- a/src/Pages/Admin/question/Model/formUtil.ts +++ b/src/Pages/Admin/question/Model/formUtil.ts @@ -32,7 +32,7 @@ export const getValidationSchema = () => { content_image: Yup.string().nullable(), isCorrect: Yup.boolean(), }), - ).min(2).nullable().test( + ).min(2).test( "at-least-one-correct", "At least one answer must be correct", (answers: any) => { @@ -111,6 +111,10 @@ export const getValidationSchemaBase = () => { "At least one answer must be correct", (answers: any) => { + if(answers === null){ + return true + } + return answers.some( (answer: any) => answer.isCorrect === true || answer.isCorrect === 1, diff --git a/src/Pages/Admin/question/Page.tsx b/src/Pages/Admin/question/Page.tsx index cc5d70f..244d272 100644 --- a/src/Pages/Admin/question/Page.tsx +++ b/src/Pages/Admin/question/Page.tsx @@ -11,7 +11,6 @@ import DeleteModels from "../../../Layout/Dashboard/DeleteModels"; import { ModalEnum } from "../../../enums/Model"; import { useGetAllSubject } from "../../../api/subject"; import { useGetAllGrade } from "../../../api/grade"; -import { useGetAllCurriculum } from "../../../api/curriculum"; import PageHeader from "../../../Layout/Dashboard/PageHeader"; import { ABILITIES_ENUM } from "../../../enums/abilities"; import { canAddQuestion } from "../../../utils/hasAbilityFn";