answer.model.js 387 Bytes
Newer Older
Yoon, Daeki's avatar
quiz    
Yoon, Daeki committed
1
2
3
import mongoose from 'mongoose'

const AnswerSchema = new mongoose.Schema({
Yoon, Daeki's avatar
Yoon, Daeki committed
4
  problemId: {
Yoon, Daeki's avatar
quiz    
Yoon, Daeki committed
5
    type: mongoose.Schema.Types.ObjectId,
Yoon, Daeki's avatar
Yoon, Daeki committed
6
    ref: 'Problem',
Yoon, Daeki's avatar
quiz    
Yoon, Daeki committed
7
8
9
  },
  type: String, // single/multiple choice?
  score: Number, // 맞힌 점수
Yoon, Daeki's avatar
Yoon, Daeki committed
10
  points: Number, // Problem.score와 자동 연결 필요
Yoon, Daeki's avatar
quiz    
Yoon, Daeki committed
11
12
13
14
  content: String, // 기록한 답
})

export default mongoose.model('Answer', AnswerSchema)