|
@@ -3,12 +3,14 @@ import {
|
|
|
} from '../../../utils/util.js'
|
|
|
|
|
|
let app = getApp()
|
|
|
+let mulSelect = 3
|
|
|
Page({
|
|
|
data: {
|
|
|
list: [],
|
|
|
redo: false,
|
|
|
preList:["A","B","C", "D","E","F"],
|
|
|
info:{},
|
|
|
+ id:0,
|
|
|
timer: null,
|
|
|
doTime: 0,
|
|
|
remainTime: 0,
|
|
@@ -24,16 +26,18 @@ Page({
|
|
|
this.setData({redo})
|
|
|
let method = redo?'Exam.examreStart':'Exam.examStart';
|
|
|
let _this = this
|
|
|
+ let oindex = [2,3,1]
|
|
|
app.formPost(method, {groupId}).then(res => {
|
|
|
if (res.code ==200) {
|
|
|
let {startTime, info, list} = res.data;
|
|
|
- let duration = list.length * 60;
|
|
|
+ let duration = info.duration
|
|
|
list = list.map(item=>{
|
|
|
delete( item["select"])
|
|
|
return item
|
|
|
}).sort( (i,j) =>{
|
|
|
- return i.type > j.type?1:-1;
|
|
|
+ return oindex.indexOf(i.type) > oindex.indexOf(j.type)?1:-1;
|
|
|
})
|
|
|
+ console.log( list.map( item=>{ return item.type}) )
|
|
|
wx.setNavigationBarTitle({
|
|
|
title: info.title+'-模拟考试'
|
|
|
})
|
|
@@ -70,15 +74,10 @@ Page({
|
|
|
clearInterval(this.data.timer)
|
|
|
},
|
|
|
returnRecord() {
|
|
|
- if( this.data.redo){
|
|
|
- wx.reLaunch({
|
|
|
- url: '/pages/exam/error/index',
|
|
|
- });
|
|
|
- }else{
|
|
|
- wx.reLaunch({
|
|
|
- url: '/pages/exam/record/index',
|
|
|
- });
|
|
|
- }
|
|
|
+ let id = this.data.id;
|
|
|
+ wx.navigateTo({
|
|
|
+ url: `/pages/exam/read/index?id=${id}`
|
|
|
+ })
|
|
|
},
|
|
|
timeOut() {
|
|
|
clearInterval(this.data.timer)
|
|
@@ -133,11 +132,11 @@ Page({
|
|
|
}
|
|
|
if( !item.select ) isFinish = false
|
|
|
}
|
|
|
- if( !isFinish && !force){
|
|
|
- app.message("还未完成", 'error')
|
|
|
- wx.hideLoading()
|
|
|
- return
|
|
|
- }
|
|
|
+ // if( !isFinish && !force){
|
|
|
+ // app.message("还未完成", 'error')
|
|
|
+ // wx.hideLoading()
|
|
|
+ // return
|
|
|
+ // }
|
|
|
param.result = param.result.join(",")
|
|
|
param.answers = param.answers.join(",")
|
|
|
param.errors = errIds.join(",")
|
|
@@ -145,6 +144,7 @@ Page({
|
|
|
app.formPost('Exam.ExamSubmit', param).then(res => {
|
|
|
if (res.code === 200) {
|
|
|
_this.setData({
|
|
|
+ id: res.data.id,
|
|
|
modalShow: true,
|
|
|
result:param,
|
|
|
});
|