diff --git a/src/app/examiner/examiner.module.ts b/src/app/examiner/examiner.module.ts index edde9d3..d096fa8 100644 --- a/src/app/examiner/examiner.module.ts +++ b/src/app/examiner/examiner.module.ts @@ -77,6 +77,7 @@ import { StationExamineeComponent } from "./statistic-analysis/examStatistics/st import { ExamineePapersComponent } from "./statistic-analysis/examStatistics/examinee-papers/examinee-papers.component"; import { ExamineeCapacityComponent } from "./statistic-analysis/abilityAnalysis/examinee-capacity/examinee-capacity.component"; import { NzRateModule } from "ng-zorro-antd/rate"; +import { EvaluateComponent } from "./review-files/evaluate/evaluate.component"; @NgModule({ declarations: [ CreateTestScoreComponent, @@ -97,6 +98,7 @@ import { NzRateModule } from "ng-zorro-antd/rate"; StationExamineeComponent, ExamineePapersComponent, ExamineeCapacityComponent, + EvaluateComponent, ], imports: [ CommonModule, diff --git a/src/app/examiner/mark-papers-two/mark-papers-two.component.html b/src/app/examiner/mark-papers-two/mark-papers-two.component.html index 0b81a6f..e5b119f 100644 --- a/src/app/examiner/mark-papers-two/mark-papers-two.component.html +++ b/src/app/examiner/mark-papers-two/mark-papers-two.component.html @@ -25,7 +25,8 @@ 交卷时间 是否已阅 分数 - 操作 + 评价 + 操作 @@ -34,6 +35,7 @@ {{item.endTime|date:'yyyy-MM-dd HH:mm'}} {{item.isMarked== true?"已阅卷":"未阅卷"}} {{item.totalScore}} + {{item.comment}} 阅卷 diff --git a/src/app/examiner/review-files/evaluate/evaluate.component.html b/src/app/examiner/review-files/evaluate/evaluate.component.html new file mode 100644 index 0000000..3f2caf2 --- /dev/null +++ b/src/app/examiner/review-files/evaluate/evaluate.component.html @@ -0,0 +1,11 @@ +

考试评价:

+
+ + 评价 + + +
+
+ + +
\ No newline at end of file diff --git a/src/app/examiner/review-files/evaluate/evaluate.component.scss b/src/app/examiner/review-files/evaluate/evaluate.component.scss new file mode 100644 index 0000000..e69de29 diff --git a/src/app/examiner/review-files/evaluate/evaluate.component.spec.ts b/src/app/examiner/review-files/evaluate/evaluate.component.spec.ts new file mode 100644 index 0000000..600f1fb --- /dev/null +++ b/src/app/examiner/review-files/evaluate/evaluate.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { EvaluateComponent } from './evaluate.component'; + +describe('EvaluateComponent', () => { + let component: EvaluateComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ EvaluateComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(EvaluateComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/examiner/review-files/evaluate/evaluate.component.ts b/src/app/examiner/review-files/evaluate/evaluate.component.ts new file mode 100644 index 0000000..20d2ace --- /dev/null +++ b/src/app/examiner/review-files/evaluate/evaluate.component.ts @@ -0,0 +1,28 @@ +import { Component, OnInit, Inject } from "@angular/core"; +import { + MatDialog, + MAT_DIALOG_DATA, + MatDialogRef, +} from "@angular/material/dialog"; +@Component({ + selector: "app-evaluate", + templateUrl: "./evaluate.component.html", + styleUrls: ["./evaluate.component.scss"], +}) +export class EvaluateComponent implements OnInit { + constructor( + public dialogRef: MatDialogRef, + @Inject(MAT_DIALOG_DATA) public data: any + ) {} + ngOnInit(): void { + // throw new Error("Method not implemented."); + } + + onNoClick(type): void { + let obj = { + type: type, + value: this.data.Evaluate, + }; + this.dialogRef.close(obj); + } +} diff --git a/src/app/examiner/review-files/review-files.component.ts b/src/app/examiner/review-files/review-files.component.ts index 8a6c3fc..fb18124 100644 --- a/src/app/examiner/review-files/review-files.component.ts +++ b/src/app/examiner/review-files/review-files.component.ts @@ -1,202 +1,351 @@ -import { HttpClient } from '@angular/common/http'; -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 { HttpClient } from "@angular/common/http"; +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 { EvaluateComponent } from "./evaluate/evaluate.component"; @Component({ - selector: 'app-review-files', - templateUrl: './review-files.component.html', - styleUrls: ['../../student/examination-details/examination-details.component.scss','./review-files.component.scss'] + selector: "app-review-files", + templateUrl: "./review-files.component.html", + styleUrls: [ + "../../student/examination-details/examination-details.component.scss", + "./review-files.component.scss", + ], }) export class ReviewFilesComponent implements OnInit { - - constructor(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 { - this.paperType = this.route.snapshot.queryParams.paperType || 1 - await this.getTest() - this.getUnitPlans()//将试卷的预案考题放进数据中 + this.paperType = this.route.snapshot.queryParams.paperType || 1; + await this.getTest(); + this.getUnitPlans(); //将试卷的预案考题放进数据中 //监听 此HTML标签焦点事件 - document.addEventListener('visibilitychange', ()=>{ - let isHidden = document.hidden + document.addEventListener("visibilitychange", () => { + let isHidden = document.hidden; if (!isHidden) { - this.getUnitPlans(false) + this.getUnitPlans(false); } - }) + }); } - paperType:any = 1; //阅卷/查看 - 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'; //选择当前考卷内容 基本信息/作战部署 + paperType: any = 1; //阅卷/查看 + 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"; //选择当前考卷内容 基本信息/作战部署 //获取考生试卷 - async getTest () { + async getTest() { await new Promise((resolve, reject) => { - this.http.get(`/api/Examinations/${this.examId}`).subscribe((data:any)=>{ - this.paperData = data - this.paperId = this.paperData.paperId + this.http + .get(`/api/Examinations/${this.examId}`) + .subscribe((data: any) => { + this.paperData = data; + this.paperId = this.paperData.paperId; - this.paperData.examinationDataInfo.forEach((element,index) => { - element.adjoinData? element.adjoinData = JSON.parse(element.adjoinData) : null - element.basicInfoData? element.basicInfoData = JSON.parse(element.basicInfoData) : null - element.facilityData? element.facilityData = JSON.parse(element.facilityData) : null - element.functionalDivisionData? element.functionalDivisionData = JSON.parse(element.functionalDivisionData) : null - element.importLocationData? element.importLocationData = JSON.parse(element.importLocationData) : null - element.adjoinItemScore = data.paperInfo.paperDataInfo[index].adjoinItemScore //四周毗邻单项分 - element.basicInfoItemScore = data.paperInfo.paperDataInfo[index].basicInfoItemScore //基本信息单项分 - element.facilityItemScore = data.paperInfo.paperDataInfo[index].facilityItemScore //消防设施单项分 - element.functionalDivisionItemSocre = data.paperInfo.paperDataInfo[index].functionalDivisionItemSocre //功能分区单选分 - element.importLocationItemScore = data.paperInfo.paperDataInfo[index].importLocationItemScore //重点部位单项分 - if (this.paperType == 1) { //阅卷 - element.adjoinScore = data.paperInfo.paperDataInfo[index].adjoinScore //四周毗邻 总分 - element.basicInfoScore = data.paperInfo.paperDataInfo[index].basicInfoScore //基本信息 总分 - element.facilityScore = data.paperInfo.paperDataInfo[index].facilityScore //消防设施 总分 - element.functionalDivisionScore = data.paperInfo.paperDataInfo[index].functionalDivisionScore //功能分区 总分 - element.importLocationScore = data.paperInfo.paperDataInfo[index].importLocationScore //重点部位 总分 - } - element.score = element.adjoinScore + element.basicInfoScore + element.facilityScore + element.functionalDivisionScore + element.importLocationScore + this.paperData.examinationDataInfo.forEach((element, index) => { + element.adjoinData + ? (element.adjoinData = JSON.parse(element.adjoinData)) + : null; + element.basicInfoData + ? (element.basicInfoData = JSON.parse(element.basicInfoData)) + : null; + element.facilityData + ? (element.facilityData = JSON.parse(element.facilityData)) + : null; + element.functionalDivisionData + ? (element.functionalDivisionData = JSON.parse( + element.functionalDivisionData + )) + : null; + element.importLocationData + ? (element.importLocationData = JSON.parse( + element.importLocationData + )) + : null; + element.adjoinItemScore = + data.paperInfo.paperDataInfo[index].adjoinItemScore; //四周毗邻单项分 + element.basicInfoItemScore = + data.paperInfo.paperDataInfo[index].basicInfoItemScore; //基本信息单项分 + element.facilityItemScore = + data.paperInfo.paperDataInfo[index].facilityItemScore; //消防设施单项分 + element.functionalDivisionItemSocre = + data.paperInfo.paperDataInfo[index].functionalDivisionItemSocre; //功能分区单选分 + element.importLocationItemScore = + data.paperInfo.paperDataInfo[index].importLocationItemScore; //重点部位单项分 + if (this.paperType == 1) { + //阅卷 + element.adjoinScore = + data.paperInfo.paperDataInfo[index].adjoinScore; //四周毗邻 总分 + element.basicInfoScore = + data.paperInfo.paperDataInfo[index].basicInfoScore; //基本信息 总分 + element.facilityScore = + data.paperInfo.paperDataInfo[index].facilityScore; //消防设施 总分 + element.functionalDivisionScore = + data.paperInfo.paperDataInfo[index].functionalDivisionScore; //功能分区 总分 + element.importLocationScore = + data.paperInfo.paperDataInfo[index].importLocationScore; //重点部位 总分 + } + element.score = + element.adjoinScore + + element.basicInfoScore + + element.facilityScore + + element.functionalDivisionScore + + element.importLocationScore; + }); + this.paperCompanyData = JSON.parse( + JSON.stringify(data.examinationDataInfo) + ); //具体考卷 + this.selectPaper = this.paperCompanyData[0]; + resolve(1); }); - this.paperCompanyData = JSON.parse( JSON.stringify(data.examinationDataInfo) ) //具体考卷 - this.selectPaper = this.paperCompanyData[0] - resolve(1) - - }) - }) + }); } //获得单位预案设定 - async getUnitPlans(type:boolean = true){ + async getUnitPlans(type: boolean = true) { for (let index = 0; index < this.paperCompanyData.length; index++) { const item = this.paperCompanyData[index]; - item.planScore = 0 //预案总分 - item.planList = [] //预案data + item.planScore = 0; //预案总分 + item.planList = []; //预案data let params = { - examinationId : this.route.snapshot.queryParams.examId, - companyId : item.companyInfo.id - } - await new Promise((resolve,reject)=>{ - this.http.get(`/api/ExaminationPlans`,{params:params}).subscribe(data => { - item.planList = data - item.planList.forEach(element => { item.planScore = item.planScore + element.paperPlanInfo.score }); - if(type == false){ - const config = new MatSnackBarConfig(); - config.verticalPosition = 'top'; - config.duration = 5000 - // this.snackBar.open('刷新成功','确定',config); - } - resolve(1) - }) - }) + examinationId: this.route.snapshot.queryParams.examId, + companyId: item.companyInfo.id, + }; + await new Promise((resolve, reject) => { + this.http + .get(`/api/ExaminationPlans`, { params: params }) + .subscribe((data) => { + item.planList = data; + item.planList.forEach((element) => { + item.planScore = item.planScore + element.paperPlanInfo.score; + }); + if (type == false) { + const config = new MatSnackBarConfig(); + config.verticalPosition = "top"; + config.duration = 5000; + // this.snackBar.open('刷新成功','确定',config); + } + resolve(1); + }); + }); } - type? this.handleResults() : null //计算答案正确错误 + type ? this.handleResults() : null; //计算答案正确错误 } //处理数据 计算答案正确错误 - handleResults () { - this.examScore = 0 - this.paperCompanyData.forEach(element => { - this.examScore = this.examScore + element.score + element.planScore //试卷总分 + 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.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 } + 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 } }); + } 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.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.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 } }); + 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() + this.getPaperGrade(); } //循环 获取最新得分 - getPaperGrade () { - this.paperCompanyData.forEach(element => { + getPaperGrade() { + this.paperCompanyData.forEach((element) => { //forEach - element.adjoinTotalPoints = 0 //四周毗邻 分数 - element.adjoinData.forEach(item => { //四周毗邻 - item.children.forEach(items => { items.isRight? element.adjoinTotalPoints = element.adjoinTotalPoints + element.adjoinItemScore : null }); + element.adjoinTotalPoints = 0; //四周毗邻 分数 + element.adjoinData.forEach((item) => { + //四周毗邻 + item.children.forEach((items) => { + items.isRight + ? (element.adjoinTotalPoints = + element.adjoinTotalPoints + element.adjoinItemScore) + : 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 } }) + 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 + element.basicInfoItemScore) + : null; + }); + } else { + //input + item.children.forEach((items) => { + items.isRight + ? (element.basicInfoTotalPoints = + element.basicInfoTotalPoints + element.basicInfoItemScore) + : null; }); - indexList.forEach(item=>{ - item.isRight? element.basicInfoTotalPoints = element.basicInfoTotalPoints + element.basicInfoItemScore : null - }) - } else { //input - item.children.forEach(items => { items.isRight? element.basicInfoTotalPoints = element.basicInfoTotalPoints + element.basicInfoItemScore : null }); } }); - element.facilityTotalPoints = 0 //消防设施总分 - element.facilityData.forEach(item => { //消防设施 - item.children.forEach(items => { items.isRight? element.facilityTotalPoints = element.facilityTotalPoints + element.facilityItemScore : null }); + element.facilityTotalPoints = 0; //消防设施总分 + element.facilityData.forEach((item) => { + //消防设施 + item.children.forEach((items) => { + items.isRight + ? (element.facilityTotalPoints = + element.facilityTotalPoints + element.facilityItemScore) + : null; + }); }); - element.functionalDivisionTotalPoints = 0 //功能分区总分 - element.functionalDivisionData.forEach(item => { //功能分区 + 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 } }) + 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 + + element.functionalDivisionItemSocre) + : null; }); - indexList.forEach(item=>{ - item.isRight? element.functionalDivisionTotalPoints = element.functionalDivisionTotalPoints + element.functionalDivisionItemSocre : null - }) } }); - element.importLocationTotalPoints = 0 //重点部位总分 - element.importLocationData.forEach(item => { //重点部位 + 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 } }) + 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 + + element.importLocationItemScore) + : null; }); - indexList.forEach(item=>{ - item.isRight? element.importLocationTotalPoints = element.importLocationTotalPoints + element.importLocationItemScore : null - }) } }); //forEach @@ -204,142 +353,175 @@ export class ReviewFilesComponent implements OnInit { } //修改结果 - editResults (e) { - let data = e - const dialogRef = this.dialog.open(editRightWrongComponent, {data}); - dialogRef.afterClosed().subscribe(data => { + 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() + e.isRight = data.isChecked; + this.getPaperGrade(); } } - }) + }); } //刷新预案设定表格 - refreshTable(){ - this.getUnitPlans(false) + refreshTable() { + this.getUnitPlans(false); } //基本信息表格 是否展示当前行 - rowIsShow (children,tag) { - let isShow:boolean = false - children.forEach(element => { - element.result == tag? isShow = true : null + rowIsShow(children, tag) { + let isShow: boolean = false; + children.forEach((element) => { + element.result == tag ? (isShow = true) : null; }); - return isShow + return isShow; } //切换 选择考卷 - togglePaper (e) { + togglePaper(e) { if (this.selectPaper.id != e.id) { - this.selectPaper = e + this.selectPaper = e; } } //切换 选择考卷内容 - togglePaperType (e) { + togglePaperType(e) { if (this.selectPaperType != e) { - this.selectPaperType = e + this.selectPaperType = e; } } //提交阅卷结果 - submitResult () { - let bodyData = { - id: this.paperData.id, - isMarked: true, - totalScore: 0, - examinationDataInfo: [], - } - let paramsData = JSON.parse(JSON.stringify( this.paperCompanyData )) //考卷 - paramsData.forEach(element => { - //计算总分 - bodyData.totalScore = bodyData.totalScore+element.adjoinTotalPoints+element.basicInfoTotalPoints+element.facilityTotalPoints+element.functionalDivisionTotalPoints+element.importLocationTotalPoints - element.planList.forEach(item => { - bodyData.totalScore = bodyData.totalScore + item.score || 0 - }); - //计算总分 - element.adjoinScore = element.adjoinTotalPoints //四周毗邻 - delete element.adjoinTotalPoints - delete element.adjoinItemScore - element.basicInfoScore = element.basicInfoTotalPoints //基本信息 - delete element.basicInfoTotalPoints - delete element.basicInfoItemScore - element.facilityScore = element.facilityTotalPoints //消防设施 - delete element.facilityTotalPoints - delete element.facilityItemScore - element.functionalDivisionScore = element.functionalDivisionTotalPoints //功能分区 - delete element.functionalDivisionTotalPoints - delete element.functionalDivisionItemSocre - element.importLocationScore = element.importLocationTotalPoints //重点部位 - delete element.importLocationTotalPoints - delete element.importLocationItemScore - delete element.planList - delete element.planScore - delete element.score - element.adjoinData = JSON.stringify(element.adjoinData) - element.basicInfoData = JSON.stringify(element.basicInfoData) - element.facilityData = JSON.stringify(element.facilityData) - element.functionalDivisionData = JSON.stringify(element.functionalDivisionData) - element.importLocationData = JSON.stringify(element.importLocationData) + submitResult() { + const dialogRef = this.dialog.open(EvaluateComponent, { + data: { Evaluate: "" }, + }); + + dialogRef.afterClosed().subscribe((result) => { + // console.log("The dialog was closed", result); + if (result.type) { + let bodyData = { + id: this.paperData.id, + isMarked: true, + totalScore: 0, + examinationDataInfo: [], + comment: result.value, + }; + let paramsData = JSON.parse(JSON.stringify(this.paperCompanyData)); //考卷 + paramsData.forEach((element) => { + //计算总分 + bodyData.totalScore = + bodyData.totalScore + + element.adjoinTotalPoints + + element.basicInfoTotalPoints + + element.facilityTotalPoints + + element.functionalDivisionTotalPoints + + element.importLocationTotalPoints; + element.planList.forEach((item) => { + bodyData.totalScore = bodyData.totalScore + item.score || 0; + }); + //计算总分 + element.adjoinScore = element.adjoinTotalPoints; //四周毗邻 + delete element.adjoinTotalPoints; + delete element.adjoinItemScore; + element.basicInfoScore = element.basicInfoTotalPoints; //基本信息 + delete element.basicInfoTotalPoints; + delete element.basicInfoItemScore; + element.facilityScore = element.facilityTotalPoints; //消防设施 + delete element.facilityTotalPoints; + delete element.facilityItemScore; + element.functionalDivisionScore = + element.functionalDivisionTotalPoints; //功能分区 + delete element.functionalDivisionTotalPoints; + delete element.functionalDivisionItemSocre; + element.importLocationScore = element.importLocationTotalPoints; //重点部位 + delete element.importLocationTotalPoints; + delete element.importLocationItemScore; + delete element.planList; + delete element.planScore; + delete element.score; + element.adjoinData = JSON.stringify(element.adjoinData); + element.basicInfoData = JSON.stringify(element.basicInfoData); + element.facilityData = JSON.stringify(element.facilityData); + element.functionalDivisionData = JSON.stringify( + element.functionalDivisionData + ); + element.importLocationData = JSON.stringify( + element.importLocationData + ); + }); + bodyData.examinationDataInfo = paramsData; + this.http + .put(`/api/Examinations/${this.paperData.id}`, bodyData) + .subscribe((data) => { + const config = new MatSnackBarConfig(); + config.verticalPosition = "top"; + config.duration = 5000; + this.snackBar.open( + "阅卷结果提交成功,页面将于一秒后关闭!", + "确定", + config + ); + setTimeout(() => { + window.close(); + }, 1000); + }); + } }); - bodyData.examinationDataInfo = paramsData - this.http.put(`/api/Examinations/${this.paperData.id}`,bodyData).subscribe(data=>{ - const config = new MatSnackBarConfig(); - config.verticalPosition = 'top'; - config.duration = 5000 - this.snackBar.open('阅卷结果提交成功,页面将于一秒后关闭!','确定',config); - setTimeout(() => { - window.close() - }, 1000); - }) } //作战部署 阅卷 - readExam(item,e){ - sessionStorage.setItem('companyName', this.selectPaper.companyInfo.name) - sessionStorage.setItem('planId', item.paperPlanInfo.planComponentId) - sessionStorage.setItem('buildingTypeId', this.selectPaper.companyInfo.buildingTypes[0].id) - sessionStorage.setItem('companyId', this.selectPaper.companyInfo.id) - let openType - item.paperPlanInfo.examPlanType == 0 ? openType = 1 : openType = 2 - window.open(`/canvasToolRead?planName=${item.paperPlanInfo.title}&paperplanId=${item.paperPlanId}&openType=${openType}&paperId=${this.paperId}&examId=${this.route.snapshot.queryParams.examId}&planComponentId=${item.paperPlanInfo.planComponentId}&paperType=${e}`) + readExam(item, e) { + sessionStorage.setItem("companyName", this.selectPaper.companyInfo.name); + sessionStorage.setItem("planId", item.paperPlanInfo.planComponentId); + sessionStorage.setItem( + "buildingTypeId", + this.selectPaper.companyInfo.buildingTypes[0].id + ); + sessionStorage.setItem("companyId", this.selectPaper.companyInfo.id); + sessionStorage.setItem("remark", item.remark); + let openType; + item.paperPlanInfo.examPlanType == 0 ? (openType = 1) : (openType = 2); + window.open( + `/canvasToolRead?planName=${item.paperPlanInfo.title}&paperplanId=${item.paperPlanId}&openType=${openType}&paperId=${this.paperId}&examId=${this.route.snapshot.queryParams.examId}&planComponentId=${item.paperPlanInfo.planComponentId}&paperType=${e}` + ); } - - - } - - export interface radioType { - isRight: boolean, - name: string, + isRight: boolean; + name: string; } @Component({ - selector: 'app-edit-rightWrong', - templateUrl: './editRightWrong.html', - styleUrls: ['./review-files.component.scss'] + 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,) { } + constructor( + public http: HttpClient, + public dialog: MatDialog, + public snackBar: MatSnackBar, + public route: ActivatedRoute, + @Inject(MAT_DIALOG_DATA) public data: any, + public dialogRef: MatDialogRef + ) {} ngOnInit(): void { - this.isChecked = JSON.parse( JSON.stringify(this.data.isRight) ) + this.isChecked = JSON.parse(JSON.stringify(this.data.isRight)); } - isChecked:boolean; //是否正确 - radioList:radioType[] = [ - { isRight: true, name: '正确', }, - { isRight: false, name: '错误', }, + isChecked: boolean; //是否正确 + radioList: radioType[] = [ + { isRight: true, name: "正确" }, + { isRight: false, name: "错误" }, ]; - submit () { - let data = {isChecked : this.isChecked} - this.dialogRef.close(data) + submit() { + let data = { isChecked: this.isChecked }; + this.dialogRef.close(data); } - } diff --git a/src/app/examiner/statistic-analysis/examStatistics/examinee-papers/examinee-papers.component.html b/src/app/examiner/statistic-analysis/examStatistics/examinee-papers/examinee-papers.component.html index afe6a00..de77196 100644 --- a/src/app/examiner/statistic-analysis/examStatistics/examinee-papers/examinee-papers.component.html +++ b/src/app/examiner/statistic-analysis/examStatistics/examinee-papers/examinee-papers.component.html @@ -16,6 +16,7 @@
+
@@ -27,8 +28,9 @@ 试卷名称 考核机构 考试结束时间 - 试卷得分 - 操作 + 试卷得分 + 试卷评价 + 操作 @@ -42,6 +44,10 @@ {{item.score}} + + + {{item.comment}} + 详情 diff --git a/src/app/examiner/statistic-analysis/examStatistics/examinee-papers/examinee-papers.component.ts b/src/app/examiner/statistic-analysis/examStatistics/examinee-papers/examinee-papers.component.ts index 797b7dd..c240d42 100644 --- a/src/app/examiner/statistic-analysis/examStatistics/examinee-papers/examinee-papers.component.ts +++ b/src/app/examiner/statistic-analysis/examStatistics/examinee-papers/examinee-papers.component.ts @@ -19,12 +19,13 @@ export class ExamineePapersComponent implements OnInit { ) {} examineeId; + examineeRealName; //获取登录账号的个人资料 Profiles: any; ngOnInit(): void { this.Profiles = JSON.parse(sessionStorage.getItem("creatorData")); this.examineeId = this.route.snapshot.queryParams.examineeId; - + this.examineeRealName = this.route.snapshot.queryParams.examineeRealName; this.getAlltabledate(); } @@ -89,7 +90,6 @@ export class ExamineePapersComponent implements OnInit { tabledataSource; length; getAlltabledate() { - console.log(5, this.starttime); let paramsdata: any = { ExamineeId: this.examineeId, ExaminationName: this.name || "", @@ -126,6 +126,38 @@ export class ExamineePapersComponent implements OnInit { this.endtime = ""; this.getAlltabledate(); } + + Export() { + let paramsdata: any = { + ExamineeId: this.examineeId, + ExaminationName: this.name || "", + EndTimeBegin: this.starttime ? this.starttime + " " + "0:0:0" : "", + EndTimeEnd: this.endtime ? this.endtime + " " + "23:59:59" : "", + }; + this.http + .get( + "/api/ExamStatisticalAnalyses/ExaminationStatistics/ExportExaminations", + { + responseType: "blob" as "json", + params: paramsdata, + } + ) + .subscribe((data: any) => { + console.log("导出成功", data); + const link = document.createElement("a"); + const blob = new Blob([data], { type: "application/vnd.ms-excel" }); + link.setAttribute("href", window.URL.createObjectURL(blob)); + link.setAttribute( + "download", + this.examineeRealName + "考试记录" + ".xls" + ); + link.style.visibility = "hidden"; + document.body.appendChild(link); + link.click(); + document.body.removeChild(link); + // this.message.create("success", `导出成功`); + }); + } goback() { history.go(-1); } diff --git a/src/app/examiner/statistic-analysis/examStatistics/station-examinee/station-examinee.component.ts b/src/app/examiner/statistic-analysis/examStatistics/station-examinee/station-examinee.component.ts index ef26108..602a8f6 100644 --- a/src/app/examiner/statistic-analysis/examStatistics/station-examinee/station-examinee.component.ts +++ b/src/app/examiner/statistic-analysis/examStatistics/station-examinee/station-examinee.component.ts @@ -93,6 +93,7 @@ export class StationExamineeComponent implements OnInit { this.router.navigate(["/home/statistic-examination/examinee-papers"], { queryParams: { examineeId: item.examineeId, + examineeRealName: item.examineeRealName, }, }); //登陆成功跳转页面 } diff --git a/src/app/student/student-exam-record/student-exam-record.component.html b/src/app/student/student-exam-record/student-exam-record.component.html index c90eb6f..3e89f03 100644 --- a/src/app/student/student-exam-record/student-exam-record.component.html +++ b/src/app/student/student-exam-record/student-exam-record.component.html @@ -8,14 +8,15 @@ -->
- +
- - + + + @@ -23,16 +24,16 @@ - + + - +
试卷名称 参加人 考核队站 考试时间考试成绩操作考试成绩考试评价操作
{{item.examineeName}} {{item.paperInfo.organizationsName}} {{item.paperInfo.startTime|date:'yyyy-MM-dd HH:mm'}}{{ item.totalScore && item.totalScore!=0 ? item.totalScore+'分' : '未阅卷' }}{{ item.totalScore && item.totalScore!=0 ? item.totalScore+'分' : '未阅卷' + }}{{item.comment}} 查看
- - + +
-
+ \ No newline at end of file diff --git a/src/app/ui/collection-tools-read/collection-tools.component.ts b/src/app/ui/collection-tools-read/collection-tools.component.ts index ba845a3..8f0a308 100644 --- a/src/app/ui/collection-tools-read/collection-tools.component.ts +++ b/src/app/ui/collection-tools-read/collection-tools.component.ts @@ -43,6 +43,7 @@ import { uploadQuestionsRead, } from "./examinationQuestions"; import { AxMessageSystem } from "src/app/working-area/model/axMessageSystem"; +import { RemarkComponent } from "./remark/remark.component"; @Component({ selector: "app-collection-tools", @@ -369,6 +370,7 @@ export class CollectionToolsReadComponent implements OnInit { } submitScore() { + // console.log(66666) if (!sessionStorage.getItem("scoreNum")) { const config = new MatSnackBarConfig(); config.verticalPosition = "top"; @@ -380,6 +382,7 @@ export class CollectionToolsReadComponent implements OnInit { paperPlanId: this.route.snapshot.queryParams.paperplanId, examinationId: this.route.snapshot.queryParams.examId, score: sessionStorage.getItem("scoreNum"), + remark: sessionStorage.getItem("notes"), }; this.http .put("/api/ExaminationPlans/ModifyScore", "", { params: params }) @@ -1473,7 +1476,9 @@ export class CollectionToolsReadComponent implements OnInit { } //阅卷备注 - notes() {} + notes() { + const dialogRef = this.dialog.open(RemarkComponent); + } } //查看需要标记的消防设施按钮 diff --git a/src/app/ui/collection-tools-read/remark/remark.component.html b/src/app/ui/collection-tools-read/remark/remark.component.html new file mode 100644 index 0000000..70f4f5e --- /dev/null +++ b/src/app/ui/collection-tools-read/remark/remark.component.html @@ -0,0 +1 @@ +{{Remark}} \ No newline at end of file diff --git a/src/app/ui/collection-tools-read/remark/remark.component.scss b/src/app/ui/collection-tools-read/remark/remark.component.scss new file mode 100644 index 0000000..e69de29 diff --git a/src/app/ui/collection-tools-read/remark/remark.component.spec.ts b/src/app/ui/collection-tools-read/remark/remark.component.spec.ts new file mode 100644 index 0000000..cee6d2e --- /dev/null +++ b/src/app/ui/collection-tools-read/remark/remark.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { RemarkComponent } from './remark.component'; + +describe('RemarkComponent', () => { + let component: RemarkComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ RemarkComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(RemarkComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/ui/collection-tools-read/remark/remark.component.ts b/src/app/ui/collection-tools-read/remark/remark.component.ts new file mode 100644 index 0000000..6f67571 --- /dev/null +++ b/src/app/ui/collection-tools-read/remark/remark.component.ts @@ -0,0 +1,22 @@ +import { Component, OnInit, Inject } from "@angular/core"; +import { + MatDialog, + MAT_DIALOG_DATA, + MatDialogRef, +} from "@angular/material/dialog"; +@Component({ + selector: "app-remark", + templateUrl: "./remark.component.html", + styleUrls: ["./remark.component.scss"], +}) +export class RemarkComponent implements OnInit { + constructor( + public dialogRef: MatDialogRef, + @Inject(MAT_DIALOG_DATA) public data: any + ) {} + + Remark; + ngOnInit(): void { + this.Remark = sessionStorage.getItem("remark"); + } +} diff --git a/src/app/ui/ui.module.ts b/src/app/ui/ui.module.ts index c59def6..5f36d28 100644 --- a/src/app/ui/ui.module.ts +++ b/src/app/ui/ui.module.ts @@ -108,6 +108,7 @@ import { import { NzTreeSelectModule } from "ng-zorro-antd/tree-select"; import { AdministratorsComponent } from "./administrators/administrators.component"; import { AddEditAdminComponent } from "./administrators/add-edit-admin/add-edit-admin.component"; +import { RemarkComponent } from './collection-tools-read/remark/remark.component'; @NgModule({ declarations: [ ChangepasswordComponent, @@ -147,6 +148,7 @@ import { AddEditAdminComponent } from "./administrators/add-edit-admin/add-edit- Score, AdministratorsComponent, AddEditAdminComponent, + RemarkComponent, ], imports: [ NzDatePickerModule,