From ffa8f775c33ab70d67ca73dfffc503fcebe9ad95 Mon Sep 17 00:00:00 2001 From: caoqianming Date: Wed, 1 Apr 2020 18:33:00 +0800 Subject: [PATCH] yati --- test_client/src/api/examtest.js | 7 + test_client/src/router/index.js | 7 + .../src/views/examtest/papercreate.vue | 8 +- .../src/views/examtest/paperupdate.vue | 209 ++++++++++++++++++ test_client/src/views/system/banner.vue | 2 +- test_mini/app.js | 4 +- test_mini/pages/main/main.js | 2 +- test_mini/pages/main/main.wxml | 2 +- test_mini/pages/moni/index.js | 2 +- test_mini/pages/moni/note.js | 8 +- test_mini/pages/my/index.js | 2 +- test_mini/pages/my/index.wxml | 2 +- test_mini/pages/test/list.js | 2 +- test_mini/pages/test/test.js | 27 +-- test_mini/pages/yati/index.js | 14 +- test_mini/pages/yati/index.wxml | 2 +- .../migrations/0020_auto_20200401_1210.py | 33 +++ .../migrations/0021_auto_20200401_1616.py | 17 ++ test_server/examtest/models_paper.py | 7 +- test_server/examtest/serializers.py | 30 ++- test_server/examtest/urls.py | 5 +- test_server/examtest/views.py | 208 ++++++++++------- test_server/question/views.py | 2 +- 23 files changed, 479 insertions(+), 123 deletions(-) create mode 100644 test_client/src/views/examtest/paperupdate.vue create mode 100644 test_server/examtest/migrations/0020_auto_20200401_1210.py create mode 100644 test_server/examtest/migrations/0021_auto_20200401_1616.py diff --git a/test_client/src/api/examtest.js b/test_client/src/api/examtest.js index 1e0b1cc..c106f9c 100644 --- a/test_client/src/api/examtest.js +++ b/test_client/src/api/examtest.js @@ -104,4 +104,11 @@ export function createPaper(data) { method: 'post', data }) +} +export function updatePaper(id, data) { + return request({ + url: `/examtest/paper/${id}/`, + method: 'put', + data + }) } \ No newline at end of file diff --git a/test_client/src/router/index.js b/test_client/src/router/index.js index 768aa95..fd6855c 100644 --- a/test_client/src/router/index.js +++ b/test_client/src/router/index.js @@ -171,6 +171,13 @@ export const asyncRoutes = [ meta: { title: '新建押题试卷', noCache: true, icon: '', perms: ['paper_add']}, hidden: true }, + { + path: 'paper/update', + name: 'UpdatePaper', + component: () => import('@/views/examtest/paperupdate.vue'), + meta: { title: '编辑押题试卷', noCache: true, icon: '', perms: ['paper_update']}, + hidden: true + }, ] }, { diff --git a/test_client/src/views/examtest/papercreate.vue b/test_client/src/views/examtest/papercreate.vue index 035bd4b..3db1968 100644 --- a/test_client/src/views/examtest/papercreate.vue +++ b/test_client/src/views/examtest/papercreate.vue @@ -29,7 +29,7 @@
多选题 - {{Form.danxuan_count}} 道 + {{Form.duoxuan_count}} 道 每道
@@ -172,18 +172,22 @@ export default { panduan_count = 0, questions = []; for (var i = 0, len = this.questions.length; i < len; i++) { - questions.push({id:this.questions[i].id,type:this.questions[i].type}) + var total_score = 0 switch (this.questions[i].type) { case "单选": danxuan_count = danxuan_count + 1; + total_score = this.Form.danxuan_score break; case "多选": duoxuan_count = duoxuan_count + 1; + total_score = this.Form.duoxuan_score break; case "判断": panduan_count = panduan_count + 1; + total_score = this.Form.panduan_score break; } + questions.push({id:this.questions[i].id,type:this.questions[i].type,total_score:total_score}) } this.Form.danxuan_count = danxuan_count this.Form.duoxuan_count = duoxuan_count diff --git a/test_client/src/views/examtest/paperupdate.vue b/test_client/src/views/examtest/paperupdate.vue new file mode 100644 index 0000000..681094a --- /dev/null +++ b/test_client/src/views/examtest/paperupdate.vue @@ -0,0 +1,209 @@ + + \ No newline at end of file diff --git a/test_client/src/views/system/banner.vue b/test_client/src/views/system/banner.vue index 27ed6ec..a6ba14c 100644 --- a/test_client/src/views/system/banner.vue +++ b/test_client/src/views/system/banner.vue @@ -19,7 +19,7 @@ -