Commit 7f858e77 by chenjinjing

no message

parent 21bc7814
......@@ -419,5 +419,72 @@ export const TablesConfig = [
},
association: []
},
// 1. 测评活动表(一次测评的整体配置)
{
tableNameCn: '测评活动表',
tableName: 'survey',
schema: {
id: { type: DataTypes.INTEGER, allowNull: false, primaryKey: true, autoIncrement: true, comment: '测评活动ID' },
semester_id: { type: DataTypes.INTEGER, allowNull: false, comment: '所属学期ID,关联semester.id' },
name: { type: DataTypes.STRING(100), allowNull: false, comment: '测评活动名称,如“2024学年第一学期导师满意度测评”' },
description: { type: DataTypes.TEXT, allowNull: true, comment: '测评说明/引导语' },
start_time: { type: DataTypes.DATE, allowNull: true, comment: '答题开始时间,为空表示无限制' },
end_time: { type: DataTypes.DATE, allowNull: true, comment: '答题结束时间,为空表示无限制' },
is_open: { type: DataTypes.BOOLEAN, allowNull: false, defaultValue: false, comment: '是否开放答题(管理员手动开启/关闭)' },
created_at: { type: DataTypes.DATE, allowNull: false, defaultValue: DataTypes.NOW },
updated_at: { type: DataTypes.DATE, allowNull: false, defaultValue: DataTypes.NOW }
},
association: []
},
// 2. 测评题目表(属于某个测评活动)
{
tableNameCn: '测评题目表',
tableName: 'survey_question',
schema: {
id: { type: DataTypes.INTEGER, allowNull: false, primaryKey: true, autoIncrement: true, comment: '题目ID' },
survey_id: { type: DataTypes.INTEGER, allowNull: false, comment: '所属测评活动ID,关联survey.id' },
question_code: { type: DataTypes.STRING(10), allowNull: false, comment: '题目编号,如Q1、Q2' },
question_text: { type: DataTypes.TEXT, allowNull: false, comment: '题目文本内容' },
question_type: { type: DataTypes.ENUM('single_choice', 'multiple_choice', 'text'), allowNull: false, comment: '题目类型:单选/多选/文本' },
options: { type: DataTypes.JSON, allowNull: true, comment: '选项列表,JSON格式:[{"key":"A","value":"0次"},{"key":"B","value":"1-2次"}],仅选择题使用' },
is_required: { type: DataTypes.BOOLEAN, allowNull: false, defaultValue: true, comment: '是否必填' },
sort_order: { type: DataTypes.INTEGER, allowNull: false, defaultValue: 0, comment: '排序序号,从小到大排列' },
created_at: { type: DataTypes.DATE, allowNull: false, defaultValue: DataTypes.NOW },
updated_at: { type: DataTypes.DATE, allowNull: false, defaultValue: DataTypes.NOW }
},
association: []
},
// 3. 测评提交主表(记录学生针对某个测评活动的整体提交)
{
tableNameCn: '测评提交表',
tableName: 'survey_submission',
schema: {
id: { type: DataTypes.INTEGER, allowNull: false, primaryKey: true, autoIncrement: true, comment: '提交记录ID' },
survey_id: { type: DataTypes.INTEGER, allowNull: false, comment: '所属测评活动ID,关联survey.id' },
student_id: { type: DataTypes.STRING(20), allowNull: false, comment: '学生user_id,关联uac_user.user_id' },
teacher_id: { type: DataTypes.STRING(20), allowNull: false, comment: '被测评的导师user_id,关联uac_user.user_id' },
submit_time: { type: DataTypes.DATE, allowNull: false, defaultValue: DataTypes.NOW, comment: '提交时间' },
created_at: { type: DataTypes.DATE, allowNull: false, defaultValue: DataTypes.NOW }
},
association: []
},
// 4. 测评答案表(不变,关联 submission_id 和 question_id)
{
tableNameCn: '测评答案表',
tableName: 'survey_answer',
schema: {
id: { type: DataTypes.INTEGER, allowNull: false, primaryKey: true, autoIncrement: true, comment: '答案ID' },
submission_id: { type: DataTypes.INTEGER, allowNull: false, comment: '关联survey_submission.id' },
question_id: { type: DataTypes.INTEGER, allowNull: false, comment: '关联survey_question.id' },
answer_text: { type: DataTypes.TEXT, allowNull: true, comment: '文本答案,用于文本题(如建议)' },
answer_option_keys: { type: DataTypes.JSON, allowNull: true, comment: '选择题答案,单选存字符串如"A",多选存数组如["A","C","E"]' },
created_at: { type: DataTypes.DATE, allowNull: false, defaultValue: DataTypes.NOW },
updated_at: { type: DataTypes.DATE, allowNull: false, defaultValue: DataTypes.NOW }
},
association: []
}
];
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment