Commit 3957cf04 authored by 李维's avatar 李维

添加卷面基础分配置

parent fa0a16f7
...@@ -2518,6 +2518,7 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -2518,6 +2518,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
const resultData = { const resultData = {
details: [], details: [],
scoreCconfigArr: [], scoreCconfigArr: [],
basicScore: 0,
totalScore: 0, totalScore: 0,
} }
this.data.scoreConfigArr.forEach(scoreGroup => { this.data.scoreConfigArr.forEach(scoreGroup => {
...@@ -2595,6 +2596,12 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -2595,6 +2596,12 @@ export default class SceneComponent extends MyCocosSceneComponent {
} }
}) })
// 检查是否配置了卷面基础分,为了拉平分值,有的试卷不满15分 30分 100分,或者有画图题
if(this.data.basicScore != null && !isNaN(Number(this.data.basicScore)) && Number(this.data.basicScore) > 0) {
totalScore += Number(this.data.basicScore);
resultData.basicScore = Number(this.data.basicScore);
}
resultData.totalScore = totalScore; resultData.totalScore = totalScore;
this.resultData = resultData; this.resultData = resultData;
console.log("答案校验完毕", resultData) console.log("答案校验完毕", resultData)
......
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
...@@ -516,6 +516,11 @@ ...@@ -516,6 +516,11 @@
</div> </div>
<button nz-button nzType="danger" nzDanger nz-popconfirm nzPopconfirmTitle="删除后不可恢复,确定删除吗?" nzPopconfirmPlacement="bottom" (nzOnConfirm)="deleteScoreConfig(i)" style="position: absolute; right: 10px; bottom: 10px;">删除</button> <button nz-button nzType="danger" nzDanger nz-popconfirm nzPopconfirmTitle="删除后不可恢复,确定删除吗?" nzPopconfirmPlacement="bottom" (nzOnConfirm)="deleteScoreConfig(i)" style="position: absolute; right: 10px; bottom: 10px;">删除</button>
</div> </div>
<div style="margin: 10px 10px;">
<span style="display: inline-block; text-align: right; width: 100px;">基础分:</span>
<input type="text" nz-input [(ngModel)]="item.basicScore" (blur)="save()" style="display: inline-block; width: 180px;">
</div>
<div style="margin: 10px 10px;"> <div style="margin: 10px 10px;">
<span style="display: inline-block; text-align: right; width: 100px;">总分显示:</span> <span style="display: inline-block; text-align: right; width: 100px;">总分显示:</span>
<nz-select nzShowSearch nzAllowClear [(ngModel)]="item.totalScoreHotZoneIndex" style="width: 180px;" (ngModelChange)="save()"> <nz-select nzShowSearch nzAllowClear [(ngModel)]="item.totalScoreHotZoneIndex" style="width: 180px;" (ngModelChange)="save()">
......
...@@ -279,6 +279,7 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy, AfterViewIni ...@@ -279,6 +279,7 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy, AfterViewIni
this.configCheckResult = "" this.configCheckResult = ""
const hotZoneIndexErr = []; const hotZoneIndexErr = [];
const scoreConfigErr = []; const scoreConfigErr = [];
const otherInfo = [];
let allScoreIndex = [] let allScoreIndex = []
let totalScore = 0; let totalScore = 0;
this.item.scoreConfigArr.forEach(config => { this.item.scoreConfigArr.forEach(config => {
...@@ -480,7 +481,10 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy, AfterViewIni ...@@ -480,7 +481,10 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy, AfterViewIni
} }
}); });
if(this.item.basicScore != null && !isNaN(Number(this.item.basicScore)) && Number(this.item.basicScore) > 0) {
totalScore += Number(this.item.basicScore);
otherInfo.push(`配置了基础分: ${this.item.basicScore}`)
}
this.item.hotZoneConfigArr.forEach((content, contentIndex) => { this.item.hotZoneConfigArr.forEach((content, contentIndex) => {
if(content.hotZoneType != this.AUDIO_PLAY) { if(content.hotZoneType != this.AUDIO_PLAY) {
...@@ -503,6 +507,14 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy, AfterViewIni ...@@ -503,6 +507,14 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy, AfterViewIni
this.configCheckResult += `\n\n【分数配置检查】${scoreConfigErr.length}处\n` this.configCheckResult += `\n\n【分数配置检查】${scoreConfigErr.length}处\n`
this.configCheckResult += scoreConfigErr.join("\n"); this.configCheckResult += scoreConfigErr.join("\n");
} }
if(otherInfo.length == 0) {
this.configCheckResult += "\n\n【其他信息】无\n"
} else {
this.configCheckResult += `\n\n【其他信息】${otherInfo.length}条\n`
this.configCheckResult += otherInfo.join("\n");
}
this.configCheckResult += `\n\n总分:【${totalScore}】` this.configCheckResult += `\n\n总分:【${totalScore}】`
} }
......
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