Browse Source

[完善]完善答题逻辑

master
邵佳豪 3 years ago
parent
commit
3e2c1ba242
  1. 2
      proxy.config.json
  2. 3
      src/app/examiner/create-test-score/create-test-score.component.ts
  3. 81
      src/app/examiner/examiner-index/examiner-index.component.html
  4. 2
      src/app/examiner/examiner-index/examiner-index.component.ts
  5. 2
      src/app/ui/collection-tools-examinee/collection-tools.component.html
  6. 4
      src/app/ui/collection-tools-read/collection-tools.component.html
  7. 3
      src/app/ui/collection-tools-read/collection-tools.component.ts

2
proxy.config.json

@ -1,6 +1,6 @@
{
"/api": {
"target": "http://121.37.20.190:8006",
"target": "http://39.106.78.171:9880",
"secure": false,
"changeOrigin": true
}

3
src/app/examiner/create-test-score/create-test-score.component.ts

@ -79,10 +79,11 @@ export class CreateTestScoreComponent implements OnInit {
getSoloPaper(){
this.http.get(`/api/Papers/${sessionStorage.getItem('paperId')}`).subscribe((data:any) => {
this.editdata=data
console.log('试卷信息',this.editdata)
data.paperDataInfo.forEach(item => {
this.unitId.push(JSON.parse(item.originalData))
})
console.log('试卷信息',this.unitId)
// console.log('试卷信息',this.unitId)
this.planItemScore()
})
}

81
src/app/examiner/examiner-index/examiner-index.component.html

@ -15,29 +15,32 @@
<datalist id="cars" (onchange)="getoption()">
<option *ngFor="let item of helpName" [value]="item.id" id={{item.id}} >{{item.name}}</option>
</datalist> -->
<input (click)="stopclose($event)" readonly autocomplete="off" [(ngModel)]="js" name="js" (focus)="openorganizationbox()" placeholder="请填写">
<mat-checkbox color="primary" style="margin-left: 6px;" [(ngModel)]="jscheck" name="jscheck">包含下级</mat-checkbox>
<div class="organizationbox" *ngIf="isorganizationbox">
<div (click)="closediv()" class="closediv"><mat-icon>clear</mat-icon></div>
<mat-tree [dataSource]="dataSource" [treeControl]="treeControl">
<mat-tree-node *matTreeNodeDef="let node" matTreeNodePadding (click)='add(node)' class="organizationlist">
<button type="button" mat-icon-button disabled ></button>
<li>{{node.name}}</li>
</mat-tree-node>
<mat-tree-node *matTreeNodeDef="let node;when: hasChild" matTreeNodePadding (click)='add(node)' class="organizationlist">
<button
type="button"
mat-icon-button
matTreeNodeToggle
[attr.aria-label]="'toggle ' + node.name">
<mat-icon class="mat-icon-rtl-mirror">
{{treeControl.isExpanded(node) ? 'expand_more' : 'chevron_right'}}
</mat-icon>
</button>
<li>{{node.name}}</li>
</mat-tree-node>
</mat-tree>
</div>
<input (click)="stopclose($event)" readonly autocomplete="off" [(ngModel)]="js" name="js"
(focus)="openorganizationbox()" placeholder="请填写">
<mat-checkbox color="primary" style="margin-left: 6px;" [(ngModel)]="jscheck" name="jscheck">包含下级
</mat-checkbox>
<div class="organizationbox" *ngIf="isorganizationbox">
<div (click)="closediv()" class="closediv">
<mat-icon>clear</mat-icon>
</div>
<mat-tree [dataSource]="dataSource" [treeControl]="treeControl">
<mat-tree-node *matTreeNodeDef="let node" matTreeNodePadding (click)='add(node)'
class="organizationlist">
<button type="button" mat-icon-button disabled></button>
<li>{{node.name}}</li>
</mat-tree-node>
<mat-tree-node *matTreeNodeDef="let node;when: hasChild" matTreeNodePadding (click)='add(node)'
class="organizationlist">
<button type="button" mat-icon-button matTreeNodeToggle
[attr.aria-label]="'toggle ' + node.name">
<mat-icon class="mat-icon-rtl-mirror">
{{treeControl.isExpanded(node) ? 'expand_more' : 'chevron_right'}}
</mat-icon>
</button>
<li>{{node.name}}</li>
</mat-tree-node>
</mat-tree>
</div>
<!-- <mat-form-field appearance="fill">
<mat-label>请选择</mat-label>
<mat-select [(ngModel)]="accound">
@ -46,14 +49,15 @@
</mat-option>
</mat-select>
</mat-form-field> -->
</div>
<div class="queryField">
<button style="background-color: #07CDCF;" (click)="findClick()">查询</button>
<button style="margin-left: 10px; background-color: #FF8678;" (click)="Reset()">重置</button>
<button style="background-color: #07CDCF;" (click)="findClick()">查询</button>
<button style="margin-left: 10px; background-color: #FF8678;" (click)="Reset()">重置</button>
</div>
<div class="queryField" style="margin-left: 620px;">
<button style="background-color: #07CDCF;" (click)="newExamination()"><img style="position: relative;top: 3px;" src="../../../assets/images/add.png"> 新增考题</button>
<button style="background-color: #07CDCF;" (click)="newExamination()"><img
style="position: relative;top: 3px;" src="../../../assets/images/add.png"> 新增考题</button>
</div>
</div>
</div>
@ -66,7 +70,7 @@
</table> -->
<table >
<table>
<thead>
<th style="width: 15%;">试卷名称</th>
<th style="width: 15%;">考核队站</th>
@ -82,21 +86,22 @@
<td>{{item.startTime|date:'yyyy-MM-dd HH:mm'}}</td>
<td>{{item.endTime|date:'yyyy-MM-dd HH:mm'}}</td>
<!-- <td [ngClass]="{'green': item.testState == '开考中','red':item.testState == '已结束'}">{{item.testState}}</td> -->
<td [ngClass]="{'green': item.status == '1','red':item.status == '2'}">{{item.status=="2"?"已结束":item.status=="0"?"未开考":"开考中"}}</td>
<td [ngClass]="{'green': item.status == '1','red':item.status == '2'}">
{{item.status == "2" ? "已结束" : item.status == "0" ? "未开考" : item.status == "-1" ? '未发布' : "开考中"}}</td>
<td>
<span style="color: #07CDCF;margin-right: 10px;cursor: pointer;" (click)="editPaper(item)">编辑</span>
<span style="color: #07CDCF;margin-right: 10px;cursor: pointer;"
(click)="editPaper(item)">编辑</span>
<span style="color: #07CDCF;cursor: pointer;" (click)="lookPaper(item)">详情</span>
<span *ngIf="item.status=='0'" style="color: #FF8678;margin-left: 10px;cursor: pointer;" (click)="deleteExam(item.id)">删除</span>
<span *ngIf="item.status=='0'" style="color: #FF8678;margin-left: 10px;cursor: pointer;"
(click)="deleteExam(item.id)">删除</span>
</td>
</tr>
</tbody>
</table>
<mat-paginator [length]="length"
[pageSize]="pageSize"
[pageSizeOptions]="pageSizeOptions"
(page)="chagePage($event)">
</mat-paginator>
<mat-paginator [length]="length" [pageSize]="pageSize" [pageSizeOptions]="pageSizeOptions"
(page)="chagePage($event)">
</mat-paginator>
</div>
</div>

2
src/app/examiner/examiner-index/examiner-index.component.ts

@ -354,7 +354,7 @@ export class FinishDia{
config.verticalPosition = 'top';
config.duration = 3000
if(this.startTime!=undefined&&this.endTime!=undefined&&this.examName!=undefined){
if(this.startTime>this.endTime){
if(this.startTime > this.endTime){
this.snackBar.open('开始时间不能大于结束时间','确定',config);
}
else{

2
src/app/ui/collection-tools-examinee/collection-tools.component.html

@ -62,7 +62,7 @@
<p style="font-size: 15px;">考试题目</p>
<nz-tree *ngIf="questionstreeData.length != 0" nzExpandAll #nzTreeComponent [nzData]="questionstreeData" nzBlockNode [nzTreeTemplate]="nzTreeTemplate"></nz-tree>
<ng-template #nzTreeTemplate let-node let-origin="origin">
<div id="terrNodePublic" (click)='selectanelPoint(node.origin,0)' [ngClass]="{'selectanelPoint': selectDisposalNode==node.origin.id}">
<div id="terrNodePublic" [ngClass]="{'selectanelPoint': selectDisposalNode==node.origin.id}">
<label title="{{node.title}}" class="overflowText textNode">{{node.title}}</label>
</div>
</ng-template>

4
src/app/ui/collection-tools-read/collection-tools.component.html

@ -8,9 +8,9 @@
</div>
</div>
<div class="headerRight" *ngIf="paperType == 0">
<button style="border: 1px solid #07CDCF; border-radius: 5px; margin: 0 15px;" (click)='lookAnswerDiv()'><mat-icon>visibility</mat-icon>
<!-- <button style="border: 1px solid #07CDCF; border-radius: 5px; margin: 0 15px;" (click)='lookAnswerDiv()'><mat-icon>visibility</mat-icon>
查看答案
</button>
</button> -->
<button (click)="score()"><mat-icon>description</mat-icon>评分</button>
<button (click)="submitScore()"><mat-icon>open_in_browser</mat-icon>提交</button>
</div>

3
src/app/ui/collection-tools-read/collection-tools.component.ts

@ -483,7 +483,6 @@ export class CollectionToolsReadComponent implements OnInit {
for(var j=0;j<a.length;j++)
{
if(a[j].id==b[i].id){
console.log('pppp')
a.splice(j,1);
j=j-1;
}
@ -491,6 +490,8 @@ export class CollectionToolsReadComponent implements OnInit {
}
return a;
}
console.log(111,this.allExaminationQuestions)
console.log(222,questionDataArr)
let arr = array_diff(this.allExaminationQuestions,questionDataArr)
let treeData = []

Loading…
Cancel
Save