Browse Source

[完善] 考官阅卷完善

master
陈鹏飞 4 years ago
parent
commit
d3689cb67a
  1. 4
      src/app/examiner/examiner.module.ts
  2. 11
      src/app/examiner/review-files/editRightWrong.html
  3. 48
      src/app/examiner/review-files/review-files.component.html
  4. 75
      src/app/examiner/review-files/review-files.component.scss
  5. 175
      src/app/examiner/review-files/review-files.component.ts

4
src/app/examiner/examiner.module.ts

@ -57,11 +57,11 @@ import { MarkPapersIndexComponent } from './mark-papers-index/mark-papers-index.
import { MarkPapersTwoComponent } from './mark-papers-two/mark-papers-two.component';
import { StatisticAnalysisComponent } from './statistic-analysis/statistic-analysis.component';
import { FinishDia }from './examiner-index/examiner-index.component';
import { ReviewFilesComponent } from './review-files/review-files.component'
import { ReviewFilesComponent,editRightWrongComponent } from './review-files/review-files.component'
@NgModule({
declarations: [CreateTestScoreComponent,AddPlanDialog,AddPlanTwoDialog,LookTreeNodeDialog,ExaminerIndexComponent, ExaminerNewOneComponent,FinishDialog,PlanLevel,MarkPapersIndexComponent, MarkPapersTwoComponent, StatisticAnalysisComponent,FinishDia, ReviewFilesComponent],
declarations: [CreateTestScoreComponent,AddPlanDialog,AddPlanTwoDialog,LookTreeNodeDialog,ExaminerIndexComponent, ExaminerNewOneComponent,FinishDialog,PlanLevel,MarkPapersIndexComponent, MarkPapersTwoComponent, StatisticAnalysisComponent,FinishDia, ReviewFilesComponent,editRightWrongComponent],
imports: [
CommonModule,
examinerRoutingModule,

11
src/app/examiner/review-files/editRightWrong.html

@ -0,0 +1,11 @@
<div class="editRightWrong">
<div class="content">
<mat-radio-group [(ngModel)]="isChecked">
<mat-radio-button *ngFor="let item of radioList" [value]='item.isRight'>{{item.name}}</mat-radio-button>
</mat-radio-group>
</div>
<div mat-dialog-actions>
<button mat-raised-button color="primary" (click)='submit()'>确定</button>
<button mat-raised-button mat-dialog-close>取消</button>
</div>
</div>

48
src/app/examiner/review-files/review-files.component.html

@ -12,7 +12,7 @@
<div class="centerLeft" style="background: #F5FDFE;"><div class="overflowText">单位名称</div><div class="overflowText">总分</div></div>
<div class="centerLeft" *ngFor="let item of paperCompanyData" [ngClass]="{'selectPaper': selectPaper.id == item.id}" (click)='togglePaper(item)'>
<div class="overflowText">{{item.companyInfo? item.companyInfo.name:'暂无单位名称'}}</div>
<div class="overflowText">{{item.score}}</div>
<div class="overflowText">{{item.score}}+{{item.planScore}}</div>
</div>
</div>
<div class="right">
@ -20,7 +20,9 @@
<label (click)='togglePaperType(1)' [ngClass]="{'selectPaperType': selectPaperType == '1'}">基本信息</label>
<label (click)='togglePaperType(2)' [ngClass]="{'selectPaperType': selectPaperType == '2'}">作战部署</label>
<button (click)='submitResult()' style="width: 100px;">提交阅卷结果</button>
<label style="float: right;margin-right: 25px;opacity: 1;width: 150px;">基本信息总分: {{selectPaper.score || 0}}分</label>
<label style="float: right;margin-right: 25px;opacity: 1;width: 150px;" *ngIf="selectPaperType == '1'">基本信息总分:
{{selectPaper.basicInfoTotalPoints+selectPaper.adjoinTotalPoints+selectPaper.importLocationTotalPoints+selectPaper.functionalDivisionTotalPoints+selectPaper.facilityTotalPoints}}分
</label>
</div>
<div class="centerRight">
<div class="paperCenter" *ngIf="selectPaperType == '1'">
@ -31,7 +33,7 @@
<mat-expansion-panel-header class="panelHeader">
<label class="mariginRight">基本信息</label>
<label>总分: <label class="mark"> {{selectPaper.basicInfoScore}}</label>分, </label><label>单项<label class="mark"></label></label>
<button class="headerButton">全部正确</button>
<button class="headerButton" *ngIf="selectPaper.basicInfoScore == selectPaper.basicInfoTotalPoints">全部正确</button>
</mat-expansion-panel-header>
<div class="publicTest" *ngFor="let item of selectPaper.basicInfoData;let itemkey = index">
<div class="publicTitle">{{item.name}}</div>
@ -39,10 +41,13 @@
<div class="tableRow" *ngFor="let element of item.tabledata; let key = index">
<div class="tabelHeader overflowText" title="{{element.propertyName}}">{{element.propertyName}}</div>
<ng-container *ngFor="let elements of element.data">
<div class="tabelCenter" *ngIf="rowIsShow(selectPaper.basicInfoData[itemkey].children,elements.tag)">
<div class="tabelCenter tableInput" *ngIf="rowIsShow(selectPaper.basicInfoData[itemkey].children,elements.tag)">
<label *ngIf="key===0" class="overflowText">{{elements.result}}</label>
<input type="text" [(ngModel)]="elements.userAnswer" name="userAnswer" *ngIf="key!=0" readonly>
<mat-icon>done</mat-icon>
<mat-icon *ngIf="key!=0 && elements.isRight" class="rightWrong">done</mat-icon>
<mat-icon *ngIf="key!=0 && !elements.isRight" class="mistakeIcon rightWrong">clear</mat-icon>
<mat-icon *ngIf="key!=0" title="修改结果" (click)='editResults(elements)'>create</mat-icon>
<p *ngIf="key!=0" class="rightKey">{{elements.result}}</p>
</div>
</ng-container>
</div>
@ -50,7 +55,10 @@
<ng-container *ngIf="!item.tabledata || !item.tabledata.length">
<div class="publicInput" *ngFor="let element of item.children">
<label>{{element.name}}:</label><input type="text" [(ngModel)]="element.userAnswer" name="userAnswer" readonly>
<mat-icon>done</mat-icon>
<mat-icon *ngIf="element.isRight">done</mat-icon>
<mat-icon class="mistakeIcon" *ngIf="!element.isRight">clear</mat-icon>
<button class="modificationResults" (click)='editResults(element)'>修改结果</button>
<p class="rightKey">{{element.result}}</p>
</div>
</ng-container>
</div>
@ -61,13 +69,16 @@
<mat-expansion-panel-header class="panelHeader">
<label class="mariginRight">四周毗邻</label>
<label>总分: <label class="mark"> {{selectPaper.adjoinScore}}</label>分, </label><label>单项<label class="mark"></label></label>
<button class="headerButton">全部正确</button>
<button class="headerButton" *ngIf="selectPaper.adjoinScore == selectPaper.adjoinTotalPoints">全部正确</button>
</mat-expansion-panel-header>
<div class="publicTest" *ngFor="let item of selectPaper.adjoinData">
<div class="publicTitle">{{item.name}}</div>
<div class="publicInput" *ngFor="let element of item.children">
<label>{{element.name}}:</label><input type="text" [(ngModel)]="element.userAnswer" name="userAnswer" readonly>
<mat-icon>done</mat-icon>
<mat-icon *ngIf="element.isRight">done</mat-icon>
<mat-icon class="mistakeIcon" *ngIf="!element.isRight">clear</mat-icon>
<button class="modificationResults" (click)='editResults(element)'>修改结果</button>
<p class="rightKey">{{element.result}}</p>
</div>
</div>
</mat-expansion-panel>
@ -77,7 +88,7 @@
<mat-expansion-panel-header class="panelHeader">
<label class="mariginRight">重点部位</label>
<label>总分: <label class="mark"> {{selectPaper.importLocationScore}}</label>分, </label><label>单项<label class="mark"></label></label>
<button class="headerButton">全部正确</button>
<button class="headerButton" *ngIf="selectPaper.importLocationScore == selectPaper.importLocationTotalPoints">全部正确</button>
</mat-expansion-panel-header>
<div class="publicTest" *ngFor="let item of selectPaper.importLocationData">
<div class="publicTitle">{{item.name}}</div>
@ -87,7 +98,10 @@
<div class="tabelCenter" *ngFor="let elements of element.data">
<label *ngIf="key===0" class="overflowText">{{elements.result}}</label>
<input type="text" [(ngModel)]="elements.userAnswer" name="userAnswer" *ngIf="key!=0" readonly>
<mat-icon>done</mat-icon>
<mat-icon *ngIf="key!=0 && elements.isRight">done</mat-icon>
<mat-icon *ngIf="key!=0 && !elements.isRight" class="mistakeIcon">clear</mat-icon>
<mat-icon *ngIf="key!=0" title="修改结果" (click)='editResults(elements)'>create</mat-icon>
<p *ngIf="key!=0" class="rightKey">{{elements.result}}</p>
</div>
</div>
</div>
@ -99,7 +113,7 @@
<mat-expansion-panel-header class="panelHeader">
<label class="mariginRight">功能分区</label>
<label>总分: <label class="mark"> {{selectPaper.functionalDivisionScore}}</label>分, </label><label>单项<label class="mark"></label></label>
<button class="headerButton">全部正确</button>
<button class="headerButton" *ngIf="selectPaper.functionalDivisionScore == selectPaper.functionalDivisionTotalPoints">全部正确</button>
</mat-expansion-panel-header>
<div class="publicTest" *ngFor="let item of selectPaper.functionalDivisionData">
<div class="publicTitle">{{item.name}}</div>
@ -109,7 +123,10 @@
<div class="tabelCenter" *ngFor="let elements of element.data">
<label *ngIf="key===0" class="overflowText">{{elements.result}}</label>
<input type="text" [(ngModel)]="elements.userAnswer" name="userAnswer" *ngIf="key!=0" readonly>
<mat-icon>done</mat-icon>
<mat-icon *ngIf="key!=0 && elements.isRight">done</mat-icon>
<mat-icon *ngIf="key!=0 && !elements.isRight" class="mistakeIcon">clear</mat-icon>
<mat-icon *ngIf="key!=0" title="修改结果" (click)='editResults(elements)'>create</mat-icon>
<p *ngIf="key!=0" class="rightKey">{{elements.result}}</p>
</div>
</div>
</div>
@ -121,13 +138,16 @@
<mat-expansion-panel-header class="panelHeader">
<label class="mariginRight">数据核验</label>
<label>总分: <label class="mark"> {{selectPaper.facilityScore}}</label>分, </label><label>单项<label class="mark"></label></label>
<button class="headerButton">全部正确</button>
<button class="headerButton" *ngIf="selectPaper.facilityScore == selectPaper.facilityTotalPoints">全部正确</button>
</mat-expansion-panel-header>
<div class="publicTest" *ngFor="let item of selectPaper.facilityData">
<div class="publicTitle">{{item.name}}</div>
<div class="publicInput" *ngFor="let element of item.children">
<label>{{element.name}}:</label><input type="text" [(ngModel)]="element.userAnswer" name="userAnswer" readonly>
<mat-icon>done</mat-icon>
<mat-icon *ngIf="element.isRight">done</mat-icon>
<mat-icon class="mistakeIcon" *ngIf="!element.isRight">clear</mat-icon>
<button class="modificationResults" (click)='editResults(element)'>修改结果</button>
<p class="rightKey">{{element.result}}</p>
</div>
</div>
</mat-expansion-panel>

75
src/app/examiner/review-files/review-files.component.scss

@ -1,15 +1,80 @@
.mat-icon {
vertical-align: middle;
color: #00CFAC;
margin-left: 5px;
margin: 0 3px;
cursor: pointer;
}
button {
border: none;
outline: none;
border-radius: 5px;
}
.mistakeIcon {
color: red;
}
.publicTest .publicInput input { width: 48%; }
.headerButton {
margin-left: auto;
margin-right: 25px;
background-color:#00CFAC;
color: #fff;
border-radius: 5px;
border: none;
outline: none;
}
//修改结果
.modificationResults {
width: 70px;
height: 30px;
background-color: #ebf8fa;
color: #07CDCF;
}
//表格 input
.publicTest .publicInput {
height: 50px;
line-height: 0px;
margin: 5px;
label { width: 30%; }
input { width: 40%; }
}
.publicTest .publicTable{
padding: 0;
margin: 10px 0;
.tableRow {
.tabelCenter {
margin: 0;
overflow: hidden;
height: 50px;
line-height: 25px;
input { height: 24px;}
.mat-icon { margin: 0; padding: 0; }
p { text-align: left; padding-left: 15%; }
}
.tableInput { //基本信息 表格 input
position: relative;
.rightWrong { position: absolute; left: 55%; top: -5px; }
input { width: 50%; }
.mat-icon { font-size: 20px; width: 20px; height: 20px; }
}
}
}
//正确答案
.rightKey {
width: 100%;
height: 18px;
line-height: 18px;
overflow: hidden;
box-sizing: border-box;
padding-left: 35%;
font-size: 14px;
color: #07CDCF;
}
// 修改结果弹窗
.editRightWrong {
button { margin: 0 10px; }
.content { margin-bottom: 10px; text-align: center; }
.mat-radio-button {
height: 22px;
line-height: 22px;
display: inline-block;
margin: 0 10px;
}
}

175
src/app/examiner/review-files/review-files.component.ts

@ -1,9 +1,8 @@
import { HttpClient } from '@angular/common/http';
import { Component, OnInit } from '@angular/core';
import { MatDialog } from '@angular/material/dialog';
import { Component, Inject, OnInit } from '@angular/core';
import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar';
import { ActivatedRoute } from '@angular/router';
import { CanvasShareDataService } from 'src/app/canvas-share-data.service';
@Component({
selector: 'app-review-files',
@ -12,20 +11,21 @@ import { CanvasShareDataService } from 'src/app/canvas-share-data.service';
})
export class ReviewFilesComponent implements OnInit {
constructor(public canvasData:CanvasShareDataService, public http:HttpClient,public dialog: MatDialog,public snackBar: MatSnackBar,public route:ActivatedRoute) { }
constructor(public http:HttpClient,public dialog: MatDialog,public snackBar: MatSnackBar,public route:ActivatedRoute) { }
async ngOnInit(): Promise<void> {
await this.getTest()
this.getUnitPlans()//将试卷的预案考题放进数据中
}
examId:any = this.route.snapshot.queryParams.examId //考卷id
examId:any = this.route.snapshot.queryParams.examId; //考卷id
paperId:any; //试卷id
paperData:any //试卷信息
examScore:number = 0//整个试卷的总分
paperCompanyData:any = []; //考生具体考卷
selectPaper:any = {id:null}; //选择当前考卷
selectPaperType:string = '1'; //选择当前考卷内容 基本信息/作战部署
paperId:any//试卷id
//获取考生试卷
async getTest () {
await new Promise((resolve, reject) => {
@ -39,7 +39,6 @@ export class ReviewFilesComponent implements OnInit {
element.functionalDivisionData? element.functionalDivisionData = JSON.parse(element.functionalDivisionData) : null
element.importLocationData? element.importLocationData = JSON.parse(element.importLocationData) : null
element.score = element.adjoinScore + element.basicInfoScore + element.facilityScore + element.functionalDivisionScore + element.importLocationScore
this.examScore = this.examScore + element.score
});
this.paperCompanyData = JSON.parse( JSON.stringify(data.examinationDataInfo) ) //具体考卷
this.selectPaper = this.paperCompanyData[0]
@ -47,25 +46,148 @@ export class ReviewFilesComponent implements OnInit {
})
})
}
//获得单位预案设定
async getUnitPlans(){
for (let index = 0; index < this.paperCompanyData.length; index++) {
const item = this.paperCompanyData[index];
item.planScore = 0 //预案总分
item.planList = [] //预案data
let params = {
paperId : this.paperData.paperId,
companyId : item.companyInfo.id
}
await new Promise((resolve,reject)=>{
this.http.get(`/api/PaperPlans`,{params:params}).subscribe(data => {
console.log(111,data)
item.planList = []
item.planList = data
item.planList.forEach(element => { item.planScore = item.planScore + element.score });
resolve(1)
})
})
}
// this.calculateScore()
this.handleResults() //计算答案正确错误
}
//处理数据 计算答案正确错误
handleResults () {
this.examScore = 0
this.paperCompanyData.forEach(element => {
this.examScore = this.examScore + element.score + element.planScore //试卷总分
//forEach
element.adjoinData.forEach(item => { //四周毗邻
item.children.forEach(items => {
if (items.isRight===undefined) {
items.result == items.userAnswer? items.isRight = true : items.isRight = false
}
});
});
element.basicInfoData.forEach(item => { //基本信息
if (item.tabledata && item.tabledata.length) { //表格
item.tabledata.forEach((itemss,index) => {
if (index!=0) {
itemss.data.forEach(items => {
if (items.isRight===undefined) { items.result == items.userAnswer? items.isRight = true : items.isRight = false }
});
}
});
} else { //input
item.children.forEach(items => { if (items.isRight===undefined) { items.result == items.userAnswer? items.isRight = true : items.isRight = false } });
}
});
element.facilityData.forEach(item => { //消防设施
item.children.forEach(items => { if (items.isRight===undefined) { items.result == items.userAnswer? items.isRight = true : items.isRight = false } });
});
element.functionalDivisionData.forEach(item => { //功能分区
item.tabledata.forEach((itemss,index) => {
if (index!=0) {
itemss.data.forEach(items => { if (items.isRight===undefined) { items.result == items.userAnswer? items.isRight = true : items.isRight = false } });
}
});
});
element.importLocationData.forEach(item => { //重点部位
item.tabledata.forEach((itemss,index) => {
if (index!=0) {
itemss.data.forEach(items => { if (items.isRight===undefined) { items.result == items.userAnswer? items.isRight = true : items.isRight = false } });
}
});
});
//forEach
});
this.getPaperGrade()
}
//循环 获取最新得分
getPaperGrade () {
this.paperCompanyData.forEach(element => {
//forEach
element.adjoinTotalPoints = 0 //四周毗邻 分数
element.adjoinData.forEach(item => { //四周毗邻
item.children.forEach(items => { items.isRight? element.adjoinTotalPoints = element.adjoinTotalPoints + 1 : null });
});
element.basicInfoTotalPoints = 0 //基本信息总分
element.basicInfoData.forEach(item => { //基本信息
if (item.tabledata && item.tabledata.length) { //表格
let indexList = []
item.tabledata[0].data.forEach((e,index) => { let everyRow = { isRight: true, index: index }; indexList.push(everyRow) }); //表格 行数
item.tabledata.forEach((itemss,index) => {
indexList.forEach(ele=>{ if (itemss.data[ele.index].isRight !=undefined && itemss.data[ele.index].isRight === false) { ele.isRight = false } })
});
indexList.forEach(item=>{
item.isRight? element.basicInfoTotalPoints = element.basicInfoTotalPoints + 1 : null
})
} else { //input
item.children.forEach(items => { items.isRight? element.basicInfoTotalPoints = element.basicInfoTotalPoints + 1 : null });
}
});
element.facilityTotalPoints = 0 //消防设施总分
element.facilityData.forEach(item => { //消防设施
item.children.forEach(items => { items.isRight? element.facilityTotalPoints = element.facilityTotalPoints + 1 : null });
});
element.functionalDivisionTotalPoints = 0 //功能分区总分
element.functionalDivisionData.forEach(item => { //功能分区
if (item.tabledata && item.tabledata.length) {
let indexList = []
item.tabledata[0].data.forEach((e,index) => { let everyRow = { isRight: true, index: index }; indexList.push(everyRow) }); //表格 行数
item.tabledata.forEach((itemss,index) => {
indexList.forEach(ele=>{ if (itemss.data[ele.index].isRight !=undefined && itemss.data[ele.index].isRight === false) { ele.isRight = false } })
});
indexList.forEach(item=>{
item.isRight? element.functionalDivisionTotalPoints = element.functionalDivisionTotalPoints + 1 : null
})
}
});
element.importLocationTotalPoints = 0 //重点部位总分
element.importLocationData.forEach(item => { //重点部位
if (item.tabledata && item.tabledata.length) {
let indexList = []
item.tabledata[0].data.forEach((e,index) => { let everyRow = { isRight: true, index: index }; indexList.push(everyRow) }); //表格 行数
item.tabledata.forEach((itemss,index) => {
indexList.forEach(ele=>{ if (itemss.data[ele.index].isRight !=undefined && itemss.data[ele.index].isRight === false) { ele.isRight = false } })
});
indexList.forEach(item=>{
item.isRight? element.importLocationTotalPoints = element.importLocationTotalPoints + 1 : null
})
}
});
//forEach
});
console.log(this.selectPaper)
}
//修改结果
editResults (e) {
let data = e
const dialogRef = this.dialog.open(editRightWrongComponent, {data});
dialogRef.afterClosed().subscribe(data => {
if (data) {
if (e.isRight != data.isChecked) {
e.isRight = data.isChecked
this.getPaperGrade()
}
}
})
}
//基本信息表格 是否展示当前行
rowIsShow (children,tag) {
let isShow:boolean = false
@ -110,4 +232,37 @@ export class ReviewFilesComponent implements OnInit {
}
}
export interface radioType {
isRight: boolean,
name: string,
}
@Component({
selector: 'app-edit-rightWrong',
templateUrl: './editRightWrong.html',
styleUrls: ['./review-files.component.scss']
})
export class editRightWrongComponent implements OnInit {
constructor(public http:HttpClient,public dialog: MatDialog,public snackBar: MatSnackBar,public route:ActivatedRoute,@Inject(MAT_DIALOG_DATA) public data: any,public dialogRef: MatDialogRef<any>,) { }
ngOnInit(): void {
this.isChecked = JSON.parse( JSON.stringify(this.data.isRight) )
}
isChecked:boolean; //是否正确
radioList:radioType[] = [
{ isRight: true, name: '正确', },
{ isRight: false, name: '错误', },
];
submit () {
let data = {isChecked : this.isChecked}
this.dialogRef.close(data)
}
}

Loading…
Cancel
Save