Sfoglia il codice sorgente

Merge branch 'master' of http://git.cc-lotus.info/new_train/service-center

liuyu 5 anni fa
parent
commit
189a6c2fee
3 ha cambiato i file con 15 aggiunte e 3 eliminazioni
  1. 6 3
      app/controller/.uploadtask.js
  2. 1 0
      app/model/task.js
  3. 8 0
      app/model/uploadtask.js

+ 6 - 3
app/controller/.uploadtask.js

@@ -8,7 +8,8 @@ module.exports = {
       '!studentid',
       'picrul',
       'taskid',
-      'score'
+      'score',
+      'answers'
     ]
   },
   destroy: {
@@ -25,7 +26,8 @@ module.exports = {
       'studentid',
       'picrul',
       'taskid',
-      'score'
+      'score',
+      'answers'
     ]
   },
   show: {
@@ -44,7 +46,8 @@ module.exports = {
         studentid : 'studentid',
         picrul : 'picrul',
         taskid: 'taskid',
-        score: 'score'
+        score: 'score',
+        answers:'answers'
       }
     },
     service: 'query',

+ 1 - 0
app/model/task.js

@@ -14,6 +14,7 @@ const questionInfo = new Schema({
   topic: { type: String, required: false, maxLength: 500 }, // 题目
   answer: { type: String, required: false, maxLength: 500 }, // 答案
   option: { type: [ optionInfo ], select: true }, // 选项
+  score: { type: String, required: false, maxLength: 500 }, // 分数
 });
 
 // 作业表

+ 8 - 0
app/model/uploadtask.js

@@ -2,6 +2,13 @@
 const Schema = require('mongoose').Schema;
 const metaPlugin = require('naf-framework-mongoose/lib/model/meta-plugin');
 
+// 答案详情
+const answerInfo = new Schema({
+  questionid: { type: String, required: false, maxLength: 200 }, // 问题id
+  answer: { type: String, required: false, maxLength: 200 }, // 答案
+  questionscore: { type: String, required: false, maxLength: 200 }, // 分数
+});
+
 // 学生上传作业表
 const UploadtaskSchema = {
   termid: { type: String, required: true, maxLength: 200 }, // 期id
@@ -12,6 +19,7 @@ const UploadtaskSchema = {
   picrul: { type: String, required: false, maxLength: 200 }, // 上传图片地址
   taskid: { type: String, required: false, maxLength: 200 }, // 作业id
   score: { type: String, required: false, maxLength: 2000 }, // 分数
+  answers: { type: [ answerInfo ], select: true }, // 回答详情
 };