zengyicheng 1 year ago
parent
commit
12f939dab5
1 changed files with 35 additions and 6 deletions
  1. 35 6
      src/components/noTerminal/studyStudent.vue

+ 35 - 6
src/components/noTerminal/studyStudent.vue

@@ -3594,11 +3594,37 @@
             </div>
             <div class="a_add_body">
               <div class="a_add_input">
-                <el-radio-group v-model="radio[index1]">
-                  <el-radio v-for="(item2, checkIndex) in askJson.askJson[index1]
-                      .checkList" :key="checkIndex" :label="checkIndex" :disabled="isAnswer" class="redioStyle"><span
-                      v-html="item2"></span></el-radio>
+                <el-radio-group
+                  v-model="radio[index1]"
+                  v-if="
+                    askJson.askJson[index1].type == '1' ||
+                    !askJson.askJson[index1].type
+                  "
+                >
+                  <el-radio
+                    v-for="(item2, checkIndex) in askJson.askJson[index1]
+                      .askItem"
+                    :key="checkIndex"
+                    :label="checkIndex"
+                    :disabled="isAnswer"
+                    class="redioStyle"
+                    ><span v-html="item2"></span
+                  ></el-radio>
                 </el-radio-group>
+                <el-checkbox-group
+                  v-model="radio[index1]"
+                  v-if="askJson.askJson[index1].type == '2'"
+                >
+                  <el-checkbox
+                    v-for="(item2, checkIndex1) in askJson.askJson[index1]
+                      .askItem"
+                    :key="checkIndex1"
+                    :label="checkIndex1"
+                    :disabled="isAnswer"
+                    class="redioStyle"
+                    ><span v-html="item2"></span>
+                  </el-checkbox>
+                </el-checkbox-group>
               </div>
             </div>
           </div>
@@ -9229,12 +9255,15 @@ export default {
         return;
       }
       for (var i = 0; i < this.askJson.askCount; i++) {
-        if (this.radio[i] !== 0 && !this.radio[i]) {
+        if (
+          (this.radio[i] instanceof Array && !this.radio[i].length) ||
+          (this.radio[i] !== 0 && !this.radio[i])
+        ) {
           this.$message.error("请选择选项");
           return;
         }
       }
-      this.askList.push({ askJson: this.askJson, anwer: this.radio.join(",") });
+      this.askList.push({ askJson: this.askJson, anwer: this.radio });
       let params = [
         {
           uid: this.sStudent.userid,