diff --git a/models/quiz.js b/models/quiz.js index 4af489e7..19b96ba8 100644 --- a/models/quiz.js +++ b/models/quiz.js @@ -40,7 +40,7 @@ const quizSchema = new Schema( values: QUIZ_VIEW_ENUM, message: ENUM_CAN_BE_ONE_OF('quiz view', QUIZ_VIEW_ENUM) }, - default: 'Scroll' + default: QUIZ_VIEW_ENUM[1] }, shuffle: { type: Boolean, diff --git a/services/quiz.js b/services/quiz.js index 4f46f24a..e15d668d 100644 --- a/services/quiz.js +++ b/services/quiz.js @@ -42,12 +42,10 @@ const quizService = { const { settings } = updateData - if (settings) { - for (let props in settings) { - quiz.settings[props] = settings[props] - } - } else { - for (let field in updateData) { + for (let field in updateData) { + if (field === 'settings') { + Object.assign(quiz.settings, settings) + } else { quiz[field] = updateData[field] } }