zhangjie 3 жил өмнө
parent
commit
a96c92cd0b

+ 27 - 10
src/features/examwork/StudentExamDetail/PreviewPaperDialog.vue

@@ -96,9 +96,9 @@ export default {
       const examStudentAnswerJson = data.examStudentAnswerJson
         ? JSON.parse(data.examStudentAnswerJson)
         : [];
-      console.log(paperStructJson);
-      console.log(answerJson);
-      console.log(examStudentAnswerJson);
+      // console.log(paperStructJson);
+      // console.log(answerJson);
+      // console.log(examStudentAnswerJson);
 
       const answerMap = {};
       answerJson.details.forEach((detail) => {
@@ -119,10 +119,16 @@ export default {
         const k = `${question.mainNumber}-${question.subNumber}`;
         if (question.subQuestions) {
           question.subQuestions.forEach((sq) => {
-            studentAnsMap[`${k}-${sq.number}`] = JSON.parse(sq.answer);
+            studentAnsMap[`${k}-${sq.number}`] = {
+              answer: JSON.parse(sq.answer),
+              score: sq.score,
+            };
           });
         } else {
-          studentAnsMap[k] = JSON.parse(question.answer);
+          studentAnsMap[k] = {
+            answer: JSON.parse(question.answer),
+            score: question.score,
+          };
         }
       });
 
@@ -134,15 +140,19 @@ export default {
             question.subQuestions.forEach((sq) => {
               k += `-${sq.number}`;
               sq.answer = answerMap[k];
-              sq.studentAnswer = studentAnsMap[k];
+              const stdAns = studentAnsMap[k] || { answer: null, score: null };
+              sq.studentAnswer = stdAns.answer;
+              sq.studentScore = stdAns.score;
             });
           } else {
             question.answer = answerMap[k];
-            question.studentAnswer = studentAnsMap[k];
+            const stdAns = studentAnsMap[k] || { answer: null, score: null };
+            question.studentAnswer = stdAns.answer;
+            question.studentScore = stdAns.score;
           }
         });
       });
-      console.log(JSON.stringify(paperStructJson));
+      // console.log(JSON.stringify(paperStructJson));
       this.paperStruct = paperStructJson;
     },
     parseRenderStructList() {
@@ -187,7 +197,7 @@ export default {
         item.id = randomCode();
         return item;
       });
-      console.log(renderStructList);
+      // console.log(renderStructList);
     },
     parseSimpleQuestion(question, isCommon) {
       let contents = [];
@@ -226,6 +236,7 @@ export default {
           },
         });
       }
+
       if (question.studentAnswer) {
         contents.push({
           cls: "topic-answer std-answer",
@@ -238,6 +249,12 @@ export default {
         });
       }
 
+      contents.push({
+        cls: "topic-score",
+        type: "text",
+        content: "得分:" + (question.studentScore || 0),
+      });
+
       return contents;
     },
     loadImg(url) {
@@ -279,7 +296,7 @@ export default {
         }
       });
 
-      console.log(imgUrls);
+      // console.log(imgUrls);
 
       if (!imgUrls.length) return Promise.resolve(true);
       const imgLoads = imgUrls.map((item) => this.loadImg(item));

+ 1 - 1
src/features/examwork/StudentExamDetail/spins/TopicAnswer.vue

@@ -1,7 +1,7 @@
 <template>
   <div class="cont-item-detail">
     <h4 class="cont-part-title">
-      {{ data.answerType === "student" ? "学生答案" : "答案" }}
+      {{ data.answerType === "student" ? "学生答案" : "标准答案" }}
     </h4>
     <div
       v-if="data.structType === STRUCT_TYPES.BOOLEAN_CHOICE"

+ 1 - 1
src/features/examwork/StudentExamDetail/spins/previewTem.js

@@ -1,6 +1,6 @@
 const resetCss = `a,body,div,footer,h1,h2,h3,h4,h5,h6,header,input,li,ol,p,span,td,th,tr,ul{margin:0;padding:0;box-sizing:border-box;-webkit-tap-highlight-color:rgba(255,255,255,0)}li{list-style:none}em,i,u{font-style:normal}button{font-family:"Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei",Arial,sans-serif}h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:700}fieldset,img{border:0}abbr{border:0;font-variant:normal}a{text-decoration:none;color:inherit}img{vertical-align:middle}body{font-family:"Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei",Arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-size:14px;color:#545454;background:#f5f5f5;min-width:1366px}`;
 
-const previewCss = `.paper-content {width: 210mm;height: 297mm;padding: 40px;margin:0 auto;}.cont-item {page-break-after: always;}.cont-item p {margin: 0;}.cont-paper-name {font-size: 20px;padding-bottom: 30px;text-align: center;}.cont-detail-name {font-size: 16px;font-weight: 600;padding: 15px 0;}.cont-topic-title {margin-bottom: 5px;}.cont-item-detail {min-height: 20px;}.cont-part-title {font-size: 14px;line-height: 20px;float: left;margin: 0;}.cont-part-body {min-height: 20px;}.cont-part-body img {max-width: 100%;max-height: 1042px;}.cont-topic-answer .cont-part-title {width: 36px;}.cont-topic-answer .cont-part-body {margin-left: 36px;}.std-answer.cont-topic-answer .cont-part-title {width: 72px;}.std-answer.cont-topic-answer .cont-part-body {margin-left: 72px;}.cont-topic-answer + .cont-topic-title {margin-top: 15px;}`;
+const previewCss = `.paper-content{width:210mm;height:297mm;padding:40px;margin:0 auto;overflow:hidden;}.cont-item{page-break-after:always;}.cont-item p{margin:0;}.cont-paper-name{font-size:20px;padding-bottom:30px;text-align:center;color:#333;}.cont-detail-name{font-size:16px;font-weight:600;padding:15px 0;color:#333;}.cont-topic-title{padding-bottom:5px;}.cont-item-detail{min-height:20px;}.cont-part-title{font-size:14px;line-height:20px;float:left;margin:0;}.cont-part-body{min-height:20px;}.cont-part-body img{max-width:100%;max-height:1042px;}.cont-topic-answer .cont-part-title{width:72px;font-weight:600;color:#333;}.cont-topic-answer .cont-part-body{margin-left:72px;}.cont-topic-answer + .cont-topic-title{padding-top:15px;}.cont-topic-score{color: #f56c6c;padding-bottom: 5px;}`;
 
 export default (domeStr) => {
   return `

+ 1 - 0
src/features/invigilation/common/FlvMedia.vue

@@ -40,6 +40,7 @@ export default {
         },
         {
           fixAudioTimestampGap: false,
+          autoCleanupSourceBuffer: true,
         }
       );
       this.flvPlayer.attachMediaElement(this.$refs.VideoMedia);

+ 9 - 7
src/styles/paper-preview.css

@@ -16,11 +16,13 @@
   font-size: 20px;
   padding-bottom: 30px;
   text-align: center;
+  color: #333;
 }
 .cont-detail-name {
   font-size: 16px;
   font-weight: 600;
   padding: 15px 0;
+  color: #333;
 }
 .cont-topic-title {
   padding-bottom: 5px;
@@ -43,18 +45,18 @@
 }
 
 .cont-topic-answer .cont-part-title {
-  width: 36px;
-}
-.cont-topic-answer .cont-part-body {
-  padding-left: 36px;
-}
-.std-answer.cont-topic-answer .cont-part-title {
   width: 72px;
+  font-weight: 600;
+  color: #333;
 }
-.std-answer.cont-topic-answer .cont-part-body {
+.cont-topic-answer .cont-part-body {
   margin-left: 72px;
 }
 
 .cont-topic-answer + .cont-topic-title {
   padding-top: 15px;
 }
+.cont-topic-score {
+  color: #f56c6c;
+  padding-bottom: 5px;
+}