-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathexamModel.js
41 lines (36 loc) · 931 Bytes
/
examModel.js
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
39
40
41
const mongoose = require("mongoose");
mongoose.connect("mongodb://localhost/ccnaSelectDb", { useNewUrlParser: true });
const Schema = mongoose.Schema;
const examSchema = new Schema({
name: String,
version: String,
pageUrl: { type: String, unique: true },
creationTimestamp: { type: Date, default: Date.now() },
questions: [
{
title: String,
questionImage: String,
identifier: { type: String },
creationTimestamp: { type: Date, default: Date.now() },
solution: {
choices: [
{
name: String,
isAnswer: Boolean,
},
],
choiceImages: [
{
name: String,
isAnswer: Boolean,
},
],
solutionImage: String,
htmlSolution: String,
explanation: String,
},
},
],
});
const qModel = mongoose.model("exam", examSchema);
module.exports = qModel;