|
@@ -0,0 +1,439 @@
|
|
|
+<template>
|
|
|
+ <div class="art-paper-content">
|
|
|
+ <Loading v-show="isLoad" bgColor="rgba(0, 0, 0, 0.3)"></Loading>
|
|
|
+ <vuescroll>
|
|
|
+ <EventBasicInfo :info="nowActive" />
|
|
|
+ <div class="art-box">
|
|
|
+ <div class="subject-box" v-for="item in artExam" :key="item.id">
|
|
|
+ <p class="subject-title">{{ item.subject.name }}</p>
|
|
|
+ <div class="paper-answer" v-if="item.exam[0]">
|
|
|
+ <div class="title-rect-group">
|
|
|
+ <h2 class="title-rect-name">
|
|
|
+ {{ item.exam[0].quotaName }}
|
|
|
+ <Icon custom="iconfont icon-yk_yuanquan_fill" size="25" color="#ccc" v-show="item.testState === 1" />
|
|
|
+ <Icon custom="iconfont icon-duigouxiao" color="#1aba1a" size="25" v-show="item.testState > 1" />
|
|
|
+ </h2>
|
|
|
+ </div>
|
|
|
+ <div class="scoreboard">
|
|
|
+ <div v-if="!item.paperInfo.length" style="padding: 25px;">
|
|
|
+ <Icon type="md-alert" size="18" color="orange" class="warm-icon" style="margin-right: 5px;" />
|
|
|
+ <span class="warm-hint">
|
|
|
+ 试卷存在问题,无法查看
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
+ <template v-else>
|
|
|
+ <div v-show="item.testState === 1" @click="showTest(item)" style="width: 100%; font-size: 25px; font-weight: 800; padding: 17px;cursor: pointer;">
|
|
|
+ <Icon custom="iconfont icon-dianji" size="30" color="#03966a" />
|
|
|
+ <span style="color: #03966a; margin-left: 10px;">{{ $t("studentWeb.exam.report.anwser") }}</span>
|
|
|
+ </div>
|
|
|
+ <h4 v-show="item.testState === 2 || item.testState === 3" style="padding: 25px;">
|
|
|
+ <Icon type="md-checkmark-circle-outline" class="warm-icon" color="green" />
|
|
|
+ {{ $t("studentWeb.exam.report.noRes") }}
|
|
|
+ </h4>
|
|
|
+ </template>
|
|
|
+ </div>
|
|
|
+ <template v-if="item.homework.length">
|
|
|
+ <div v-for="(hw, index) in item.homework" :key="index">
|
|
|
+ <ArtView ref="art" :hwInfo="hw" :hwIndex="index" @changeHwAnswer="changeHwAnswer" @openMask="openMask" />
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </div>
|
|
|
+ <div v-else class="paper-answer">
|
|
|
+ 暂无科目相关内容
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </vuescroll>
|
|
|
+ <!-- <div class="top-icon" @click="gotoTop">
|
|
|
+ <Icon type="ios-arrow-up" size="30" color="#249e35" />
|
|
|
+ </div> -->
|
|
|
+ <div v-if="previewStatus" class="image-viewer">
|
|
|
+ <div style="width: fit-content; position: relative; margin: auto;">
|
|
|
+ <Icon type="md-close" class="close-icon" @click="previewStatus = false" />
|
|
|
+ <video v-if="previewFile.type == 'video'" id="previewVideo" :src="previewFile.url" width="870"
|
|
|
+ controls="controls" style="max-height: 800px;">
|
|
|
+ {{$t('teachContent.tips8')}}
|
|
|
+ </video>
|
|
|
+ <audio v-else-if="previewFile.type == 'audio'" controls>
|
|
|
+ <source :src="previewFile.url">
|
|
|
+ {{$t('teachContent.notAudio')}}
|
|
|
+ </audio>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import { mapGetters, mapState } from 'vuex';
|
|
|
+import EventBasicInfo from "../../../EventBasicInfo";
|
|
|
+import ArtView from "./ArtView.vue";
|
|
|
+export default {
|
|
|
+ components: {
|
|
|
+ EventBasicInfo,
|
|
|
+ ArtView
|
|
|
+ },
|
|
|
+ data () {
|
|
|
+ return {
|
|
|
+ isLoad: false,
|
|
|
+ paperData: [], //试卷信息:学生作答记录、批注、知识点等
|
|
|
+ artExam: [],
|
|
|
+ artInfo: undefined, //艺术活动信息
|
|
|
+ musicInfo: undefined, //智音信息
|
|
|
+ stusInfo: [],// 艺术评测接口返回的stus
|
|
|
+ previewStatus: false,
|
|
|
+ previewFile: null,
|
|
|
+ testState: 0, //1:未作答 2:未评分 3:已评分
|
|
|
+ }
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ ...mapState({
|
|
|
+ userInfo: state => state.userInfo
|
|
|
+ }),
|
|
|
+ ...mapGetters(['getItemTitle']),
|
|
|
+ nowActive() {
|
|
|
+ return this.getItemTitle
|
|
|
+ },
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+ nowActive: {
|
|
|
+ handler(n, o) {
|
|
|
+ this.artInfo = undefined
|
|
|
+ this.musicInfo = undefined
|
|
|
+ this.artExam = []
|
|
|
+ // 艺术评测需要先获取详细信息
|
|
|
+ this.getArtInfo()
|
|
|
+ }
|
|
|
+ },
|
|
|
+ },
|
|
|
+ async created () {
|
|
|
+ this.sasInfo = await this.getSas()
|
|
|
+ this.getArtInfo()
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ getSas() {
|
|
|
+ return new Promise(async (r, j) => {
|
|
|
+ let code = this.getItemTitle.school
|
|
|
+ let sasInfo = await this.$tools.getBlobSas(code)
|
|
|
+ r(sasInfo)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ async getArtInfo() {
|
|
|
+ this.isLoad = true
|
|
|
+ let params = {
|
|
|
+ id: this.getItemTitle.id,
|
|
|
+ code: this.getItemTitle.school
|
|
|
+ }
|
|
|
+ let nowTime = new Date()
|
|
|
+ this.$api.studentWeb.getArtInfo(params).then(async res => {
|
|
|
+ if(res.art) {
|
|
|
+ this.artInfo = res.art
|
|
|
+ this.musicInfo = res.music
|
|
|
+ let subList = []
|
|
|
+ res.art.settings.forEach(item => {
|
|
|
+ item.task.forEach(task => {
|
|
|
+ // 0:评分,1:评测,2:作业
|
|
|
+ if(task.type) {
|
|
|
+ let examInfo = undefined
|
|
|
+ let quotaId = this.$parent.quotas.find(quotas => {return quotas.id === item.id})
|
|
|
+ let files = undefined
|
|
|
+ if(task.type === 1) {
|
|
|
+ examInfo = res.stus.find(stu => {
|
|
|
+ return stu.id === task.acId
|
|
|
+ })
|
|
|
+ if(examInfo) {
|
|
|
+ examInfo.isOrder = task.isOrder //0:默认,1:乱序
|
|
|
+ examInfo.quotaId = item.id
|
|
|
+ examInfo.quotaName = item.quotaname
|
|
|
+ examInfo.quotaId = item.id
|
|
|
+ }
|
|
|
+ } else if(task.type === 2) {
|
|
|
+ files = res.works[0].results.find(work => {
|
|
|
+ return work.taskId === task.acId
|
|
|
+ })
|
|
|
+ if(files.files) {
|
|
|
+ files.files = files.files.map(item => {
|
|
|
+ item.url = item.url + '?' + this.sasInfo.sas
|
|
|
+ return item
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 按照科目来区分试卷
|
|
|
+ let subIndex = subList.findIndex(sub => {
|
|
|
+ return task.subject === sub.subject.id
|
|
|
+ })
|
|
|
+ console.log(examInfo);
|
|
|
+ // 没有该科目,就保存一次,再增加对应的试卷id:acId
|
|
|
+ if(subIndex === -1) {
|
|
|
+ let examList = {
|
|
|
+ subject: {
|
|
|
+ id: task.subject,
|
|
|
+ name: ""
|
|
|
+ },
|
|
|
+ exam: [],
|
|
|
+ examInfo: [],
|
|
|
+ homework: [],
|
|
|
+ paperInfo: [],
|
|
|
+ testState: 0,
|
|
|
+ }
|
|
|
+ if(this.getItemTitle.ext) {
|
|
|
+ examList.subject.name = this.getItemTitle.ext.subjects.find(sub => {
|
|
|
+ return sub.id === task.subject
|
|
|
+ }).name
|
|
|
+ }
|
|
|
+ if(task.type === 1 && examInfo) {
|
|
|
+ examList.exam.push(examInfo)
|
|
|
+ } else if(task.type === 2 && item.id === 'quota_22') {
|
|
|
+ examList.homework.push({
|
|
|
+ id: task.acId,
|
|
|
+ quotaName: item.quotaname,
|
|
|
+ quotaId: item.id,
|
|
|
+ subject: task.subject,
|
|
|
+ workDesc: task.workDesc,
|
|
|
+ workEnd: this.$tools.formatTime(task.workEnd, 'yyyy-MM-dd hh:mm'),
|
|
|
+ answer: files.files ? files.files : undefined,
|
|
|
+ overTime: nowTime > task.workEnd,
|
|
|
+ musicId: this.musicInfo.questionId,
|
|
|
+ musicNm: this.musicInfo.questionName,
|
|
|
+ isAnswer: res.works[0].zyanswer.thirdAnswerId ? 1 : 0,
|
|
|
+ })
|
|
|
+ }
|
|
|
+ subList.push(examList)
|
|
|
+ } else {
|
|
|
+ if(task.type === 1 && examInfo) {
|
|
|
+ subList[subIndex].exam.push(examInfo)
|
|
|
+ } else if(task.type === 2 && item.id === "quota_22" && task.subject != 'subject_painting') {
|
|
|
+ subList[subIndex].homework.push({
|
|
|
+ id: task.acId,
|
|
|
+ quotaName: item.quotaname,
|
|
|
+ quotaId: item.id,
|
|
|
+ subject: task.subject,
|
|
|
+ workDesc: task.workDesc,
|
|
|
+ workEnd: this.$tools.formatTime(task.workEnd, 'yyyy-MM-dd hh:mm'),
|
|
|
+ answer: files.files ? files.files : undefined,
|
|
|
+ overTime: nowTime > task.workEnd, //作业提交已经到期
|
|
|
+ musicId: this.musicInfo.questionId, //智音id
|
|
|
+ musicNm: this.musicInfo.questionName,
|
|
|
+ isAnswer: res.works[0].zyanswer.thirdAnswerId ? 1 : 0,
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+ this.stusInfo = res.stus
|
|
|
+
|
|
|
+ this.artExam = subList
|
|
|
+ let listss = await this.getSubPaper()
|
|
|
+ console.log('试卷列表', listss);
|
|
|
+ if(listss.length) {
|
|
|
+ let infos = await this.getPaper()
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }).finally(() => {
|
|
|
+ this.isLoad = false
|
|
|
+ })
|
|
|
+ },
|
|
|
+ getSubPaper() {
|
|
|
+ return new Promise((resolve, reject) => {
|
|
|
+ let promiseArr = []
|
|
|
+ this.artExam.forEach(item => {
|
|
|
+ promiseArr.push(new Promise((r, j) => {
|
|
|
+ try {
|
|
|
+ if(!item.exam[0]) {
|
|
|
+ r(undefined)
|
|
|
+ }
|
|
|
+ let params = {
|
|
|
+ cIds: this.artInfo.classes,
|
|
|
+ code: this.artInfo.school,
|
|
|
+ id: item.exam[0].id,
|
|
|
+ scode: `Exam-${this.artInfo.school}`,
|
|
|
+ studentId: this.userInfo.sub,
|
|
|
+ }
|
|
|
+ this.$api.studentWeb.FindStudentPaper(params).then(res => {
|
|
|
+ if(res.status === 200) {
|
|
|
+ if(res.papers.length) {
|
|
|
+ let blob = this.stusInfo.find(stu => {
|
|
|
+ return stu.paper[0].subject === res.subjects[0].id
|
|
|
+ })
|
|
|
+ if(blob) {
|
|
|
+ let paperArt = res.papers.find(papers => {
|
|
|
+ return papers.blob === blob.paper[0].blob
|
|
|
+ })
|
|
|
+ paperArt.source = this.getItemTitle.source || null
|
|
|
+ paperArt.qamode = this.getItemTitle.qamode
|
|
|
+ item.examInfo.push(paperArt)
|
|
|
+ }
|
|
|
+ for (let i = 0; i < item.examInfo.length; i++) {
|
|
|
+ item.examInfo[i].acId = item.exam[i].id
|
|
|
+ item.examInfo[i].subject = res.subjects[i]
|
|
|
+ item.examInfo[i].allClass = res.claId
|
|
|
+ item.examInfo[i].isOrder = this.getItemTitle.type === 'Art' ? item.exam[0].isOrder : 0
|
|
|
+ if(res.stuAns.length) {
|
|
|
+ console.log(res.stuAns, i, res.stuAns[i]);
|
|
|
+ if (!res.stuAns[i].length) {
|
|
|
+ item.examInfo[i].stuAns = []
|
|
|
+ item.examInfo[i].stuScore = []
|
|
|
+ } else {
|
|
|
+ item.examInfo[i].stuAns = res.stuAns[i]
|
|
|
+ // 批注
|
|
|
+ item.examInfo[i].mark = res.mark[i]
|
|
|
+ item.examInfo[i].stuScore = res.stuScore[i]
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ item.examInfo[i].stuAns = []
|
|
|
+ item.examInfo[i].stuScore = []
|
|
|
+ }
|
|
|
+ item.examInfo[i].taskStatus = item.exam[0].taskStatus
|
|
|
+ }
|
|
|
+ r(true)
|
|
|
+ } else {
|
|
|
+ r(undefined)
|
|
|
+ }
|
|
|
+ } else if(res.status === 500) {
|
|
|
+ // 统一给500,服务器内部错误
|
|
|
+ this.$Message.error(this.$t("studentWeb.exam.dataError"))
|
|
|
+ j(undefined)
|
|
|
+ } else {
|
|
|
+ j(undefined)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } catch (error) {
|
|
|
+ j(error)
|
|
|
+ }
|
|
|
+ }))
|
|
|
+ })
|
|
|
+ Promise.allSettled(promiseArr).then(result => {
|
|
|
+ resolve(result)
|
|
|
+ }).catch(e => {
|
|
|
+ console.log(e);
|
|
|
+ reject(e)
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 获取试卷信息
|
|
|
+ getPaper() {
|
|
|
+ return new Promise((resolve, reject) => {
|
|
|
+ let promiseArr = []
|
|
|
+ this.artExam.forEach(item => {
|
|
|
+ promiseArr.push(new Promise(async (r, j) => {
|
|
|
+ let codes = this.getItemTitle.scope == 'school' ? this.getItemTitle.school : this.getItemTitle.creatorId
|
|
|
+ if(item.examInfo[0]?.blob) {
|
|
|
+ let code = {
|
|
|
+ scope: this.getItemTitle.scope,
|
|
|
+ code: codes,
|
|
|
+ blob: item.examInfo[0].blob,
|
|
|
+ examId: codes
|
|
|
+ }
|
|
|
+ try {
|
|
|
+ item.paperInfo.push(await this.getStuPaper(code))
|
|
|
+ } catch (error) {
|
|
|
+ this.$Message.error(this.$t("studentWeb.exam.examError"))
|
|
|
+ this.isLoad = false
|
|
|
+ r(undefined)
|
|
|
+ }
|
|
|
+ if(item.examInfo[0].stuScore != undefined) {
|
|
|
+ if (item.examInfo[0].stuScore[0] == undefined) {
|
|
|
+ let score = []
|
|
|
+ for (let info of item.paperInfo[0].slides) {
|
|
|
+ if (info.type !== 'compose') {
|
|
|
+ score.push(-1)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ item.examInfo[0].stuScore = score
|
|
|
+ }
|
|
|
+ }
|
|
|
+ let k = 0
|
|
|
+ for (let score of item.examInfo[0].stuScore) {
|
|
|
+ if (score == -1) { //有未打分
|
|
|
+ k++
|
|
|
+ }
|
|
|
+ }
|
|
|
+ item.testState = k ? (item.examInfo[0].stuAns ? 1 : 2) : 3
|
|
|
+ console.error('试卷信息', item.paperInfo)
|
|
|
+ r(true)
|
|
|
+ } else {
|
|
|
+ r(undefined)
|
|
|
+ }
|
|
|
+ }))
|
|
|
+ })
|
|
|
+ Promise.allSettled(promiseArr).then(result => {
|
|
|
+ console.log('Promise', result);
|
|
|
+ resolve(result)
|
|
|
+ }).catch(e => {
|
|
|
+ console.log(e);
|
|
|
+ reject(e)
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
+ getStuPaper(code) {
|
|
|
+ return new Promise(async(r, j) => {
|
|
|
+ try {
|
|
|
+ let a = await this.$evTools.getStuPaper(code)
|
|
|
+ r(a)
|
|
|
+ } catch(e) {
|
|
|
+ j(undefined)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ showTest(art) {
|
|
|
+ let textArr = {
|
|
|
+ scope: this.getItemTitle.scope,
|
|
|
+ cntr: this.getItemTitle.scope === 'school' ? this.getItemTitle.school : this.getItemTitle.creatorId,
|
|
|
+ examId: this.getItemTitle.id,
|
|
|
+ subjectId: art.subject.id,
|
|
|
+ stuId: this.$store.state.userInfo.sub
|
|
|
+ }
|
|
|
+ this.$store.commit("setComposeData", textArr)
|
|
|
+ localStorage.setItem("composeData", encodeURIComponent(JSON.stringify(textArr)))
|
|
|
+ // 存储一个字段:该艺术评测是否要乱序作答
|
|
|
+ // getExamInfo 可能会有,就不用localStorage,如果用localStorage,要注意退出作答时清除之前的artExam
|
|
|
+ localStorage.setItem("artExam", encodeURIComponent(JSON.stringify(art.examInfo[0].isOrder)))
|
|
|
+ this.$router.push({
|
|
|
+ name: "examView/evaluation",
|
|
|
+ })
|
|
|
+ let ids = {
|
|
|
+ examId: this.getItemTitle.id,
|
|
|
+ subjectId: art.subject.id,
|
|
|
+ }
|
|
|
+ sessionStorage.setItem("ids", encodeURIComponent(JSON.stringify(ids)))
|
|
|
+ if (art.subject) {
|
|
|
+ this.$store.commit("ToggleLessonTestPopWithSubject", art.examInfo[0])
|
|
|
+ localStorage.setItem("subjectNow", encodeURIComponent(JSON.stringify(art.examInfo[0])))
|
|
|
+
|
|
|
+ let code = {
|
|
|
+ scope: this.getItemTitle.scope,
|
|
|
+ code: textArr.cntr,
|
|
|
+ blob: art.examInfo[0].blob,
|
|
|
+ examId: textArr.cntr
|
|
|
+ }
|
|
|
+ this.$store.commit("SetPaperInfo", art.paperInfo[0])
|
|
|
+ this.$store.commit("SetExamInfo", art.examInfo[0])
|
|
|
+ // 不在localStorage存题目内容,改为在作答页面重新获取
|
|
|
+ // PaperTest.vue:通过paperCoed重新获取题目信息
|
|
|
+ localStorage.setItem('paperCoed', encodeURIComponent(JSON.stringify(code)))
|
|
|
+ localStorage.setItem("examInfo", encodeURIComponent(JSON.stringify(art.examInfo[0])))
|
|
|
+ }
|
|
|
+ },
|
|
|
+ gotoTop() {
|
|
|
+ document.getElementsByClassName("art-box")[0].scrollIntoView()
|
|
|
+ },
|
|
|
+ changeHwAnswer(answer, index) {
|
|
|
+ let attach = [...answer.attachments]
|
|
|
+ attach = attach.map(item => {
|
|
|
+ item.url = item.url + '?' + this.sasInfo.sas
|
|
|
+ return item
|
|
|
+ })
|
|
|
+ this.artExam.homework[index].answer = attach
|
|
|
+ this.$forceUpdate()
|
|
|
+ },
|
|
|
+ openMask(item) {
|
|
|
+ this.previewFile = item
|
|
|
+ this.previewStatus = true
|
|
|
+ },
|
|
|
+ }
|
|
|
+}
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="less" scoped>
|
|
|
+@import "./ArtTestReport.less";
|
|
|
+</style>
|