answer.model.js 390 Bytes
Newer Older
Yoon, Daeki's avatar
quiz    
Yoon, Daeki committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import mongoose from 'mongoose'

const AnswerSchema = new mongoose.Schema({
  questionId: {
    type: mongoose.Schema.Types.ObjectId,
    ref: 'Question',
  },
  type: String, // single/multiple choice?
  score: Number, // 맞힌 점수
  points: Number, // Question.score와 자동 연결 필요
  content: String, // 기록한 답
})

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