diff --git a/test_client/src/views/examtest/rulecreate.vue b/test_client/src/views/examtest/rulecreate.vue
index dc27217..584bf07 100644
--- a/test_client/src/views/examtest/rulecreate.vue
+++ b/test_client/src/views/examtest/rulecreate.vue
@@ -26,7 +26,8 @@
+ @visible-change="getQuestionCount"
+ @remove-tag="getQuestionCount2">
分钟
- {{Form.totalscore}} 分
+ {{Form.total_score}} 分
-
- 分
+
+ 分
立即创建
@@ -86,8 +87,8 @@ export default {
panduan_count:0,
panduan_score:0,
limit:0,
- totalscore:0,
- passscore:0
+ total_score:0,
+ pass_score:0
},
typecount:{
danxuan:0,
@@ -109,7 +110,7 @@ export default {
{ required: true, message: "时间限制不能为空"},
{ type: "number", message: "时间限制必须是数字"}
],
- passscore: [
+ pass_score: [
{ required: true, message: "及格分数不能为空"},
{ type: "number", message: "及格分数必须是数字"}
]
@@ -163,15 +164,22 @@ export default {
this.typecount = response.data
});
}
-
+ },
+ getQuestionCount2(val) {
+ getQuestionCount({ids:this.Form.questioncat}).then(response => {
+ this.typecount = response.data
+ });
},
calScore(current,old) {
let form = this.Form
let score = form.danxuan_count * form.danxuan_score + form.duoxuan_count * form.duoxuan_score + form.panduan_count * form.panduan_score
- this.Form.totalscore = score
+ this.Form.total_score = score
},
resetForm(formName) {
this.$refs[formName].resetFields();
+ this.typecount.danxuan = 0;
+ this.typecount.duoxuan = 0;
+ this.typecount.panduan = 0;
},
goBack() {
this.$router.replace('/sjmanage/testrule/')
diff --git a/test_client/src/views/question/question.vue b/test_client/src/views/question/question.vue
index f2bb576..4d3ec3e 100644
--- a/test_client/src/views/question/question.vue
+++ b/test_client/src/views/question/question.vue
@@ -83,10 +83,10 @@
{{ scope.row.questioncat_name }}
- {{ scope.row.type_display }}
+ {{ scope.row.type }}
- {{ scope.row.level_display }}
+ {{ scope.row.level }}
diff --git a/test_mini/pages/cuoti/index.js b/test_mini/pages/cuoti/index.js
index 8ed06eb..efbec89 100644
--- a/test_mini/pages/cuoti/index.js
+++ b/test_mini/pages/cuoti/index.js
@@ -14,13 +14,13 @@ Page({
},
radioChange: function (e) {
var that = this
- that.data.currentTm['userChecked'] = e.detail.value
+ that.data.currentTm['user_answer'] = e.detail.value
that.data.ctms[that.data.tmIndex] = that.data.currentTm
that.showAnswer()
},
checkboxChange: function (e) {
var that = this
- that.data.currentTm['userChecked'] = e.detail.value
+ that.data.currentTm['user_answer'] = e.detail.value
that.data.ctms[that.data.tmIndex] = that.data.currentTm
},
/**
@@ -128,7 +128,7 @@ Page({
'currentTm': currentTm
})
that.showOptions()
- if (currentTm.userChecked) {
+ if (currentTm.user_answer) {
that.showAnswer()
}
},
@@ -136,17 +136,17 @@ Page({
var that = this
let currentTm = that.data.currentTm
let isright = false
- if (currentTm.type == 2) {
- if (currentTm.userChecked) {
- if (currentTm.userChecked.sort().toString() == currentTm.right.sort().toString()) {
+ if (currentTm.type == '多选') {
+ if (currentTm.user_answer) {
+ if (currentTm.user_answer.sort().toString() == currentTm.right.sort().toString()) {
isright = true
}
}
} else {
- isright = currentTm.right == currentTm.userChecked
+ isright = currentTm.right == currentTm.user_answer
}
- // if (isright == false && currentTm.userChecked != undefined) {
+ // if (isright == false && currentTm.user_answer != undefined) {
// currentTm.dtime = util.formatTime(new Date())
// that.data.ctms.unshift(currentTm)
// if (that.data.ctms.length > 40) {
@@ -180,8 +180,8 @@ Page({
let option = {}
option.key = key
option.value = key + ':' + currentTm.options[key]
- if (currentTm.userChecked) {
- if (key == currentTm.userChecked || currentTm.userChecked.indexOf(key) != -1) {
+ if (currentTm.user_answer) {
+ if (key == currentTm.user_answer || currentTm.user_answer.indexOf(key) != -1) {
option.checked = true
}
} else {
@@ -199,6 +199,8 @@ Page({
that.data.ctms.splice(index,1)
if(that.data.ctms.length>index){
that.showTm(index)
+ } else if (that.data.ctms.length > 0 && index > 1){
+ that.showTm(index-1)
}
else{
wx.navigateBack({
diff --git a/test_mini/pages/cuoti/index.wxml b/test_mini/pages/cuoti/index.wxml
index bca0e37..605bfff 100644
--- a/test_mini/pages/cuoti/index.wxml
+++ b/test_mini/pages/cuoti/index.wxml
@@ -4,9 +4,7 @@
{{tmIndex+1}}.
- 单选题
- 多选题
- 判断题
+ {{currentTm.type}}
{{currentTm.questioncat_name}}(
@@ -15,7 +13,7 @@
{{currentTm.name}}
-
+
-
+