Przeglądaj źródła

答题卡修改

liurongli 7 miesięcy temu
rodzic
commit
224b4c5440

+ 106 - 33
src/components/PaperImage.vue

@@ -461,7 +461,7 @@ export default {
         
         this.ImageInfoChange();//用image图片替代背景  是为了高清显示
         
-        // console.log("加载边框数据",this.drawData);
+        console.log("加载边框数据",this.drawData);
         for(var i=0;i<this.drawData.length;i++)
         {
           let item=this.drawData[i];
@@ -506,6 +506,29 @@ export default {
               ctx.font = `${fontSize}px Arial`; // 让文字大小跟随缩放
               
               ctx.textAlign = 'left';
+
+              const iconX=obj.x-20*this.zoomRate*this.scale;
+              const iconY=obj.y-20*this.zoomRate*this.scale;
+              const iconWidth = 100*this.zoomRate*this.scale; 
+              const iconHeight = 100*this.zoomRate*this.scale;
+
+              // displayType:res.data.displayType,//显示类型 0-分数 1-对错 2-等级
+              // displayName: res.data.displayName,//显示值
+              // correctType: res.data.correctType,//显示对错的时候 0-错 1-半对 2-全对
+              if(item.displayType === 0){
+                ctx.fillText(`${item.displayName}`,obj.x+35*this.zoomRate*this.scale,obj.y);
+              }else{
+                if(item.correctType==0){
+                  //0 分全错
+                  ctx.drawImage(this.CacheAllWrong, iconX, iconY, iconWidth, iconHeight);
+                }else if(item.correctType==2){
+                  //满分 全对
+                  ctx.drawImage(this.CacheAllRight, iconX, iconY, iconWidth, iconHeight);
+                }else{
+                  //半对
+                  ctx.drawImage(this.CacheHalfRight, iconX, iconY, iconWidth, iconHeight);
+                }
+              }
             }
             else
             {
@@ -521,26 +544,40 @@ export default {
               const iconWidth = 50*this.zoomRate*this.scale; 
               const iconHeight = 50*this.zoomRate*this.scale;
               // console.log("打印item.score",item.score)
-              if(item.score==0)
-              {
+              if(item.displayType === 0 || item.displayType === 2){
+                ctx.fillText(`${item.displayName}`,obj.x+35*this.zoomRate*this.scale,obj.y);
+              }else{
+                if(item.correctType==0){
+                  //0 分全错
+                  ctx.drawImage(this.CacheAllWrong, iconX, iconY, iconWidth, iconHeight);
+                }else if(item.correctType==2){
+                  //满分 全对
+                  ctx.drawImage(this.CacheAllRight, iconX, iconY, iconWidth, iconHeight);
+                }else{
+                  //半对
+                  ctx.drawImage(this.CacheHalfRight, iconX, iconY, iconWidth, iconHeight);
+                }
+              }
+              // if(item.score==0)
+              // {
                 
                 
-                //0 分全错
-                ctx.drawImage(this.CacheAllWrong, iconX, iconY, iconWidth, iconHeight);
+              //   //0 分全错
+              //   ctx.drawImage(this.CacheAllWrong, iconX, iconY, iconWidth, iconHeight);
                 
-              }
-              else if(item.score==item.fullScore)
-              {
-                //满分 全对
-                ctx.drawImage(this.CacheAllRight, iconX, iconY, iconWidth, iconHeight);
-              }
-              else
-              {
-                //半对
-                ctx.drawImage(this.CacheHalfRight, iconX, iconY, iconWidth, iconHeight);
-              }  
+              // }
+              // else if(item.score==item.fullScore)
+              // {
+              //   //满分 全对
+              //   ctx.drawImage(this.CacheAllRight, iconX, iconY, iconWidth, iconHeight);
+              // }
+              // else
+              // {
+              //   //半对
+              //   ctx.drawImage(this.CacheHalfRight, iconX, iconY, iconWidth, iconHeight);
+              // }  
             }
-            ctx.fillText(item.score,obj.x+35*this.zoomRate*this.scale,obj.y);
+            // ctx.fillText(`${item.score}`,obj.x+35*this.zoomRate*this.scale,obj.y);
             
             // ctx.fillStyle = 'blue';
             // ctx.font = `24px Arial`; // 让文字大小跟随缩放
@@ -613,6 +650,27 @@ export default {
               ctx.font = `${fontSize}px Arial`; // 让文字大小跟随缩放
               
               ctx.textAlign = 'left';
+
+              const iconX=obj.x-20*this.zoomRate*this.scale;
+              const iconY=obj.y-20*this.zoomRate*this.scale;
+              const iconWidth = 100*this.zoomRate*this.scale; 
+              const iconHeight = 100*this.zoomRate*this.scale;
+
+
+              if(item.displayType == 0){
+                ctx.fillText(`${item.displayName}`,obj.x+35*this.zoomRate*this.scale,obj.y);
+              }else{
+                if(item.correctType==0){
+                  //0 分全错
+                  ctx.drawImage(this.CacheAllWrong, iconX, iconY, iconWidth, iconHeight);
+                }else if(item.correctType==2){
+                  //满分 全对
+                  ctx.drawImage(this.CacheAllRight, iconX, iconY, iconWidth, iconHeight);
+                }else{
+                  //半对
+                  ctx.drawImage(this.CacheHalfRight, iconX, iconY, iconWidth, iconHeight);
+                }
+              }
             }
             else
             {
@@ -627,27 +685,42 @@ export default {
               const iconY=obj.y-20*this.zoomRate*this.scale;
               const iconWidth = 50*this.zoomRate*this.scale; 
               const iconHeight = 50*this.zoomRate*this.scale;
+
+              if(item.displayType === 0 || item.displayType === 2){
+                ctx.fillText(`${item.displayName}`,obj.x+35*this.zoomRate*this.scale,obj.y);
+              }else{
+                if(item.correctType==0){
+                  //0 分全错
+                  ctx.drawImage(this.CacheAllWrong, iconX, iconY, iconWidth, iconHeight);
+                }else if(item.correctType==2){
+                  //满分 全对
+                  ctx.drawImage(this.CacheAllRight, iconX, iconY, iconWidth, iconHeight);
+                }else{
+                  //半对
+                  ctx.drawImage(this.CacheHalfRight, iconX, iconY, iconWidth, iconHeight);
+                }
+              }
               // console.log("打印item.score",item.score)
-              if(item.score==0)
-              {
+              // if(item.score==0)
+              // {
                 
                 
-                //0 分全错
-                ctx.drawImage(this.CacheAllWrong, iconX, iconY, iconWidth, iconHeight);
+              //   //0 分全错
+              //   ctx.drawImage(this.CacheAllWrong, iconX, iconY, iconWidth, iconHeight);
                 
-              }
-              else if(item.score==item.fullScore)
-              {
-                //满分 全对
-                ctx.drawImage(this.CacheAllRight, iconX, iconY, iconWidth, iconHeight);
-              }
-              else
-              {
-                //半对
-                ctx.drawImage(this.CacheHalfRight, iconX, iconY, iconWidth, iconHeight);
-              }  
+              // }
+              // else if(item.score==item.fullScore)
+              // {
+              //   //满分 全对
+              //   ctx.drawImage(this.CacheAllRight, iconX, iconY, iconWidth, iconHeight);
+              // }
+              // else
+              // {
+              //   //半对
+              //   ctx.drawImage(this.CacheHalfRight, iconX, iconY, iconWidth, iconHeight);
+              // }  
             }
-            ctx.fillText(item.score,obj.x+35*this.zoomRate*this.scale,obj.y);
+            // ctx.fillText(item.score,obj.x+35*this.zoomRate*this.scale,obj.y);
             
             // ctx.fillStyle = 'blue';
             // ctx.font = `24px Arial`; // 让文字大小跟随缩放

+ 104 - 36
src/components/PaperImageSmall.vue

@@ -506,6 +506,26 @@ export default {
               ctx.font = `${fontSize}px Arial`; // 让文字大小跟随缩放
               
               ctx.textAlign = 'left';
+
+              const iconX=obj.x-20*this.zoomRate*this.scale;
+              const iconY=obj.y-20*this.zoomRate*this.scale;
+              const iconWidth = 100*this.zoomRate*this.scale; 
+              const iconHeight = 100*this.zoomRate*this.scale;
+
+              if(item.displayType === 0 || item.displayType === 2){
+                ctx.fillText(`${item.displayName}`,obj.x+35*this.zoomRate*this.scale,obj.y);
+              }else{
+                if(item.correctType==0){
+                  //0 分全错
+                  ctx.drawImage(this.CacheAllWrong, iconX, iconY, iconWidth, iconHeight);
+                }else if(item.correctType==2){
+                  //满分 全对
+                  ctx.drawImage(this.CacheAllRight, iconX, iconY, iconWidth, iconHeight);
+                }else{
+                  //半对
+                  ctx.drawImage(this.CacheHalfRight, iconX, iconY, iconWidth, iconHeight);
+                }
+              }
             }
             else
             {
@@ -518,29 +538,44 @@ export default {
               //判断是什么类型 scoreType 分数类型1:全对 2:半对 3: 全错
               const iconX=obj.x-20*this.zoomRate*this.scale;
               const iconY=obj.y-20*this.zoomRate*this.scale;
-              const iconWidth = 50*this.zoomRate*this.scale; 
-              const iconHeight = 50*this.zoomRate*this.scale;
+              const iconWidth = 100*this.zoomRate*this.scale; 
+              const iconHeight = 100*this.zoomRate*this.scale;
+
+              if(item.displayType === 0){
+                ctx.fillText(`${item.displayName}`,obj.x+35*this.zoomRate*this.scale,obj.y);
+              }else{
+                if(item.correctType==0){
+                  //0 分全错
+                  ctx.drawImage(this.CacheAllWrong, iconX, iconY, iconWidth, iconHeight);
+                }else if(item.correctType==2){
+                  //满分 全对
+                  ctx.drawImage(this.CacheAllRight, iconX, iconY, iconWidth, iconHeight);
+                }else{
+                  //半对
+                  ctx.drawImage(this.CacheHalfRight, iconX, iconY, iconWidth, iconHeight);
+                }
+              }
               // console.log("打印item.score",item.score)
-              if(item.score==0)
-              {
+              // if(item.score==0)
+              // {
                 
                 
-                //0 分全错
-                ctx.drawImage(this.CacheAllWrong, iconX, iconY, iconWidth, iconHeight);
+              //   //0 分全错
+              //   ctx.drawImage(this.CacheAllWrong, iconX, iconY, iconWidth, iconHeight);
                 
-              }
-              else if(item.score==item.fullScore)
-              {
-                //满分 全对
-                ctx.drawImage(this.CacheAllRight, iconX, iconY, iconWidth, iconHeight);
-              }
-              else
-              {
-                //半对
-                ctx.drawImage(this.CacheHalfRight, iconX, iconY, iconWidth, iconHeight);
-              }  
+              // }
+              // else if(item.score==item.fullScore)
+              // {
+              //   //满分 全对
+              //   ctx.drawImage(this.CacheAllRight, iconX, iconY, iconWidth, iconHeight);
+              // }
+              // else
+              // {
+              //   //半对
+              //   ctx.drawImage(this.CacheHalfRight, iconX, iconY, iconWidth, iconHeight);
+              // }  
             }
-            ctx.fillText(item.score,obj.x+35*this.zoomRate*this.scale,obj.y);
+            // ctx.fillText(item.score,obj.x+35*this.zoomRate*this.scale,obj.y);
             
             // ctx.fillStyle = 'blue';
             // ctx.font = `24px Arial`; // 让文字大小跟随缩放
@@ -613,6 +648,24 @@ export default {
               ctx.font = `${fontSize}px Arial`; // 让文字大小跟随缩放
               
               ctx.textAlign = 'left';
+              const iconX=obj.x-20*this.zoomRate*this.scale;
+              const iconY=obj.y-20*this.zoomRate*this.scale;
+              const iconWidth = 100*this.zoomRate*this.scale; 
+              const iconHeight = 100*this.zoomRate*this.scale;
+              if(item.displayType === 0){
+                ctx.fillText(`${item.displayName}`,obj.x+35*this.zoomRate*this.scale,obj.y);
+              }else{
+                if(item.correctType==0){
+                  //0 分全错
+                  ctx.drawImage(this.CacheAllWrong, iconX, iconY, iconWidth, iconHeight);
+                }else if(item.correctType==2){
+                  //满分 全对
+                  ctx.drawImage(this.CacheAllRight, iconX, iconY, iconWidth, iconHeight);
+                }else{
+                  //半对
+                  ctx.drawImage(this.CacheHalfRight, iconX, iconY, iconWidth, iconHeight);
+                }
+              }
             }
             else
             {
@@ -625,29 +678,44 @@ export default {
               //判断是什么类型 scoreType 分数类型1:全对 2:半对 3: 全错
               const iconX=obj.x-20*this.zoomRate*this.scale;
               const iconY=obj.y-20*this.zoomRate*this.scale;
-              const iconWidth = 50*this.zoomRate*this.scale; 
-              const iconHeight = 50*this.zoomRate*this.scale;
+              const iconWidth = 100*this.zoomRate*this.scale; 
+              const iconHeight = 100*this.zoomRate*this.scale;
               // console.log("打印item.score",item.score)
-              if(item.score==0)
-              {
+
+              if(item.displayType === 0 || item.displayType === 2){
+                ctx.fillText(`${item.displayName}`,obj.x+35*this.zoomRate*this.scale,obj.y);
+              }else{
+                if(item.correctType==0){
+                  //0 分全错
+                  ctx.drawImage(this.CacheAllWrong, iconX, iconY, iconWidth, iconHeight);
+                }else if(item.correctType==2){
+                  //满分 全对
+                  ctx.drawImage(this.CacheAllRight, iconX, iconY, iconWidth, iconHeight);
+                }else{
+                  //半对
+                  ctx.drawImage(this.CacheHalfRight, iconX, iconY, iconWidth, iconHeight);
+                }
+              }
+              // if(item.score==0)
+              // {
                 
                 
-                //0 分全错
-                ctx.drawImage(this.CacheAllWrong, iconX, iconY, iconWidth, iconHeight);
+              //   //0 分全错
+              //   ctx.drawImage(this.CacheAllWrong, iconX, iconY, iconWidth, iconHeight);
                 
-              }
-              else if(item.score==item.fullScore)
-              {
-                //满分 全对
-                ctx.drawImage(this.CacheAllRight, iconX, iconY, iconWidth, iconHeight);
-              }
-              else
-              {
-                //半对
-                ctx.drawImage(this.CacheHalfRight, iconX, iconY, iconWidth, iconHeight);
-              }  
+              // }
+              // else if(item.score==item.fullScore)
+              // {
+              //   //满分 全对
+              //   ctx.drawImage(this.CacheAllRight, iconX, iconY, iconWidth, iconHeight);
+              // }
+              // else
+              // {
+              //   //半对
+              //   ctx.drawImage(this.CacheHalfRight, iconX, iconY, iconWidth, iconHeight);
+              // }  
             }
-            ctx.fillText(item.score,obj.x+35*this.zoomRate*this.scale,obj.y);
+            // ctx.fillText(item.score,obj.x+35*this.zoomRate*this.scale,obj.y);
             
             // ctx.fillStyle = 'blue';
             // ctx.font = `24px Arial`; // 让文字大小跟随缩放

+ 12 - 1
src/components/StudentPaper.vue

@@ -41,7 +41,12 @@
                 <el-table-column label="得分/答案" align="center">
                   <template slot-scope="scope">
                     <div :class="scope.row.fullScore==scope.row.score?'':'question_score'">
-                    {{ scope.row.score }}
+                    <template v-if="scope.row.displayType === 0">{{ scope.row.displayName }}</template>
+                    <template v-else>
+                      <img v-if="scope.row.correctType==0" src="@/assets/icon/icon_all_wrong.svg" style="width: 12px;" />
+                      <img v-else-if="scope.row.correctType==2" src="@/assets/icon/icon_all_right.svg" style="width: 12px;" />
+                      <img v-else src="@/assets/icon/icon_half_right.svg" style="width: 12px;" />
+                    </template>
                     <span v-if="scope.row.answer">/{{ scope.row.answer }}</span>
                     </div>
                   </template>
@@ -207,6 +212,9 @@ export default {
                 questionName: '总分',
                 fullScore: res?.data?.fullScore || 150,
                 score: res?.data?.levelName ?? res?.data?.totalScore,
+                displayType:res.data.displayType,//显示类型 0-分数 1-对错 2-等级
+                displayName: res.data.displayName,//显示值
+                correctType: res.data.correctType,//显示对错的时候 0-错 1-半对 2-全对
                 questionAnswer: '',
                 answer: '',
                 samplingPosition:"{\"x\":195,\"y\":247,\"page\":1}",
@@ -370,6 +378,9 @@ export default {
     .question_score
     {
       color:#F56C6C;
+      display: flex;
+      align-items: center;
+      justify-content: center;
     }
   }
 }

+ 3 - 0
src/views/analysisReport/studentPage/scrolReport/transcript_single.vue

@@ -443,6 +443,9 @@ export default {
               questionName: '总分',
               fullScore: res?.data?.fullScore || 150,
               score: res?.data?.levelName ?? res?.data?.totalScore,
+              displayType:res.data.displayType,//显示类型 0-分数 1-对错 2-等级
+              displayName: res.data.displayName,//显示值
+              correctType: res.data.correctType,//显示对错的时候 0-错 1-半对 2-全对
               questionAnswer: '',
               answer: '',
               samplingPosition:"{\"x\":195,\"y\":247,\"page\":1}",

+ 1 - 1
version.json

@@ -1,5 +1,5 @@
 {
-  "version": "0.1.3_2025_10_16_0",
+  "version": "0.1.3_2025_10_29_0",
   "content": [
     {
       "time": "2024-11-1",