diff --git a/test_mini/pages/cuoti/index.js b/test_mini/pages/cuoti/index.js
index 9f3901a..97593d8 100644
--- a/test_mini/pages/cuoti/index.js
+++ b/test_mini/pages/cuoti/index.js
@@ -11,7 +11,8 @@ Page({
tm_index: 0,
isright:false,
answerP:false,
- tmtotal:0
+ tmtotal:0,
+ moShi:'看题模式'
},
radioChange: function (e) {
var that = this
@@ -23,6 +24,7 @@ Page({
var that = this
that.data.currentTm['user_answer'] = e.detail.value
that.data.ctms[that.data.tm_index] = that.data.currentTm
+
},
/**
* 生命周期函数--监听页面加载
@@ -127,7 +129,7 @@ Page({
'currentTm': currentTm
})
that.showOptions()
- if (currentTm.user_answer) {
+ if (currentTm.user_answer && that.data.moShi=='看题模式') {
that.showAnswer()
}
},
@@ -145,13 +147,6 @@ Page({
} else {
isright = currentTm.right == currentTm.user_answer
}
- // if (isright == false && currentTm.user_answer != undefined) {
- // currentTm.dtime = util.formatTime(new Date())
- // that.data.ctms.unshift(currentTm)
- // if (that.data.ctms.length > 40) {
- // that.data.ctms.length = 40
- // }
- // }
return isright
},
showAnswer: function () {
@@ -166,11 +161,13 @@ Page({
var that = this
var tm_index = that.data.tm_index + 1
that.showTm(tm_index)
+ that.showAnswerP()
},
previous: function () {
var that = this
var tm_index = that.data.tm_index - 1
that.showTm(tm_index)
+ that.showAnswerP()
},
showOptions: function () {
let currentTm = this.data.currentTm
@@ -179,7 +176,7 @@ Page({
let option = {}
option.key = key
option.value = key + ':' + currentTm.options[key]
- if (currentTm.user_answer) {
+ if (currentTm.user_answer && this.data.moShi == '看题模式') {
if (key == currentTm.user_answer || currentTm.user_answer.indexOf(key) != -1) {
option.checked = true
}
@@ -205,5 +202,31 @@ Page({
wx.navigateBack({
})
}
+ },
+ changeM: function () {
+ var that = this
+ if(that.data.moShi=='看题模式'){
+ that.setData({
+ moShi:'背题模式',
+ answerP:false
+ })
+ that.showOptions()
+ }else{
+ that.setData({
+ moShi: '看题模式'
+ })
+ }
+ },
+ showAnswerP:function(){
+ var that = this
+ if (that.data.moShi == '背题模式') {
+ that.setData({
+ answerP:false
+ })
+ }else{
+ that.setData({
+ answerP: true
+ })
+ }
}
})
\ No newline at end of file
diff --git a/test_mini/pages/cuoti/index.wxml b/test_mini/pages/cuoti/index.wxml
index 0a53c4a..d8c3afc 100644
--- a/test_mini/pages/cuoti/index.wxml
+++ b/test_mini/pages/cuoti/index.wxml
@@ -1,5 +1,11 @@
- 题量: {{tm_index+1}}/{{tmtotal}}
+
+ 题量: {{tm_index+1}}/{{tmtotal}}
+
+
+ {{moShi}}
+ (点击切换)
+
diff --git a/test_mini/pages/cuoti/index.wxss b/test_mini/pages/cuoti/index.wxss
index 0ee5e6b..662adc2 100644
--- a/test_mini/pages/cuoti/index.wxss
+++ b/test_mini/pages/cuoti/index.wxss
@@ -3,7 +3,9 @@
height:30px;
color:#fff;
background-color: cornflowerblue;
- text-align: center;
+ text-align: left;
+ display:flex;
+ flex-direction: row;
}
.btns{
height:40px;
diff --git a/test_mini/pages/lianxi/index.wxml b/test_mini/pages/lianxi/index.wxml
index 4877c07..91c2c8c 100644
--- a/test_mini/pages/lianxi/index.wxml
+++ b/test_mini/pages/lianxi/index.wxml
@@ -13,6 +13,9 @@
已答
{{item.ydtmtotal}}
+ 道,
+ 共
+ {{item.tmtotal}}
道
diff --git a/test_mini/pages/lianxi/main.wxml b/test_mini/pages/lianxi/main.wxml
index afad9f3..cf1dfda 100644
--- a/test_mini/pages/lianxi/main.wxml
+++ b/test_mini/pages/lianxi/main.wxml
@@ -1,5 +1,5 @@
-
+ 题量: {{tm_index+1}}/{{tmtotal}}