problem.model.js 533 Bytes
Newer Older
Yoon, Daeki's avatar
quiz    
Yoon, Daeki committed
1
2
import mongoose from 'mongoose'

Yoon, Daeki's avatar
Yoon, Daeki committed
3
const ProblemSchema = new mongoose.Schema({
Yoon, Daeki's avatar
quiz    
Yoon, Daeki committed
4
5
6
7
8
9
10
11
12
  type: String, // 객관식, 주관식 single/multiple choice
  created: {
    type: Date,
    default: Date.now
  },
  updated: Date,
  level: String,
  category: [String],
  score: Number, //문제당 할당 점수
Yoon, Daeki's avatar
Yoon, Daeki committed
13
14
  question: String, //질문
  answers: [String], // 선택형 항목
Yoon, Daeki's avatar
quiz    
Yoon, Daeki committed
15
16
17
18
19
20
  correct: {
    type: mongoose.Schema.Types.ObjectId,
    ref: 'Answer'
  }, // 정답; Answer Model 객체
})

Yoon, Daeki's avatar
Yoon, Daeki committed
21
export default mongoose.model('Problem', ProblemSchema)