多体系建设信息化条统-前端
祖安之光
yesterday ee0087bb2a995a3b4a769d836fa75fd4dcdf5082
增加查看试卷按钮
2 files modified
57 ■■■■ changed files
src/views/work/onlineEducation/groupExams/components/correctExam.vue 53 ●●●● patch | view | raw | blame | history
src/views/work/onlineEducation/groupExams/components/student.vue 4 ●●●● patch | view | raw | blame | history
src/views/work/onlineEducation/groupExams/components/correctExam.vue
@@ -16,19 +16,19 @@
            <div>
              <span style="font-size: 20px">{{data.form.examPaper.name}}</span>
              <div class="examInfo">
                <span>得分:{{data.form.score}} / {{data.form.totalScore}}</span>
                <span>得分:{{data.backValue.state == 0 ? '暂无' : data.form.score}} / {{data.form.totalScore}}</span>
                <span>学生:{{data.form.student.name}}</span>
                <el-divider style="margin-top: 10px" />
              </div>
              <div v-if="data.form.questions && data.form.questions.length>0" style="display: flex;flex-wrap: wrap;line-height: 40px">
              <div v-if="data.backValue.state !== 0 && data.form.questions && data.form.questions.length>0" style="display: flex;flex-wrap: wrap;line-height: 40px">
                <div v-for="(item,index) in data.form.questions" :key="index" style="margin-right: 5px">
                  <el-tag size="large" style="cursor: pointer" effect="light" :type="item.studentAnswer.passed == 0 ? 'danger' :item.studentAnswer.passed == 1?'success': 'warning'" @click="toView(index+1)">{{index+1}}</el-tag>
                </div>
                <el-divider />
              </div>
              <div style="display: flex;justify-content: center;">
              <!-- <div style="display: flex;justify-content: center;">
                <el-button type="primary" @click="submitExam" v-if="data.queryParams.state != 2">提交批改</el-button>
              </div>
              </div> -->
            </div>
          </el-card>
        </div>
@@ -47,19 +47,19 @@
                      <span style="margin-left: 10px;font-size: 16px">{{item.title}}</span>
                    </div>
                    <div style="display: flex;margin-top: 15px;margin-left: 25px">
                      <div v-for="single in item.content.items" :class="{toRed : item.studentAnswer.answer == single.prefix}">
                      <div v-for="single in item.content.items" :class="{toRed : data.backValue.state !== 0 && item.studentAnswer && item.studentAnswer.answer && (item.studentAnswer.answer == single.prefix)}">
                        <span style="font-size: 15px;margin-right: 5px">{{single.prefix}}.</span>
                        <span style="font-size: 15px;margin-right: 20px">{{single.content}}</span>
                      </div>
                    </div>
                    <div style="display: flex;flex-direction: column;margin-left: 25px;margin-top: 20px;font-size: 14px;line-height: 25px">
                    <div v-if="data.backValue.state !== 0" style="display: flex;flex-direction: column;margin-left: 25px;margin-top: 20px;font-size: 14px;line-height: 25px">
                      <div style="display: flex">
                        <span>结果:</span>
                        <el-tag size="small" :type="item.studentAnswer.passed == 0 ? 'danger' :item.studentAnswer.passed == 1?'success': 'warning'">{{item.studentAnswer.passed == 0 ? '错误' :item.studentAnswer.passed == 1? '正确' :'待批改' }}</el-tag>
                      </div>
                      <span>分数:{{data.form.examPaper.singleScore}}</span>
                      <span>解析:{{item.content.analyze}}</span>
                      <span>正确答案:{{item.answer}}</span>
                      <span v-if="item.studentAnswer && item.studentAnswer.answer">正确答案:{{item.answer}}</span>
                    </div>
                    <el-divider />
@@ -77,19 +77,19 @@
                      <span style="margin-left: 10px;font-size: 16px">{{item.title}}</span>
                    </div>
                    <div style="display: flex;margin-top: 15px;margin-left: 25px">
                      <div v-for="single in item.content.items" :class="{toRed : item.studentAnswer.answerArr.includes(single.prefix)}">
                      <div v-for="single in item.content.items" :class="{toRed : data.backValue.state !== 0 && item.studentAnswer && item.studentAnswer.answerArr && item.studentAnswer.answerArr.includes(single.prefix)}">
                        <span style="font-size: 15px;margin-right: 5px">{{single.prefix}}.</span>
                        <span style="font-size: 15px;margin-right: 20px">{{single.content}}</span>
                      </div>
                    </div>
                    <div style="display: flex;flex-direction: column;margin-left: 25px;margin-top: 20px;font-size: 14px;line-height: 25px">
                    <div v-if="data.backValue.state !== 0" style="display: flex;flex-direction: column;margin-left: 25px;margin-top: 20px;font-size: 14px;line-height: 25px">
                      <div style="display: flex">
                        <span>结果:</span>
                        <el-tag size="small" :type="item.studentAnswer.passed == 0 ? 'danger' :item.studentAnswer.passed == 1?'success': 'warning'">{{item.studentAnswer.passed == 0 ? '错误' :item.studentAnswer.passed == 1? '正确' :'待批改' }}</el-tag>
                      </div>
                      <span>分数:{{data.form.examPaper.multiScore}}</span>
                      <span>解析:{{item.content.analyze}}</span>
                      <span>正确答案:{{item.answer}}</span>
                      <span v-if="item.studentAnswer && item.studentAnswer.answer">正确答案:{{item.answer}}</span>
                    </div>
                    <el-divider />
@@ -107,19 +107,19 @@
                      <span style="margin-left: 10px;font-size: 16px">{{item.title}}</span>
                    </div>
                    <div style="display: flex;margin-top: 15px;margin-left: 25px">
                      <div v-for="single in item.content.items" :class="{toRed : item.studentAnswer.answer == single.prefix}">
                      <div v-for="single in item.content.items" :class="{toRed : data.backValue.state !== 0 && item.studentAnswer && item.studentAnswer.answer && item.studentAnswer.answer == single.prefix}">
                        <span style="font-size: 15px;margin-right: 5px">{{single.prefix}}.</span>
                        <span style="font-size: 15px;margin-right: 20px">{{single.content}}</span>
                      </div>
                    </div>
                    <div style="display: flex;flex-direction: column;margin-left: 25px;margin-top: 20px;font-size: 14px;line-height: 25px">
                    <div v-if="data.backValue.state !== 0" style="display: flex;flex-direction: column;margin-left: 25px;margin-top: 20px;font-size: 14px;line-height: 25px">
                      <div style="display: flex">
                        <span>结果:</span>
                        <el-tag size="small" :type="item.studentAnswer.passed == 0 ? 'danger' :item.studentAnswer.passed == 1?'success': 'warning'">{{item.studentAnswer.passed == 0 ? '错误' :item.studentAnswer.passed == 1? '正确' :'待批改' }}</el-tag>
                      </div>
                      <span>分数:{{data.form.examPaper.judgeScore}}</span>
                      <span>解析:{{item.content.analyze}}</span>
                      <span>正确答案:{{item.answer}}</span>
                      <span v-if="item.studentAnswer && item.studentAnswer.answer">正确答案:{{item.answer}}</span>
                    </div>
                    <el-divider />
                  </div>
@@ -138,22 +138,22 @@
                    <div style="display: flex;margin-top: 15px;margin-left: 30px">
                     <span style="font-weight: 600">{{item.studentAnswer.answer}}</span>
                    </div>
                    <div style="display: flex;flex-direction: column;margin-left: 25px;margin-top: 20px;font-size: 14px;line-height: 25px">
                    <div v-if="data.backValue.state !== 0" style="display: flex;flex-direction: column;margin-left: 25px;margin-top: 20px;font-size: 14px;line-height: 25px">
                      <div style="display: flex">
                        <span>结果:</span>
                        <el-tag size="small" :type="item.studentAnswer.passed == 0 ? 'danger' :item.studentAnswer.passed == 1?'success': 'warning'">{{item.studentAnswer.passed == 0 ? '错误' :item.studentAnswer.passed == 1? '正确' :'待批改' }}</el-tag>
                      </div>
                      <span>分数:{{data.form.examPaper.easyScore}}</span>
                      <span>解析:{{item.content.analyze}}</span>
                      <span>正确答案:{{item.answer}}</span>
                      <div style="display: flex;align-items: center;margin-top: 5px" v-if="item.studentAnswer.passed == 2">
                      <span v-if="item.studentAnswer && item.studentAnswer.answer">正确答案:{{item.answer}}</span>
                      <!-- <div style="display: flex;align-items: center;margin-top: 5px" v-if="item.studentAnswer.passed == 2">
                        <span style="color: #EAB308">批改:</span>
                        <el-input-number v-model="item.score" :min="0" :max="data.form.examPaper.easyScore" :step="1" />
                      </div>
                      <div style="display: flex;align-items: center;margin-top: 5px" v-else>
                        <span style="color: #EAB308">得分:</span>
                        <el-input-number v-model="item.studentAnswer.score" :min="0" :max="data.form.examPaper.easyScore" :step="1" disabled />
                      </div>
                      </div> -->
                    </div>
                    <el-divider />
@@ -179,8 +179,6 @@
import {isRelogin} from "@/utils/request";
const route = useRoute()
const router = useRouter();
const backValue = ref()
const data = reactive({
  queryParams: {
    id: null,
@@ -197,6 +195,13 @@
    questions: [],
    student: {}
  },
  backValue: {
    id: null,
    paperId: null,
    pageNum: null,
    pageSize: null,
    state: null
  },
  singleList:[],
  judgeList: [],
  multiList:[],
@@ -204,7 +209,7 @@
});
onMounted(async ()=>{
  const val = JSON.parse(route.query.val)
  backValue.value = val
  data.backValue = val
  data.queryParams.paperId = val.paperId
  data.queryParams.id = val.id
  data.queryParams.state = val.state
@@ -266,7 +271,7 @@
      return {
        ...item,
        content: JSON.parse(item.content),
        studentAnswer: {
        studentAnswer: item.studentAnswer?{
          answerArr:item.studentAnswer.answer?item.studentAnswer.answer.split(','):[],
          answer: item.studentAnswer.answer,
          id: item.studentAnswer.id,
@@ -275,7 +280,7 @@
          questionId: item.studentAnswer.questionId,
          score: item.studentAnswer.score,
          studentId: item.studentAnswer.studentId,
        }
        }:{}
      }
    })
  }
@@ -292,8 +297,8 @@
  const obj = {
    type: 'exam',
    paperId: data.queryParams.paperId,
    pageNum: backValue.value.pageNum,
    pageSize: backValue.value.pageSize,
    pageNum: data.backValue.pageNum,
    pageSize: data.backValue.pageSize,
  }
  const v = JSON.stringify(obj)
  router.push({ path: "/examStu", query: { val: v } });
src/views/work/onlineEducation/groupExams/components/student.vue
@@ -92,7 +92,7 @@
      </el-table-column>
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width"  width="180">
        <template #default="scope">
<!--          <el-button link type="primary" @click="correct(scope.row)" v-if="scope.row.state != 0">批阅</el-button>-->
          <el-button link type="primary" @click="correct(scope.row)">查看试卷</el-button>
          <el-button link type="danger" @click="handleDelete(scope.row)">删除</el-button>
        </template>
      </el-table-column>
@@ -157,7 +157,7 @@
const { queryParams, total, dataList } = toRefs(data);
const backValue = ref()
const backValue = reactive()
onMounted(async ()=>{
  if(route.query.val){