Commit b918afe9 authored by JinWei's avatar JinWei

Merge branch 'feature/jj_exam' into 'master'

fix: 修复构建慢的问题

See merge request !3
parents acb35551 5e998af5
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -11,6 +11,10 @@ ...@@ -11,6 +11,10 @@
"e2e": "ng e2e" "e2e": "ng e2e"
}, },
"private": true, "private": true,
"engines": {
"node": ">=12.0.0 <13.0.0",
"npm": ">=6.0.0 <7.0.0"
},
"dependencies": { "dependencies": {
"@angular/animations": "~9.0.2", "@angular/animations": "~9.0.2",
"@angular/common": "~9.0.2", "@angular/common": "~9.0.2",
...@@ -28,11 +32,12 @@ ...@@ -28,11 +32,12 @@
"ali-oss": "^6.5.1", "ali-oss": "^6.5.1",
"compressing": "^1.5.0", "compressing": "^1.5.0",
"ng-zorro-antd": "^8.5.2", "ng-zorro-antd": "^8.5.2",
"node-sass": "4.0.0",
"rxjs": "~6.5.4", "rxjs": "~6.5.4",
"spark-md5": "^3.0.0", "spark-md5": "^3.0.0",
"tslib": "^1.10.0", "tslib": "^1.10.0",
"zone.js": "~0.10.2" "zone.js": "~0.10.2",
"querystring": "^0.2.0",
"crypto-js": "^4.1.1"
}, },
"devDependencies": { "devDependencies": {
"@angular-devkit/build-angular": "~0.900.3", "@angular-devkit/build-angular": "~0.900.3",
...@@ -51,7 +56,6 @@ ...@@ -51,7 +56,6 @@
"karma-jasmine": "~2.0.1", "karma-jasmine": "~2.0.1",
"karma-jasmine-html-reporter": "^1.4.2", "karma-jasmine-html-reporter": "^1.4.2",
"protractor": "~5.4.3", "protractor": "~5.4.3",
"querystring": "^0.2.1",
"ts-node": "~8.3.0", "ts-node": "~8.3.0",
"tslint": "~5.18.0", "tslint": "~5.18.0",
"typescript": "~3.7.5" "typescript": "~3.7.5"
......
...@@ -47,8 +47,11 @@ ...@@ -47,8 +47,11 @@
<!-- 题目头部 --> <!-- 题目头部 -->
<div style="display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; padding-bottom: 15px; border-bottom: 1px solid #eee;"> <div style="display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; padding-bottom: 15px; border-bottom: 1px solid #eee;">
<h3 style="margin: 0; color: #333;">第 {{i+1}} 题</h3> <h3 style="margin: 0; color: #333;">第 {{i+1}} 题</h3>
<div style="display: flex; gap: 8px;">
<button nz-button (click)="copyQuestion(i)">复制题目</button>
<button nz-button nzType="danger" (click)="deleteQuestion(i)">删除题目</button> <button nz-button nzType="danger" (click)="deleteQuestion(i)">删除题目</button>
</div> </div>
</div>
<!-- 题目图片 --> <!-- 题目图片 -->
<div style="margin-bottom: 15px; display: flex; align-items: flex-start; gap: 15px;"> <div style="margin-bottom: 15px; display: flex; align-items: flex-start; gap: 15px;">
......
...@@ -65,10 +65,12 @@ export class FormComponent extends ComponentBase implements OnInit, OnChanges, O ...@@ -65,10 +65,12 @@ export class FormComponent extends ComponentBase implements OnInit, OnChanges, O
if (!this.item.questionArr) { if (!this.item.questionArr) {
this.item.questionArr = []; this.item.questionArr = [];
} }
const defaultOptions = [{}, {}];
this.syncOptionKeys(defaultOptions);
this.item.questionArr.push({ this.item.questionArr.push({
text: "", text: "",
correctIndex: null, correctIndex: 0,
optionArr: [] optionArr: defaultOptions
}); });
this.save(); this.save();
} }
...@@ -78,6 +80,12 @@ export class FormComponent extends ComponentBase implements OnInit, OnChanges, O ...@@ -78,6 +80,12 @@ export class FormComponent extends ComponentBase implements OnInit, OnChanges, O
this.save(); this.save();
} }
copyQuestion(i: number) {
const copy = JSON.parse(JSON.stringify(this.item.questionArr[i]));
this.item.questionArr.push(copy);
this.save();
}
onCorrectAnswerChange(question: any, index: number) { onCorrectAnswerChange(question: any, index: number) {
question.correctIndex = index; question.correctIndex = index;
this.save(); this.save();
......
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