2024-09-13 13:03:35 +00:00
|
|
|
import express from "express";
|
2024-10-01 08:03:44 +00:00
|
|
|
import { getStdExercises, getStdExerciseById, stdAnswerExercise, getStudentAnswersByStdLearningId } from "../../controllers/learningControllers/stdExercise.js";
|
2024-09-13 13:03:35 +00:00
|
|
|
import { verifyLoginUser } from "../../middlewares/User/authUser.js";
|
|
|
|
|
import { updateStdLearningById } from "../../controllers/learningControllers/stdLearning.js";
|
2024-09-30 01:06:15 +00:00
|
|
|
import { checkCorrectAnswers, calculateScore, checkFirstFiveCorrect, nextLearning } from "../../middlewares/autoGrading.js";
|
2024-09-13 13:03:35 +00:00
|
|
|
|
|
|
|
|
const router = express.Router();
|
|
|
|
|
|
|
|
|
|
router.get("/stdExercise", verifyLoginUser, getStdExercises);
|
|
|
|
|
|
|
|
|
|
router.get("/stdExercise/:id", verifyLoginUser, getStdExerciseById);
|
|
|
|
|
|
2024-10-10 02:55:13 +00:00
|
|
|
router.get("/studentAnswers/:id", verifyLoginUser, getStudentAnswersByStdLearningId);
|
2024-09-13 13:03:35 +00:00
|
|
|
|
2024-10-10 02:55:13 +00:00
|
|
|
router.post("/stdExercise", verifyLoginUser, stdAnswerExercise, checkCorrectAnswers, calculateScore, checkFirstFiveCorrect, nextLearning, updateStdLearningById);
|
2024-10-01 08:03:44 +00:00
|
|
|
|
2024-09-13 13:03:35 +00:00
|
|
|
export default router
|