|
@@ -2,22 +2,18 @@
|
|
|
<div>
|
|
|
<div class="tw-bg-white tw-p-5 tw-rounded-xl tw-mb-5">
|
|
|
<ProjectSelect
|
|
|
- disabled
|
|
|
- :project-id="projectId"
|
|
|
v-model:value="projectId"
|
|
|
- />
|
|
|
- <span class="tw-mr-4"></span>
|
|
|
- <CourseSelect
|
|
|
disabled
|
|
|
- :root-org-id="rootOrgId"
|
|
|
- v-model:value="courseId"
|
|
|
+ :projectId="projectId"
|
|
|
/>
|
|
|
<span class="tw-mr-4"></span>
|
|
|
- <PaperTypeSelect disabled v-model:value="paperType" />
|
|
|
+ <CourseSelect v-model:value="courseId" disabled :rootOrgId="rootOrgId" />
|
|
|
+ <span class="tw-mr-4"></span>
|
|
|
+ <PaperTypeSelect v-model:value="paperType" disabled />
|
|
|
<span class="tw-mr-4"></span>
|
|
|
试卷名称: <a-input disabled :value="paperName" style="width: 120px" />
|
|
|
<span class="tw-mr-4"></span>
|
|
|
- <a-button @click="search" class="query-btn">查询</a-button>
|
|
|
+ <a-button class="query-btn" @click="search">查询</a-button>
|
|
|
|
|
|
<div class="tw-float-right">
|
|
|
<a-button @click="goBack">返回</a-button>
|
|
@@ -42,13 +38,13 @@
|
|
|
</div>
|
|
|
<div v-if="activeTab === '3'">
|
|
|
<QuestionTypeDifficulty
|
|
|
- :project-id="projectId"
|
|
|
+ :projectId="projectId"
|
|
|
:questions="paperQuestionGroups"
|
|
|
/>
|
|
|
</div>
|
|
|
<div v-if="activeTab === '4'">
|
|
|
<QuestionTypeDiscrimination
|
|
|
- :project-id="projectId"
|
|
|
+ :projectId="projectId"
|
|
|
:questions="paperQuestionGroups"
|
|
|
/>
|
|
|
</div>
|
|
@@ -56,10 +52,10 @@
|
|
|
<QuestionDifficultyGroup
|
|
|
:questions="paperQuestions"
|
|
|
:totalScore="paper.totalScore"
|
|
|
- :project-id="projectId"
|
|
|
+ :projectId="projectId"
|
|
|
:courseId="courseId"
|
|
|
:paperId="paperId"
|
|
|
- :range-config="paper.difficulityRangeConfig"
|
|
|
+ :rangeConfig="paper.difficulityRangeConfig"
|
|
|
/>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -69,7 +65,7 @@
|
|
|
<script setup lang="ts">
|
|
|
import { useMainStore } from "@/store";
|
|
|
import { goBack } from "@/utils/utils";
|
|
|
-import { watch, onMounted, ref, toRaw } from "vue";
|
|
|
+import { watch, onMounted } from "vue";
|
|
|
import { useRoute } from "vue-router";
|
|
|
import ProjectSelect from "@/components/ProjectSelect.vue";
|
|
|
import {
|
|
@@ -83,6 +79,7 @@ import QuestionAttr from "./QuestionAttr.vue";
|
|
|
import QuestionDifficultyGroup from "./QuestionDifficultyGroup.vue";
|
|
|
import QuestionTypeDifficulty from "./QuestionTypeDifficulty.vue";
|
|
|
import QuestionTypeDiscrimination from "./QuestionTypeDiscrimination.vue";
|
|
|
+import { Paper, SASQuestion, SASQuestionGroup } from "@/types";
|
|
|
|
|
|
const store = useMainStore();
|
|
|
store.currentLocation = "项目管理 / 项目列表 / 试卷分析";
|
|
@@ -97,13 +94,13 @@ const route = useRoute();
|
|
|
const projectId = +route.params.projectId;
|
|
|
const paperId = +route.params.paperId;
|
|
|
|
|
|
-let paper = $ref({});
|
|
|
+let paper = $ref<Paper>({} as Paper);
|
|
|
let pageSize = $ref(10);
|
|
|
let pageNo = $ref(1);
|
|
|
|
|
|
-let paperQuestions = $ref([]);
|
|
|
-let paperQuestionGroups = $ref([]);
|
|
|
-let sasPaper = $ref({});
|
|
|
+let paperQuestions = $ref<SASQuestion[]>([]);
|
|
|
+let paperQuestionGroups = $ref<SASQuestionGroup[]>([]);
|
|
|
+// let sasPaper = $ref<SASPaper>({} as SASPaper);
|
|
|
|
|
|
async function search() {
|
|
|
pageNo = 1;
|
|
@@ -122,8 +119,12 @@ async function fetchData() {
|
|
|
|
|
|
const res2 = await getPaperQuestions(paperId);
|
|
|
res2.data = res2.data.map((q) => {
|
|
|
- q.difficulityLevel = JSON.parse(q.difficulityLevel || "[]");
|
|
|
- q.difficulityGroupLevel = JSON.parse(q.difficulityGroupLevel || "[]");
|
|
|
+ q.difficulityLevel = JSON.parse(
|
|
|
+ <string>(<unknown>q.difficulityLevel) || "[]"
|
|
|
+ );
|
|
|
+ q.difficulityGroupLevel = JSON.parse(
|
|
|
+ <string>(<unknown>q.difficulityGroupLevel) || "[]"
|
|
|
+ );
|
|
|
q.avgScore = Math.round(q.avgScore * 100) / 100;
|
|
|
q.stdev = Math.round(q.stdev * 100) / 100;
|
|
|
q.coefficient = Math.round(q.coefficient * 100) / 100;
|
|
@@ -134,20 +135,26 @@ async function fetchData() {
|
|
|
paperQuestions = res2.data;
|
|
|
|
|
|
const res4 = await getSasPaper(paperId);
|
|
|
- res4.data.difficulityLevel = JSON.parse(res4.data.difficulityLevel || "[]");
|
|
|
+ res4.data.difficulityLevel = JSON.parse(
|
|
|
+ <string>(<unknown>res4.data.difficulityLevel) || "[]"
|
|
|
+ );
|
|
|
res4.data.discriminationLevel = JSON.parse(
|
|
|
- res4.data.discriminationLevel || "[]"
|
|
|
+ <string>(<unknown>res4.data.discriminationLevel) || "[]"
|
|
|
);
|
|
|
- // console.log(res4.data);
|
|
|
- sasPaper = res4.data;
|
|
|
+ // // console.log(res4.data);
|
|
|
+ // sasPaper = res4.data;
|
|
|
|
|
|
const res3 = await getPaperQuestionGroups(projectId, paperId);
|
|
|
res3.data = res3.data.map((q) => {
|
|
|
- q.difficulityLevel = JSON.parse(q.difficulityLevel || "[]");
|
|
|
- q.discriminationLevel = JSON.parse(q.discriminationLevel || "[]");
|
|
|
+ q.difficulityLevel = JSON.parse(
|
|
|
+ <string>(<unknown>q.difficulityLevel) || "[]"
|
|
|
+ );
|
|
|
+ q.discriminationLevel = JSON.parse(
|
|
|
+ <string>(<unknown>q.discriminationLevel) || "[]"
|
|
|
+ );
|
|
|
return q;
|
|
|
});
|
|
|
- res3.data.push(res4.data);
|
|
|
+ res3.data.push(<SASQuestionGroup>(<unknown>res4.data));
|
|
|
paperQuestionGroups = res3.data;
|
|
|
}
|
|
|
|