mcp-quiz-server
Version:
🧠AI-Powered Quiz Management via Model Context Protocol (MCP) - Create, manage, and take quizzes directly from VS Code, Claude, and other AI agents.
76 lines (75 loc) • 3.19 kB
JavaScript
;
/**
* @fileoverview User-Facing Quiz Routes - Entry point for user-facing quiz functionality
* @version 1.0.0
* @since 2025-08-04
* @module UserFacingQuizRoutes
* @description Entry point for all user-facing quiz routes that provide HTML interfaces
* instead of raw JSON APIs. Includes quiz start, preview, embed, and guest modes.
* @contributors GitHub Copilot
* @requirements REQ_ROUTES_001 (User-Facing Quiz URL System)
* @testType integration
*/
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || (function () {
var ownKeys = function(o) {
ownKeys = Object.getOwnPropertyNames || function (o) {
var ar = [];
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
return ar;
};
return ownKeys(o);
};
return function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
__setModuleDefault(result, mod);
return result;
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.createUserFacingQuizRoutes = createUserFacingQuizRoutes;
// Workaround for Express typing issues
const express = __importStar(require("express"));
const quiz_embed_1 = require("./quiz-embed");
const quiz_guest_1 = require("./quiz-guest");
const quiz_preview_1 = require("./quiz-preview");
const quiz_start_1 = require("./quiz-start");
/**
* Creates user-facing quiz routes with proper modular organization.
*
* @description Combines all user-facing quiz functionality into a single router
* while maintaining separation of concerns through module breakdown.
*
* @param config Configuration with controller factory
* @returns Express router with all user-facing quiz routes
*
* @since 2025-08-04
* @author GitHub Copilot
*/
function createUserFacingQuizRoutes(config) {
const router = express.Router();
// Mount sub-routers for different user-facing functionality
router.use('/start', (0, quiz_start_1.createQuizStartRoutes)(config));
router.use('/preview', (0, quiz_preview_1.createQuizPreviewRoutes)(config));
router.use('/embed', (0, quiz_embed_1.createQuizEmbedRoutes)(config));
router.use('/guest', (0, quiz_guest_1.createQuizGuestRoutes)(config));
return router;
}
// UserFacingQuizConfig already exported inline above