import express from "express";
import { getStdLearnings, getStdLearningById, createStdLearning, updateStdLearningById, learningScoreByStdLearningId, learningHistory, learningHistoryBySectionId, learningHistoryByTopicId, recentStudentActivities, getLastCreatedStdLearningByLevelId } from "../../controllers/learningControllers/stdLearning.js";
import { checkStdLearning } from "../../middlewares/checkStdLearning.js";
import { verifyLoginUser } from "../../middlewares/User/authUser.js";

const router = express.Router();

router.get("/stdLearning", verifyLoginUser, getStdLearnings);

router.get("/stdLearning/activities", verifyLoginUser, recentStudentActivities);

router.get("/stdLearning/:id", verifyLoginUser, getStdLearningById);

router.get("/stdLearning/score/:stdLearningId", verifyLoginUser, learningScoreByStdLearningId);

router.get("/learningHistory", verifyLoginUser, learningHistory);

router.get("/learningHistory/section/:sectionId", verifyLoginUser, learningHistoryBySectionId);

router.get("/learningHistory/topic/:topicId", verifyLoginUser, learningHistoryByTopicId);

router.get("/stdLearning/level/:levelId", verifyLoginUser, getLastCreatedStdLearningByLevelId);

router.post("/stdLearning", verifyLoginUser, checkStdLearning, createStdLearning);

router.put("/stdLearning/:id", verifyLoginUser, updateStdLearningById);

export default router