Commit 9b1507d4 authored by wangqinghua's avatar wangqinghua

结果页面

parent cf0b4e52
<?xml version='1.0' encoding='utf-8'?> <?xml version='1.0' encoding='utf-8'?>
<widget id="io.ionic.smart19.starter.test" version="4.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0"> <widget id="io.ionic.smart19.starter.test" version="4.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>党建云平台(测试)</name> <name>党建云平台(测试)</name>
<description>An awesome Ionic/Cordova app.</description> <description>An awesome Ionic/Cordova app.</description>
<author email="hi@ionicframework" href="http://ionicframework.com/">Ionic Framework Team</author> <author email="hi@ionicframework" href="http://ionicframework.com/">Ionic Framework Team</author>
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
"proxies": [ "proxies": [
{ {
"path": "/wisdomgroup", "path": "/wisdomgroup",
"proxyUrl": "http://10.10.202.3:8080/wisdomgroup" "proxyUrl": "http://180.168.156.212:2931/wisdomgroup"
} }
] ]
} }
\ No newline at end of file
...@@ -61,7 +61,7 @@ ...@@ -61,7 +61,7 @@
<ng-container *ngIf="item.questionType == 4"> <ng-container *ngIf="item.questionType == 4">
<p> <p>
<label> <label>
<input [(ngModel)]="item.answer" [name]="item.questionQueId" value="A type="radio"> <input [(ngModel)]="item.answer" [name]="item.questionQueId" value="A" type="radio">
<span class=" selectIndex">A</span>&nbsp;&nbsp; <span class=" selectIndex">A</span>&nbsp;&nbsp;
</label> </label>
......
...@@ -6,6 +6,7 @@ import {LearningResultPage} from "../learning-result/learning-result"; ...@@ -6,6 +6,7 @@ import {LearningResultPage} from "../learning-result/learning-result";
import {LearnService} from "../learn.service"; import {LearnService} from "../learn.service";
import {DatePipe} from "@angular/common"; import {DatePipe} from "@angular/common";
import {CommonService} from "../../../../service/common.service"; import {CommonService} from "../../../../service/common.service";
import {ReviewResultPage} from "../review-result/review-result";
@IonicPage() @IonicPage()
@Component({ @Component({
...@@ -65,7 +66,7 @@ export class LearningDoPage { ...@@ -65,7 +66,7 @@ export class LearningDoPage {
let totalTime = this.totalTime; let totalTime = this.totalTime;
this.clock = window.setInterval(() => { this.clock = window.setInterval(() => {
totalTime--; totalTime--;
this.useTime ++; this.useTime++;
let hourse = (Math.floor(totalTime / 3600)).toString(); let hourse = (Math.floor(totalTime / 3600)).toString();
hourse = (hourse.length > 1 ? hourse : '0' + hourse); hourse = (hourse.length > 1 ? hourse : '0' + hourse);
let minutes = Math.floor(totalTime / 60).toString(); let minutes = Math.floor(totalTime / 60).toString();
...@@ -141,39 +142,39 @@ export class LearningDoPage { ...@@ -141,39 +142,39 @@ export class LearningDoPage {
}) })
} }
submit(){ submit() {
if(this.type == 'reset'){ const data = {
this.navCtrl.push("LearningResultPage",{ listMap: this.list.map(e => {
testId:this.testId, if (e.answer.length > 1) {
title:this.title e.answer = e.answer.substr(0, e.answer.length - 1);
}); }
const d = {
}else{ questionId: e.questionId,
const data = { questionType: e.questionType,
listMap: this.list.map(e => { answer: e.answer
if (e.answer.length > 1) { };
e.answer = e.answer.substr(0, e.answer.length - 1); return d;
} }),
const d = { recordId: this.recordId,
questionId: e.questionId, answerTime: this.useTime,
questionType: e.questionType, };
answer: e.answer this.learnSer.submitPaper(data).subscribe(
}; (res) => {
return d; this.commonSer.toast("提交成功");
}), if(this.type == 'reset') {
recordId: this.recordId, this.navCtrl.push("ReviewResultPage", {
answerTime: this.useTime, result: res.data,
}; title: this.title
this.learnSer.submitPaper(data).subscribe( })
(res) => { }else{
this.commonSer.toast("提交成功"); this.navCtrl.push("LearningResultPage", {
this.navCtrl.push("LearningResultPage",{ testId: this.testId,
testId:this.testId, title: this.title
title:this.title
}) })
} }
) }
} )
} }
} }
...@@ -10,6 +10,6 @@ ...@@ -10,6 +10,6 @@
<ion-content> <ion-content>
<p class="explain margin-top-100">本次答题共计{{item?.questionCount}}题,满分{{item?.fullMarks}}分</p> <p class="explain margin-top-100">本次答题共计{{item?.questionCount}}题,满分{{item?.fullMarks}}分</p>
<p class="explain margin-top-20">时间:{{item?.timeLimit | formatTime}}</p> <p class="explain margin-top-20">时间:{{item?.timeLimit | formatTime}}</p>
<p class="explain margin-top-20">分数超过{{item?.fullMarks}}分合格</p> <p class="explain margin-top-20">分数超过{{item?.score}}分通过</p>
<button class="submit-btn submit" (click)="goToDO()">开始答题</button> <button class="submit-btn submit" (click)="goToDO()">开始答题</button>
</ion-content> </ion-content>
...@@ -18,7 +18,8 @@ export class LearningExplainPage { ...@@ -18,7 +18,8 @@ export class LearningExplainPage {
questionCount: 0, questionCount: 0,
fullMarks: 0, fullMarks: 0,
timeLimit: 0, timeLimit: 0,
testId:null testId:null,
score:0,
}; //测试对象 }; //测试对象
constructor(public navCtrl: NavController, public navParams: NavParams, constructor(public navCtrl: NavController, public navParams: NavParams,
public learnSer: LearnService,public commonSer:CommonService) { public learnSer: LearnService,public commonSer:CommonService) {
...@@ -34,7 +35,7 @@ export class LearningExplainPage { ...@@ -34,7 +35,7 @@ export class LearningExplainPage {
this.learnSer.startTest(data).subscribe( this.learnSer.startTest(data).subscribe(
(res) => { (res) => {
this.item = res.data; this.item = res.data;
this.item.fullMarks = Math.floor(this.item.fullMarks *0.6); this.item.score = Math.floor(this.item.fullMarks *0.6);
} }
) )
} }
......
...@@ -65,8 +65,7 @@ ...@@ -65,8 +65,7 @@
</div> </div>
<div class="content-button padding-15-0"> <div class="content-button padding-15-0">
<span>参与人员:</span> <span>参与人员:</span>
<span *ngIf="item.groupName">{{item.groupName}}</span> <span *ngIf="item.testObject">{{item.testObject}}</span>
<span *ngIf="!item.groupName">全体人员</span>
<span float-right class="join">测试</span> <span float-right class="join">测试</span>
</div> </div>
</div> </div>
...@@ -97,8 +96,7 @@ ...@@ -97,8 +96,7 @@
</div> </div>
<div class="content-button padding-15-0"> <div class="content-button padding-15-0">
<span>参与人员:</span> <span>参与人员:</span>
<span *ngIf="item.groupName">{{item.groupName}}</span> <span *ngIf="item.testObject">{{item.testObject}}</span>
<span *ngIf="!item.groupName">全体人员</span>
<span float-right class="look">查看</span> <span float-right class="look">查看</span>
</div> </div>
</div> </div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment