diff --git a/src/App.tsx b/src/App.tsx
index 6f7f6d6..dd6c3e8 100644
--- a/src/App.tsx
+++ b/src/App.tsx
@@ -22,6 +22,7 @@ import Quiz from './pages/Quizzes/Quiz'
import QuizTries from './pages/Quizzes/QuizTries'
import Waveform from './pages/Quizzes/Waveform'
import CreateCourse from './pages/Professor/CreateCourse'
+import CreateQuiz from './pages/Professor/CreateQuiz'
export default function App() {
return (
@@ -47,6 +48,7 @@ export default function App() {
} />
} />
} />
+ } />
{/* } /> */}
{/* } /> */}
{/* } /> */}
diff --git a/src/components/course/ExercisesGroup.tsx b/src/components/course/ExercisesGroup.tsx
index a46695b..41cd22c 100644
--- a/src/components/course/ExercisesGroup.tsx
+++ b/src/components/course/ExercisesGroup.tsx
@@ -100,8 +100,8 @@ export default function ExercisesGroup({itens} : ExercisesGroupProps) {
// Mostrar loading enquanto não há dados de status
if (Object.keys(quizStatusMap).length === 0) {
return (
-
- Carregando quizzes...
+
+ Nenhum quiz encontrado...
)
}
diff --git a/src/pages/Course/Course.tsx b/src/pages/Course/Course.tsx
index d3d26a9..ff3160b 100644
--- a/src/pages/Course/Course.tsx
+++ b/src/pages/Course/Course.tsx
@@ -1,5 +1,5 @@
import { useEffect, useState } from 'react';
-import { useParams } from 'react-router-dom';
+import { useNavigate, useParams } from 'react-router-dom';
import { fetchAllQuizes, fetchUserQuizProgress } from '@/services/api/quiz';
import { fetchCourse, exportCourseGrades } from '@/services/api/course';
import { Quiz } from '@/interfaces/Quiz';
@@ -16,6 +16,8 @@ import ExercisesGroup from '@/components/course/ExercisesGroup';
import PostThreadCourse from '@/components/course/PostThreadCourse';
import NewPostForm from '@/components/course/NewPostForm';
import ReplyForm from '@/components/course/ReplyForm';
+import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
+import { faPencil } from '@fortawesome/free-solid-svg-icons';
export default function Course() {
const [Quizes, setQuizes] = useState
([]);
@@ -30,6 +32,8 @@ export default function Course() {
const { user, isLoading: isAuthLoading } = useAuth();
const [isExporting, setIsExporting] = useState(false);
+ const navigate = useNavigate();
+
const topLevelPosts = posts.filter(p => p.id_parent === null);
const replies = posts.filter(p => p.id_parent !== null);
const getRepliesForPost = (postId: string) => {
@@ -211,32 +215,8 @@ export default function Course() {
)}
-
- {isUserTheCourseTeacher && (
- <>
-
-
- >
- )}
+
+
@@ -244,10 +224,49 @@ export default function Course() {
{/* Seção de Questionários */}
-
-
- Questionários
-
+
+
+
+
+ {user?.role === 2 &&
+
+ }
+
+
+
+ {isUserTheCourseTeacher && (
+ <>
+
+
+ >
+ )}
+
diff --git a/src/pages/Professor/CreateCourse.tsx b/src/pages/Professor/CreateCourse.tsx
index 2bcc07e..b40106a 100644
--- a/src/pages/Professor/CreateCourse.tsx
+++ b/src/pages/Professor/CreateCourse.tsx
@@ -1,8 +1,7 @@
import Footer from '@/components/footer/Footer'
import Header from '@/components/header/Header'
import { CreateCourseForm } from '@/interfaces/Course'
-import { useEffect, useState } from 'react'
-import { useParams } from 'react-router-dom'
+import { useState } from 'react'
export default function CreateCourse() {
const handleDateChange = (field: 'beginDate' | 'endDate') => (e: React.ChangeEvent
) => {
diff --git a/src/pages/Professor/CreateQuiz.tsx b/src/pages/Professor/CreateQuiz.tsx
new file mode 100644
index 0000000..39535dd
--- /dev/null
+++ b/src/pages/Professor/CreateQuiz.tsx
@@ -0,0 +1,78 @@
+import Footer from '@/components/footer/Footer'
+import Header from '@/components/header/Header'
+import { useState } from 'react'
+import { useParams } from 'react-router-dom';
+
+export default function CreateQuiz() {
+ const { courseId } = useParams();
+
+ const [form, setForm] = useState({
+ idCourse: courseId,
+ name: '',
+ description: '',
+ maxAttempts: 1,
+ })
+
+ return (
+
+
+
+
+
+ Criar Quiz
+
+
+ Cadastre um novo quiz para este curso. Depois, adicione as perguntas!
+
+
+
+
+
Nome do Quiz
+
setForm({ ...form, name: e.target.value })}
+ placeholder="Quiz 1 - Introdução"
+ />
+
+
+
+
+
+
Máximo de tentativas
+
+ setForm({ ...form, maxAttempts: Number(e.target.value) })
+ }
+ placeholder="1"
+ />
+
+
+
+
+
+
+
+
+ )
+}