| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644 |
- <template>
- <div class="scroll_content">
- <div class="select_box">
- <el-radio-group v-model="errorType" size="medium" @change="_queryStudentErrorQuestion">
- <el-radio-button :label="-1">全部试题({{ allErrorCount }})</el-radio-button>
- <el-radio-button :label="0">未掌握({{ unMasterCount }})</el-radio-button>
- <el-radio-button :label="1">已掌握({{ masterCount }})</el-radio-button>
- <el-radio-button :label="2">复习题({{ reviewCount }})</el-radio-button>
- </el-radio-group>
- </div>
- <div class="content">
- <div class="right_btn" v-if="errorType !== 1">
- <el-button size="medium" @click="downloadDialogVisible = true; isVariation = 0">下载错题本</el-button>
- <el-button type="primary" size="medium"
- @click="downloadDialogVisible = true; isVariation = 1">下载个性化提升手册</el-button>
- </div>
- <Download :visible.sync="downloadDialogVisible" :examId="examId" :subjectCode="subjectCode"
- :isVariation="isVariation" />
- <template v-if="questionList.length > 0">
- <div v-for="(question, index) in questionList" :key="question.questionId">
- <div class="question_card">
- <div class="card_top">
- <div class="card_top_info">
- <div class="left">
- <span class="number mr_10">{{ countGlobalIndex(index + 1) }}</span>
- <span class="gray">试题类型:</span>
- <span class="black mr_10">{{ question.questionType }}</span>
- <span class="tag" v-if="question.classScoreRate < 40">高频错题</span>
- </div>
- </div>
- <div class="question_content line_height_20" v-if="question.sourceType === 1"
- v-html="question.questionData.questionStem"></div>
- <div class="question_content" v-if="question.sourceType === 2">
- <img :src="question.questionImg" alt="" width="100%">
- </div>
- <div class="card_footer">
- <div class="footer_item">
- <span class="gray">满分:</span>
- <span class="blue">{{ question.fullScore }}</span>
- <span class="gray">分</span>
- </div>
- <div class="footer_item">
- <span class="gray">我的得分:</span>
- <span class="blue">{{ question.score }}</span>
- <span class="gray">分</span>
- </div>
- <div class="footer_item">
- <span class="gray">难度:</span>
- <span style="font-weight: bold;" :class="countDiffcutyClass(question.difficulty)">
- {{ question.difficulty }}
- </span>
- </div>
- </div>
- </div>
- <div class="card_buttom">
- <div class="btn_box">
- <span class="black" :class="{ blue: question.answerShow }" size="small"
- @click="ShowAnserAndParse(1, question);">
- <i class="iconfont icon_daan"></i>
- 我的答案
- <i class="answerShow_content" v-if="question.answerShow && !question.parseShow"></i>
- </span>
- <span class="black" :class="{ blue: question.parseShow }" size="small"
- @click="ShowAnserAndParse(2, question);">
- <i class="iconfont icon_jiexi"></i>
- 查看解析
- <i class="parseShow_content" v-if="question.parseShow && !question.answerShow"></i>
- </span>
- <template v-if="question.errorStatus === 0">
- <template v-if="errorType === -1 || errorType === 0">
- <span class="black" size="small"
- @click="_markStudentErrorQuestion(question, 1)">
- <i class="iconfont icon_biaojiyizhangwo"></i>
- 标记为已掌握
- </span>
- <span class="black" size="small"
- @click="_markStudentErrorQuestion(question, 2)">
- <i class="iconfont icon_jiarufuxiben"></i>
- 加入复习本
- </span>
- </template>
- </template>
- <template v-if="errorType === 1 || question.errorStatus === 1">
- <span class="black" size="small" @click="_markStudentErrorQuestion(question, 0)">
- <i class="iconfont icon_biaojiweizhangwo"></i>
- 标记为未掌握
- </span>
- </template>
- <template v-if="errorType === 2 || question.errorStatus === 2">
- <span class="black" size="small" @click="_markStudentErrorQuestion(question, 0)">
- <i class="iconfont icon_yichufuxiben"></i>
- 移除复习本
- </span>
- </template>
- </div>
- <div class="content" v-if="question.parseShow && !question.answerShow">
- <div class="flex">
- <div class="flex_left" style="line-height: 28px;">知识点:</div>
- <div class="flex_right">
- <template v-if="question.knowledgePoint && question.knowledgePoint.length > 0">
- <KnowledgePoint v-for="(know, index) in question.knowledgePoint"
- :key="index" :text="know" />
- </template>
- </div>
- </div>
- <div class="flex">
- <div class="flex_left">答 案:</div>
- <div class="flex_right">
- <div v-if="question.sourceType === 1" v-html="question.questionData.answer">
- </div>
- <div v-if="question.sourceType === 2">
- <img :src="question.answerImg" alt="" width="100%" />
- </div>
- </div>
- </div>
- <div class="flex">
- <div class="flex_left">解 析:</div>
- <div class="flex_right">
- <div style="line-height: 1.5;" v-show="question.sourceType === 1"
- v-html="question.questionData.analysis">
- </div>
- <div v-if="question.sourceType === 2">
- <img :src="question.parseImg" alt="" width="100%" />
- </div>
- </div>
- </div>
- </div>
- <div class="content" v-if="question.answerShow && !question.parseShow">
- <div class="content_inner" v-if="question.sourceType === 1"
- v-html="question.studentAnswer"></div>
- <div class="content_inner" v-if="question.sourceType === 2">
- <img :src="question.studentAnswerImg" alt="" width="100%" />
- </div>
- </div>
- </div>
- </div>
- <!-- 变式题推送 -->
- <div class="question_card" v-if="question.variationQuestion">
- <div class="card_top">
- <div class="card_top_info">
- <div class="left">
- <span class="number mr_10"
- :class="countLevel(question.variationQuestion.questionLevel).color">
- {{ countLevel(question.variationQuestion.questionLevel).text }}
- </span>
- <span class="gray">试题类型:</span>
- <span class="black" style="margin-right: 20px;">
- {{ question.variationQuestion.questionType }}
- </span>
- <span class="gray">难度:</span>
- <span style="font-weight: bold;"
- :class="countDiffcutyClass(question.variationQuestion.difficulty)">
- {{ question.variationQuestion.difficulty }}
- </span>
- </div>
- </div>
- <div class="question_content line_height_20"
- v-html="question.variationQuestion.questionStem">这是题目内容</div>
- <!-- <div class="yuwen">
- <span class="btn_span active">1</span>
- <span class="btn_span">2</span>
- <div class="question_list"></div>
- </div> -->
- <div class="card_footer">
- <div class="gray">知识点:</div>
- <KnowledgePoint :text="question.variationQuestion.knowledgePoint" />
- </div>
- </div>
- </div>
- </div>
- <div style="text-align: right;">
- <el-pagination background layout="prev, pager, next" :total="pageParam.total"
- :page-size="pageParam.pageSize" :current-page="pageParam.pageNum"
- @current-change="handleCurrentChange">
- </el-pagination>
- </div>
- </template>
- <NoData v-else>暂无数据</NoData>
- </div>
- </div>
- </template>
- <script>
- import {
- queryStudentErrorQuestion,
- markStudentErrorQuestion,
- downloadStudentErrorQuestion,
- } from '../../../http/api/errorQuestion';
- import Download from './Download.vue';
- import loadImg from './loadImg.js'
- import { Loading } from 'element-ui';
- import NoData from './NoData/NoData.vue';
- import KnowledgePoint from './KnowledgePoint.vue';
- export default {
- components: {
- Download,
- NoData,
- KnowledgePoint,
- },
- data() {
- return {
- pageParam: {
- pageNum: 1,
- pageSize: 10,
- total: 0,
- },
- questionList: [],
- allErrorCount: 0,
- unMasterCount: 0,
- masterCount: 0,
- reviewCount: 0,
- answerUrls: [],
- uploadPaperUrls: [],
- errorType: -1, // -1全部 0未掌握 1已掌握 2复习题
- examId: null,
- examType: null,
- gradeCode: null,
- downloadDialogVisible: false,
- isVariation: 0,
- };
- },
- computed: {
- subjectCode() {
- return this.$store.state.report.filterObject.subjectCode;
- }, //分析报告公共参数变量
- IsVariation() {
- return this.$store.state.question.isVariation;
- },
- },
- watch: {
- subjectCode(newVal, oldVal) {
- if (newVal !== oldVal) {
- this._queryStudentErrorQuestion();
- }
- },
- IsVariation(newVal) {
- if (newVal === 0 || newVal === 1) {
- this.downloadDialogVisible = true
- this.isVariation = newVal
- }
- },
- },
- created() {
- const ExamInfoItem = JSON.parse(localStorage.getItem("ExamInfoItem") || "{}");
- const reportExamCourseItem = JSON.parse(localStorage.getItem("reportExamCourseItem") || "{}");
- this.examId = reportExamCourseItem.examId;
- this.gradeCode = ExamInfoItem.examData.gradeCode;
- this.examType = ExamInfoItem.examData.examType;
- },
- async mounted() {
- await this._queryStudentErrorQuestion();
- },
- methods: {
- countGlobalIndex(index) {
- return (this.pageParam.pageNum - 1) * this.pageParam.pageSize + index;
- },
- countDiffcutyClass(difficulty) {
- // 容易:#90CB75 较易:#FAC858 一般:#5470C6 较难:#EA7ACB 困难:#EE6666
- const classMap = {
- '容易': 'easy',
- '较易': 'medium_easy',
- '一般': 'medium',
- '较难': 'medium_hard',
- '困难': 'hard'
- }
- return classMap[difficulty] || ''
- },
- countLevel(num) {
- // 1 :拔高题 2:进阶题 3:巩固题
- console.log('num', num);
- const arr = ['拔高题', '进阶题', '巩固题']
- const color = ['bg_hard', 'bg_medium', 'bg_easy',]
- return {
- text: arr[num - 1],
- color: color[num - 1],
- }
- },
- ShowAnserAndParse(type, question) {
- if (type === 1) {
- question.answerShow = !question.answerShow;
- question.parseShow = false
- }
- if (type === 2) {
- question.parseShow = !question.parseShow;
- question.answerShow = false
- }
- },
- async _queryStudentErrorQuestion() {
- const instance = Loading.service({ fullscreen: true });
- const { subjectCode, gradeCode, examType, examId, errorType, pageParam: { pageNum, pageSize } } = this
- const res = await queryStudentErrorQuestion({ subjectCode, gradeCode, examType, examId, errorType, pageNum, pageSize });
- if (res.code === 200) {
- const { allErrorCount, unMasterCount, masterCount, reviewCount, questionList, answerUrls, uploadPaperUrls } = res.data.records[0];
- this.allErrorCount = allErrorCount;
- this.masterCount = masterCount;
- this.unMasterCount = unMasterCount;
- this.reviewCount = reviewCount;
- this.answerUrls = answerUrls;
- this.uploadPaperUrls = uploadPaperUrls;
- this.pageParam.total = res.data.total * 1;
- for (let i = 0; i < questionList.length; i++) {
- const { sourceType, titleCoordinates, answerCoordinates, parseCoordinates, paintingPosition } = questionList[i]
- questionList[i].answerShow = false;
- questionList[i].parseShow = false;
- if (sourceType === 2) {
- const questionImg = await loadImg(this.uploadPaperUrls, titleCoordinates);
- questionList[i].questionImg = questionImg;
- const answerImg = await loadImg(this.answerUrls, answerCoordinates);
- questionList[i].answerImg = answerImg;
- const parseImg = await loadImg(this.answerUrls, parseCoordinates);
- questionList[i].parseImg = parseImg;
- // TODO: 学生答案图片加载,由于
- const studentAnswerImg = await loadImg(this.answerUrls, paintingPosition);
- questionList[i].studentAnswerImg = studentAnswerImg;
- }
- }
- this.questionList = questionList;
- // 缓慢滚动到顶部
- this.scrollToTop();
- }
- instance.close();
- },
- scrollToTop() {
- // 等待 DOM 更新完成
- this.$nextTick(() => {
- const container = document.querySelector('.content_right');
- if (container) {
- container.scrollTo({ top: 0, behavior: 'smooth' });
- }
- });
- },
- async _markStudentErrorQuestion(question, markStatus) {
- const res = await markStudentErrorQuestion({
- questionId: question.questionId,
- examId: this.examId,
- subjectCode: this.subjectCode,
- markStatus
- })
- if (res.code === 200) {
- this.$message.success('操作成功');
- await this._queryStudentErrorQuestion();
- } else {
- this.$message.error(res.message || '操作失败');
- }
- },
- async handleCurrentChange(page) {
- this.pageParam.pageNum = page;
- await this._queryStudentErrorQuestion();
- },
- },
- }
- </script>
- <style scoped lang="scss">
- .flex {
- display: flex;
- margin-bottom: 10px;
- .flex_left {
- width: 60px;
- }
- .flex_right {
- flex: 1;
- display: flex;
- flex-wrap: wrap;
- }
- }
- .bg_easy {
- background-color: #3BA272 !important;
- }
- .bg_medium {
- background-color: #5470C6 !important;
- }
- .bg_hard {
- background-color: #EE6666 !important;
- }
- .select_box {
- background-color: #ffffff;
- border-radius: 10px;
- padding: 10px;
- margin-bottom: 10px;
- }
- .content {
- background-color: #ffffff;
- border-radius: 10px;
- padding: 20px;
- margin-bottom: 10px;
- }
- .right_btn {
- display: flex;
- justify-content: flex-end;
- margin-bottom: 10px;
- }
- .question_card {
- margin-bottom: 10px;
- border: 1px solid #ebeef5;
- border-radius: 10px;
- overflow: hidden;
- .card_top {
- padding: 20px;
- }
- .card_top_info {
- display: flex;
- justify-content: space-between;
- margin-bottom: 20px;
- .left {
- display: flex;
- align-items: center;
- span {
- font-size: 14px;
- }
- .tag {
- color: #ffffff;
- padding: 4px 5px;
- font-size: 12px;
- background-color: #F56C6C;
- border-radius: 2px;
- position: relative;
- &::before {
- content: '';
- position: absolute;
- left: -5px;
- top: 50%;
- transform: translateY(-50%);
- width: 0;
- height: 0;
- border-top: 5px solid transparent;
- border-bottom: 5px solid transparent;
- border-right: 5px solid #EE6666;
- }
- }
- }
- }
- .number {
- color: #ffffff;
- font-size: 14px;
- padding: 5px 9px;
- background-color: #2E64FA;
- border-radius: 4px;
- }
- .btn_span {
- color: #2E64FA;
- font-size: 14px;
- padding: 5px 9px;
- border: 1px solid #2E64FA;
- border-radius: 4px;
- cursor: pointer;
- margin-right: 10px;
- &.active {
- color: #ffffff;
- background-color: #2E64FA;
- border-radius: 4px;
- }
- }
- .gray {
- color: #999;
- }
- .black {
- color: #333;
- }
- .blue {
- color: #2E64FA;
- }
- .question_content {
- margin-bottom: 20px;
- }
- .yuwen {
- margin-top: 20px;
- .question_list {
- margin-top: 20px;
- height: 100px;
- padding-top: 20px;
- border-top: 1px solid #EBEEF5;
- }
- }
- .card_footer {
- display: flex;
- align-items: center;
- padding-top: 20px;
- border-top: 1px solid #EBEEF5;
- .footer_item {
- margin-right: 40px;
- }
- }
- .card_buttom {
- background-color: #F0F2F5;
- padding: 15px 20px;
- .btn_box {
- display: flex;
- justify-content: flex-end;
- span {
- margin-left: 20px;
- cursor: pointer;
- }
- }
- .content {
- padding: 20px;
- background-color: #ffffff;
- margin-top: 20px;
- border-radius: 10px;
- .content_inner {
- border: 2px dotted #DCDFE6;
- border-radius: 4px;
- padding: 10px;
- }
- }
- .parseShow_content {
- position: relative;
- &::before {
- content: '';
- position: absolute;
- right: 20px;
- /* 根据需要调整三角水平位置 */
- top: 24px;
- /* 三角放置在外部,超出上方 */
- width: 0;
- height: 0;
- border-left: 10px solid transparent;
- border-right: 10px solid transparent;
- border-bottom: 12px solid #ffffff;
- z-index: 2;
- }
- }
- .answerShow_content {
- position: relative;
- &::before {
- content: '';
- position: absolute;
- right: 20px;
- /* 根据需要调整三角水平位置 */
- top: 24px;
- /* 三角放置在外部,超出上方 */
- width: 0;
- height: 0;
- border-left: 10px solid transparent;
- border-right: 10px solid transparent;
- border-bottom: 12px solid #ffffff;
- z-index: 2;
- }
- }
- }
- ::v-deep .qml-answer {
- margin-left: 0;
- margin-bottom: 0;
- }
- ::v-deep .qml-explanation .qml-seg p {
- margin-left: 0 !important;
- }
- ::v-deep .qml-explanation .qml-seg p,
- ::v-deep .qml-exps-sq {
- margin-left: 0 !important;
- }
- }
- </style>
|