+
正确
-
@@ -164,17 +164,19 @@ function queryData(){
userId: userInfo.value.userId,
examPaperId:rows.value.examPaperId
},'post',9100,header).then((resData) => {
- elapsedTime.value=(rows.value.timeLimit*60)
- resData.forEach((item,i)=>{
- if(item.type=='multiple'){
- item.choice=[]
- }else{
- item.choice=""
- }
- problemData.value.push(item)
- problemList.value.push({index:i+1,whether:""})
- })
- start()
+ if(resData&&resData.code==200){
+ elapsedTime.value=(rows.value.timeLimit*60)
+ resData.data.forEach((item,i)=>{
+ if(item.type=='multiple'){
+ item.choice=[]
+ }else{
+ item.choice=""
+ }
+ problemData.value.push(item)
+ problemList.value.push({index:i+1,whether:""})
+ })
+ start()
+ }
});
}else if(rows.value.types==2){
$api.myRequest('/train/public/trainExamDash/continueExam', {
@@ -190,11 +192,13 @@ function queryData(){
item.submitAnswers=true
}else{
item.choice=[]
+ item.submitAnswers=false
}
}else{
if(item.choosed){
item.choice=item.choosed;
item.submitAnswers=true
+ item.submitAnswers=false
}else{
item.choice=""
}
@@ -233,14 +237,13 @@ function submit(){
}
let header={
'Authorization':Authorization.value,
- 'Content-Type':"application/json"
+ 'Content-Type':"application/x-www-form-urlencoded"
}
$api.myRequest('/train/public/trainExamDash/submitAnswer', parm,'post',9100,header).then((resData) => {
if(resData&&resData.code==200){
problemData.value[indexs].submitAnswers=true
if(problemData.value.length==questionIndex.value){
- $api.msg('已经是最后一题了', '请仔细检查后交卷')
-
+ $api.msg('已经是最后一题了,请仔细检查后交卷!')
}else{
questionIndex.value+=1
}
@@ -266,18 +269,7 @@ function complete(){
}
}
})
- this.$confirm((arr.length>0?'第'+arr.join(",")+'题还未作答,':'请仔细检查试卷 ,')+'确认是否交卷?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(() => {
- onpaper()
- }).catch(() => {
- this.$message({
- type: 'info',
- message: '已取消'
- });
- });
+
};
function onpaper(){
@@ -290,7 +282,7 @@ function onpaper(){
}
let header={
'Authorization':Authorization.value,
- 'Content-Type':"application/json"
+ 'Content-Type':"application/x-www-form-urlencoded"
}
$api.myRequest('/train/public/trainExamDash/submitExam', parm,'post',9100,header).then((resData) => {
if(resData&&resData.code==200){
@@ -371,7 +363,17 @@ function switchs(i){
dialogVisible.value=false
};
function exit(){
- navBack()
+ wx.showModal({
+ title: '提示',
+ content: '直接退出是不计分的, 确定要退出吗?',
+ success (res) {
+ if (res.confirm) {
+ navBack()
+ } else if (res.cancel) {
+ console.log('用户点击取消')
+ }
+ }
+ })
}