11wqe1 преди 3 месеца
родител
ревизия
ab1b01b185

+ 133 - 61
src/components/components/choseWorksDetailDialog.vue

@@ -111,6 +111,7 @@
                               :label="checkp"
                               class="redioStyle"
                             >
+                            <span>{{ optionTypeList[checkp] }}.</span>
                               <div
                                 style="margin-right: 10px"
                                 v-if="item2 && item2.imgType && item2.imgType == 1"
@@ -135,6 +136,7 @@
                              
                               class="redioStyle"
                             >
+                            <span>{{ optionTypeList[checkIndex] }}.</span>
                               <div
                                 style="margin-right: 10px"
                                 v-if="item2 && item2.imgType && item2.imgType == 1"
@@ -150,63 +152,6 @@
                       </div>
                     </div>
                   </div>
-
-                  <!-- <div
-                    class="s_b_m_b_i_m_choseList"
-                    v-for="(item, index) in testJson"
-                  >
-                    <div class="s_b_m_b_i_m_c_title">
-                      <span>{{ index + 1 }}</span>
-                      <svg
-                        width="16"
-                        height="16"
-                        viewBox="0 0 16 16"
-                        fill="none"
-                        xmlns="http://www.w3.org/2000/svg"
-                      >
-                        <path
-                          d="M15.3536 8.35355C15.5488 8.15829 15.5488 7.84171 15.3536 7.64645L12.1716 4.46447C11.9763 4.2692 11.6597 4.2692 11.4645 4.46447C11.2692 4.65973 11.2692 4.97631 11.4645 5.17157L14.2929 8L11.4645 10.8284C11.2692 11.0237 11.2692 11.3403 11.4645 11.5355C11.6597 11.7308 11.9763 11.7308 12.1716 11.5355L15.3536 8.35355ZM1 8.5H15V7.5H1V8.5Z"
-                          fill="#3681FC"
-                        />
-                      </svg>
-
-                      <span
-                        >{{
-                          item.type == 1
-                            ? "单选题:"
-                            : "多选题:"
-                        }}{{ item.teststitle }}</span
-                      >
-                  </div>
-
-                  <div
-                    class="s_b_m_b_i_m_c_options"
-                    v-for="(item2, index2) in item.checkList"
-
-                  >
-               
-                    <div class="s_b_m_b_i_m_c_o_btn">
-                      <span
-                        class="s_b_m_b_i_m_c_o_btn1"
-                        v-if="item.type == 1"
-                      >
-                 
-                      </span>
-                      <span class="s_b_m_b_i_m_c_o_btn2" v-else>
-
-                      </span>
-                    </div>
-                    <span>
-                      <img
-                        v-if="item2.imgType && item2.imgType === 1"
-                        :src="item2.src"
-                        alt=""
-                        @click="$hevueImgPreview(item2.src)"
-                      />
-                      <span v-else>{{ item2 }}</span>
-                    </span>
-                  </div>
-                  </div> -->
                 </div>
 
                 <!-- 问答1 -->
@@ -356,6 +301,82 @@
 
                   <!-- </div> -->
                 </div>
+                <div v-if="[4].includes(toolType)" class="s_b_m_b_i_m_evaluation">
+
+
+                  <div>
+                    <div
+                      class="a_add_title"
+                      style="
+                        display: flex;
+                        flex-direction: row;
+                        align-items: center;
+                        justify-content: center;
+                      "
+                    >
+                      <div style="margin-right: 20px; font-size: 20px">标题:</div>
+                      <div style="font-size: 20px">{{ testData.askTitle }}</div>
+                    </div>
+                    <div class="a_addBox">
+                      <div style="font-size: 16px; color: #c7c7c7; margin-bottom: 10px">
+                        题目内容
+                      </div>
+                      <div
+                        class="a_add_box"
+                        v-for="(item1, index1) in testData.askCount"
+                        :key="index1"
+                      >
+                        <div class="a_add_head">
+                          <div style="display: flex">
+                            <span class="askIndex"> {{ index1 + 1 }}</span>
+                            <div>题目:{{ testData.askJson[index1].askstitle }}</div>
+                          </div>
+                          <img
+                            v-if="testData.askJson[index1].img"
+                            :src="testData.askJson[index1].img"
+                            style="height: 300px; margin-top: 10px; max-width: 100%"
+                          />
+                        </div>
+                        <div class="a_add_body">
+                          <div class="a_add_input">
+                            <el-radio-group
+                              v-model="radioS[index1]"
+                              v-if="
+                                testData.askJson[index1].type == '1' ||
+                                !testData.askJson[index1].type
+                              "
+                            >
+                            
+                              <el-radio
+                                v-for="(item2, checkIndex) in testData.askJson[index1]
+                                  .checkList"
+                                :key="checkIndex"
+                                :label="checkIndex"
+                                :disabled="isAnswer"
+                                class="redioStyle"
+                                ><span>{{ optionTypeList[checkIndex] }}.</span><span v-html="item2"></span
+                              ></el-radio>
+                            </el-radio-group>
+                            <el-checkbox-group
+                              v-model="radioS[index1]"
+                              v-if="testData.askJson[index1].type == '2'"
+                            >
+                              <el-checkbox
+                                v-for="(item2, checkIndex1) in testData.askJson[index1]
+                                  .checkList"
+                                :key="checkIndex1"
+                                :label="checkIndex1"
+                                :disabled="isAnswer"
+                                class="redioStyle"
+                                ><span v-html="item2"></span>
+                              </el-checkbox>
+                            </el-checkbox-group>
+                          </div>
+                        </div>
+                      </div>
+                    </div>
+                  </div>
+                </div>
                 <!-- 思维网格 电子白板 思维导图 -->
                 <div v-if="[7,1,3].includes(toolType)" class="s_b_m_b_i_m_iframe">
                   <div v-if="[7].includes(toolType)">
@@ -690,7 +711,20 @@
 														<span :class="`${item3.right?'answerRight':'answerWrong'}`">{{ item3.label }}</span>
 													</span>
 												</span>
-
+                        
+
+                        <div class="answerSelect" v-if="[4].includes(toolType)">
+													<span v-for="(item2,index2) in JSON.parse(item.works)[0].anwer" 
+                          :key="index2" 
+                          >
+                          <div style="border-bottom: 3px #ccc solid;" v-if="typeof item2 === 'number'">{{ optionTypeList[item2] }}</div>
+                          <div style="border-bottom: 3px #ccc solid;" v-else>
+                            <span v-for="(iki,oi) in item2" :key="oi">
+                              {{ optionTypeList[iki] }}
+                            </span>
+                          </div>
+                          </span>
+												</div>
 												<div class="answerSelect" v-if="[41].includes(toolType)">
 													<span v-for="(item2,index2) in item.works.split(',')" :key="index2" :class="`${testData.selectJson.answer[index2]===parseInt(item2)?'answerRight':'answerWrong'}`">{{ optionTypeList[item2] }}</span>
 												</div>
@@ -828,12 +862,13 @@ export default {
         worksPreview: false
       },
       dialogTypeList: [
-        { label: "作业详细", value: 0,showType:[1,7,15,40,41,45,47,48,49,52,3], loading: false },
+        { label: "作业详细", value: 0,showType:[1,7,15,40,41,45,47,48,49,52,3,4], loading: false },
         { label: "题目统计", value: 1,showType:[45,15], loading: false },
-        { label: "学生统计", value: 2,showType:[1,7,15,40,41,45,47,48,52,3], loading: false }
+        { label: "学生统计", value: 2,showType:[1,7,15,40,41,45,47,48,52,3,4], loading: false }
       ],
 			toolList:[
 				{label:"选择题",value:45,img:require("../../assets/icon/thirdToolList/choose.png")},
+				{label:"问卷调查",value:4,img:require("../../assets/icon/thirdToolList/ask.png")},
 				{label:"思维导图",value:3,img:require("../../assets/icon/secondToolList/mindMapping.png")},
 				{label:"表格",value:48,img:require("../../assets/icon/fourthToolList/table.png")},
         {label:"文档",value:52,img:require("../../assets/icon/fourthToolList/text.png")},
@@ -1313,7 +1348,20 @@ export default {
                 iframeWindow.document.head.appendChild(_ajs);
                 console.log('66666');
     },
-   
+    // 截图
+    dataURLtoFile_shishi(dataurl, filename) {
+      let arr = dataurl.split(","),
+        mime = arr[0].match(/:(.*?);/)[1],
+        bstr = atob(arr[1]),
+        n = bstr.length,
+        u8arr = new Uint8Array(n);
+      while (n--) {
+        u8arr[n] = bstr.charCodeAt(n);
+      }
+      return new File([u8arr], filename, {
+        type: mime
+      });
+    },
     // beforeUpload(event) {
      
     //     var file = event;
@@ -1491,6 +1539,22 @@ export default {
         answerType = 6
         answerData={ eBzText:this.questionsData,eStar:this.radioS }
         answerData = JSON.stringify(answerData)
+      }else if(this.toolType == 4){ //问卷调查
+        for (var i = 0; i < this.testData.askCount; i++) {
+          if (
+            (this.radioS[i] instanceof Array && !this.radioS[i].length) ||
+            (this.radioS[i] !== 0 && !this.radioS[i])
+          ) {
+            this.$message.error("请选择选项");
+            return;
+          }
+        }
+        answerType = 2
+        
+        answerData=[{askJson:{askCount:this.testData.askCount,askTitle:this.testData.askTitle,
+          askJson:this.testData.askJson},
+          anwer:this.radioS}]
+        answerData = JSON.stringify(answerData)
       }
 
       let params = []
@@ -1723,6 +1787,14 @@ export default {
             this.testData.rateJson.forEach(e=>{
               this.radioS.push('')
             })
+          }else if(this.toolType == 4){ //问卷调查
+            this.testData.askJson.forEach(e=>{
+              if (e.type && e.type == 2) {
+                this.radioS.push([])
+              }else{
+                this.radioS.push('')
+              }
+            })
           }
       }
     },

+ 133 - 3
src/components/components/studentWorkPreviewDialog.vue

@@ -17,7 +17,7 @@
           </div>
           <div
             class="s_b_m_content"
-            v-if="[45, 48, 52, 15, 41, 47,40].includes(tool)"
+            v-if="[45, 48, 52, 15, 41, 47,40,4].includes(tool)"
           >
             <div class="s_b_m_tool45" v-if="[45].includes(tool)">
               <div class="s_b_m_toolItem" v-for="(item, index) in testJson">
@@ -95,7 +95,81 @@
                 <div></div>
               </div>
             </div>
-
+            <div class="s_b_m_tool45" v-if="[4].includes(tool)">
+             
+              <div>
+                <div
+                  class="a_add_title"
+                  style="
+                    display: flex;
+                    flex-direction: row;
+                    align-items: center;
+                    justify-content: center;
+                  "
+                >
+                  <div style="margin-right: 20px; font-size: 20px">标题:</div>
+                  <div style="font-size: 20px">{{ testData.askTitle }}</div>
+                </div>
+                <div class="a_addBox">
+                  <div style="font-size: 16px; color: #c7c7c7; margin-bottom: 10px">
+                    题目内容
+                  </div>
+                  <div
+                    class="a_add_box"
+                    v-for="(item1, index1) in testData.askCount"
+                    :key="index1"
+                  >
+                    <div class="a_add_head">
+                      <div style="display: flex">
+                        <span class="askIndex"> {{ index1 + 1 }}</span>
+                        <div>题目:{{ testData.askJson[index1].askstitle }}</div>
+                      </div>
+                      <img
+                        v-if="testData.askJson[index1].img"
+                        :src="testData.askJson[index1].img"
+                        style="height: 300px; margin-top: 10px; max-width: 100%"
+                      />
+                    </div>
+                    <div class="a_add_body">
+                      <div class="a_add_input">
+                        <el-radio-group
+                          v-model="userAnswer[index1]"
+                          v-if="
+                            testData.askJson[index1].type == '1' ||
+                            !testData.askJson[index1].type
+                          "
+                        >
+                        
+                          <el-radio
+                            v-for="(item2, checkIndex) in testData.askJson[index1]
+                              .checkList"
+                            :key="checkIndex"
+                            :label="checkIndex"
+                            :disabled="isAnswer"
+                            class="redioStyle"
+                            ><span>{{ optionTypeList[checkIndex] }}.</span><span v-html="item2"></span
+                          ></el-radio>
+                        </el-radio-group>
+                        <el-checkbox-group
+                          v-model="userAnswer[index1]"
+                          v-if="testData.askJson[index1].type == '2'"
+                        >
+                          <el-checkbox
+                            v-for="(item2, checkIndex1) in testData.askJson[index1]
+                              .checkList"
+                            :key="checkIndex1"
+                            :label="checkIndex1"
+                            :disabled="isAnswer"
+                            class="redioStyle"
+                            ><span>{{ optionTypeList[checkIndex1] }}.</span> <span v-html="item2"></span>
+                          </el-checkbox>
+                        </el-checkbox-group>
+                      </div>
+                    </div>
+                  </div>
+                </div>
+              </div>
+            </div>
             <div class="s_b_m_tool48" v-if="[48, 52].includes(tool)">
               <div v-html="userAnswer"></div>
             </div>
@@ -210,6 +284,11 @@ export default {
           value: 45,
           img: require("../../assets/icon/thirdToolList/choose.png")
         },
+        {
+          label: "问卷调查",
+          value: 4,
+          img: require("../../assets/icon/thirdToolList/ask.png")
+        },
         {
           label: "表格",
           value: 48,
@@ -259,7 +338,9 @@ export default {
       studentWork: null,
       testData: null,
       testJson: null,
-      tool: null
+      tool: null,
+			optionTypeList:['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z']
+
     };
   },
   methods: {
@@ -291,6 +372,11 @@ export default {
           ? this.studentWork.works
           : JSON.parse(this.studentWork.works);
         if ([45].includes(this.tool)) {
+          let _answer = _studentWorks[0].anwer;
+          _result = _answer;
+        } else if ([4].includes(this.tool)) {
+          console.log('_studentWorks',_studentWorks);
+
           let _answer = _studentWorks[0].anwer;
           _result = _answer;
         } else if ([48, 52].includes(this.tool)) {
@@ -644,4 +730,48 @@ export default {
   border: solid 1px #D0D0D2;
   background-color: #F7F6F9;
 }
+.a_add_body {
+  display: flex;
+  align-items: center;
+}
+
+.a_add_input {
+  display: flex;
+  align-items: center;
+  flex-wrap: wrap;
+  width: 100%;
+}
+
+.a_add_input >>> .el-radio-group,
+.a_add_input >>> .el-checkbox-group {
+  width: 100%;
+}
+
+.a_add_input >>> .el-radio,
+.a_add_input >>> .el-checkbox {
+  display: flex;
+  flex-direction: row;
+  flex-wrap: nowrap;
+  align-items: center;
+  padding: 15px 0;
+}
+
+.a_add_input >>> .el-radio:not(:last-child),
+.a_add_input >>> .el-checkbox:not(:last-child) {
+  width: 100%;
+  border-bottom: 1px solid #efefef;
+}
+.redioStyle >>> .el-radio__label {
+  font-size: 18px;
+}
+
+.redioStyle >>> .el-radio__label > span,
+.redioStyle >>> .el-checkbox__label > span {
+  word-break: break-all;
+  white-space: normal;
+}
+
+.redioStyle >>> .el-checkbox__label {
+  font-size: 18px;
+}
 </style>

+ 4 - 0
src/components/easy2/studyStudent.vue

@@ -1097,6 +1097,10 @@
                               alt
                             />
                             <div style="margin: 5px 0">问卷调查</div>
+                            <div class="upload_toolBtn"  @click="openChoseWorksDetailDialog(tooC,toolIndex,taskCount,4)"
+                            style="position: absolute;right: 33px;top: -30px;">
+                              投影
+                            </div>
                             <div
                               class="upload_toolBtn"
                               v-if="tType === '1'"

+ 4 - 0
src/components/easy3/studyStudent.vue

@@ -1050,6 +1050,10 @@
                               alt
                             />
                             <div style="margin: 5px 0">问卷调查</div>
+                            <div class="upload_toolBtn"  @click="openChoseWorksDetailDialog(tooC,toolIndex,taskCount,4)"
+                            style="position: absolute;right: 33px;top: -30px;">
+                              投影
+                            </div>
 														<div class="upload_toolBtn" v-if="tType==='1'" @click="openStatisticalAnalysis(tooC,toolIndex,taskCount)"
                               style="position: absolute;right: 33px;top: -30px;">
                               统计分析

+ 6 - 0
src/components/studyStudent.vue

@@ -1012,6 +1012,10 @@
                               alt
                             />
                             <div style="margin: 5px 0">问卷调查</div>
+                            <div class="upload_toolBtn"  @click="openChoseWorksDetailDialog(tooC,toolIndex,taskCount,4)"
+                            style="position: absolute;right: 153px;top: -30px;">
+                              投影
+                            </div>
 														<div class="upload_toolBtn" v-if="tType==='1'" @click="openStatisticalAnalysis(tooC,toolIndex,taskCount)"
                               style="position: absolute;right: 33px;top: -30px;">
                               统计分析
@@ -17888,6 +17892,8 @@ export default {
           type: 2,
         },
       ];
+      console.log('params',params);
+      
       this.ajax
         .post(this.$store.state.api + "addCourseWorks", params)
         .then((res) => {

+ 4 - 0
src/components/studySutdentClass/studyStudent.vue

@@ -1050,6 +1050,10 @@
                               alt
                             />
                             <div style="margin: 5px 0">问卷调查</div>
+                            <div class="upload_toolBtn"  @click="openChoseWorksDetailDialog(tooC,toolIndex,taskCount,4)"
+                            style="position: absolute;right: 33px;top: -30px;">
+                              投影
+                            </div>
                             <div
                               class="upload_toolBtn"
                               v-if="tType === '1'"