diff --git a/app/components/AddQuestion.tsx b/app/components/AddQuestion.tsx index 88a0a21..b042540 100644 --- a/app/components/AddQuestion.tsx +++ b/app/components/AddQuestion.tsx @@ -14,15 +14,38 @@ const App: React.FC = () => { const [option4, setOption4 ] = useState(''); const [moduleId, setModuleId] = useState(''); const [correctAnswer, setCorrectAnswer] = useState(''); + + let moduleList = [ + { + moduleId : "1", + moduleName : "Module Name - 1" + }, + { + moduleId : "2", + moduleName : "Module Name - 2" + }, + { + moduleId : "3", + moduleName : "Module Name - 3" + }, + { + moduleId : "4", + moduleName : "Module Name - 4" + }, + { + moduleId : "5", + moduleName : "Module Name - 5" + } + ] - const [moduleList, setModuleList] = useState([]); + // const [moduleList, setModuleList] = useState([]); const [loading, setLoading] = useState(true); const [error, setError] = useState(null); const [open, setOpen] = useState(false); const [submitLoading, setSubmitLoading] = useState(false); useEffect(() => { - fetch(`https://api.teachertrainingkolkata.in/api/quiz-module-list`) + fetch(`http://localhost:5174/api/quiz-module-list`) .then((res) => { if (!res.ok) { throw new Error('Network response was not ok'); @@ -31,7 +54,7 @@ const App: React.FC = () => { }) .then((data) => { console.log(data); - setModuleList(data); + // setModuleList(data); setLoading(false); }) .catch((error) => { @@ -46,7 +69,7 @@ const App: React.FC = () => { const data = { question, option1, option2, option3, option4, correctAnswer, moduleId }; setSubmitLoading(true); try { - const response = await fetch(`https://api.teachertrainingkolkata.in/api/create-question`, { + const response = await fetch(`http://localhost:5174/api/create-question`, { method: 'POST', headers: { 'Content-Type': 'application/json', diff --git a/app/components/ClassMates.tsx b/app/components/ClassMates.tsx index b940706..9120aab 100644 --- a/app/components/ClassMates.tsx +++ b/app/components/ClassMates.tsx @@ -14,7 +14,7 @@ export default function classMatesDirectory() { useEffect(() => { - fetch('https://api.teachertrainingkolkata.in/api/class-mates') + fetch('http://localhost:5174/api/class-mates') .then(res => { if (!res.ok) { throw new Error('Network response was not ok'); diff --git a/app/components/ClassShedules.tsx b/app/components/ClassShedules.tsx new file mode 100644 index 0000000..1c40ea3 --- /dev/null +++ b/app/components/ClassShedules.tsx @@ -0,0 +1,155 @@ +import React from "react"; +import { SettingOutlined, QuestionCircleOutlined, LogoutOutlined, RightOutlined } from '@ant-design/icons'; +import { Layout, Menu, theme, Button, Modal, MenuProps } from 'antd'; +import { Dropdown, Space } from 'antd'; +import dayjs from 'dayjs'; +import 'dayjs/locale/zh-cn'; +import { Calendar, Col, Row, Typography } from 'antd'; +import type { CalendarProps } from 'antd'; +import type { Dayjs } from 'dayjs'; +import dayLocaleData from 'dayjs/plugin/localeData'; +import { Content } from "antd/es/layout/layout"; +import '../../public/assets/left_side_nav.css'; + +dayjs.extend(dayLocaleData); + +const schedule = [ + { time: '9 AM', title: 'Lorem Ipsum', details: '9 - 10 AM', borderColor: 'indigo-600', bgColor: 'bg-blue-200' }, + { time: '10 AM', title: 'Lorem Ipsum', details: '10 - 11 AM', borderColor: 'orange-600', bgColor: 'bg-blue-200' }, + { time: '11 AM', title: '', details: '', borderColor: '', bgColor: '' }, + { time: '12 PM', title: 'Lorem Ipsum dolor sit', details: '11:30 AM - 12:30 PM', borderColor: 'indigo-600', bgColor: '' }, + { time: '1 PM', title: 'Lorem Ipsum', details: '11:30 AM - 12:30 PM', borderColor: 'green-600', bgColor: '' }, + { time: '2 PM', title: 'Lorem Ipsum dolor sit', details: '11:30 AM - 12:30 PM', borderColor: 'red-700', bgColor: '' }, + { time: '3 PM', title: 'Lorem Ipsum dolor sit', details: '11 AM - 12:30 PM', borderColor: 'blue-700', bgColor: '' }, + { time: '4 PM', title: 'Lorem Ipsum', details: '11:30 AM - 12:30 PM', borderColor: 'sky-700', bgColor: 'bg-blue-200' }, + { time: '5 PM', title: '', details: '', borderColor: '', bgColor: '' } + ]; + +const App: React.FC = () => { + + + const { token } = theme.useToken(); + + const onPanelChange = (value: Dayjs, mode: CalendarProps['mode']) => { + console.log(value.format('YYYY-MM-DD'), mode); + }; + + const wrapperStyle: React.CSSProperties = { + width: 320, + border: `1px solid ${token.colorBorderSecondary}`, + borderRadius: token.borderRadiusLG, + padding: 16, + }; + + const headerStyle: React.CSSProperties = { + display: 'flex', + justifyContent: 'space-around', + alignItems: 'center', + // marginBottom: 16, + backgroundColor: '#0752bc', + height: 47, + borderTopLeftRadius: 10, + borderTopRightRadius: 10, + + }; + + + const titleStyle: React.CSSProperties = { + fontSize: 14, + fontWeight: 'bold', + color: '#fff', + }; + + const navButtonStyle: React.CSSProperties = { + cursor: 'pointer', + fontSize: 16, + }; + + + return ( + <> +
+
+
+
+
+ { + const monthFormat = 'MMMM'; + const year = value.year(); + const month = value.format(monthFormat); + + const prevMonth = () => { + const newValue = value.clone().subtract(1, 'month'); + onChange(newValue); + }; + + const nextMonth = () => { + const newValue = value.clone().add(1, 'month'); + onChange(newValue); + }; + + return ( +
+
+
{`${month} ${year}`}
+
+
+
{'<'}
+
{'>'}
+
+
+ ); + + }} + + onPanelChange={onPanelChange} + /> +
+
+
+
+ {/*

Upcoming Classes

*/} +

Upcoming Classes >

+
+
+
+
+
+
+
+
+
+
+
+
+
+
+

Today's Schedule

+
+ {schedule.map((item, index) => ( +
+ {item.time} + {item.title ? ( +
+ {item.title}
+ {item.details} +
+ ) : ( +
+ )} +
+ ))} +
+
+
+
+
+
+ + + + ) +} +export default App; diff --git a/app/components/ContinueLearning.tsx b/app/components/ContinueLearning.tsx index e6f83ee..0ff69fa 100644 --- a/app/components/ContinueLearning.tsx +++ b/app/components/ContinueLearning.tsx @@ -14,7 +14,7 @@ export default function ContinueLearning() { useEffect(() => { - fetch('https://api.teachertrainingkolkata.in/api/continue-learning') + fetch('http://localhost:5174/api/continue-learning') .then(res => { if (!res.ok) { throw new Error('Network response was not ok'); diff --git a/app/components/ExaminationsPractical.tsx b/app/components/ExaminationsPractical.tsx index 2bd6001..675400d 100644 --- a/app/components/ExaminationsPractical.tsx +++ b/app/components/ExaminationsPractical.tsx @@ -6,31 +6,45 @@ import { InboxOutlined } from '@ant-design/icons'; import type { UploadProps } from 'antd'; import { message, Upload } from 'antd'; + const { Dragger } = Upload; - -const props: UploadProps = { - name: 'file', - multiple: true, - action: 'https://660d2bd96ddfa2943b33731c.mockapi.io/api/upload', - onChange(info) { - const { status } = info.file; - if (status !== 'uploading') { - console.log(info.file, info.fileList); - } - if (status === 'done') { - message.success(`${info.file.name} file uploaded successfully.`); - } else if (status === 'error') { - message.error(`${info.file.name} file upload failed.`); - } - }, - onDrop(e) { - console.log('Dropped files', e.dataTransfer.files); - }, -}; - const App: React.FC = () => { + const [fileCount, setFileCount] = useState(0); + const [uploadingNumber, setUploadingNumber] = useState(0); + + + const props: UploadProps = { + name: 'file', + multiple: true, + action: 'https://660d2bd96ddfa2943b33731c.mockapi.io/api/upload', + onChange(info) { + + const { status } = info.file; + setFileCount(info.fileList.length); // Update file count whenever files are added or removed + if (status !== 'uploading') { + // console.log(info.file, info.fileList); + } + if (status === 'done') { + + message.success(`${info.file.name} file uploaded successfully.`); + } else if (status === 'error') { + message.error(`${info.file.name} file upload failed.`); + setUploadingNumber(currentFile => currentFile + 1); + } + }, + onDrop(e) { + // console.log('Dropped files', e.dataTransfer.files); + setFileCount(e.dataTransfer.files.length); // Update file count on drop + // setUploadingNumber(currentFile => currentFile + 1); + + + }, + }; + + const [isModalOpen, setIsModalOpen] = useState(false); + const showModal = () => { setIsModalOpen(true); }; @@ -70,13 +84,15 @@ const App: React.FC = () => { + {/*

{uploadingNumber} / {fileCount}

*/}
- + @@ -85,7 +101,8 @@ const App: React.FC = () => {
- + diff --git a/app/components/KnowledgeQuests.tsx b/app/components/KnowledgeQuests.tsx index 66cc459..1580e18 100644 --- a/app/components/KnowledgeQuests.tsx +++ b/app/components/KnowledgeQuests.tsx @@ -14,7 +14,7 @@ export default function KnowledgeQuests() { useEffect(() => { - fetch('https://api.teachertrainingkolkata.in/api/knowledge-quests') + fetch('http://localhost:5174/api/knowledge-quests') .then(res => { if (!res.ok) { throw new Error('Network response was not ok'); diff --git a/app/components/KnowledgeQuestsPageContent.tsx b/app/components/KnowledgeQuestsPageContent.tsx index 913aa1c..75bbd88 100644 --- a/app/components/KnowledgeQuestsPageContent.tsx +++ b/app/components/KnowledgeQuestsPageContent.tsx @@ -20,8 +20,8 @@ export default function Index() { const fetchData = async () => { try { const [allResponse, completedResponse] = await Promise.all([ - fetch('https://api.teachertrainingkolkata.in/api/all-assesment'), - fetch('https://api.teachertrainingkolkata.in/api/complete-assesment') + fetch('http://localhost:5174/api/all-assesment'), + fetch('http://localhost:5174/api/complete-assesment') ]); if (!allResponse.ok || !completedResponse.ok) { diff --git a/app/components/LeftSideMenuItems.tsx b/app/components/LeftSideMenuItems.tsx index 735303a..5674a23 100644 --- a/app/components/LeftSideMenuItems.tsx +++ b/app/components/LeftSideMenuItems.tsx @@ -20,11 +20,11 @@ const items2: MenuProps['items'] = [ children: [ { key: 'administration1', - label: (Class Schedules), + label: (Class Schedules), }, { key: 'administration2', - label: (Classmate Directory), + label: (Classmate Directory), }, { key: 'administration3', diff --git a/app/components/ModuleList.tsx b/app/components/ModuleList.tsx index 1030828..2abf015 100644 --- a/app/components/ModuleList.tsx +++ b/app/components/ModuleList.tsx @@ -12,7 +12,7 @@ export default function AdminIndex() { const [error, setError] = useState(null); useEffect(() => { - fetch(`https://api.teachertrainingkolkata.in/api/quiz-module-list`) + fetch(`http://localhost:5174/api/quiz-module-list`) .then(res => { if (!res.ok) { throw new Error('Network response was not ok'); diff --git a/app/components/NewModule.tsx b/app/components/NewModule.tsx index 0c3159d..e48f6ad 100644 --- a/app/components/NewModule.tsx +++ b/app/components/NewModule.tsx @@ -15,7 +15,7 @@ const App: React.FC = () => { }; setLoading(true); try { - const response = await fetch(`https://api.teachertrainingkolkata.in/api/create-module`, { + const response = await fetch(`http://localhost:5174/api/create-module`, { method: 'POST', headers: { 'Content-Type': 'application/json', diff --git a/app/components/NewQuiz.tsx b/app/components/NewQuiz.tsx index 926c2c2..53dd217 100644 --- a/app/components/NewQuiz.tsx +++ b/app/components/NewQuiz.tsx @@ -19,7 +19,7 @@ const App: React.FC = () => { const [submitLoading, setSubmitLoading] = useState(false); useEffect(() => { - fetch(`https://api.teachertrainingkolkata.in/api/quiz-module-list`) + fetch(`http://localhost:5174/api/quiz-module-list`) .then((res) => { if (!res.ok) { throw new Error('Network response was not ok'); @@ -50,7 +50,7 @@ const App: React.FC = () => { }; setSubmitLoading(true); try { - const response = await fetch(`https://api.teachertrainingkolkata.in/api/create-quiz`, { + const response = await fetch(`http://localhost:5174/api/create-quiz`, { method: 'POST', headers: { 'Content-Type': 'application/json', diff --git a/app/components/ProgressReview copy.tsx b/app/components/ProgressReview copy.tsx index 7ed3ef6..d42e1c9 100644 --- a/app/components/ProgressReview copy.tsx +++ b/app/components/ProgressReview copy.tsx @@ -33,7 +33,7 @@ export default function Index() { const [error, setError] = useState(null); useEffect(() => { - fetch('https://api.teachertrainingkolkata.in/api/quiz-module') + fetch('http://localhost:5174/api/quiz-module') .then((res) => { if (!res.ok) { throw new Error('Network response was not ok'); diff --git a/app/components/ProgressReview.tsx b/app/components/ProgressReview.tsx index c917c82..3410fdc 100644 --- a/app/components/ProgressReview.tsx +++ b/app/components/ProgressReview.tsx @@ -46,7 +46,7 @@ export default function Index() { const [moduleList, setModuleList] = useState([]); useEffect(() => { - fetch(`https://api.teachertrainingkolkata.in/api/question-list`) + fetch(`http://localhost:5174/api/question-list`) .then((res) => { if (!res.ok) { throw new Error('Network Response not ok'); @@ -68,7 +68,7 @@ useEffect(() => { try { const moduleData = await Promise.all( questionList.map((question) => - fetch(`https://api.teachertrainingkolkata.in/api/quiz-module-list`) + fetch(`http://localhost:5174/api/quiz-module-list`) .then((res) => { if (!res.ok) { throw new Error('Network Response not ok'); @@ -94,7 +94,7 @@ useEffect(() => { useEffect(() => { - fetch('https://api.teachertrainingkolkata.in/api/quiz-module') + fetch('http://localhost:5174/api/quiz-module') .then((res) => { if (!res.ok) { throw new Error('Network response was not ok'); diff --git a/app/components/QuestionList.tsx b/app/components/QuestionList.tsx index ba7c5e6..1566a1c 100644 --- a/app/components/QuestionList.tsx +++ b/app/components/QuestionList.tsx @@ -17,7 +17,7 @@ export default function AdminIndex() { const [error, setError] = useState(null); useEffect(() => { - fetch(`https://api.teachertrainingkolkata.in/api/question-list`) + fetch(`http://localhost:5174/api/question-list`) .then(res => { if (!res.ok) { throw new Error('Network response was not ok'); diff --git a/app/components/QuizList.tsx b/app/components/QuizList.tsx index ee2817d..e0b3198 100644 --- a/app/components/QuizList.tsx +++ b/app/components/QuizList.tsx @@ -15,7 +15,7 @@ export default function AdminIndex() { const [error, setError] = useState(null); useEffect(() => { - fetch(`https://api.teachertrainingkolkata.in/api/quiz-list`) + fetch(`http://localhost:5174/api/quiz-list`) .then(res => { if (!res.ok) { throw new Error('Network response was not ok'); diff --git a/app/components/QuizzesScore.tsx b/app/components/QuizzesScore.tsx index 517e311..729fd22 100644 --- a/app/components/QuizzesScore.tsx +++ b/app/components/QuizzesScore.tsx @@ -14,7 +14,7 @@ export default function quizScoreData() { useEffect(() => { - fetch('https://api.teachertrainingkolkata.in/api/quiz-score') + fetch('http://localhost:5174/api/quiz-score') .then(res => { if (!res.ok) { throw new Error('Network response was not ok'); diff --git a/app/components/TopPerformers.tsx b/app/components/TopPerformers.tsx index f68bfb9..879a7c6 100644 --- a/app/components/TopPerformers.tsx +++ b/app/components/TopPerformers.tsx @@ -17,7 +17,7 @@ export default function TopPerformers() { const [error, setError] = useState(null); useEffect(() => { - fetch('https://api.teachertrainingkolkata.in/api/top-performers') + fetch('http://localhost:5174/api/top-performers') .then(res => { if (!res.ok) { throw new Error('Network response was not ok'); diff --git a/app/routes/albums.art-&-craft.tsx b/app/routes/albums.art-&-craft.tsx index 026dc88..c80b2a8 100644 --- a/app/routes/albums.art-&-craft.tsx +++ b/app/routes/albums.art-&-craft.tsx @@ -70,7 +70,7 @@ const App: React.FC = () => {
- Course,},{title: Albums,},{title: 'Art & Craft Album'}]}/> + Course,},{title: Albums,},{title: 'Art & Craft Album'}]}/>
+ + e.preventDefault()}> + +
+ +
+

My Profile

+

Rayan Holiday

+
+ +
+
+
+
+
+
+
+ {/* Place Content from here */} + + + + + + + ); +}; +export default App; + diff --git a/app/routes/quiz._index.tsx b/app/routes/quiz._index.tsx index cd86ab3..26c6dcd 100644 --- a/app/routes/quiz._index.tsx +++ b/app/routes/quiz._index.tsx @@ -29,7 +29,7 @@ export default function QuizIndex() { const [timeLeft, setTimeLeft] = useState(120); // 120 seconds timer const [newQuizIds, setNewQuizIds] = useState(); useEffect(() => { - fetch(`https://api.teachertrainingkolkata.in/api/question-list`) + fetch(`http://localhost:5174/api/question-list`) .then(res => { if (!res.ok) { throw new Error('Network response was not ok'); @@ -96,7 +96,7 @@ export default function QuizIndex() { const finalAnswers = [...answers, newAnswer]; setAnswers(finalAnswers); console.log('Console Answers ', finalAnswers); - const apiUrl = 'https://api.teachertrainingkolkata.in/api/save-quiz-response'; + const apiUrl = 'http://localhost:5174/api/save-quiz-response'; fetch(apiUrl, { method: 'POST', headers: { diff --git a/app/routes/quiz.result.tsx b/app/routes/quiz.result.tsx index 5e4b8b7..ea59ccd 100644 --- a/app/routes/quiz.result.tsx +++ b/app/routes/quiz.result.tsx @@ -107,7 +107,7 @@ export default function QuizResult(){ let quizIdValue = urlParams.get('id'); console.log(quizIdValue); - fetch(`https://api.teachertrainingkolkata.in/api/quizresult-aftersubmit?id=${quizIdValue}`) + fetch(`http://localhost:5174/api/quizresult-aftersubmit?id=${quizIdValue}`) .then(response => { if (!response.ok) { throw new Error('Network response was not ok'); diff --git a/app/routes/quiz3.tsx b/app/routes/quiz3.tsx index 97c52f0..aeab422 100644 --- a/app/routes/quiz3.tsx +++ b/app/routes/quiz3.tsx @@ -144,7 +144,7 @@ export default function Index() { const [error, setError] = useState(null); useEffect(() => { - fetch(`https://api.teachertrainingkolkata.in/api/question-list`) + fetch(`http://localhost:5174/api/question-list`) .then(res => { if (!res.ok) { throw new Error('Network response was not ok'); diff --git a/app/routes/sign-in.tsx b/app/routes/sign-in.tsx index 05c89d5..ff67e2c 100644 --- a/app/routes/sign-in.tsx +++ b/app/routes/sign-in.tsx @@ -13,7 +13,7 @@ export default function SignIn() { password, }; try { - const response = await fetch('https://api.teachertrainingkolkata.in/api/sign-in', { + const response = await fetch('http://localhost:5174/api/sign-in', { method: 'POST', headers: { 'Content-Type': 'application/json', diff --git a/app/routes/student-dashboard._index.tsx b/app/routes/student-dashboard._index.tsx index 1179477..feb18f8 100644 --- a/app/routes/student-dashboard._index.tsx +++ b/app/routes/student-dashboard._index.tsx @@ -82,11 +82,11 @@ const App: React.FC = () => {

Student Dashboard