-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsectionQuestion.js
More file actions
38 lines (35 loc) · 934 Bytes
/
sectionQuestion.js
File metadata and controls
38 lines (35 loc) · 934 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
const mongoose = require("mongoose");
const { lecture } = require("./lecture");
const { sectionQuiz } = require("./sectionQuiz");
const { Schema } = mongoose;
const answerSchema = new Schema(
{
answer: { type: String, maxlength: 1000, required: true },
explanation: { type: String, maxlength: 1000, required: true },
istrue: Boolean,
},
{ timestamps: true }
);
const sectionQuestionSchema = new Schema(
{
question: { type: Schema.Types.String, required: true },
isActive: Boolean,
answers: [answerSchema],
sectionQuizId: {
type: Schema.Types.ObjectId,
ref: "sectionQuiz",
required: true,
},
},
{ timestamps: true }
);
const sectionQuestion = mongoose.model(
"sectionQuestion",
sectionQuestionSchema
);
module.exports = { sectionQuestionSchema, sectionQuestion };
// helperLetureId: {
// type: Schema.Types.ObjectId,
// ref: lecture,
// required: false,
// },