From db85dc636b526f03f192bfb928dfed89f22252d8 Mon Sep 17 00:00:00 2001 From: zakie khan <121384625+zakie2003@users.noreply.github.com> Date: Sat, 14 Sep 2024 20:59:26 +0530 Subject: [PATCH 1/2] question photo edit fixed --- .../ReadyQuestionPaperDashboard.jsx | 8 -------- src/edit_question/EditQuestion.jsx | 8 +++++--- src/edit_ready_question/EditReadyQuestion.jsx | 16 +++++++++------- 3 files changed, 14 insertions(+), 18 deletions(-) diff --git a/src/ReadyQuestionPaperDashboard/ReadyQuestionPaperDashboard.jsx b/src/ReadyQuestionPaperDashboard/ReadyQuestionPaperDashboard.jsx index 1e045cc..aa99abf 100644 --- a/src/ReadyQuestionPaperDashboard/ReadyQuestionPaperDashboard.jsx +++ b/src/ReadyQuestionPaperDashboard/ReadyQuestionPaperDashboard.jsx @@ -111,14 +111,6 @@ const ReadyQuestionPaperDashboard = () => { ))} - -
- -
) : (<>
diff --git a/src/edit_question/EditQuestion.jsx b/src/edit_question/EditQuestion.jsx index 4765f0f..73a1efa 100644 --- a/src/edit_question/EditQuestion.jsx +++ b/src/edit_question/EditQuestion.jsx @@ -18,7 +18,7 @@ const EditQuestion = () => { const [questionDescription, setQuestionDescription] = useState(location.state.questionDescription); const [compilerReq, setCompilerReq] = useState(location.state.compilerReq); const [marks, setMarks] = useState(location.state.marks); - const [image, setImage] = useState(null); + const [image, setImage] = useState(location.state.image); const [loading, setLoading] = useState(false); const [loadingSpinner,setLoadingSpinner] = useState(true); const [modalIsOpen, setModalIsOpen] = useState(false); @@ -176,8 +176,10 @@ const EditQuestion = () => { {image ? (
- Question - + Question + {e.stopPropagation();handleRemoveImage()}} />
) : (

diff --git a/src/edit_ready_question/EditReadyQuestion.jsx b/src/edit_ready_question/EditReadyQuestion.jsx index 5a68326..6eacb88 100644 --- a/src/edit_ready_question/EditReadyQuestion.jsx +++ b/src/edit_ready_question/EditReadyQuestion.jsx @@ -18,7 +18,7 @@ const EditReadyQuestion = () => { const [questionDescription, setQuestionDescription] = useState(location.state.questionDescription); const [compilerReq, setCompilerReq] = useState(location.state.compilerReq); const [marks, setMarks] = useState(location.state.marks); - const [image, setImage] = useState(null); + const [image, setImage] = useState(location.state.image); const [loading, setLoading] = useState(false); const [loadingSpinner,setLoadingSpinner] = useState(true); const [modalIsOpen, setModalIsOpen] = useState(false); @@ -27,7 +27,7 @@ const EditReadyQuestion = () => { const navigate = useNavigate(); useEffect(()=>{setTimeout(()=>{setLoadingSpinner(false)},1000);},[]); - + console.log(location.state); const handleEditQuestion = async () => { if (!questionheading || !questionDescription || !compilerReq || !marks) { setModalMessage('Please fill in all the required fields.'); @@ -108,7 +108,7 @@ const EditReadyQuestion = () => { onDrop, maxSize: 10485760, // 10MB limit }); -console.log(paperId); +console.log(image); return ( <> @@ -162,7 +162,7 @@ console.log(paperId); setMarks(e.target.value)} + onChange={() => setMarks(marks)} placeholder="Enter marks" required className="add_question_input" @@ -176,9 +176,11 @@ console.log(paperId); {image ? (

- Question - -
+ Question + {e.stopPropagation();handleRemoveImage()}} /> +
) : (

From 29c96b03abcdf4c6165db83449344294de87d6ff Mon Sep 17 00:00:00 2001 From: zakie khan <121384625+zakie2003@users.noreply.github.com> Date: Sat, 14 Sep 2024 21:22:48 +0530 Subject: [PATCH 2/2] edit diable --- src/edit_ready_question/EditReadyQuestion.jsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/edit_ready_question/EditReadyQuestion.jsx b/src/edit_ready_question/EditReadyQuestion.jsx index 6eacb88..07ca8f7 100644 --- a/src/edit_ready_question/EditReadyQuestion.jsx +++ b/src/edit_ready_question/EditReadyQuestion.jsx @@ -166,6 +166,7 @@ console.log(image); placeholder="Enter marks" required className="add_question_input" + disabled />