Skip to content

Commit

Permalink
Merge pull request #35 from areebahmeddd/master
Browse files Browse the repository at this point in the history
Master
  • Loading branch information
SkySingh04 authored Feb 28, 2024
2 parents 9a3160d + 44d7a09 commit 23d6ab3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
18 changes: 9 additions & 9 deletions app/components/Fileinput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { useDropzone } from "react-dropzone";
import { v4 as uuidv4 } from 'uuid';
import {useRouter} from "next/navigation";
interface FileInputProps {
onFileUpload: (data: { quizInfo: QuizInfo; quizData: any; fileName: string }) => void;
onFileUpload: (data: any) => void;
}

interface QuizInfo {
Expand Down Expand Up @@ -84,9 +84,8 @@ function FileInput({ onFileUpload }: FileInputProps) {
const { getRootProps, getInputProps } = useDropzone({ onDrop });

const generateQuiz = () => {

if (quizInfo.quizName && quizInfo.course && quizInfo.courseCode && excelData) {
onFileUpload({ quizInfo, quizData: excelData, fileName });
onFileUpload({ ...quizInfo, quizData: excelData, fileName });
setQuizGenerated(true);
router.push("/");
} else {
Expand Down Expand Up @@ -155,19 +154,20 @@ function FileInput({ onFileUpload }: FileInputProps) {
</div>
)}
<div className="flex mt-4 mb-10">
{!viewQuizData ? (
{!viewQuizData && (
<button
onClick={generateQuiz}
className="bg-blue-500 text-white font-semibold px-6 py-2 rounded-md hover:bg-blue-600 mr-4 mb-[200px]"
className="bg-blue-500 text-white font-semibold px-6 py-2 rounded-md hover:bg-blue-600 mb-[200px] mr-2"
>
Generate Quiz
</button>
) : (
)}
{viewQuizData && (
<button
onClick={toggleViewQuizData}
className="bg-blue-500 text-white font-semibold px-6 py-2 rounded-md hover:bg-blue-600 mb-[200px] mr-4"
onClick={generateQuiz}
className="bg-blue-500 text-white font-semibold px-6 py-2 rounded-md hover:bg-blue-600 mb-[200px] mr-2"
>
Hide Quiz Data
Generate Quiz
</button>
)}
<button
Expand Down
2 changes: 1 addition & 1 deletion app/components/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const Footer = () => {
return (
<footer className="footer fixed bottom-0 left-0 right-0 px-2 z-50 flex justify-center bg-slate-800 text-white ">
<aside className="items-center grid-flow-col">
<p>Made By <b>Akash Singh</b> and <a href="https://github.com/Akash-Singh04/QuizQuest/graphs/contributors"><u>Contributors</u></a> © 2024 - All rights reserved</p>
<p>Made By <b>Akash Singh</b> and <a href="https://github.com/Akash-Singh04/QuizQuest/graphs/contributors"><u>Contributors</u></a> © {new Date().getFullYear()} - All rights reserved</p>
</aside>
<nav className="grid-flow-col gap-4 md:place-self-center md:justify-self-end">
<IconButton
Expand Down

0 comments on commit 23d6ab3

Please sign in to comment.