Browse Source

[完善] 考官阅卷页面完善

master
陈鹏飞 4 years ago
parent
commit
f733991b19
  1. 10
      src/app/app-routing.module.ts
  2. 5
      src/app/examiner/examiner.module.ts
  3. 2
      src/app/examiner/mark-papers-two/mark-papers-two.component.html
  4. 18
      src/app/examiner/mark-papers-two/mark-papers-two.component.ts
  5. 171
      src/app/examiner/review-files/review-files.component.html
  6. 15
      src/app/examiner/review-files/review-files.component.scss
  7. 25
      src/app/examiner/review-files/review-files.component.spec.ts
  8. 82
      src/app/examiner/review-files/review-files.component.ts
  9. 71
      src/app/student/examination-details/examination-details.component.ts

10
src/app/app-routing.module.ts

@ -18,6 +18,7 @@ import { CreateTestScoreComponent } from './examiner/create-test-score/create-te
import { CollectionToolsComponent } from './ui/collection-tools/collection-tools.component';
import { ExaminationDetailsComponent } from './student/examination-details/examination-details.component';
import { CollectionToolsExamineeComponent } from './ui/collection-tools-examinee/collection-tools.component';
import { ReviewFilesComponent } from './examiner/review-files/review-files.component';
@ -31,13 +32,14 @@ const routes: Routes = [
{path:'',loadChildren:() => import('./ui/ui.module').then(m => m.UiModule)}
]
},
{ path:'examiner/create-test-score', component:CreateTestScoreComponent,canActivate: [AuthGuard],}, //创建试卷具体分数页面
{ path:'canvasTool', component:CollectionToolsComponent,canActivate: [AuthGuard], }, //考官编制工具
{ path:'canvasToolExaminee', component:CollectionToolsExamineeComponent,canActivate: [AuthGuard], }, //考生编制工具
{ path:'examiner/create-test-score', component:CreateTestScoreComponent,canActivate: [AuthGuard],}, //考官 创建考卷
{ path:'canvasTool', component:CollectionToolsComponent,canActivate: [AuthGuard], }, //考官 编制工具
{ path:'reviewFiles', component: ReviewFilesComponent,canActivate: [AuthGuard], }, //考官 阅卷
{ path:'examinationDetails', component:ExaminationDetailsComponent,canActivate: [AuthGuard], }, //考生试卷 考试基本信息/作战部署
{ path:'canvasToolExaminee', component:CollectionToolsExamineeComponent,canActivate: [AuthGuard], }, //考生 编制工具
{ path:'adminLogin', component:LoginComponent}, //管理员登录路由
{ path:'login', component:LockscreenComponent}, //教员学员登录路由
];
@NgModule({

5
src/app/examiner/examiner.module.ts

@ -56,11 +56,12 @@ import { PlanLevel } from '../pipes/size.pipe';
import { MarkPapersIndexComponent } from './mark-papers-index/mark-papers-index.component';
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 { FinishDia }from './examiner-index/examiner-index.component';
import { ReviewFilesComponent } from './review-files/review-files.component'
@NgModule({
declarations: [CreateTestScoreComponent,AddPlanDialog,AddPlanTwoDialog,LookTreeNodeDialog,ExaminerIndexComponent, ExaminerNewOneComponent,FinishDialog,PlanLevel,MarkPapersIndexComponent, MarkPapersTwoComponent, StatisticAnalysisComponent,FinishDia],
declarations: [CreateTestScoreComponent,AddPlanDialog,AddPlanTwoDialog,LookTreeNodeDialog,ExaminerIndexComponent, ExaminerNewOneComponent,FinishDialog,PlanLevel,MarkPapersIndexComponent, MarkPapersTwoComponent, StatisticAnalysisComponent,FinishDia, ReviewFilesComponent],
imports: [
CommonModule,
examinerRoutingModule,

2
src/app/examiner/mark-papers-two/mark-papers-two.component.html

@ -35,7 +35,7 @@
<td [ngClass]="{'green': item.isMarked == true,'red':item.isMarked == false}">{{item.isMarked== true?"已阅卷":"未阅卷"}}</td>
<td>90</td>
<td >
<span style="color: #01CFD5;">阅卷</span>
<span style="color: #01CFD5;cursor: pointer;" (click)='reviewFiles(item)'>阅卷</span>
</td>
</tr>
</tbody>

18
src/app/examiner/mark-papers-two/mark-papers-two.component.ts

@ -15,11 +15,6 @@ import { PageEvent } from '@angular/material/paginator';
import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar';
import {FormControl} from '@angular/forms';
import { Router,ActivatedRoute } from '@angular/router';
const ELEMENT_DATA = [
{name: "张三三", organization: '浦东支队', startTime: "2020-09-19 10:00", mark: '120',testState:'未阅卷'},
{name: "提亚马特", organization: '黄埔支队', startTime: "2020-09-19 10:00", mark: '100',testState:'已阅卷'},
{name: "艾泽拉斯", organization: '徐汇支队', startTime: "2020-09-19 10:00", mark: '90',testState:'已阅卷'},
];
@Component({
selector: 'app-mark-papers-two',
@ -34,15 +29,14 @@ export class MarkPapersTwoComponent implements OnInit {
this.activatedRoute.queryParams.subscribe(param=>{
this.headtext=param.level
this.getid=param.id
//console.log(headName)
});
this.getAlltabledate()
}
headtext
getid//试卷id
dataSource
markName//试卷名称
markDate//考试日期
//分页
@ViewChild(MatPaginator, {static: true})
pageEvent: PageEvent;
@ -51,6 +45,7 @@ export class MarkPapersTwoComponent implements OnInit {
pageSize:any; //每页条数
pageSizeOptions: number[] = [10] //设置每页条数
PageNumber:any //第几页
//获取表格信息
getAlltabledate(){
let paramsdata:any = {
@ -63,13 +58,18 @@ export class MarkPapersTwoComponent implements OnInit {
this.http.get("/api/Examinations",{params:paramsdata}).subscribe((data:any)=>{
this.dataSource=data.items
this.length=data.totalCount
console.log(this.dataSource)
})
}
//分页事件
chagePage(e){
this.PageNumber = e.pageIndex+1
this.getAlltabledate()
}
//阅卷
reviewFiles (e) {
window.open(`/reviewFiles?examId=${e.id}`)
}
}

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

@ -0,0 +1,171 @@
<div class="content">
<div style="min-height: 60px;"><app-tabbar></app-tabbar></div>
<div class="center">
<div class="left">
<div class="headerLeft">
<div>单位列表</div>
<div style="text-align: right;">总分:
<label style="color: #07CDCF;">{{examScore}}</label>
</div>
</div>
<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>
</div>
<div class="right">
<div class="headerRight">
<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>
</div>
<div class="centerRight">
<div class="paperCenter" *ngIf="selectPaperType == '1'">
<mat-accordion multi>
<!-- 基本信息 -->
<mat-expansion-panel *ngIf="selectPaper.basicInfoData && selectPaper.basicInfoData.length">
<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>
</mat-expansion-panel-header>
<div class="publicTest" *ngFor="let item of selectPaper.basicInfoData;let itemkey = index">
<div class="publicTitle">{{item.name}}</div>
<div class="publicTable" *ngIf="item.tabledata && item.tabledata.length">
<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)">
<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>
</div>
</ng-container>
</div>
</div>
<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>
</div>
</ng-container>
</div>
</mat-expansion-panel>
<!-- 基本信息 -->
<!-- 四周毗邻 -->
<mat-expansion-panel *ngIf="selectPaper.adjoinData && selectPaper.adjoinData.length">
<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>
</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>
</div>
</div>
</mat-expansion-panel>
<!-- 四周毗邻 -->
<!-- 重点部位 -->
<mat-expansion-panel *ngIf="selectPaper.importLocationData && selectPaper.importLocationData.length">
<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>
</mat-expansion-panel-header>
<div class="publicTest" *ngFor="let item of selectPaper.importLocationData">
<div class="publicTitle">{{item.name}}</div>
<div class="publicTable">
<div class="tableRow" *ngFor="let element of item.tabledata; let key = index">
<div class="tabelHeader overflowText" title="{{element.propertyName}}">{{element.propertyName}}</div>
<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>
</div>
</div>
</div>
</div>
</mat-expansion-panel>
<!-- 重点部位 -->
<!-- 功能分区 -->
<mat-expansion-panel *ngIf="selectPaper.functionalDivisionData && selectPaper.functionalDivisionData.length">
<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>
</mat-expansion-panel-header>
<div class="publicTest" *ngFor="let item of selectPaper.functionalDivisionData">
<div class="publicTitle">{{item.name}}</div>
<div class="publicTable">
<div class="tableRow" *ngFor="let element of item.tabledata; let key = index">
<div class="tabelHeader overflowText" title="{{element.propertyName}}">{{element.propertyName}}</div>
<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>
</div>
</div>
</div>
</div>
</mat-expansion-panel>
<!-- 功能分区 -->
<!-- 数据核验 -->
<mat-expansion-panel *ngIf="selectPaper.facilityData && selectPaper.facilityData.length">
<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>
</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>
</div>
</div>
</mat-expansion-panel>
<!-- 数据核验 -->
</mat-accordion>
</div>
<!-- 作战部署 -->
<div class="paperCenter" *ngIf="selectPaperType == '2'">
<div class="planList">
<table>
<tr>
<td>预案名称</td>
<td>添加人</td>
<td>修改时间</td>
<td>是否公开</td>
<td>编制级别</td>
<td>设置分数</td>
<td>操作</td>
</tr>
<tr *ngFor="let item of selectPaper.planList">
<td>{{item.title}}</td>
<td>{{item.creatorName}}</td>
<td>{{item.modifiedTime | date:'yyyy-MM-dd'}}</td>
<td>{{item.isPublic ? '已公开' : '未公开'}}</td>
<td>{{item.planLevel | planlevel}}</td>
<td style="color: #FF8678;">{{item.score}}分</td>
<td>
<span style="color: #07CDCF;" (click)="enterExam(item)">进入</span>
</td>
</tr>
</table>
</div>
</div>
<!-- 作战部署 -->
</div>
</div>
</div>
</div>

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

@ -0,0 +1,15 @@
.mat-icon {
vertical-align: middle;
color: #00CFAC;
margin-left: 5px;
}
.publicTest .publicInput input { width: 48%; }
.headerButton {
margin-left: auto;
margin-right: 25px;
background-color:#00CFAC;
color: #fff;
border-radius: 5px;
border: none;
outline: none;
}

25
src/app/examiner/review-files/review-files.component.spec.ts

@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { ReviewFilesComponent } from './review-files.component';
describe('ReviewFilesComponent', () => {
let component: ReviewFilesComponent;
let fixture: ComponentFixture<ReviewFilesComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ ReviewFilesComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(ReviewFilesComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

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

@ -0,0 +1,82 @@
import { HttpClient } from '@angular/common/http';
import { Component, OnInit } from '@angular/core';
import { MatDialog } 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',
templateUrl: './review-files.component.html',
styleUrls: ['../../student/examination-details/examination-details.component.scss','./review-files.component.scss']
})
export class ReviewFilesComponent implements OnInit {
constructor(public canvasData:CanvasShareDataService, public http:HttpClient,public dialog: MatDialog,public snackBar: MatSnackBar,public route:ActivatedRoute) { }
ngOnInit(): void {
this.getTest()
}
examId:any = this.route.snapshot.queryParams.examId //考卷id
paperData:any //试卷信息
examScore:number = 0//整个试卷的总分
paperCompanyData:any = []; //考生具体考卷
selectPaper:any = {id:null}; //选择当前考卷
selectPaperType:string = '1'; //选择当前考卷内容 基本信息/作战部署
//获取考生试卷
getTest () {
this.http.get(`/api/Examinations/${this.examId}`).subscribe((data:any)=>{
this.paperData = data
this.paperData.examinationDataInfo.forEach(element => {
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.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]
})
}
//基本信息表格 是否展示当前行
rowIsShow (children,tag) {
let isShow:boolean = false
children.forEach(element => {
element.result == tag? isShow = true : null
});
return isShow
}
//切换 选择考卷
togglePaper (e) {
if (this.selectPaper.id != e.id) {
this.selectPaper = e
}
}
//切换 选择考卷内容
togglePaperType (e) {
if (this.selectPaperType != e) {
this.selectPaperType = e
}
}
//提交阅卷结果
submitResult () {
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 5000
this.snackBar.open('阅卷结果提交成功','确定',config);
}
//进入作战部署 阅卷
enterExam(item){
}
}

71
src/app/student/examination-details/examination-details.component.ts

@ -138,47 +138,36 @@ export class ExaminationDetailsComponent implements OnInit {
//交卷
uploadPaper () {
// let body = {
// id: this.route.snapshot.queryParams.examId,
// // name: null,
// // serverTime: null,
// // startTime: null,
// // endTime: null,
// // deadline: null,
// // isMarked: null,
// // totalScore: null,
// // examineeId: null,
// // examineeName: null,
// // paperId: null,
// // paperEndTime: null,
// examinationDataInfo: []
// }
// let uploadPaper = JSON.parse( JSON.stringify(this.paperCompanyData) )
// uploadPaper.forEach(element => {
// delete element.score
// delete element.planScore
// delete element.planList
// delete element.id
// delete element.paperId
// element.examinationId = this.route.snapshot.queryParams.examId
// 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 || [] )
// });
// console.log(body)
// body.examinationDataInfo = uploadPaper
// this.http.put(`/api/Examinations/UpdateExaminationData/${this.route.snapshot.queryParams.examId}`,body).subscribe(data=>{
// console.log(data)
// })
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('试卷提交成功! 本页面即将关闭','确定',config);
// window.setTimeout(()=>{
// window.close()
// },10000)
let isUpload = confirm('您确定要提交试卷吗')
if (isUpload) {
let body = {
id: this.route.snapshot.queryParams.examId,
examinationDataInfo: []
}
let uploadPaper = JSON.parse( JSON.stringify(this.paperCompanyData) )
uploadPaper.forEach(element => {
delete element.score
delete element.planScore
delete element.planList
delete element.id
delete element.paperId
element.examinationId = this.route.snapshot.queryParams.examId
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 || [] )
});
body.examinationDataInfo = uploadPaper
this.http.put(`/api/Examinations/UpdateExaminationData/${this.route.snapshot.queryParams.examId}`,body).subscribe(data=>{
this.surplusTime = -1
window.setTimeout(()=>{ window.close() },8000) //8秒后关闭页面
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('试卷提交成功! 本页面即将关闭','确定',config);
})
}
}
//进入作战部署 考卷

Loading…
Cancel
Save