diff --git a/src/ReadyQuestionPaperDashboard/ReadyQuestionPaperDashboard.jsx b/src/ReadyQuestionPaperDashboard/ReadyQuestionPaperDashboard.jsx index ed3d891..6ee6bde 100644 --- a/src/ReadyQuestionPaperDashboard/ReadyQuestionPaperDashboard.jsx +++ b/src/ReadyQuestionPaperDashboard/ReadyQuestionPaperDashboard.jsx @@ -121,14 +121,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..07ca8f7 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,10 +162,11 @@ console.log(paperId); setMarks(e.target.value)} + onChange={() => setMarks(marks)} placeholder="Enter marks" required className="add_question_input" + disabled />

@@ -176,9 +177,11 @@ console.log(paperId); {image ? (
- Question - -
+ Question + {e.stopPropagation();handleRemoveImage()}} /> + ) : (