|
@@ -2,28 +2,23 @@
|
|
|
<div class="mark-param-group">
|
|
|
<div class="box-justify part-box part-box-pad">
|
|
|
<div>
|
|
|
- <p class="tips-info">
|
|
|
- 1.如果采用整卷批阅,请将全部主观题选上。如果采用分题阅卷,请将需要在一个评阅任务里评阅的题目勾选在一起;
|
|
|
+ <p v-if="unsetQuestionNos.length" class="tips-info tips-error">
|
|
|
+ 试题{{
|
|
|
+ unsetQuestionNos.join(",")
|
|
|
+ }}未设置评卷员,请点击列表里设置评卷员选择评卷员
|
|
|
</p>
|
|
|
- <p class="tips-info">
|
|
|
- 2.如果采用分班阅卷,每个班都将按设置的评卷任务进行评卷,请给每个班级选择对应评卷老师;
|
|
|
- </p>
|
|
|
- <p class="tips-info tips-error">3.开始阅卷后不允许删除评卷分组!</p>
|
|
|
</div>
|
|
|
<div>
|
|
|
- <el-switch
|
|
|
- v-if="checkPrivilege('button', 'OpenClassReading', 'MarkSetting')"
|
|
|
- v-model="markClassIsOpen"
|
|
|
- active-text="分班阅卷"
|
|
|
- @change="markClassChange"
|
|
|
- ></el-switch>
|
|
|
- <el-button class="ml-2" type="primary" @click="toAdd">新增</el-button>
|
|
|
+ <el-button type="primary" @click="toPrev">上一步</el-button>
|
|
|
+ <el-button type="primary" @click="toNext">下一步</el-button>
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
<div class="part-box part-box-pad">
|
|
|
- <el-table :data="groupList" border>
|
|
|
- <el-table-column type="index" width="50"> </el-table-column>
|
|
|
+ <el-table :data="subjectiveTaskList" border>
|
|
|
+ <el-table-column label="大题名称" prop="mainTitle"> </el-table-column>
|
|
|
+ <el-table-column label="大题号" prop="mainNumber"> </el-table-column>
|
|
|
+ <el-table-column label="小题号" prop="subNumber"> </el-table-column>
|
|
|
<el-table-column label="评卷员">
|
|
|
<template slot-scope="scope">
|
|
|
<el-tag
|
|
@@ -31,9 +26,15 @@
|
|
|
:key="user.id"
|
|
|
class="tag-spin tag-wrap"
|
|
|
size="medium"
|
|
|
+ effect="dark"
|
|
|
+ closable
|
|
|
+ @close="toDeleteMarker(scope.row, user)"
|
|
|
>
|
|
|
{{ user.name }}({{ user.loginName }})
|
|
|
</el-tag>
|
|
|
+ <el-button type="text" @click="toSetMarker(scope.row)">
|
|
|
+ 设置评卷员
|
|
|
+ </el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column label="评卷方式" width="100">
|
|
@@ -56,11 +57,6 @@
|
|
|
{{ scope.row.doubleRate }}%
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="评阅题目">
|
|
|
- <template slot-scope="scope">
|
|
|
- {{ scope.row.questions | questionsFilter }}
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
<el-table-column label="评卷区" width="80" align="center">
|
|
|
<template slot-scope="scope">
|
|
|
<i
|
|
@@ -74,8 +70,8 @@
|
|
|
<el-button
|
|
|
class="btn-primary"
|
|
|
type="text"
|
|
|
- @click="toEdit(scope.row)"
|
|
|
- >编辑</el-button
|
|
|
+ @click="toSetMarkType(scope.row)"
|
|
|
+ >评卷方式设置</el-button
|
|
|
>
|
|
|
<el-button
|
|
|
class="btn-primary"
|
|
@@ -84,35 +80,30 @@
|
|
|
@click="toSetArea(scope.row)"
|
|
|
>评卷区</el-button
|
|
|
>
|
|
|
- <el-button
|
|
|
- class="btn-danger"
|
|
|
- type="text"
|
|
|
- @click="toDelete(scope.row)"
|
|
|
- >删除</el-button
|
|
|
- >
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
- <p v-if="unsetQuestionNos.length" class="tips-info tips-error">
|
|
|
- 未设置试题:{{ unsetQuestionNos.join(",") }}
|
|
|
- </p>
|
|
|
</div>
|
|
|
|
|
|
- <!-- ModifyMarkGroup -->
|
|
|
- <modify-mark-group
|
|
|
- ref="ModifyMarkGroup"
|
|
|
+ <!-- ModifyMarkType -->
|
|
|
+ <modify-mark-type
|
|
|
+ ref="ModifyMarkType"
|
|
|
+ :instance="curRow"
|
|
|
+ @modified="markTypeModified"
|
|
|
+ ></modify-mark-type>
|
|
|
+ <!-- ModifyMarkMarker -->
|
|
|
+ <modify-mark-marker
|
|
|
+ ref="ModifyMarkMarker"
|
|
|
+ :instance="curRow"
|
|
|
:course-id="basicInfo.courseId"
|
|
|
- :instance="curGroupInfo"
|
|
|
- :disabled-question-nos="disabledQuestionNos"
|
|
|
- :paper-structure="subjectiveQuestionList"
|
|
|
- @modified="groupModified"
|
|
|
- @cancel="updateDisableQuestionNos"
|
|
|
- ></modify-mark-group>
|
|
|
+ :question-list="curRowQuestions"
|
|
|
+ @modified="markMarkerModified"
|
|
|
+ ></modify-mark-marker>
|
|
|
<!-- ModifyMarkArea -->
|
|
|
<modify-mark-area
|
|
|
ref="ModifyMarkArea"
|
|
|
:base-info="basicInfo"
|
|
|
- :group="curGroupInfo"
|
|
|
+ :group="curRow"
|
|
|
:paper-list="paperList"
|
|
|
@modified="areaModified"
|
|
|
></modify-mark-area>
|
|
@@ -121,41 +112,33 @@
|
|
|
|
|
|
<script>
|
|
|
import { mapState, mapMutations } from "vuex";
|
|
|
-import ModifyMarkGroup from "./ModifyMarkGroup.vue";
|
|
|
+import ModifyMarkType from "./ModifyMarkType.vue";
|
|
|
import ModifyMarkArea from "./ModifyMarkArea.vue";
|
|
|
+import ModifyMarkMarker from "./ModifyMarkMarker.vue";
|
|
|
+
|
|
|
import {
|
|
|
examStructureFindJpg,
|
|
|
- markGroupItemSave,
|
|
|
- markGroupItemUpdate,
|
|
|
- markGroupItemDelete,
|
|
|
- markGroupAreaSave,
|
|
|
- markClassStatusUpdate,
|
|
|
+ markSubjectiveBindMarker,
|
|
|
+ markSubjectiveUpdateMarkType,
|
|
|
+ markSubjectiveUpdateMarkArea,
|
|
|
} from "../../api";
|
|
|
import { cardDetail } from "../../../card/api";
|
|
|
-import { deepCopy, maxNum } from "@/plugins/utils";
|
|
|
import { SCORE_POLICY_TYPE } from "@/constants/enumerate";
|
|
|
-import { omit, pick } from "lodash";
|
|
|
|
|
|
export default {
|
|
|
name: "mark-param-group",
|
|
|
components: {
|
|
|
- ModifyMarkGroup,
|
|
|
+ ModifyMarkType,
|
|
|
ModifyMarkArea,
|
|
|
+ ModifyMarkMarker,
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
- markClassIsOpen: false,
|
|
|
SCORE_POLICY_TYPE,
|
|
|
questionCount: 0,
|
|
|
- groupQuestionCount: 0,
|
|
|
- groupList: [],
|
|
|
- fullDisabledQuestionNos: [],
|
|
|
- disabledQuestionNos: [],
|
|
|
- unsetQuestionNos: [],
|
|
|
- curGroupInfo: {},
|
|
|
+ curRow: {},
|
|
|
subjectiveQuestionList: [],
|
|
|
- subjectiveQuestionCount: 0,
|
|
|
- objectiveQuestionCount: 0,
|
|
|
+ curRowQuestions: [],
|
|
|
MARK_TYPE: {
|
|
|
0: "单评",
|
|
|
1: "双评",
|
|
@@ -170,24 +153,20 @@ export default {
|
|
|
...mapState("markParam", [
|
|
|
"basicInfo",
|
|
|
"paperStructureInfo",
|
|
|
- "openMarkClass",
|
|
|
- "groupInfo",
|
|
|
+ "openMergeMarker",
|
|
|
+ "subjectiveTaskList",
|
|
|
]),
|
|
|
},
|
|
|
- filters: {
|
|
|
- questionsFilter(val) {
|
|
|
- return val
|
|
|
- .map((item) => `${item.mainNumber}-${item.subNumber}`)
|
|
|
- .join(",");
|
|
|
- },
|
|
|
- },
|
|
|
mounted() {
|
|
|
this.initData();
|
|
|
this.getPaperList();
|
|
|
this.getCardPages();
|
|
|
},
|
|
|
methods: {
|
|
|
- ...mapMutations("markParam", ["setGroupInfo", "setOpenMarkClass"]),
|
|
|
+ ...mapMutations("markParam", [
|
|
|
+ "setSubjectiveTaskList",
|
|
|
+ "updateSubjectiveTaskItem",
|
|
|
+ ]),
|
|
|
async getPaperList() {
|
|
|
this.paperList = [];
|
|
|
const data = await examStructureFindJpg({
|
|
@@ -211,10 +190,6 @@ export default {
|
|
|
this.cardPages = cardContent.pages;
|
|
|
},
|
|
|
initData() {
|
|
|
- this.markClassIsOpen = this.openMarkClass;
|
|
|
- this.groupList = this.groupInfo.map((item) => {
|
|
|
- return { ...deepCopy(item), id: this.$randomCode() };
|
|
|
- });
|
|
|
this.questionCount = this.paperStructureInfo.length;
|
|
|
this.subjectiveQuestionList = this.paperStructureInfo
|
|
|
.filter((item) => !item.objective)
|
|
@@ -227,115 +202,82 @@ export default {
|
|
|
this.subjectiveQuestionCount = this.subjectiveQuestionList.length;
|
|
|
this.objectiveQuestionCount =
|
|
|
this.questionCount - this.subjectiveQuestionCount;
|
|
|
- this.updateDisableQuestionNos();
|
|
|
|
|
|
this.dataReady = true;
|
|
|
},
|
|
|
- updateDisableQuestionNos(filterId) {
|
|
|
- let groupList = this.groupList;
|
|
|
- if (filterId)
|
|
|
- groupList = groupList.filter((item) => item.id !== filterId);
|
|
|
- let disabledQuestionNos = [];
|
|
|
- groupList.forEach((item) => {
|
|
|
- disabledQuestionNos = [
|
|
|
- ...disabledQuestionNos,
|
|
|
- ...item.questions.map(
|
|
|
- (item) => `${item.mainNumber}-${item.subNumber}`
|
|
|
- ),
|
|
|
- ];
|
|
|
- });
|
|
|
- this.disabledQuestionNos = disabledQuestionNos;
|
|
|
- if (!filterId) {
|
|
|
- this.groupQuestionCount = disabledQuestionNos.length;
|
|
|
- this.fullDisabledQuestionNos = [...disabledQuestionNos];
|
|
|
- }
|
|
|
- this.updateUnsetQuestionNos();
|
|
|
- },
|
|
|
- updateUnsetQuestionNos() {
|
|
|
- this.unsetQuestionNos = this.subjectiveQuestionList
|
|
|
- .filter((q) => !this.fullDisabledQuestionNos.includes(q.qno))
|
|
|
- .map((q) => q.qno);
|
|
|
+ toSetMarker(row) {
|
|
|
+ this.curRow = row;
|
|
|
+ this.curRowQuestions = [
|
|
|
+ {
|
|
|
+ mainNumber: row.mainNumber,
|
|
|
+ subNumber: row.subNumber,
|
|
|
+ },
|
|
|
+ ];
|
|
|
+ this.$refs.ModifyMarkMarker.open();
|
|
|
},
|
|
|
- toAdd() {
|
|
|
- this.updateDisableQuestionNos();
|
|
|
- if (this.groupQuestionCount === this.subjectiveQuestionCount) {
|
|
|
- this.$message.error("当前已经没有主观题目可供设置!");
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
- this.curGroupInfo = {
|
|
|
- id: this.$randomCode(),
|
|
|
- groupNumber: maxNum(this.groupList.map((item) => item.groupNumber)) + 1,
|
|
|
- doubleEnable: false,
|
|
|
- doubleRate: 100,
|
|
|
- arbitrateThreshold: 1,
|
|
|
- scorePolicy: "AVG",
|
|
|
- markers: [],
|
|
|
- pictureConfigs: [],
|
|
|
- questions: [],
|
|
|
- isNew: true,
|
|
|
+ async markMarkerModified(row) {
|
|
|
+ const datas = {
|
|
|
+ questionId: row.questionId,
|
|
|
+ markers: row.markers,
|
|
|
};
|
|
|
- this.$refs.ModifyMarkGroup.open();
|
|
|
- },
|
|
|
- toEdit(row) {
|
|
|
- this.curGroupInfo = row;
|
|
|
- this.updateDisableQuestionNos(row.id);
|
|
|
- this.$refs.ModifyMarkGroup.open();
|
|
|
+ await markSubjectiveBindMarker({
|
|
|
+ examId: this.basicInfo.examId,
|
|
|
+ paperNumber: this.basicInfo.paperNumber,
|
|
|
+ ...datas,
|
|
|
+ });
|
|
|
+ this.updateSubjectiveTaskItem(datas);
|
|
|
},
|
|
|
toSetArea(row) {
|
|
|
- this.curGroupInfo = row;
|
|
|
+ this.curRow = row;
|
|
|
this.$refs.ModifyMarkArea.open();
|
|
|
},
|
|
|
- async toDelete(row) {
|
|
|
- if (this.deleting) return;
|
|
|
-
|
|
|
- const confirm = await this.$confirm(
|
|
|
- `删除分组会清理评卷任务,确定要删除当前分组吗?`,
|
|
|
- "提示",
|
|
|
- {
|
|
|
- type: "warning",
|
|
|
- }
|
|
|
- ).catch(() => {});
|
|
|
+ async areaModified(row) {
|
|
|
+ const pos = this.subjectiveTaskList.findIndex(
|
|
|
+ (item) => item.questionId === row.questionId
|
|
|
+ );
|
|
|
+ if (pos === -1) return;
|
|
|
+ const datas = {
|
|
|
+ questionId: row.questionId,
|
|
|
+ pictureConfigs: row.pictureConfigs,
|
|
|
+ };
|
|
|
+ await markSubjectiveUpdateMarkArea(datas);
|
|
|
+ this.updateSubjectiveTaskItem(datas);
|
|
|
+ },
|
|
|
+ async toDeleteMarker(row, marker) {
|
|
|
+ const confirm = await this.$confirm(`确定要删除当前评卷员吗?`, "提示", {
|
|
|
+ type: "warning",
|
|
|
+ }).catch(() => {});
|
|
|
if (confirm !== "confirm") return;
|
|
|
|
|
|
- this.deleting = true;
|
|
|
- const res = await markGroupItemDelete({
|
|
|
+ const markers = row.markers.filter((item) => item.id !== marker.id);
|
|
|
+ const datas = {
|
|
|
+ questionId: row.questionId,
|
|
|
+ markers,
|
|
|
+ };
|
|
|
+ await markSubjectiveBindMarker({
|
|
|
examId: this.basicInfo.examId,
|
|
|
paperNumber: this.basicInfo.paperNumber,
|
|
|
- groupNumber: row.groupNumber,
|
|
|
- }).catch(() => {});
|
|
|
- this.deleting = false;
|
|
|
- if (!res) return;
|
|
|
-
|
|
|
- const pos = this.groupList.findIndex((item) => item.id === row.id);
|
|
|
- this.groupList.splice(pos, 1);
|
|
|
- this.updateDisableQuestionNos();
|
|
|
- this.updateData();
|
|
|
+ ...datas,
|
|
|
+ });
|
|
|
+ this.updateSubjectiveTaskItem(datas);
|
|
|
},
|
|
|
- async groupModified(row) {
|
|
|
- const pos = this.groupList.findIndex((item) => item.id === row.id);
|
|
|
- if (!row.pictureConfigs.length) {
|
|
|
- row.pictureConfigs = this.autoParsePictureConfigList(row.questions);
|
|
|
- }
|
|
|
-
|
|
|
- const data = await this.updateMarkGroup(row, pos === -1);
|
|
|
- row.pictureConfigs = data.pictureConfigList;
|
|
|
- if (pos === -1) {
|
|
|
- this.groupList.push(row);
|
|
|
- } else {
|
|
|
- this.groupList.splice(pos, 1, row);
|
|
|
- }
|
|
|
- this.updateDisableQuestionNos();
|
|
|
- this.updateData();
|
|
|
+ toSetMarkType(row) {
|
|
|
+ console.log(row);
|
|
|
},
|
|
|
- async updateMarkGroup(row, isAdd) {
|
|
|
- const data = {
|
|
|
- examId: this.basicInfo.examId,
|
|
|
- paperNumber: this.basicInfo.paperNumber,
|
|
|
- groupInfo: omit(row, ["id"]),
|
|
|
+ async markTypeModified(row) {
|
|
|
+ const pos = this.subjectiveTaskList.findIndex(
|
|
|
+ (item) => item.questionId === row.questionId
|
|
|
+ );
|
|
|
+ if (pos === -1) return;
|
|
|
+ const datas = {
|
|
|
+ questionId: row.questionId,
|
|
|
+ doubleEnable: row.doubleEnable,
|
|
|
+ doubleRate: row.doubleRate,
|
|
|
+ arbitrateThreshold: row.arbitrateThreshold,
|
|
|
+ scorePolicy: row.scorePolicy,
|
|
|
};
|
|
|
- const updateApi = isAdd ? markGroupItemSave : markGroupItemUpdate;
|
|
|
- return await updateApi(data);
|
|
|
+ await markSubjectiveUpdateMarkType(datas);
|
|
|
+ this.updateSubjectiveTaskItem(datas);
|
|
|
},
|
|
|
autoParsePictureConfigList(questions) {
|
|
|
if (!questions.length) return [];
|
|
@@ -410,75 +352,11 @@ export default {
|
|
|
// console.log(combinePictureConfigList);
|
|
|
return combinePictureConfigList;
|
|
|
},
|
|
|
- async areaModified(row) {
|
|
|
- const pos = this.groupList.findIndex((item) => item.id === row.id);
|
|
|
- if (pos === -1) return;
|
|
|
-
|
|
|
- await markGroupAreaSave({
|
|
|
- examId: this.basicInfo.examId,
|
|
|
- paperNumber: this.basicInfo.paperNumber,
|
|
|
- groupNumber: row.groupNumber,
|
|
|
- pictureConfigs: row.pictureConfigs,
|
|
|
- });
|
|
|
- this.groupList.splice(pos, 1, row);
|
|
|
- this.updateData();
|
|
|
- },
|
|
|
- async markClassChange() {
|
|
|
- const name = this.markClassIsOpen ? "开启" : "取消";
|
|
|
- const confirm = await this.$confirm(`确定要${name}分班阅卷吗?`, "提示", {
|
|
|
- type: "warning",
|
|
|
- }).catch(() => {});
|
|
|
- if (confirm !== "confirm") {
|
|
|
- this.markClassIsOpen = !this.markClassIsOpen;
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
- const res = await markClassStatusUpdate({
|
|
|
- examId: this.basicInfo.examId,
|
|
|
- paperNumber: this.basicInfo.paperNumber,
|
|
|
- openMarkClass: this.markClassIsOpen,
|
|
|
- }).catch(() => {
|
|
|
- this.markClassIsOpen = !this.markClassIsOpen;
|
|
|
- });
|
|
|
- if (!res) return;
|
|
|
- this.setOpenMarkClass(this.markClassIsOpen);
|
|
|
- },
|
|
|
- checkData() {
|
|
|
- let errorMessages = [];
|
|
|
-
|
|
|
- if (this.subjectiveQuestionCount > this.groupQuestionCount) {
|
|
|
- errorMessages.push("当前还有题目未设置分组");
|
|
|
- }
|
|
|
-
|
|
|
- this.groupList.forEach((item, index) => {
|
|
|
- if (item.doubleRate === 1 && !item.arbitrateThreshold) {
|
|
|
- errorMessages.push(`序号${index + 1}设置中,仲裁阀值不能为空`);
|
|
|
- }
|
|
|
- });
|
|
|
-
|
|
|
- if (errorMessages.length) {
|
|
|
- this.$message.error(errorMessages.join("。"));
|
|
|
- return;
|
|
|
- }
|
|
|
- },
|
|
|
- getData() {
|
|
|
- return this.groupList.map((item) => {
|
|
|
- const group = omit(item, ["id"]);
|
|
|
- group.questions = group.questions.map((item) =>
|
|
|
- pick(item, [
|
|
|
- "id",
|
|
|
- "mainNumber",
|
|
|
- "mainTitle",
|
|
|
- "subNumber",
|
|
|
- "questionType",
|
|
|
- "qno",
|
|
|
- ])
|
|
|
- );
|
|
|
- return group;
|
|
|
- });
|
|
|
+ toPrev() {
|
|
|
+ this.$emit("prev");
|
|
|
},
|
|
|
- updateData() {
|
|
|
- this.setGroupInfo(this.getData());
|
|
|
+ toNext() {
|
|
|
+ this.$emit("next");
|
|
|
},
|
|
|
},
|
|
|
};
|