chore: relocate backend into apps/api ahead of monorepo merge

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
2026-08-24 12:20:40 +08:00
co-authored by Claude Sonnet 5
parent af44598df6
commit eaa6d2276a
388 changed files with 0 additions and 13998 deletions
@@ -0,0 +1,28 @@
const { DataTypes } = require("sequelize");
const sequelize = require("../../config/db.config");
const QuizQuestion = sequelize.define("QuizQuestion", {
question_id: { type: DataTypes.BIGINT, primaryKey: true, autoIncrement: true },
uuid: { type: DataTypes.UUID, defaultValue: DataTypes.UUIDV4, unique: true },
// polymorphic: belongs to either unit_quiz OR course_assessment
quiz_id: { type: DataTypes.BIGINT, allowNull: true }, // → unit_quizzes
assessment_id: { type: DataTypes.BIGINT, allowNull: true }, // → course_assessments
type: {
type: DataTypes.ENUM("true_false", "multiple_choice", "multi_select"),
allowNull: false,
},
question: { type: DataTypes.TEXT, allowNull: false },
explanation: { type: DataTypes.TEXT, allowNull: true }, // shown after answer
order_index: { type: DataTypes.INTEGER, defaultValue: 0 },
points: { type: DataTypes.INTEGER, defaultValue: 1 },
createdBy: { type: DataTypes.BIGINT, allowNull: true },
deletedBy: { type: DataTypes.BIGINT, allowNull: true },
}, {
tableName: "quiz_questions",
timestamps: true,
paranoid: true,
});
module.exports = QuizQuestion