Skip to content

Commit

Permalink
Merge pull request #35 from zakie2003/zak-branch3
Browse files Browse the repository at this point in the history
Zak branch3
  • Loading branch information
nishant0708 authored Sep 14, 2024
2 parents 242c99f + 29c96b0 commit 70b24c2
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -121,14 +121,6 @@ const ReadyQuestionPaperDashboard = () => {
</div>
</div>
))}

<center>
<button
className="question_submit-button"
>
Submit
</button>
</center>
</div>
</>) : (<>
<div className="no-questions-container">
Expand Down
8 changes: 5 additions & 3 deletions src/edit_question/EditQuestion.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -176,8 +176,10 @@ const EditQuestion = () => {
<input {...getInputProps()} />
{image ? (
<div className="add_question_image_preview">
<img src={URL.createObjectURL(image)} alt="Question" className="add_question_preview_image" />
<FaTimes className="add_question_remove_image_icon" onClick={handleRemoveImage} />
<img src={image ? typeof image === 'string'
? image: URL.createObjectURL(image):
URL.createObjectURL(image)} alt="Question" className="add_question_preview_image" />
<FaTimes className="add_question_remove_image_icon" onClick={(e)=>{e.stopPropagation();handleRemoveImage()}} />
</div>
) : (
<p>
Expand Down
17 changes: 10 additions & 7 deletions src/edit_ready_question/EditReadyQuestion.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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.');
Expand Down Expand Up @@ -108,7 +108,7 @@ const EditReadyQuestion = () => {
onDrop,
maxSize: 10485760, // 10MB limit
});
console.log(paperId);
console.log(image);
return (
<>
<Navbar />
Expand Down Expand Up @@ -162,10 +162,11 @@ console.log(paperId);
<input
type="number"
value={marks}
onChange={(e) => setMarks(e.target.value)}
onChange={() => setMarks(marks)}
placeholder="Enter marks"
required
className="add_question_input"
disabled
/>
</div>
</div>
Expand All @@ -176,9 +177,11 @@ console.log(paperId);
<input {...getInputProps()} />
{image ? (
<div className="add_question_image_preview">
<img src={URL.createObjectURL(image)} alt="Question" className="add_question_preview_image" />
<FaTimes className="add_question_remove_image_icon" onClick={handleRemoveImage} />
</div>
<img src={image ? typeof image === 'string'
? image: URL.createObjectURL(image):
URL.createObjectURL(image)} alt="Question" className="add_question_preview_image" />
<FaTimes className="add_question_remove_image_icon" onClick={(e)=>{e.stopPropagation();handleRemoveImage()}} />
</div>
) : (
<p>
<div className='add_question_cloudicon'>
Expand Down

0 comments on commit 70b24c2

Please sign in to comment.