<template>
  <div class="choseWorksDetailDialog" v-if="show">
    <el-dialog
      :visible.sync="show"
      width="100%"
      height="100%"
      style="overflow: hidden;"
      fullscreen
      :modal="true"
      :close-on-click-modal="false"
      :show-close="false"
    >
      <div class="s_box">
        <div class="s_b_main">
          <div class="s_b_m_top">
            <div class="s_b_m_t_left">
              <div class="s_b_m_t_leftSp" :style="{'margin-right': item.showType.includes(toolType) ? '40px' : 0}" v-for="item in dialogTypeList" :key="item.value">
                <span
                  v-if="item.showType.includes(toolType) && !item.noShow.includes(tType)"
                  :class="{ s_b_m_t_l_active: showType === item.value }"
                  @click="changeShowType(item.value)"
                  >{{ (toolType == 15 && item.value ==1)? lang.ssWordCloud : lang[item.langKey] }}</span
                >
              </div>
            </div>
            <div class="s_b_m_t_right">
              <span @click="close">{{ lang.ssClose }}</span>
            </div>
          </div>
          <div class="s_b_m_bottom">
            <div class="s_b_m_b_item" v-if="showType === 0 && dialogTypeList[0].showType.includes(toolType)">
              <div class="s_b_m_b_i_main" ref="imgWork">
                <div class="s_b_m_b_i_m_title" v-if="testData">
                  <div style="display: flex;justify-content: space-between;align-items: center;margin-bottom: 5px;">
                    <div class="titTop">
                      <img style="border-radius: 5px;" :src="toolList.find(item=>item.value===toolType).img" alt/>
                      <span>{{ lang[toolList.find(item=>item.value===toolType).langKey] }}</span>
                    </div>

                    <el-button type="primary"
                    size="small"
                    v-if="[7,1,3].includes(toolType)"
                    @click="captureScreenshot">{{ lang.ssHomeworkSubmit }}</el-button>

                    <el-button type="primary"
                    size="small"
                    v-if="[45,4,48,52,15,41,47,40].includes(toolType)"
                    @click="submitWork">{{ lang.ssHomeworkSubmit }}</el-button>

                    <el-button type="primary"
                      size="small"
                      v-if="[57].includes(toolType)"
                    @click="upLoadCocoPi">{{ lang.ssHomeworkSubmit }}</el-button>

                    <el-button type="primary"
                      size="small"
                      v-if="[72].includes(toolType)"
                    @click="upLoadApp">{{ lang.ssHomeworkSubmit }}</el-button>
                  </div>
                  <span v-if="testData.toolDetail" class="renderedFor">
                    <span v-html="renderedFormula(testData.toolDetail)"></span>
                  </span>
									<span v-else>{{ lang.ssNone }}</span>
                </div>

                <span v-if="![7,1,3,23,18,21,71,23,24,32,63,28,31,39,66].includes(toolType)">{{ lang.ssQuestionContent }}</span>

                <!-- 选择题1  -->
                <div v-if="[45].includes(toolType) && testJson">
                  <div
                    class="a_add_box"
                    v-for="(item1, index1) in testJson"
                    :key="index1"
                  >
                    <div class="a_add_head">
                      <div style="display: flex">
                        <span class="askIndex">{{ index1 + 1 }}</span>
                        <div
                          v-if="testJson.type == '1'"
                          style="margin-right: 5px; min-width: 70px"
                        >
                          ({{ lang.ssSingleChoice }})
                        </div>
                        <div
                          v-if="item1.type == '2'"
                          style="margin-right: 5px; min-width: 70px"
                        >
                          ({{ lang.ssMultipleChoice }})
                        </div>
                        <div style="display: flex;" class="renderedFor">
                          <span style="flex-shrink: 0;">{{ lang.ssQuestionColon }}</span>
                          <span v-html="renderedFormula(item1.teststitle)"></span>
                        </div>
                      </div>
                      <img
                        v-if="item1.img"
                        :src="item1.img"
                        style="height: 300px; margin-top: 10px; max-width: 100%"
                      />
                    </div>
                    <div
                      class="timuImgBox"
                      v-if="
                        item1.timuList &&
                        item1.timuList.length
                      "
                    >
                      <div
                        v-for="(timg, tIndex) in item1.timuList"
                        :key="tIndex"
                        class="timuImg"
                        @click.stop="previewImg(timg.src)"
                      >
                        <img :src="timg.src" alt="" />
                      </div>
                    </div>
                    <div class="a_add_body">
                      <div class="a_add_input">
                        <el-radio-group
                          v-model="radioS[index1]"
                          v-if="item1.type == '1'"
                        >
                          <div class="radioBox">
                            <el-radio
                              v-for="(item2, checkp) in item1.checkList"
                              :key="checkp"
                              :label="checkp"
                              class="redioStyle"
                            >
                            <span>{{ optionTypeList[checkp] }}.</span>
                              <div
                                style="margin-right: 10px"
                                v-if="item2 && item2.imgType && item2.imgType == 1"
                              >
                                <div class="inImg"  @click="$hevueImgPreview(item2.src)">
                                  <img :src="item2.src" alt="" />
                                </div>
                              </div>
                              <span v-else v-html="item2"></span>
                            </el-radio>
                          </div>
                        </el-radio-group>
                        <el-checkbox-group
                          v-model="radioS[index1]"
                          v-if="item1.type == '2'"
                        >
                          <div class="radioBox">
                            <el-checkbox
                              v-for="(item2, checkIndex) in item1.checkList"
                              :key="checkIndex"
                              :label="checkIndex"

                              class="redioStyle"
                            >
                            <span>{{ optionTypeList[checkIndex] }}.</span>
                              <div
                                style="margin-right: 10px"
                                v-if="item2 && item2.imgType && item2.imgType == 1"
                              >
                                <div class="inImg" @click="$hevueImgPreview(item2.src)">
                                  <img :src="item2.src" alt="" />
                                </div>
                              </div>
                              <span v-else v-html="item2"></span>
                            </el-checkbox>
                          </div>
                        </el-checkbox-group>
                      </div>
                    </div>
                  </div>
                </div>

                <!-- 问答1 -->
								<div v-if="[15].includes(toolType)" class="s_b_m_b_i_m_question">
									<div class="s_b_m_b_i_m_c_title">
                     <span></span>
                    <span>{{ lang.ssAsk }}：{{ testData.answerQ }}</span>
                  </div>
                  <el-input
                    type="textarea"
                    :rows="10"
                    :placeholder="lang.ssEnterContent"
                    resize="none"
                    v-model="questionsData">
                  </el-input>
									<!-- <span style="padding: 10px;">
                    {{ questionsData }}
									</span> -->
								</div>
                <!-- 选择匹配1 -->
                <div v-if="[41].includes(toolType)" class="s_b_m_b_i_m_selectiveMatching">
									<div class="sm_left">
										<img :src="testData.selectJson.url" alt="" @click="$hevueImgPreview(testData.selectJson.url)">
									</div>
									<div class="sm_right">
										<div class="sm_right_item" v-for="(item,index) in testData.selectJson.answer" :key="index + 'q1'">
											<el-select v-model="radioS[index]" :placeholder="lang.ssPleaseSelect">
  			  							<el-option
  			  								v-for="(item2,index2) in testData.selectJson.select"
  			  								:key="index2"
  			  								:label="item2"
  			  								:value="index2">
												</el-option>
											</el-select>
										</div>
									</div>
								</div>
                <!-- 排序1 -->
                <div v-if="[47].includes(toolType)" class="s_b_m_b_i_m_sorting">
									<div class="sortingItem" v-for="(item,index) in testData.sentenceList" :key="index">
										<div class="s_b_m_b_i_m_c_title2">
                      <span></span>
                      <span>{{ lang.ssQuestion }}{{ index + 1 }}:{{ lang.ssPleaseChooseCorrectOrder }}</span>
                    </div>

                    <div class="si_box2">
                      <div class="si_b_bottom">
                        <div class="si_b_t_item"
                          style="line-height: 47px;"
                         @click="sentenceBtn2(index,index2)"
                         v-for="(item2,index2) in radioS[index]"
                         :key="index2">
                         {{ item2 }}</div>
                      </div>

                      <div style="height: 1px;background-color: #ccc;width: 100%;margin: 10px 0"></div>

                      <div class="si_b_bottom">
                          <div class="si_b_b_item"
                            :style="{border : isShowList[index][index2] ? 'solid 2px #A3C7F9' : 'none'}"
                            v-for="(item2,index2) in item.addSentence"
                            :key="index2">
                            <div v-show="isShowList[index][index2]"
                              style="width: 100%;height: 100%;line-height: 47px;text-align: center;"
                              @click="sentenceBtn(index,index2,'0')"
                              >{{ item2 }}</div>
                            </div>
                      </div>
                    </div>
									</div>
								</div>
                <!-- 个人评价1 -->
                <div v-if="[40].includes(toolType)" class="s_b_m_b_i_m_evaluation">
                  <div class="middleBox">
                    <div class="pfBox" v-for="(e, eIndex) in testData.rateJson" :key="eIndex">
                      <div class="nameAndrate">
                        <div>{{ e.value }}</div>
                        <el-rate
                          v-model="radioS[eIndex]"
                        ></el-rate>
                      </div>
                      <div v-if="e.detail">{{ e.detail }}</div>
                    </div>

                    <div class="bz">
                      <textarea
                        rows="4"
                        class="pj"
                        style="
                          padding: 10px 5px;
                          width: 70%;
                          background: #f7f6f9;
                          font-size: 14px;
                          text-indent: 10px;
                          resize:none
                        "
                        cols
                        :placeholder="lang.ssEnterEvaluation"
                        v-model="questionsData"
                      ></textarea>
                    </div>
                  </div>
									<!-- <div class="e_item" v-for="(item,index) in testData.rateJson" :key="index">
										<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.value?item.value:lang.ssNoTitle }}</span>
                    </div>
                    <div class="e_item_content" v-if="testJson">
                      <span class="e_i_c_detail">{{ item.detail?item.detail:lang.ssNoContent }}</span>
                      <el-rate :value="testJson.eStar[index]" disabled :max="item.score"></el-rate>
                    </div>

									</div>
									<span v-if="testJson" style="padding: 10px;">{{ testJson.eBzText }}</span>
								</div> -->
                </div>
                <!-- 表格1 -->
                <div v-if="[48].includes(toolType)" class="s_b_m_b_i_m_evaluation">
                  <!-- <el-form> -->
                    <editor-bar
                      v-model="questionsData"
                    ></editor-bar>

                    <!-- <div  class="cont" v-if="testData && testData.tableJson && testData.tableJson.text" v-html="testData.tableJson.text"></div> -->
                  <!-- </el-form> -->
                </div>
                <!-- 文档 1 -->
                <div v-if="[52].includes(toolType)" class="s_b_m_b_i_m_evaluation">
                    <editor-bar
                      v-model="questionsData"
                    ></editor-bar>
                </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">{{ lang.ssTitleColon }}</div>
                      <div style="font-size: 20px">{{ testData.askTitle }}</div>
                    </div>
                    <div class="a_addBox">
                      <div style="font-size: 16px; color: #c7c7c7; margin-bottom: 10px">
                        {{ lang.ssQuestionContent }}
                      </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 style="display: flex;align-items: center;">{{ lang.ssQuestionColon }}{{ 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"
                                >{{ optionTypeList[checkIndex1] }}.<span v-html="item2"></span>
                              </el-checkbox>
                            </el-checkbox-group>
                          </div>
                        </div>
                      </div>
                    </div>
                  </div>
                </div>
                <!-- 思维网格 电子白板 思维导图 -->
                <div id="loadLi_JieE" v-if="[7,1,3,57,18,21,71,23,24,32,63,28,31,39,66,72].includes(toolType)" style="position: relative;min-height: 850px; " class="s_b_m_b_i_m_iframe">
                  <div style="display: none;
                  position: absolute;
                  height: 100%;
                  top: 50%; left: 50%;
                  transform: translate(-50%, -50%); ">
                    <div style="color: rgb(255, 255, 255);
                      padding: 15px; background: rgba(0, 0, 0, 0.44);
                      font-size: 18px;display: flex; align-items: center;
                      justify-content: center;width: 100%;height: 100%;box-sizing: border-box;">
                        <img src="//beta.pbl.cocorobo.cn/pbl-student-table/dist/js/loading.gif"
                          style="width: 26px; margin-right: 10px;">
                        <span>{{ lang.ssUploading }}</span>
                    </div>
                  </div>


                  <!-- 思维网格 -->
                  <div v-if="[7].includes(toolType)">
										<iframe
    								  allow="camera *; microphone *;display-capture;midi;encrypted-media;"
    								  :src="`https://beta.pbl.cocorobo.cn/pbl-teacher-table/dist/#/Grid?userid=${userId}`"
    								  ref="iframeThoughtGridRef"
    								></iframe>
									</div>

                  <!-- 电子白板 -->
									<div v-if="[1].includes(toolType)">
										<iframe
    								  allow="camera *; microphone *;display-capture;midi;encrypted-media;"
    								  src="https://beta.iwb.cocorobo.cn/"
    								  ref="iframeWhiteBoardRef"
    								></iframe>
									</div>

                  <!-- 思维导图 -->
                  <div v-if="[3].includes(toolType)">
										<iframe id="dialogFrame"
    								  allow="camera *; microphone *;display-capture;midi;encrypted-media;"
    								  src="https://beta.cloud.cocorobo.cn/kityminder-editor/dist/index.html"
    								  ref="iframeMainMapRef"
    								></iframe>
                  </div>

                  <!-- cocopi -->
                  <div v-if="[57].includes(toolType)">
										<iframe id="dialogFrame1"
    								  allow="camera *; microphone *;display-capture;midi;encrypted-media;"
    								  src="https://pi.cocorobo.cn/"
    								  ref="iframePiRef"
    								></iframe>
                  </div>

                  <!-- 训练服务器 -->
                  <div v-if="[18].includes(toolType)">
										<iframe
    								  allow="camera *; microphone *;display-capture;midi;encrypted-media;"
    								  src="https://xunlian.cocorobo.cn/"
    								></iframe>
                  </div>

                  <!-- AIoT Blockly -->
                  <div v-if="[21].includes(toolType)">
										<iframe
    								  allow="camera *; microphone *;display-capture;midi;encrypted-media;"
    								  src="https://x.cocorobo.cn"
    								></iframe>
                  </div>

                  <!-- ai智能体 -->
                  <div v-if="[71].includes(toolType)">
										<iframe
    								  allow="camera *; microphone *;display-capture;midi;encrypted-media;"
    								  :src="AIUrl"
    								></iframe>
                  </div>
                  <!-- AI Python -->
                  <div v-if="[23].includes(toolType)" class="s_b_m_b_i_m_evaluation">
                    <iframe
                        frameborder="no"
                        border="0"
                        scrolling="no"
                        style="border:0;width:100%;height:100%;"
                        src="https://python-blockly.cocorobo.cn/"
                        >
                    </iframe>
                  </div>
                  <!-- AI Blockly -->
                  <div v-if="[24].includes(toolType)" class="s_b_m_b_i_m_evaluation">
                    <iframe
                        frameborder="no"
                        border="0"
                        scrolling="no"
                        style="border:0;width:100%;height:100%;"
                        src="https://ai-blockly.cocorobo.cn/?lang=zh-hans"
                        >
                    </iframe>
                  </div>

                  <!-- 源码编辑 -->
                  <div v-if="[32].includes(toolType)" class="s_b_m_b_i_m_evaluation">
                    <iframe
                        frameborder="no"
                        border="0"
                        scrolling="no"
                        style="border:0;width:100%;height:100%;"
                        src="https://kitten.codemao.cn/"
                        >
                    </iframe>
                  </div>
                   <!-- 海龟编程 -->
                   <div v-if="[63].includes(toolType)" class="s_b_m_b_i_m_evaluation">
                    <iframe
                        frameborder="no"
                        border="0"
                        scrolling="no"
                        style="border:0;width:100%;height:100%;"
                        src="https://wood.codemao.cn/"
                        >
                    </iframe>
                  </div>
                  <!-- 翻译 -->
                  <div v-if="[28].includes(toolType)" class="s_b_m_b_i_m_evaluation">
                    <iframe
                        frameborder="no"
                        border="0"
                        scrolling="no"
                        style="border:0;width:100%;height:100%;"
                        src="//dict.youdao.com/"
                        >
                    </iframe>
                  </div>
                  <!-- 数学画板 -->
                  <div v-if="[31].includes(toolType)" class="s_b_m_b_i_m_evaluation">
                    <iframe
                        frameborder="no"
                        border="0"
                        scrolling="no"
                        style="border:0;width:100%;height:100%;"
                        src="//www.netpad.net.cn/svg.html"
                        >
                    </iframe>
                  </div>
                  <!-- GeoGebra -->
                  <div v-if="[39].includes(toolType)" class="s_b_m_b_i_m_evaluation">
                    <iframe
                        frameborder="no"
                        border="0"
                        scrolling="no"
                        style="border:0;width:100%;height:100%;"
                        src="//www.geogebra.org/calculator"
                        >
                    </iframe>
                  </div>
                  <!-- 公式编辑 -->
                  <div v-if="[66].includes(toolType)" class="s_b_m_b_i_m_evaluation">
                    <iframe
                        frameborder="no"
                        border="0"
                        scrolling="no"
                        style="border:0;width:100%;height:100%;"
                        src="https://www.latexlive.com/"
                        >
                    </iframe>
                  </div>
                  <!-- 公式编辑 -->
                  <div v-if="[72].includes(toolType)" class="s_b_m_b_i_m_evaluation">
                    <iframe
                        allow= "camera *; microphone *;display-capture;midi;encrypted-media;"
                        frameborder="no"
                        border="0"
                        scrolling="no"
                        style="border:0;width:100%;height:100%;"
                        :src="appStoreUrl"
                        ref="appStore"
                        >
                    </iframe>
                  </div>
                  <!-- 时间轴 -->
                  <!-- <div v-if="[68].includes(toolType)" class="s_b_m_b_i_m_evaluation">
                    <iframe
                        frameborder="no"
                        border="0"
                        scrolling="no"
                        style="border:0;width:100%;height:100%;"
                        src="https://time.graphics/editor"
                        >
                    </iframe>
                  </div> -->

                </div>

                <!-- 英语写作  -->
                <div v-if="[69].includes(toolType)" class="s_b_m_b_i_m_evaluation">
                  <onlineWrite
                    :englishList="englishList"
                    :myAnswerList1="myAnswerList1"
                    ref="engJson"
                  ></onlineWrite>
                  <div style="width: 100%;display: flex;justify-content: flex-end;">
                    <el-button type="primary" @click="addEnglishWork">{{ lang.ssConfirm }}</el-button>
                  </div>
                </div>
                <!-- 英语写口语  -->
                <div v-if="[70].includes(toolType)" class="s_b_m_b_i_m_evaluation">
                  <EnglishVoice
                    :englishVoiceJson='englishVoiceJson'
                    :userid="userId"
                    :id="id"
                    :courseType="courseType"
                    :taskCount="taskCount"
                    :toolindex="toolIndex"
                    @selectSWorks="selectSWorks"
                    @selectStudent="selectStudent"
                    :englishVoiceJsonWork="englishVoiceJsonWork"></EnglishVoice>
                  </div>

                <!-- 学生分组 -->
                <div v-if="[49].includes(toolType) && groupStudent.length > 0" class="s_b_m_b_i_m_evaluation">
                  <div v-if="courseDetail.userid == userId" class="g_d_btnBox">
                    <div style="color: rgb(171 171 171); margin: 0 10px 0 0">
                      {{ lang.ssOpenSeatTip }}
                    </div>

                    <div class="group_switch">
                      <span>{{ lang.ssOpenSeat }}</span>
                      <el-switch
                        v-model="islock"
                        active-text=""
                        class="switchCss"
                        @change="lockChair"
                      ></el-switch>
                    </div>
                    <div
                      type="primary"
                      @click="updateGroup"
                      class="returnBtn"
                      style="background-color: #225bc7"
                    >
                      {{ lang.ssGroupSettings }}
                    </div>
                  </div>
                  <div>
                    <div
                      class="g_d_box"
                      v-if="groupJson.group"
                    >
                      <div
                        class="g_d_group"
                        v-for="(g, gindex) in groupJson.group"
                        :key="gindex"
                      >

                          <div class="g_d_group_chair">
                            <div v-if="groupJson.number > 1">
                              <span
                                :class="{
                                  isChair:
                                    groupStudent[toolIndex][gindex] &&
                                    groupStudent[toolIndex][gindex][0],
                                  updateChair:
                                    courseDetail.userid == userId &&
                                    groupStudent[toolIndex][gindex] &&
                                    groupStudent[toolIndex][gindex][0] &&
                                    groupJson.islock == 2,
                                }"
                                ><span
                                  class="updateChairBtn"
                                  @click="
                                    updateGroupChair(
                                      groupStudent[toolIndex][gindex] &&
                                        groupStudent[toolIndex][gindex][0]
                                    )
                                  "
                                  >{{ lang.ssModify }}</span
                                ></span
                              ><span>{{
                                groupStudent[toolIndex][gindex] &&
                                groupStudent[toolIndex][gindex][0]
                                  ? groupStudent[toolIndex][gindex] &&
                                    groupStudent[toolIndex][gindex][0].name
                                  : lang.ssEmptyPosition
                              }}</span>
                            </div>
                            <div v-if="groupJson.number > 4">
                              <span
                                :class="{
                                  isChair:
                                    groupStudent[toolIndex][gindex] &&
                                    groupStudent[toolIndex][gindex][4],
                                  updateChair:
                                    courseDetail.userid == userId &&
                                    groupStudent[toolIndex][gindex] &&
                                    groupStudent[toolIndex][gindex][4] &&
                                    groupJson.islock == 2,
                                }"
                                ><span
                                  class="updateChairBtn"
                                  @click="
                                    updateGroupChair(
                                      groupStudent[toolIndex][gindex] &&
                                        groupStudent[toolIndex][gindex][4]
                                    )
                                  "
                                  >{{ lang.ssModify }}</span
                                ></span
                              ><span>{{
                                groupStudent[toolIndex][gindex] &&
                                groupStudent[toolIndex][gindex][4]
                                  ? groupStudent[toolIndex][gindex] &&
                                    groupStudent[toolIndex][gindex][4].name
                                  : lang.ssEmptyPosition
                              }}</span>
                            </div>
                            <div v-if="groupJson.number > 8">
                              <span
                                :class="{
                                  isChair:
                                    groupStudent[toolIndex][gindex] &&
                                    groupStudent[toolIndex][gindex][8],
                                  updateChair:
                                    courseDetail.userid == userId &&
                                    groupStudent[toolIndex][gindex] &&
                                    groupStudent[toolIndex][gindex][8] &&
                                    groupJson.islock == 2,
                                }"
                                ><span
                                  class="updateChairBtn"
                                  @click="
                                    updateGroupChair(
                                      groupStudent[toolIndex][gindex] &&
                                        groupStudent[toolIndex][gindex][8]
                                    )
                                  "
                                  >{{ lang.ssModify }}</span
                                ></span
                              ><span>{{
                                groupStudent[toolIndex][gindex] &&
                                groupStudent[toolIndex][gindex][8]
                                  ? groupStudent[toolIndex][gindex] &&
                                    groupStudent[toolIndex][gindex][8].name
                                  : lang.ssEmptyPosition
                              }}</span>
                            </div>
                          </div>
                          <div class="g_d_group_tableBox">
                            <div class="g_d_group_chair2">
                              <div v-if="groupJson.number > 2">
                                <span
                                  :class="{
                                    isChair:
                                      groupStudent[toolIndex][gindex] &&
                                      groupStudent[toolIndex][gindex][2],
                                    updateChair:
                                      courseDetail.userid == userId &&
                                      groupStudent[toolIndex][gindex] &&
                                      groupStudent[toolIndex][gindex][2] &&
                                      groupJson.islock == 2,
                                  }"
                                  ><span
                                    class="updateChairBtn"
                                    @click="
                                      updateGroupChair(
                                        groupStudent[toolIndex][gindex] &&
                                          groupStudent[toolIndex][gindex][2]
                                      )
                                    "
                                    >{{ lang.ssModify }}</span
                                  ></span
                                ><span>{{
                                  groupStudent[toolIndex][gindex] &&
                                  groupStudent[toolIndex][gindex][2]
                                    ? groupStudent[toolIndex][gindex] &&
                                      groupStudent[toolIndex][gindex][2].name
                                    : lang.ssEmptyPosition
                                }}</span>
                              </div>
                              <div v-if="groupJson.number > 6">
                                <span
                                  :class="{
                                    isChair:
                                      groupStudent[toolIndex][gindex] &&
                                      groupStudent[toolIndex][gindex][6],
                                    updateChair:
                                      courseDetail.userid == userId &&
                                      groupStudent[toolIndex][gindex] &&
                                      groupStudent[toolIndex][gindex][6] &&
                                      groupJson.islock == 2,
                                  }"
                                  ><span
                                    class="updateChairBtn"
                                    @click="
                                      updateGroupChair(
                                        groupStudent[toolIndex][gindex] &&
                                          groupStudent[toolIndex][gindex][6]
                                      )
                                    "
                                    >{{ lang.ssModify }}</span
                                  ></span
                                ><span>{{
                                  groupStudent[toolIndex][gindex] &&
                                  groupStudent[toolIndex][gindex][6]
                                    ? groupStudent[toolIndex][gindex] &&
                                      groupStudent[toolIndex][gindex][6].name
                                    : lang.ssEmptyPosition
                                }}</span>
                              </div>
                            </div>
                            <div class="g_d_group_table">
                              <div>
                                {{ g.name }}
                              </div>
                              <div>
                                <div
                                  v-if="
                                    courseDetail.userid == userId && groupJson.islock == 2
                                  "
                                  @click="deleteGroupChair(gindex)"
                                >
                                  {{ lang.ssRemoveMember }}
                                </div>
                                <div
                                  @click="selectGroup(gindex)"
                                  v-else-if="
                                    groupStudentUid[toolIndex] &&
                                    groupStudentUid[toolIndex][gindex].indexOf(userId) == -1
                                  "
                                >
                                  {{ lang.ssJoinGroup }}
                                </div>
                                <div
                                  @click="
                                    exitGroup(
                                      groupStudent[toolIndex][gindex] &&
                                        groupStudent[toolIndex][gindex][
                                        groupStudentUid[toolIndex][gindex].indexOf(userId)
                                        ].id
                                    )
                                  "
                                  v-else-if="
                                    groupStudentUid[toolIndex] &&
                                    groupStudentUid[toolIndex][gindex].indexOf(userId) != -1
                                  "
                                >
                                  {{ lang.ssExitGroup }}
                                </div>
                              </div>
                            </div>
                            <div class="g_d_group_chair2">
                              <div v-if="groupJson.number > 3">
                                <span
                                  :class="{
                                    isChair:
                                      groupStudent[toolIndex][gindex] &&
                                      groupStudent[toolIndex][gindex][3],
                                    updateChair:
                                      courseDetail.userid == userId &&
                                      groupStudent[toolIndex][gindex] &&
                                      groupStudent[toolIndex][gindex][3] &&
                                      groupJson.islock == 2,
                                  }"
                                  ><span
                                    class="updateChairBtn"
                                    @click="
                                      updateGroupChair(
                                        groupStudent[toolIndex][gindex] &&
                                          groupStudent[toolIndex][gindex][3]
                                      )
                                    "
                                    >{{ lang.ssModify }}</span
                                  ></span
                                ><span>{{
                                  groupStudent[toolIndex][gindex] &&
                                  groupStudent[toolIndex][gindex][3]
                                    ? groupStudent[toolIndex][gindex] &&
                                      groupStudent[toolIndex][gindex][3].name
                                    : lang.ssEmptyPosition
                                }}</span>
                              </div>
                              <div v-if="groupJson.number > 7">
                                <span
                                  :class="{
                                    isChair:
                                      groupStudent[toolIndex][gindex] &&
                                      groupStudent[toolIndex][gindex][7],
                                    updateChair:
                                      courseDetail.userid == userId &&
                                      groupStudent[toolIndex][gindex] &&
                                      groupStudent[toolIndex][gindex][7] &&
                                      groupJson.islock == 2,
                                  }"
                                  ><span
                                    class="updateChairBtn"
                                    @click="
                                      updateGroupChair(
                                        groupStudent[toolIndex][gindex] &&
                                          groupStudent[toolIndex][gindex][7]
                                      )
                                    "
                                    >{{ lang.ssModify }}</span
                                  ></span
                                ><span>{{
                                  groupStudent[toolIndex][gindex] &&
                                  groupStudent[toolIndex][gindex][7]
                                    ? groupStudent[toolIndex][gindex] &&
                                      groupStudent[toolIndex][gindex][7].name
                                    : lang.ssEmptyPosition
                                }}</span>
                              </div>
                            </div>
                          </div>
                          <div class="g_d_group_chair">
                            <div v-if="groupJson.number > 1">
                              <span
                                :class="{
                                  isChair:
                                    groupStudent[toolIndex][gindex] &&
                                    groupStudent[toolIndex][gindex][1],
                                  updateChair:
                                    courseDetail.userid == userId &&
                                    groupStudent[toolIndex][gindex] &&
                                    groupStudent[toolIndex][gindex][1] &&
                                    groupJson.islock == 2,
                                }"
                                ><span
                                  class="updateChairBtn"
                                  @click="
                                    updateGroupChair(
                                      groupStudent[toolIndex][gindex] &&
                                        groupStudent[toolIndex][gindex][1]
                                    )
                                  "
                                  >{{ lang.ssModify }}</span
                                ></span
                              ><span>{{
                                groupStudent[toolIndex][gindex] &&
                                groupStudent[toolIndex][gindex][1]
                                  ? groupStudent[toolIndex][gindex] &&
                                    groupStudent[toolIndex][gindex][1].name
                                  : lang.ssEmptyPosition
                              }}</span>
                            </div>
                            <div v-if="groupJson.number > 5">
                              <span
                                :class="{
                                  isChair:
                                    groupStudent[toolIndex][gindex] &&
                                    groupStudent[toolIndex][gindex][5],
                                  updateChair:
                                    courseDetail.userid == userId &&
                                    groupStudent[toolIndex][gindex] &&
                                    groupStudent[toolIndex][gindex][5] &&
                                    groupJson.islock == 2,
                                }"
                                ><span
                                  class="updateChairBtn"
                                  @click="
                                    updateGroupChair(
                                      groupStudent[toolIndex][gindex] &&
                                        groupStudent[toolIndex][gindex][5]
                                    )
                                  "
                                  >{{ lang.ssModify }}</span
                                ></span
                              ><span>{{
                                groupStudent[toolIndex][gindex] &&
                                groupStudent[toolIndex][gindex][5]
                                  ? groupStudent[toolIndex][gindex] &&
                                    groupStudent[toolIndex][gindex][5].name
                                  : lang.ssEmptyPosition
                              }}</span>
                            </div>
                            <div v-if="groupJson.number > 9">
                              <span
                                :class="{
                                  isChair:
                                    groupStudent[toolIndex][gindex] &&
                                    groupStudent[toolIndex][gindex][9],
                                  updateChair:
                                    courseDetail.userid == userId &&
                                    groupStudent[toolIndex][gindex] &&
                                    groupStudent[toolIndex][gindex][9] &&
                                    groupJson.islock == 2,
                                }"
                                ><span
                                  class="updateChairBtn"
                                  @click="
                                    updateGroupChair(
                                      groupStudent[toolIndex][gindex] &&
                                        groupStudent[toolIndex][gindex][9]
                                    )
                                  "
                                  >{{ lang.ssModify }}</span
                                ></span
                              ><span>{{
                                groupStudent[toolIndex][gindex] &&
                                groupStudent[toolIndex][gindex][9]
                                  ? groupStudent[toolIndex][gindex] &&
                                    groupStudent[toolIndex][gindex][9].name
                                  : lang.ssEmptyPosition
                              }}</span>
                            </div>
                          </div>
                      </div>
                    </div>
                  </div>
                </div>

              </div>
            </div>
            <div class="s_b_m_b_item" v-if="showType === 1 && dialogTypeList[1].showType.includes(toolType)">

              <div v-if="toolType == 45">
                <div class="s_b_m_b_i_eChartsArea">
								<div class="s_b_m_b_i_e_title">
									<span v-for="item in statisticsTypeList" :key="item.value" :class="{'s_b_m_b_i_e_t_active':showStatisticsType===item.value}" @click="changeShowStatisticsType(item.value)">{{lang[item.langKey]}}</span>
								</div>

								<div class="s_b_m_b_i_e_charts">
									<eChartsView1 v-if="showStatisticsType===0 && accuracyRateData" :data="accuracyRateData"/>
									<eChartsView2 v-if="showStatisticsType===1 && optionSummaryData" :data="optionSummaryData"/>
								</div>

								<div v-if="accuracyRateData" class="s_b_m_b_i_e_charts_bottom">
                    <span
                      v-for="(item,index) in accuracyRateData.series[0].data" :key="index+'q2'" @click="jumpTo(index)" >
                      {{ lang.ssQuestionNum.replace(/\*/g, index+1) }} {{ item }}%
                    </span>
								</div>
							</div>

              <div class="s_b_m_b_i_table">
                <div
                  class="s_b_m_b_i_m_choseList"
                  :id="index+'JP'"
                  v-for="(item, index) in tableData"
                  :key="index + 'q3'"
                >
                  <div class="s_b_m_b_i_m_c_title renderedFor" >
                    <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
                      style="display: flex;align-items: center;"
                        >{{
                          typeof item.answer === "number"
                            ? lang.ssSingleChoiceWithColon
                            : lang.ssMultipleChoiceWithColon
                        }}<span v-html="renderedFormula(item.title)"></span></span
                      >
                  </div>

									<div class="s_b_m_b_i_m_c_accuracyRate">
										<span>{{ lang.ssAccuracyRateColon }}{{ item.accuracyRate }}%</span>
									</div>

                  <div class="s_b_m_b_i_m_c_table">
                    <el-table :data="item.optionsList" style="width: 800px">
                      <el-table-column prop="label" :label="lang.ssOption">
												<template slot-scope="scope">
                          <span>{{ optionTypeList[scope.$index] }}.</span>
													<img  @click.stop="$hevueImgPreview(scope.row.label.src)" class="tableImage"
                          v-if="scope.row.label.imgType && scope.row.label.imgType === 1" :src="scope.row.label.src"/>
													<span v-else>{{ scope.row.label }}</span>
												</template>
                      </el-table-column>
                      <el-table-column prop="count" align="center" :label="lang.ssSubtotal" width="60">
                      </el-table-column>
                      <el-table-column prop="scale" :label="lang.ssProportion" width="300">
												<template slot-scope="scope">
													<div class="tableProgress">
														<el-progress :percentage="scope.row.scale"></el-progress>
													</div>
												</template>
                      </el-table-column>
                    </el-table>
                  </div>

                </div>
              </div>
              </div>
							<div v-if="toolType == 15">
                <choseWordCloud :cloudData="cy" :dialogVisibleWordCloud="dialogVisibleWordCloud"></choseWordCloud>
              </div>


            </div>
            <div class="s_b_m_b_item s_b_m_b_worksSubmit" v-if="showType === 2 && dialogTypeList[2].showType.includes(toolType)">
              <div class="s_b_b_i_noSubmit">
                <div class="s_b_b_i_ws_top">
                  <div class="s_b_b_i_ws_t_left">
                    <div @click="foldList.noSubmit = !foldList.noSubmit">
                      <span>{{ lang.ssNotSubmitted }}</span>
                      <span> ({{ noWorksStudent.length }}) </span>
                      <svg
                        :style="{
                          transform: foldList.noSubmit
                            ? 'rotate(-180deg)'
                            : 'rotate(0deg)'
                        }"
                        width="16"
                        height="16"
                        viewBox="0 0 16 16"
                        xmlns="http://www.w3.org/2000/svg"
                      >
                        <path
                          d="M3.54028 6.45964L4.45952 5.54041L7.9999 9.08079L11.5403 5.54041L12.4595 6.45964L7.9999 10.9193L3.54028 6.45964Z"
                        />
                      </svg>
                    </div>
                  </div>
                  <div class="s_b_b_i_ws_t_right"></div>
                </div>
                <div class="s_b_b_i_ws_bottom" v-show="!foldList.noSubmit" >
                  <div style="display: flex;width: 100%;flex-wrap: wrap;" v-if="noWorksStudent.length > 0">
                    <div
                      class="s_b_b_i_ws_b_noSubmitItem"
                      v-for="item in noWorksStudent"
                      :key="item.userid"
                    >
                      {{ item.student }}
                    </div>
                  </div>
                  <span v-if="noWorksStudent.length === 0"
                    >{{ lang.ssNoUnsubmittedStudents }}</span
                  >
                </div>
              </div>
              <div class="s_b_b_i_worksPreview">
                <div class="s_b_b_i_ws_top">
                  <div class="s_b_b_i_ws_t_left">
                    <div
                      @click="foldList.worksPreview = !foldList.worksPreview"
                    >
                      <span>{{ lang.ssWorkPreview }}</span>
                      <span> ({{ worksStudent.length }}) </span>
                      <svg
                        :style="{
                          transform: foldList.worksPreview
                            ? 'rotate(-180deg)'
                            : 'rotate(0deg)'
                        }"
                        width="16"
                        height="16"
                        viewBox="0 0 16 16"
                        xmlns="http://www.w3.org/2000/svg"
                      >
                        <path
                          d="M3.54028 6.45964L4.45952 5.54041L7.9999 9.08079L11.5403 5.54041L12.4595 6.45964L7.9999 10.9193L3.54028 6.45964Z"
                        />
                      </svg>
                    </div>
                  </div>
                  <div class="s_b_b_i_ws_t_right"></div>
                </div>
                <div class="s_b_b_i_ws_bottom" v-show="!foldList.worksPreview">
                  <div style="display: flex;width: 100%;flex-wrap: wrap;" v-if="worksStudent.length > 0">
                    <div
                      class="s_b_b_i_ws_b_isSubmitItem"
                      v-for="item in worksStudent"
                      :key="item.userid"
                    >
                      <div
                        class="s_b_b_i_ws_b_i_s_i_t_top"
                        :style="`cursor: ${[45,7,52,48].includes(toolType)?'pointer':'default'};padding: ${[7,52,48,72].includes(toolType)?'0px':'10px'};`"
                        @click="StudentWork(item)"
                        >

                      <!-- @click="openTools(item)"  -->
                      <div
                        class="s_b_b_i_ws_b_i_s_i_t_t_delIcon"
                      >
                        <div>
                          <span v-if="toolType == 45">{{ accuracy(item) }}</span>
                        </div>
                        <img v-if="item.userid == userId || ['1','4'].includes(tType)" @click.stop="deleteWorks(item.wid)" src="../../assets/deleteworks.png" alt="" />
                      </div>

											<div class="s_b_b_i_ws_b_i_s_i_t_t_answer">



												<span v-if="[15].includes(toolType)" class="questionsAndAnswersSpan">{{ questionsAndAnswers(item) }}</span>

                        <template v-if="[45].includes(toolType)">
                          <span v-for="(answer,answerIndex) in worksCheckAnswer(item)" :key="item.userid+'-'+answerIndex+'-'+answer.index">

                            <template v-if="answer.type===1">
                              <span  v-for="(item2,indP) in answer.label" :key="indP +'indP'">
                                <span :class="`${item2.right?'answerRight':'answerWrong'}`">{{ item2.label }}</span>
                              </span>
                            </template>

                            <template v-if="answer.type===2">
                              <span  class="answer2" :class="`${answer.isRight?'answerRightLine':'answerWrongLine'}`"
                              v-for="(item3,indUi) in answer.label" :key="indUi + 'indUi2'">
                                <span :class="`${item3.right?'answerRight':'answerWrong'}`">{{ item3.label }}</span>
                              </span>
                            </template>

                          </span>
                        </template>


                        <div class="answerSelect "  v-if="[57].includes(toolType)">
                          <!-- <img style="width: 300px;" src="../../assets/icon/word2.png" /> -->
                           <div style="width: 100%;height: 110px;text-align: center;line-height: 110px;">{{ lang.ssCocoPiWork }}</div>
												</div>
                        <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>

                        <div class="answerSort" v-if="[47].includes(toolType)">
                          <span v-for="(item2,index2) in JSON.parse(item.works)" :key="index2+'index2P'">
                            <span :class="`${JSON.stringify(item2.chooseSenList)===JSON.stringify(item2.rightAnswer)?'answerRight':'answerWrong'}`">{{ JSON.stringify(item2.chooseSenList)===JSON.stringify(item2.rightAnswer)?'✓':'✕' }}</span>
                          </span>
                        </div>

                        <div class="answerEvaluation" v-if="[40].includes(toolType)">
                          <el-rate v-for="(item2,index2) in JSON.parse(item.works).eStar" :key="index2+'3l'" :value="item2" disabled :max="testData.rateJson[index2].score"></el-rate>
                          <span>{{ JSON.parse(item.works).eBzText }}</span>
                        </div>

												<div class="imageWorks" v-if="[7,1,3].includes(toolType)">
														<img :src="item.works" alt="" @click.stop="$hevueImgPreview(item.works)">
												</div>

                        <!-- <div class="imageWorks" v-if="[1].includes(toolType)">
														<img :src="item.works" alt="" @click.stop="$hevueImgPreview(item.works)">
												</div> -->

												<div class="imageWorks" v-if="[52,48,72].includes(toolType)">
													<img :src="require('../../assets/icon/isWord.png')" alt="">
													<!-- <img v-if="[48].includes(toolType)" :src="require('../../assets/icon/isTxt.png')" alt=""> -->
												</div>

												<!-- <span>{{ worksCheckAnswer(item) }}</span> -->
											</div>
                    </div>
                    <div class="s_b_b_i_ws_b_i_s_i_t_bottom">
                      <el-tooltip
                        class="item"
                        effect="dark"
                        :content="item.sName"
                        placement="top"
                      >
                        <span>{{ item.sName }}</span>
                      </el-tooltip>

                      <span>{{ item.time }}</span>
                    </div>
                  </div>
                  </div>

                  <span v-if="worksStudent.length === 0">{{ lang.ssNoSubmittedStudents }}</span>
                </div>
              </div>
            </div>

            <div class="s_b_m_b_item" v-if="tType!=2" v-show="showType === 3 && dialogTypeList[2].showType.includes(toolType) && worksStudent.length>0">
              <smarter v-if="show" :worksStudent="worksStudent" :toolType="toolType" :toolList="toolList" :testData="testData"/>
            </div>
          </div>
        </div>
      </div>
    </el-dialog>
    <el-dialog
      :title="lang.ssGroupSettings"
      :visible.sync="dialogVisibleGroup2"
      :append-to-body="true"
      width="650px"
      :before-close="handleClose"
      class="dialog_diy"
    >
      <div class="groupBox">
        <div v-if="groupJson2.group" class="groupContent">
          <div class="groupTitle">{{ lang.ssPleaseSetGroupNumberAndName }}</div>
          <div
            v-for="(item, index) in groupJson2.group"
            :key="index"
            class="groupName"
          >
            <span class="groupn">{{ lang.ssGroupNameColon.replace(/\*/g, index + 1) }}</span>
            <el-input
              v-model="item.name"
              :placeholder="lang.ssEnterName"
              style="width: 250px"
            ></el-input>
            <!-- <div class="groupBtn">
              <el-button type="primary" size="small" @click="addGroup(index)">
                添加</el-button>
              <el-button type="primary" size="small" @click="deleteGroup(index)"
                v-if="groupJson2.group && groupJson2.group.length > 1">删除</el-button>
            </div> -->
          </div>
        </div>
        <div class="groupContent">
          <div class="groupTitle">{{ lang.ssPleaseSetGroupSize }}</div>
          <!-- <el-input v-model="groupJson.number" placeholder="2-10人以内"
            style="width: 150px; margin: 10px 10px 0 0"></el-input> -->
          <el-input
            v-model="groupJson2.number"
            style="width: 150px"
            :placeholder="lang.ssEnter2to10Digits"
            @change="numberPan"
          ></el-input>
        </div>
      </div>
      <span slot="footer" class="dialog-footer">
        <el-button @click="dialogVisibleGroup2 = false">{{ lang.ssCancel }}</el-button>
        <el-button type="primary" @click="updateGroupJson">{{ lang.ssConfirm }}</el-button>
      </span>
    </el-dialog>
    <el-dialog
      :title="lang.ssRemoveMember"
      :visible.sync="dialogVisibleDeleteGroup"
      :append-to-body="true"
      width="350px"
      :before-close="handleClose"
      class="dialog_diy"
    >
      <div>
        <h2>
          {{ this.deleteGroupArray.name }}
        </h2>
        <div style="color: rgb(171 171 171); margin-top: 10px">
          {{ lang.ssPleaseSelectMembersToDelete }}
        </div>
        <el-checkbox-group v-model="checkDeleteGroup">
          <el-checkbox
            style="display: flex; margin-top: 20px"
            v-for="(item, index) in deleteGroupUser"
            :label="item.userid"
            :key="index"
            >{{ item.name }}</el-checkbox
          >
        </el-checkbox-group>
      </div>
      <span slot="footer" class="dialog-footer">
        <el-button @click="dialogVisibleDeleteGroup = false">{{ lang.ssCancel }}</el-button>
        <el-button type="primary" @click="deleteChair">{{ lang.ssConfirm }}</el-button>
      </span>
    </el-dialog>
    <studentWorkPreviewDialog ref="studentWorkPreviewDialogRef" @close="studentPreviewClose"/>
  </div>
</template>

<script>
import eChartsView from './eChartsView.vue'
import choseWordCloud from './choseWordCloud.vue'
import studentWorkPreviewDialog from './studentWorkPreviewDialog.vue';
import EditorBar from "../tools/wangEnduit.vue";
import EnglishVoice from '../EnglishVoice3/index.vue'
import onlineWrite from "./onlineWrite";
import smarter from './intelligentAnalysis/smarter.vue';
import { tools as toolsList } from "@/common/tools2.js";
import { myMixin } from "@/mixins/mixin.js"
// import html2canvas from "html2canvas";
import katex from 'katex'
import 'katex/dist/katex.min.css'
export default {
  mixins: [ myMixin ],
	components:{
		eChartsView1:eChartsView,
		eChartsView2:eChartsView,
    choseWordCloud,
    studentWorkPreviewDialog,
    EditorBar,
    onlineWrite,
    EnglishVoice,
    smarter
	},
  props: {
    worksStudentData: {
      type: Array,
      default: () => []
    },
    oid: {
      type: String
    },
    org: {
      type: String
    },
    groupStudent2: {
      type: Array,
      default: () => []
    },
    groupStudentUid2: {
      type: Array,
      default: () => []
    },
    courseDetail: {
      type: Object
    },
    noWorksSData: {
      type: Array,
      default: () => []
    },
    chapInfoListData: {
      type: Array,
      default: () => []
    },
    courseType: {
      type: [String , Number],
      default: 0
    },
    tType:{
      type: String ,
      default: '0'
    },
    sIsOpen:{
      type: Boolean,
      default: false
    },
    taskCount: {
      type: Number,
      default: 0
    }
  },
  data() {
    return {
      isAnswer:false,
      homeWorkLoading:false,
      toolsList:toolsList,
      appStoreUrl:'',
      chapInfoListData2:[],
      radioS:[], //提交作业数组容器
      questionsData:'', //提交作业字符串容器
      isShowList:[], //排序判断的显示容器
      islock:true,
      tcid: this.$route.query.tcid,
      AIUrl:'',
      show: false,
      showType: 0,
      timerId:'',
      myAnswerList1:{}, //英语写作
      englishList:{},//英语写作
      englishVoiceJsonWork:[], //英语口语
      englishVoiceJson:{}, //英语口语
      groupJson:[], //学生分组
      groupStudentUid:[], //学生分组
      groupStudent:[], //学生分组
      groupJson2:{},
      checkDeleteGroup:[],
      deleteGroupUser:[],
      deleteGroupArray:[],
      groupIndex:'',
      dialogVisibleDeleteGroup:false,
      dialogVisibleGroup2:false,
      userId: this.$route.query.userid,
      courseId:this.$route.query.courseId,
      id: this.$route.query.courseId,
      classid: this.$route.query.cid,
      wordCloudData:[], //词云数据
      dialogVisibleWordCloud:false,
			showStatisticsType:0,
      data: null,
      testJson: null,
      testJsonCopy: [],
      screenCopy:'',
      testData: null,
      toolIndex: null,
      worksStudent: [],
      noWorksStudent: [],
			toolType:null,
      foldList: {
        noSubmit: false,
        worksPreview: false
      },
      dialogTypeList: [
        { langKey: "ssWorkDetails", value: 0,showType:[1,7,15,40,41,45,47,48,49,52,3,4,57,18,21,71,69,70,23,24,32,63,28,31,39,66,72], loading: false,noShow:[] },
        { langKey: "ssQuestionStatistics", value: 1,showType:[45,15], loading: false,noShow:['2']},
        { langKey: "ssStudentStatistics", value: 2,showType:[1,7,15,40,41,45,47,48,52,3,4,57,72], loading: false,noShow:[] },
        { langKey: "ssSmartAnalysis",value:3,showType:[1,7,15,40,41,45,47,48,52,3,4,57,72],loading: false,noShow:['2']}
      ],
			toolList:[
				{langKey:"ssChoice",value:45,img:require("../../assets/icon/thirdToolList/choose.png")},
				{langKey:"ssTraining",value:18,img:require("../../assets/icon/thirdToolList/trainPlatform.png")},
				{langKey:"ssAiotBlockly",value:21,img:require("../../assets/icon/fourthToolList/program.png")},
				{langKey:"ssAiPython",value:23,img:require("../../assets/icon/fourthToolList/Pythonprogram.png")},
				{langKey:"ssAiBlockly",value:24,img:require("../../assets/icon/fourthToolList/AIprogram.png")},
				{langKey:"ssCodeEdit",value:32,img:require("../../assets/icon/thirdToolList/code.png")},
				{langKey:"ssTurtle",value:63,img:require("../../assets/icon/fourthToolList/Wood.png")},
				{langKey:"ssTranslate",value:28,img:require("../../assets/icon/secondToolList/translation.png")},
				{langKey:"ssMathBoard",value:31,img:require("../../assets/icon/secondToolList/networkPanel.png")},
				{langKey:"ssGeoGebra",value:39,img:require("../../assets/icon/secondToolList/GeoGebra.png")},
				{langKey:"ssFormula",value:66,img:require("../../assets/icon/secondToolList/formulaEdi.png")},
				{langKey:"ssEnglishWrite",value:69,img:require("../../assets/icon/secondToolList/english.png")},
				{langKey:"ssEnglishSpeak",value:70,img:require("../../assets/icon/thirdToolList/englishVoice.png")},
				{langKey:"ssAiAgent",value:71,img:require("../../assets/icon/fourthToolList/chatgpt.png")},
				{langKey:"ssCocoPi",value:57,img:require("../../assets/icon/fourthToolList/cocopi.png")},
				{langKey:"ssSurvey",value:4,img:require("../../assets/icon/thirdToolList/ask.png")},
				{langKey:"ssMindMap",value:3,img:require("../../assets/icon/secondToolList/mindMapping.png")},
				{langKey:"ssTable",value:48,img:require("../../assets/icon/fourthToolList/table.png")},
        {langKey:"ssDocument",value:52,img:require("../../assets/icon/fourthToolList/text.png")},
				{langKey:"ssStudentGroup",value:49,img:require("../../assets/icon/fourthToolList/group.png")},
				{langKey:"ssWhiteboard",value:1,img:require("../../assets/icon/secondToolList/whiteBoard.png")},
				{langKey:"ssQa",value:15,img:require("../../assets/icon/thirdToolList/answer.png")},
				{langKey:"ssMatch",value:41,img:require("../../assets/icon/thirdToolList/select.png")},
				{langKey:"ssSort",value:47,img:require("../../assets/icon/fourthToolList/conSentences.png")},
				{langKey:"ssPersonalEval",value:40,img:require("../../assets/icon/secondToolList/eval.png")},
				{langKey:"ssMindGrid",value:7,img:require("../../assets/icon/secondToolList/mindNetwork.png")},
				{langKey:"ssAppCenter",value:72,img:require("../../assets/icon/firstToolList/appStore.png")}
			],
			statisticsTypeList:[
				{langKey:"ssAccuracyRate",value:0},
				{langKey:"ssOptionSummary",value:1}
			],
			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']
    };
  },

  computed: {
    renderedFormula() {
      return function(val){
        if (this.lang.lang == 'com') {
          return val;
        }
        try {
           // 判断是否含有HTML标签，<tag ...>...</tag>
            const hasTag = /<([a-zA-Z][\w\-]*)([^>]*)>([\s\S]*?)<\/\1>/g.test(val);
            if (!hasTag) {
              val = val.trim().replace(/[\u200B-\u200D\uFEFF]/g, '');

              // 纯文本，整体渲染
              try {
                return katex.renderToString(val.trim(), {
                  throwOnError: false,
                  strict: false,
                  output: "htmlAndMathml"
                });
              } catch (e) {
                return val; // 渲染失败原样输出
              }
            } else {
              // 有标签，对每个标签内容渲染
              return val.replace(
                /<([a-zA-Z][\w\-]*)([^>]*)>([\s\S]*?)<\/\1>/g,
                (match, tag, attrs, inner) => {
                  let html;
                  val = val.trim().replace(/[\u200B-\u200D\uFEFF]/g, '');
                  try {
                    html = katex.renderToString(inner.trim(), {
                      throwOnError: false,
                      strict: false,
                      output: "htmlAndMathml"
                    });
                  } catch (e) {
                    html = inner;
                  }
                  return `<${tag}${attrs}>${html}</${tag}>`;
                }
              );
            }
        } catch (e) {
          console.error('KaTeX渲染错误:', e);
          return val;
        }
      }
    },
    tableData() {
      let _result = [];
      if (this.show && this.toolIndex !== null && [45].includes(this.toolType)) {
        let worksJson = [];
        if (this.testJson) {
          worksJson = JSON.parse(JSON.stringify(this.testJson));
        } else if (this.worksStudent.length > 0) {
          worksJson = JSON.parse(this.worksStudent[0].works)[0].testJson
            .testJson;
        }

        let isWorksData = [];
        let pushData = [];

        isWorksData = this.worksStudent.map(i => JSON.parse(i.works)[0].anwer);
        console.log('worksJson',worksJson);

        pushData = worksJson.map((item, index) => {
          return {
            title: item.teststitle,
            answer: item.answer,
            accuracyRate: 0,
            accuracyCount: 0,
            choseCount: 0,
            optionsList: item.checkList.map((item2, index2) => {
              return { label: item2, count: 0, scale: 0 };
            })
          };
        });
        isWorksData.forEach(i => {
          i.forEach((item, index) => {
            pushData[index].choseCount++; //做了这道题的人数+1
            if (typeof item === "number") {
              //单选题
              pushData[index].optionsList[item].count += 1; //选了这选项的次数+1
              if (pushData[index].answer === item) {
                pushData[index].accuracyCount += 1; //选对了的人数+1
              }
            } else {
              //多选题
              item.forEach(i2 => {
                pushData[index].optionsList[i2].count += 1; //选了这选项的次数+1
              });
              if (JSON.stringify(item.sort()) === JSON.stringify(pushData[index].answer.sort())) {
                pushData[index].accuracyCount += 1; //选对了的人数+1
              }
            }
          });
        });

        pushData.forEach(i => {
          i.accuracyRate = parseFloat(((i.accuracyCount / i.choseCount) * 100).toFixed(2));
          i.optionsList.forEach(i2 => {
            i2.scale = parseFloat(((i2.count / i.choseCount) * 100).toFixed(2));
          });
        });

        _result = pushData;
      }
      return _result;
    },
		accuracyRateData(){
			let _result = null;
			if(this.tableData.length>0){
				let eChartsData = {
    		  xAxis: {
    		    type: 'category',
    		    data: []
    		  },
    		  yAxis: {
    		    type: 'value'  // y 轴的值类型
    		  },
    		  series: [
    		    {
    		      name: this.lang.ssAccuracyRate,
    		      type: 'bar',
    		      data: [],
    		      itemStyle: {
    		        color: '#5c87ef'  // 设置条形图的颜色
    		      }
    		    }
    		  ],
    		  // 设置条形图的间隔
    		  barCategoryGap: '50%',
    		}

				this.tableData.forEach((item,index)=>{
					eChartsData.xAxis.data.push(this.lang.ssQuestionLabel.replace(/\*/g, index+1));
					eChartsData.series[0].data.push(item.accuracyRate);
				})

				_result = eChartsData;
				// eChartsData.xAxis.data = this.tableData.
			}

			return _result;
		},
		optionSummaryData(){
			let _result = null;

			if(this.tableData.length>0){
				let eChartsData = {
				  legend: {},
				  tooltip: {},
				  dataset: {
				    source: [
				      [this.lang.ssOption],
				      // ['Matcha Latte', 43.3,0, 93.7,90],
				      // ['Milk Tea', 83.1, 73.4, 55.1],
				      // ['Cheese Cocoa', 86.4, 65.2, 82.5],
				      // ['Walnut Brownie', 72.4, 53.9, 39.1]
				    ]
				  },
				  xAxis: { type: 'category' },
				  yAxis: {},
				  // Declare several bar series, each will be mapped
				  // to a column of dataset.source by default.
				  series: [
						// { type: 'bar' },
					]
				};

				let maxChoseLength = this.tableData.reduce((max,item)=>{
					return Math.max(max,item.optionsList.length)
				},0)

				for(let i=0;i<maxChoseLength;i++){
					eChartsData.dataset.source[0].push(this.lang.ssOptionLabel.replace(/\*/g, i+1))
					eChartsData.series.push({type:'bar'})//,label: { show: true, position: 'top' }
				}

				this.tableData.forEach((item,index)=>{
					eChartsData.dataset.source.push([this.lang.ssQuestionLabel.replace(/\*/g, index+1)])
					item.optionsList.forEach((item2,index2)=>{
						eChartsData.dataset.source[index+1].push(item2.count)
					})
				})

				_result = eChartsData;
			}
			return _result;
		},
		worksCheckAnswer(){
			return data=>{
				let _result = [];
				if([45].includes(this.toolType)){
					let works = JSON.parse(data.works);
				let testJson = works[0].testJson.testJson;
				let worksAnswer = works[0].anwer;

				let answerList = [];


				worksAnswer.forEach((item,index)=>{
					let _workAnswer = testJson[index].answer;
					if(typeof item === "number"){//单选题
						if(item===_workAnswer){
							answerList.push({type:1,index:index,label:[{right:true,label:this.optionTypeList[item]}]})
						}else{
							answerList.push({type:1,index:index,label:[{right:false,label:this.optionTypeList[item]}],})
						}
					}else{//多选题
						let _item = item.sort();
						let _workAnswer2 = _workAnswer.sort();
						let _obj = {type:2,isRight:JSON.stringify(_item)===JSON.stringify(_workAnswer2),index:index,label:[]};
						_item.forEach((item2,index2)=>{
							if(_workAnswer2.includes(item2)){
								_obj.label.push({right:true,label:this.optionTypeList[item2]})
							}else{
								_obj.label.push({right:false,label:this.optionTypeList[item2]})
							}
						})
						answerList.push(_obj);
					}
				})

				_result = answerList;
				}

				return _result;
			}
		},
		questionsAndAnswers(){
			return data=>{
				let _result = "";
				if([15].includes(this.toolType)){
					let _work = data.works?JSON.parse(data.works)[0]:null;
					if(_work){
						_result = _work.answer;
					}
				}
				return _result;
			}
		},
    cy(){
      let _result = ''
      if(this.toolType==15){
        this.worksStudent.forEach(e=>{
          _result += JSON.parse(e.works)[0].answer+','
        })
      }

      return _result;
    },
    // 选择题正确率百分比
    accuracy(){
      return data=>{

        let allData = JSON.parse(data.works)[0]
        let answerData = []
        let num = 0
        allData.testJson.testJson.forEach(e=>{
          let _answer = e.answer;
          if(typeof _answer == 'object'){
            _answer.sort((a,b)=>a-b)
          }
          answerData.push(_answer)
        })

        allData.anwer.forEach(e=>{
          if(typeof e == 'object'){
            e.sort((a,b)=>a-b)
          }
        })


        answerData.forEach((e,i)=>{
          if (JSON.stringify(e) == JSON.stringify(allData.anwer[i])) {
            num++
          }
        })

        let et = ((num / answerData.length) * 100).toFixed(1)
				return  et+'%';
			}
    }
  },
  watch: {
    chapInfoListData:{
      handler(newl){
        if (this.show && this.toolType == 49){
          if (JSON.stringify(newl) != JSON.stringify(this.chapInfoListData2)) {
            this.chapInfoListData2 = newl

            let _tempData = newl[this.courseType].chapterInfo[0]
              .taskJson[this.taskCount].toolChoose[this.toolIndex];

            this.testData = _tempData ? _tempData : null;

            this.testJson = this.testData.testJson
              ? this.testData.testJson.testJson
              : null;

            this.groupJson = this.testData.groupJson;
            this.islock = this.groupJson.islock == 1 ? true : false;
            this.selectGroup()
          }
        }
      },
      deep: true
    },

    worksStudentData: {
      handler(newValue) {

        if (this.toolIndex == null) return

        let workSData = []

        // 工具几的学生作业
        let zjm = JSON.parse(
          JSON.stringify(newValue[this.toolIndex])
        );

        // 判断是否开启学生查看作业(是否隐藏其他同学作业)
        if (this.tType == 2 && !this.sIsOpen) {
          workSData = zjm.filter( e =>{
            return this.userId == e.userid
          })
        }else {
          workSData = JSON.parse(
            JSON.stringify(newValue[this.toolIndex])
          );
        }

        // 新增作业时进入这个,和上方代码一样,都是为了筛选作业
        if (
          this.show &&
          this.toolIndex !== null &&
          JSON.stringify(this.worksStudent) !==
            JSON.stringify(workSData)
        ) {
            let yym = JSON.parse(
              JSON.stringify(newValue[this.toolIndex])
            );
            // 判断是否开启学生查看作业
            if (this.tType == 2  && !this.sIsOpen) {
              this.worksStudent = yym.filter( e =>{
                return this.userId == e.userid
              })
            }else {
              this.worksStudent = JSON.parse(
                JSON.stringify(newValue[this.toolIndex])
              );
            }
            // // 获取学生单独作业
            this.testJsonCopy = yym.filter( e =>{
              return this.userId == e.userid
            })

          this.dialogTypeList[2].loading = false;
          }
      },
      deep: true
    },
    // 监视是否开启学生查看所有作业
    sIsOpen:{
      handler(newl,oldl){
        if (!this.show) return

          let yym = JSON.parse(
            JSON.stringify(this.worksStudentData[this.toolIndex])
          );
          // 判断是否开启学生查看作业
          if (this.tType == 2 && !newl) {
            this.worksStudent = yym.filter( e =>{
              return this.userId == e.userid
            })
          }else{
            this.worksStudent = JSON.parse(
              JSON.stringify(this.worksStudentData[this.toolIndex])
            );
          }
      },
      deep: true
    },
    noWorksSData: {
      handler(newValue) {
        if (!this.show) return

        if (
          this.show &&
          this.toolIndex !== null &&
          JSON.stringify(this.noWorksStudent) !==
            JSON.stringify(newValue[this.toolIndex])
        ) {
          this.noWorksStudent = JSON.parse(
            JSON.stringify(newValue[this.toolIndex])
          );
          this.dialogTypeList[2].loading = false;
        }
      },
      deep: true
    }
  },
  methods: {

    // 提交应用中心作业
    async upLoadApp(){
      let _iframe = this.$refs.appStore;
      document.getElementById('loadLi_JieE').children[0].style.display = "block"


        // window.exposed_outputs
        // let Cow = JSON.stringify(_iframe.contentWindow.exposed_outputs)
        const pptJsonStr = JSON.stringify(_iframe.contentWindow.exposed_outputs);
        const pptJsonFile = new File([pptJsonStr], "pptData.json", { type: "application/json" });
        // 你可以根据需要将pptJsonFile上传或保存

        let Cow = await this.uploadFile(pptJsonFile);
        // uid: this.userId,
        //       cid: this.id,
        //       stage: this.courseType,
        //       task: this.taskCount,
        //       tool: this.toolIndex,
        //       content: answerData,
        //       type: answerType,
        //       atool: 52
        let params = [
            {
            uid: this.userId,
            cid: this.id,
            stage: this.courseType,
            task: this.taskCount,
            tool: this.toolIndex,
            content: Cow,
            type: 20,
            atool: 72
            }
        ];
        if (this.homeWorkLoading) return this.$message.info(this.lang.ssClickTooFast)
        this.homeWorkLoading = true
        this.ajax
            .post(this.$store.state.api + "addCourseWorks3-2", params)
            .then(res => {
            this.$message({
                message: this.lang.ssSubmitSuccess,
                type: "success"
            });
            setTimeout(() => {
                this.homeWorkLoading = false
            }, 500);

                this.$emit('selectSWorks');
                this.$emit('selectStudent');
                document.getElementById('loadLi_JieE').children[0].style.display = "none"
                this.addOp3('1', "", { courseid: this.id,tool: 'AI应用',data: Cow,type: "course_tool_sub" }, 'success')

            })
            .catch(err => {
               document.getElementById('loadLi_JieE').children[0].style.display = "none"
                this.$message.error(this.lang.ssSubmitFailed);
                setTimeout(() => {
                    this.homeWorkLoading = false
                }, 500);

                console.error(err);
               this.addOp3('1', "", { courseid: this.id,tool: 'AI应用',data: Cow,type: "course_tool_sub" }, err)

            });
    },
        //上传文件
    uploadFile(file) {
        return new Promise((resolve)=>{
            var credentials = {
            accessKeyId: "AKIATLPEDU37QV5CHLMH",
            secretAccessKey: "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"
        }; //秘钥形式的登录上传
        window.AWS.config.update(credentials);
        window.AWS.config.region = "cn-northwest-1"; //设置区域

        var bucket = new window.AWS.S3({ params: { Bucket: "ccrb" } }); //选择桶
        var _this = this;

        if (file) {
            var params = {
            Key:
                file.name.split(".")[0] +
                new Date().getTime() +
                "." +
                file.name.split(".")[file.name.split(".").length - 1],
            ContentType: file.type,
            Body: file,
            "Access-Control-Allow-Credentials": "*",
            ACL: "public-read"
            }; //key可以设置为桶的相抵路径，Body为文件， ACL最好要设置
            var options = {
            partSize: 2048 * 1024 * 1024,
            queueSize: 2,
            leavePartsOnError: true
            };
            bucket
            .upload(params, options)
            .on("httpUploadProgress", function(evt) {
                //这里可以写进度条
                // console.log("Uploaded : " + parseInt((evt.loaded * 80) / evt.total) + '%');
            })
            .send(function(err, data) {
                if (err) {
                // var a = _this.$refs.upload1.uploadFiles;
                // a.splice(a.length - 1, a.length);
                _this.$message.error(this.lang.ssUploadFailedPptData);
                } else {
                //上传成功处理
                // _this.unitJson[_this.unitIndex].chapterInfo[0].fileList1.push({
                //   name: file.name,
                //   url: data.Location,
                //   uid: file.uid
                // });
                // _this.imgChange();
                // console.log(data.Location);
                resolve(data.Location)
                }
            });
        }
        })
    },
    // 设置分组
    updateGroupJson(){
      for (var i = 0; i < this.groupStudentUid[this.toolIndex].length; i++) {
        if (
          this.groupStudentUid[this.toolIndex][i].length >
          this.groupJson2.number
        ) {
          this.$message.error(this.lang.ssGroupSizeExceedsSetting);
          return;
        }
      }
      this.groupJson = JSON.parse(JSON.stringify(this.groupJson2));

      this.chapInfoListData2[this.courseType].chapterInfo[0].taskJson[
        this.taskCount
      ].toolChoose[this.toolIndex].groupJson = this.groupJson;


      let params = [
        {
          cid: this.id,
          chapters: JSON.stringify(this.chapInfoListData2),
          uid: this.userId,
          unitIndex: this.courseType,
        },
      ];
      this.ajax
        .post(this.$store.state.api + "updateWorkNew4", params)
        .then((res) => {
          this.$message.success(this.lang.ssSettingSuccess);
          this.$emit('getCourseDetail',2)
          this.$forceUpdate();
        })
        .catch((err) => {
          this.$message.error(this.lang.ssNetworkError);
          console.error(err);
        });
    },
    // 提交英语写作作业
    addEnglishWork() {
      let myAnList ={}
      myAnList = this.$refs['engJson'].myAnswerList;
      if (!myAnList.engTitle || !myAnList.engText || myAnList.engTitle == "" || myAnList.engText == "") {
        this.$message.error(this.lang.ssPleaseEnterTitleAndContent);
        return;
      }
      let params = [
        {
          uid: this.userId,
          cid: this.id,
          stage: this.courseType,
          task: this.taskCount,
          tool: this.toolIndex,
          content: JSON.stringify(myAnList),
          type: 16,
          atool: 69,
          text: "",
        },
      ];
      //  console.log('params',params);
      if (this.homeWorkLoading) return this.$message.info(this.lang.ssClickTooFast)
      this.homeWorkLoading = true
      this.ajax
        .post(this.$store.state.api + "addCourseWorks5", params)
        .then((res) => {
            this.$message({
              message: this.lang.ssSubmitSuccess,
              type: "success",
            });
          setTimeout(() => {
              this.homeWorkLoading = false
          }, 500);

          this.addOp3('1', "", { courseid: this.id,tool: '英语写作',data:JSON.stringify(myAnList) ,type: "course_tool_sub" }, 'success')

          this.englishList = {};
        })
        .catch((err) => {
          this.$message.error(this.lang.ssSubmitFailed);
          console.error(err);
          setTimeout(() => {
              this.homeWorkLoading = false
          }, 500);

          this.addOp3('1', "", { courseid: this.id,tool: '英语写作',data:JSON.stringify(myAnList) ,type: "course_tool_sub" }, err)
        });
    },
    updateGroup(){
      this.groupJson2 = JSON.parse(JSON.stringify(this.groupJson));
      this.dialogVisibleGroup2 = true;
    },

    lockChair(){
      this.groupJson2 = JSON.parse(JSON.stringify(this.groupJson));
      this.groupJson2.islock = this.groupJson2.islock == 1 ? 2 : 1;
      this.groupJson = JSON.parse(JSON.stringify(this.groupJson2));
      this.islock = this.groupJson.islock == 1 ? true : false;

      this.chapInfoListData2[this.courseType].chapterInfo[0].taskJson[
        this.taskCount
      ].toolChoose[this.toolIndex].groupJson = this.groupJson;


      let params = [
        {
          cid: this.id,
          chapters: JSON.stringify(this.chapInfoListData2),
          uid: this.userId,
          unitIndex: this.courseType,
        },
      ];
      this.ajax
        .post(this.$store.state.api + "updateWorkNew4", params)
        .then((res) => {
          this.$message.success(this.lang.ssSettingSuccess);
          this.$emit('getCourseDetail')
          this.$forceUpdate();
        })
        .catch((err) => {
          this.$message.error(this.lang.ssNetworkError);
          console.error(err);
        });
    },

    // 加入分组前检查人员是否已经满了
    selectGroup(index) {

        //教师查看全部作业
        let params = {
          cid: this.id,
          s: this.courseType,
          t: this.taskCount,
        };
        this.ajax
          .get(this.$store.state.api + "selectSWorks", params)
          .then((res) => {

            let groupStudent = []
            let groupStudentUid = []

            let a = this.chapInfoListData[this.courseType].chapterInfo[0]
            .taskJson[this.taskCount].toolChoose
            var f = res.data[3];

            if (this.tType == 2) {
              this.tcid = this.classid
            }


            for (var i = 0; i < a.length; i++) {

              groupStudent[i] = [];
              groupStudentUid[i] = [];


              if (a[i].tool[0] == 49) {
                for (var gA = 0; gA < a[i].groupJson.group.length; gA++) {
                  groupStudent[i][gA] = [];
                  groupStudentUid[i][gA] = [];

                  for (var g = 0; g < f.length; g++) {
                    if (
                      f[g].ttype == 2 &&
                      this.tcid &&
                      this.arrayToArray( (f[g].classid ? f[g].classid.split(",") : []), this.tcid.split(","))
                      .length == 0
                    ) {
                      continue;
                    }


                    let _classId = this.arrayToArray(
                        this.courseDetail.juri ? this.courseDetail.juri.split(",") : [],
                        this.classid ? this.classid.split(",") : []
                      )

                      // console.log(' this.tcid', this.tcid);

                    if (gA == f[g].group && f[g].tool == i
                      && (this.arrayToArray((f[g].classid ? f[g].classid.split(",") : []),this.tcid.split(",")).length !== 0
                      || this.arrayToArray((f[g].classid ? f[g].classid.split(",") : []), _classId).length !== 0
                      || (!this.tcid && this.tType == '1') || (this.courseDetail.juri === '') || f[g].ttype == 1)
                    ){
                      groupStudent[i][gA].push(f[g]);
                      groupStudentUid[i][gA].push(f[g].userid);
                    }
                  }
                }
                this.$forceUpdate();
              }
            }
            this.groupStudent = groupStudent
            this.groupStudentUid = groupStudentUid

            if (index != null) {
              this.joinGroup(index)
            }

          })
          .catch((err) => {
            console.error(err);
          });


    },
    // 判断是否在班级内
    arrayToArray(arrayo, arrayt) {
      let array1 = arrayo;
      let array2 = arrayt;

      let commonElements = [];

      for (let i = 0; i < array1.length; i++) {
        for (let j = 0; j < array2.length; j++) {
          if (array1[i] === array2[j]) {
            commonElements.push(array1[i]);
          }
        }
      }
      return commonElements;
    },
    numberPan() {
      if (
        /[^\d]/.test(this.groupJson.number) ||
        this.groupJson.number < 2 ||
        this.groupJson.number > 10
      ) {
        this.$message.error(this.lang.ssEnterNumber2To10);
        this.groupJson.number = "";
      }
    },
    deleteGroupChair(gindex) {
      this.checkDeleteGroup = [];
      console.log(this.groupStudent[this.toolIndex][gindex]);
      console.log(this.groupJson.group[gindex]);

      this.deleteGroupUser = JSON.parse(
        JSON.stringify(this.groupStudent[this.toolIndex][gindex])
      );

      this.deleteGroupArray = this.groupJson.group[gindex];
      this.groupIndex = gindex;
      this.dialogVisibleDeleteGroup = true;
    },
    async deleteChair() {
      for (let i = 0; i < this.checkDeleteGroup.length; i++) {
        const gid =
          this.groupStudent[this.toolIndex][this.groupIndex][
            this.groupStudentUid[this.toolIndex][this.groupIndex].indexOf(
              this.checkDeleteGroup[i]
            )
          ];
        let params = [
          {
            gid: gid.id,
          },
        ];
        var a = await this.deleteChairA(params);
        if (i == this.checkDeleteGroup.length - 1) {
          this.$message.success(this.lang.ssExitSuccess);
          this.dialogVisibleDeleteGroup = false;
          this.deleteGroupUser = [];
          this.deleteGroupArray = {};
          this.groupIndex = "";
          this.checkDeleteGroup = [];
          this.selectGroup()

        }
      }
    },
    deleteChairA(params) {
      return new Promise((resolve, reject) => {
        this.ajax
          .post(this.$store.state.api + "exitGroup", params)
          .then((res) => {
            resolve(1);
          })
          .catch((err) => {
            this.$message.error(this.lang.ssNetworkError);
            console.error(err);
          });
      });
    },
    joinGroup(index) {
      if (this.groupJson.islock == 2) {
        this.$message.error(this.lang.ssPositionLockedCannotJoin);
        return;
      }
      if (
        this.groupStudent[this.toolIndex][index].length >
          this.groupJson.number ||
        this.groupStudent[this.toolIndex][index].length == this.groupJson.number
      ) {
        this.$message.error(this.lang.ssPositionFullCannotJoin);
        return;
      }
      let params = [
        {
          cid: this.id,
          stage: this.courseType,
          task: this.taskCount,
          tool: this.toolIndex,
          g: index,
          uid: this.userId,
        },
      ];
      this.ajax
        .post(this.$store.state.api + "joinGroup", params)
        .then((res) => {
          this.$message.success(this.lang.ssJoinSuccess);
          this.selectGroup()
        })
        .catch((err) => {
          this.$message.error(this.lang.ssNetworkError);
          console.error(err);
        });
    },

    // 退出分组
    exitGroup(id) {
      if (this.groupJson.islock == 2) {
        this.$message.error(this.lang.ssPositionLockedCannotExit);
        return;
      }
      let params = [
        {
          gid: id,
        },
      ];

      this.ajax
        .post(this.$store.state.api + "exitGroup", params)
        .then((res) => {
          this.$message.success(this.lang.ssExitSuccess);
          this.selectGroup()
        })
        .catch((err) => {
          this.$message.error(this.lang.ssNetworkError);
          console.error(err);
        });
    },
    // 提交Cocopi作业
    upLoadCocoPi(){

      let _iframe = this.$refs.iframePiRef;
      let text = _iframe.contentWindow.getLoadXmlStr()
      document.getElementById('loadLi_JieE').children[0].style.display = "block"
      // addCourseWorks4-u2

      let params = [{
          uid:this.userId,
          cid:this.courseId,
          s:this.courseType,
          task:this.taskCount,
          t:this.toolIndex,
          text:text.replaceAll(/%/g, "%25"),
          type:15,
          aTool: this.toolType,
          txt:text
        }]
        if (this.homeWorkLoading) return this.$message.info(this.lang.ssClickTooFast)
        this.homeWorkLoading = true
        this.ajax.post(this.$store.state.api+"addCourseWorks4-u2",params).then(res=>{
          document.getElementById('loadLi_JieE').children[0].style.display = "none"
          this.$message.success(this.lang.ssUploadSuccess)
          setTimeout(() => {
            this.homeWorkLoading = false
          }, 500);
        })
        .catch(err=>{
          setTimeout(() => {
            this.homeWorkLoading = false
          }, 500);
          this.$message.success(this.lang.ssUploadFailed)
          console.log(err);
        })
        this.addOp3('1', "", { courseid: this.id,tool: 'Cocopi',data:JSON.stringify(text.replaceAll(/%/g, "%25")) ,type: "course_tool_sub" }, 'success')


    },
    // 截图类提交作业
    async captureScreenshot(){

      // this.$refs.iframeWhiteBoardRef.contentWindow;
      document.getElementById('loadLi_JieE').children[0].style.display = "block"

      let iframeWindow = ''
      let text = ''
      let str = ''

      if (this.toolType == 7) { //思维网格
        str = 'mindNetwork'
        iframeWindow = this.$refs.iframeThoughtGridRef.contentWindow;
      }else if (this.toolType == 1) {//电子白板
        str = 'whiteboard'
        iframeWindow = this.$refs.iframeWhiteBoardRef.contentWindow;
      }else if (this.toolType == 3) {//思维导图
        str = 'mind'
        iframeWindow = this.$refs.iframeMainMapRef.contentWindow;
      }else if (this.toolType == 57) {//CocoPi
        str = 'CocoPi'
        iframeWindow = this.$refs.iframePiRef.contentWindow;
      }
      console.log('iframeWindow',iframeWindow);


      if (this.toolType == 1) {
          text = JSON.stringify(iframeWindow.h.app.scene.elements)
      } else if (this.toolType == 3) {
        text = await this.getEditorContent(iframeWindow);
      }
      console.log('text',text);
      if (this.homeWorkLoading) return this.$message.info(this.lang.ssClickTooFast)
      this.homeWorkLoading = true
      setTimeout(() => {
        this.homeWorkLoading = false
      }, 1000);
      var _ajs = iframeWindow.document.createElement("script");
            _ajs.type = "text/javascript";
            _ajs.innerHTML =
                // 'console.log(' + _loading + ');\n' +
                'var _js = document.createElement("script");\n' +
                'console.log(_js);\n' +
                '_js.type="text/javascript";\n' +
                '_js.charset="UTF-8";\n' +
                '_js.src="https://cloud.cocorobo.cn/js/Common/html2canvas.min.js";\n' +
                "_js.onload = function(){\n" +
                'console.log(_js);\n' +
                ' var a = document.getElementsByTagName("img")\n' +
                ' for(var i = 0;i<a.length;i++){a[i].crossOrigin="anonymous"}\n' +
                " html2canvas(document.body,{allowTaint: true,useCORS: true,height: document.body.scrollHeight,windowHeight: document.body.scrollHeight}).then(canvas => {\n" +
                ' var base64Url = canvas.toDataURL("image/png");\n' +
                'var base64 = "<img src=" + base64Url + " />"\n' +
                'var file = dataURLtoFile_shishi(base64Url, "截图")\n' +
                "beforeUpload_shishi(file," +
                "'" +
                this.userId +
                "'" +
                ", " +
                "'" +
                this.courseId +
                "'" +
                ", " +
                "'" +
                this.courseType +
                "'" +
                ", " +
                "'" +
                this.taskCount +
                "'" +
                ", " +
                "'" +
                this.toolIndex +
                "'" +
                ", " +
                "'" +
                ('loadLi_JieE') +
                "'" +
                ", " +
                "'" +
                this.toolType +
                "'" +
                ", " +
                "`" +
                text +
                "`" +
                ")\n" +
                " });\n" +
                "}\n" +
                'console.log(_js);\n' +
                "document.head.appendChild(_js);\n";
                iframeWindow.document.head.appendChild(_ajs);

                this.addOp3('1', "", { courseid: this.id,tool: this.toolsList[this.toolType],data:JSON.stringify(text) ,type: "course_tool_sub" }, 'success')


                // this.$message.success('上传成功')
    },
    getEditorContent(iframe) {
        return new Promise((resolve, reject) => {
            iframe.editor.minder.exportData('json').then(function (content) {
                console.log(content);
                resolve(content)
            });
        });
    },
    // 提交作业
    submitWork(){
      // 选择题提交
      let answerData = null;
      let answerType = null;
      let urlT = 'addCourseWorks';

      if (this.toolType == 45) { //选择题
        answerType = 8
        for (var i = 0; i < this.testJson.length; i++) {
          if (this.testJson[i].type == '2' && !this.radioS[i].length) {
            this.$message.error(this.lang.ssPleaseSelectOption);
            return;
          }
          if (this.testJson[i].type == '1' && (!this.radioS[i] && this.radioS[i] !== 0)) {
            this.$message.error(this.lang.ssPleaseSelectOption);
            return;
          }
        }

        let zjm = []

        zjm.push({ testJson: this.testData.testJson, anwer: this.radioS });

        answerData = JSON.stringify(zjm)
      }else if (this.toolType == 15) { //问答
        if (!this.questionsData) return this.$message.error(this.lang.ssPleaseFillAnswer)
        answerType = 3
        answerData = []
        answerData.push({
          answerTitle: this.testData.answerQ,
          answer: this.questionsData,
        })
        answerData = JSON.stringify(answerData)
      }else if(this.toolType == 41){ //选择匹配
        if (this.radioS.length < this.testData.selectJson.answer.length) return this.$message.error(this.lang.ssPleaseSelectAnswer)
        answerType = 7
        answerData = this.radioS
      }else if(this.toolType == 52){// 文档
        if (!this.questionsData) return this.$message.error(this.lang.ssPleaseFillAnswer)

        answerType = 13
        urlT = 'addCourseWorks3-2';
        answerData = {text : this.questionsData}
        answerData = JSON.stringify(answerData)
      }else if(this.toolType == 48){ //表格
        if (!this.questionsData) return this.$message.error(this.lang.ssPleaseFillAnswer)
        answerType = 10
        answerData = {text : this.questionsData}
        answerData = JSON.stringify(answerData)
      }else if(this.toolType == 47){ //排序
        for (var i = 0; i < this.radioS.length; i++) {
          for (var j = 0; j < this.radioS[i].length; j++) {
            if (
              this.radioS[i][j] == undefined ||
              (this.radioS[i][j] == ""  &&  this.radioS[i][j] !== '0')
            ) {
              this.$message.error(this.lang.ssPleaseCompleteAnswer);
              return;
            }
          }
        }
        answerType = 9

        answerData = JSON.parse(JSON.stringify(this.testData.sentenceList))
        answerData.forEach((e,i)=>{
          e.chooseSenList = this.radioS[i]
          e.addChangeSen = []
          e.chooseSenList.forEach(k=>{
            e.addChangeSen.push('')
          })
        })
        answerData = JSON.stringify(answerData)
      }else if(this.toolType == 40){ //个人评价
        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(this.lang.ssPleaseSelectOption);
            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 = []
      if (this.toolType == 52) {
        params = [
            {
              uid: this.userId,
              cid: this.id,
              stage: this.courseType,
              task: this.taskCount,
              tool: this.toolIndex,
              content: answerData,
              type: answerType,
              atool: 52
            },
          ];
      }else{
        params = [
          {
            uid: this.userId,
            cid: this.id,
            stage: this.courseType,
            task: this.taskCount,
            tool: this.toolIndex,
            content: answerData,
            type: answerType
          },
        ];
      }
      if (this.homeWorkLoading) return this.$message.info(this.lang.ssClickTooFast)
      this.homeWorkLoading = true
      // return console.log('params',params);

        this.ajax
          .post(this.$store.state.api + urlT, params)
          .then((res) => {
            this.$message({
              message: this.lang.ssSubmitSuccess,
              type: "success",
            });
            setTimeout(() => {
              this.homeWorkLoading = false
            }, 500);
            // this.askList = [];
            this.$emit("selectStudent")
            this.$emit("selectSWorks")
            this.$emit("selectSLook")
            this.addOp3('1', "", { courseid: this.id,tool: this.toolsList[this.toolType],data:answerData ,type: "course_tool_sub" }, 'success')

          })
          .catch((err) => {
            this.$message.error(this.lang.ssSubmitFailed);
            setTimeout(() => {
              this.homeWorkLoading = false
            }, 500);
            console.error(err);
            this.addOp3('1', "", { courseid: this.id,tool: this.toolsList[this.toolType],data:answerData ,type: "course_tool_sub" }, err)

          });

    },
    selectSWorks(){
      this.$emit("selectSWorks")
    },
    selectStudent(){
      this.$emit("selectStudent")
    },
    // 排序操作答案
    sentenceBtn2(val,val1){
      let yym = this.testData.sentenceList[val].addSentence
      yym.forEach((e,i)=>{
        if (e == this.radioS[val][val1]) {
          this.isShowList[val].splice(i,1,true)
        }
      })
      this.radioS[val].splice(val1,1,'')

    },
    // 排序操作题目
    sentenceBtn(val,val1){
      if (!this.isShowList[val][val1]) return

      this.isShowList[val].splice(val1,1,false)
      for (let index = 0; index < this.radioS[val].length; index++) {
        if (!this.radioS[val][index] && this.radioS[val][index] !== 0) {
          this.radioS[val].splice(index,1,this.testData.sentenceList[val].addSentence[val1])
          return
        }
      }
    },

    jumpTo(val){
      let a = document.getElementById(val+"JP");
      a.scrollIntoView({
        behavior: "smooth" // 平滑滚动效果
      });

    },
    open(data) {
      if (this.show) return;
      this.show = true;
      this.data = data;
      this.toolIndex = data.toolIndex;
			this.toolType = data.toolType;
			if(this.dialogTypeList.findIndex(i=>i.showType.includes(this.toolType))==-1){
				this.changeShowType(this.dialogTypeList.findIndex(i=>i.showType.includes(this.toolType)))
			}
      this.setData();
			if([3,1,7,57,71,72].includes(this.toolType)){
        this.$nextTick(() => {
          this.getIframeWorksData();
        });
      }
    },
    openWordCloud() {
      this.dialogVisibleWordCloud = true
    },
    StudentWork(item){
      console.log('item',item);

      if (this.toolType == 57) {
        this.$message(this.lang.ssCannotViewOnProjection)
        return
      }

      this.$refs.studentWorkPreviewDialogRef.open({work:item,testData:this.testData,testJson:this.testJson,tool:this.toolType});
      this.$emit("changeSplitScreenBehavior",{code: 1,
        form: {
          toolType:this.toolType,
          toolIndex: this.toolIndex,
          courseType: this.courseType,
          taskCount: this.taskCount,
          type: this.showType,
					showStatisticsType:this.showStatisticsType,
					lookWorks:item.wid
        }})
      // if (this.toolType == 41) {
      //   this.testJsonCopy=val.works.split(',')
      // }else if(this.toolType == 52 ) {
      //   return this.openTools(val)
      // }else if(this.toolType == 48) {
      //   return this.openTools(val)
      //   return this.openTools(JSON.parse(val))
      // }else if(this.toolType == 40){
      //   this.testJsonCopy=JSON.parse(val.works)
      // }else{
      //   this.testJsonCopy=JSON.parse(val.works)[0]
      // }

      // console.log('this.testJson',JSON.parse(JSON.stringify(this.testJsonCopy)));

      // this.showType = 0;
			// this.$emit("changeSplitScreenBehavior",{code: 1,
      //   form: {
      //     toolType:this.toolType,
      //     toolIndex: this.toolIndex,
      //     courseType: this.courseType,
      //     taskCount: this.taskCount,
      //     type: this.showType,
			// 		showStatisticsType:this.showStatisticsType,
			// 		lookWorks:val.wid
      //   }})
    },
    studentPreviewClose(){
      this.$emit("changeSplitScreenBehavior",{code: 1,
        form: {
          toolType:this.toolType,
          toolIndex: this.toolIndex,
          courseType: this.courseType,
          taskCount: this.taskCount,
          type: this.showType,
					showStatisticsType:this.showStatisticsType,
					lookWorks:null
        }})
    },
    setData() {
      if (this.show && this.toolIndex !== null) {

        // if (this.worksStudentData[this.toolIndex].length) {
          let yym = JSON.parse(
            JSON.stringify(this.worksStudentData[this.toolIndex])
          );
          // 获取学生单独作业，监视属性中也有这个
          this.testJsonCopy = yym.filter( e =>{
            return this.userId == e.userid
          })
          // 判断是否开启学生查看作业，监视属性中也有这个
          if (this.tType == 2 && !this.sIsOpen) {
                  this.worksStudent = yym.filter( e =>{
                    return this.userId == e.userid
                  })
          }else{
            this.worksStudent = JSON.parse(
              JSON.stringify(this.worksStudentData[this.toolIndex])
            );
          }


        this.noWorksStudent = JSON.parse(
          JSON.stringify(this.noWorksSData[this.toolIndex])
        );
          let _tempData = this.chapInfoListData[this.courseType].chapterInfo[0]
            .taskJson[this.taskCount].toolChoose[this.toolIndex];

          this.testData = _tempData ? _tempData : null;

          this.testJson = this.testData.testJson
            ? this.testData.testJson.testJson
            : null;

            // console.log('this.testData',this.testData);
            // console.log('this.testJsonCopy',this.testJsonCopy);
          if (this.toolType == 45 ) { //选择题
            this.testJson.forEach(e=>{
              if (e.type == '2') {
                this.radioS.push([])
              }else{
                this.radioS.push('')
              }
            })
            this.testJsonCopy = [{answer:[],testJson:this.testJson ? this.testData.testJson : null}]
          } else if(this.toolType == 52 ) { //文本
            if (this.testJsonCopy && this.testJsonCopy.length) {
              this.questionsData = JSON.parse(this.testJsonCopy[0].works).text
            }else{
              if (this.testData.wordJson && this.testData.wordJson.text) {
                this.questionsData = this.testData.wordJson.text
              }
            }
          }else if(this.toolType == 48) { //表格
            if (this.testJsonCopy && this.testJsonCopy.length) {
              this.questionsData = JSON.parse(this.testJsonCopy[0].works).text
            }else if(this.testData && this.testData.tableJson && this.testData.tableJson.text){
              this.questionsData = this.testData.tableJson.text
            }else{
              this.questionsData = ''
            }
          }else if(this.toolType == 47) { //排序

            // 把正确答案的数组先创建好
            this.testData.sentenceList.forEach((e,i)=>{
              this.radioS.push([])
              e.addSentence.forEach((k,l)=>{
                this.radioS[i].push('')
              })
            })

            //把题目选项点击隐藏写好
            this.testData.sentenceList.forEach((e,i)=>{
              this.isShowList.push([])
              e.addSentence.forEach((k,l)=>{
                this.isShowList[i].push(true)
              })
            })
          }else if(this.toolType == 40){ //个人评价
            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('')
              }
            })
          }else if (this.toolType == 69) { //英语写作
            console.log('this.testJsonCopy',this.testJsonCopy);

            // if (this.testJsonCopy.length) {
            //     this.myAnswerList1 = JSON.parse(this.testJsonCopy[0].works)
            // } else {
            this.myAnswerList1 = {engTitle: "",engText: "",imgList: [],};
            // }

            // console.log('this.testData',this.testData);

            this.englishList = this.testData.englishList
              ? this.testData.englishList
              : {};
          }else if (this.toolType == 70) {  //英语口语

            if (this.testJsonCopy.length) {
                  this.englishVoiceJsonWork = JSON.parse(this.testJsonCopy[0].works)
            } else {
              this.englishVoiceJsonWork = [];
            }

            console.log('this.testData',this.testData);

            let englishVoiceJson = {}
            englishVoiceJson = this.testData.englishVoiceJson
              ? this.testData.englishVoiceJson
              : {};

            this.englishVoiceJson = JSON.parse(JSON.stringify(englishVoiceJson));
          }else if (this.toolType == 49) { //学生分组
            // if (this.toolType == 49) {
            this.chapInfoListData2 = JSON.parse(JSON.stringify(this.chapInfoListData))
            // }
            this.groupStudent=this.groupStudent2
            this.groupStudentUid=this.groupStudentUid2


            this.groupJson = this.testData.groupJson;
            this.islock = this.groupJson.islock == 1 ? true : false;
            this.timerId = setInterval(() => {
              this.selectGroup()
              console.log('分组同步');
            }, 5000);
          }
      }
    },
    close() {
      this.show = false;
      // 清除定时器
      if (this.timerId) {
        clearInterval(this.timerId);
      }
      this.init();
			this.$emit("changeSplitScreenBehavior",{code:99})
    },
    handleClose(done){
      done();
    },
    init() {
      this.data = null;
      this.showType = 0;
			this.showStatisticsType = 0;
      this.testJson = null;
      this.testJsonCopy = null;
      this.radioS = [];
      this.questionsData = '';
      this.isShowList=[],
      this.worksStudent = [];
      this.noWorksStudent = [];
      this.toolIndex = null;
      this.testData = null;
			this.toolType = null;
      this.chapInfoListData2= [];
      this.foldList = {
        noSubmit: false,
        worksPreview: false
      };
      this.myAnswerList1={}; //英语写作
      this.englishList={},//英语写作
      this.englishVoiceJsonWork=[] //英语口语
      this.englishVoiceJson={} //英语口语
      this.groupJson=[] //学生分组
      this.groupStudentUid=[] //学生分组
      this.groupStudent=[] //学生分组
      this.groupJson2={}
    },
    changeShowType(type) {
      if (type == 1 && this.toolType == 15) {
        this.openWordCloud()
      }
      this.showType = type;
			this.$emit("changeSplitScreenBehavior",{code: 1,
        form: {
          toolType:this.toolType,
          toolIndex: this.toolIndex,
          courseType: this.courseType,
          taskCount: this.taskCount,
          type: this.showType,
					showStatisticsType:this.showStatisticsType,
        }})

    },
    deleteWorks(wid) {
      this.$emit("deleteWorks", wid);
      this.dialogTypeList[2].loading = true;
    },
		openTools(data){
			if([45].includes(this.toolType)){
				this.$emit("openTools",this.toolType,this.toolIndex,this.taskCount,data.works,data.sName)
			}else if([52,48].includes(this.toolType)){
				this.$emit("openWord",data)
			}
		},
		changeShowStatisticsType(type){
			this.showStatisticsType = type;
			this.$emit("changeSplitScreenBehavior",{code: 1,
        form: {
          toolType:this.toolType,
          toolIndex: this.toolIndex,
          courseType: this.courseType,
          taskCount: this.taskCount,
          type: this.showType,
					showStatisticsType:this.showStatisticsType
        }})
		},
		splitScreenFn(data){
			if(data.type!==undefined){
				this.showType = data.type;
			}
			if(data.showStatisticsType!==undefined){
				this.showStatisticsType = data.showStatisticsType;
			}
			if(data.toolType!==undefined &&this.toolType != data.toolType){
				this.toolType = data.toolType;
        this.setData();
        this.$forceUpdate();
			}

			if(data.lookWorks !== undefined){
        let work = this.worksStudent.find(e=>e.wid==data.lookWorks);
        if(work){
          this.StudentWork(work)
        }else if(data.lookWorks===null){
        this.$refs.studentWorkPreviewDialogRef.close();
      }
			}
		},
		getIframeWorksData(){
			if([3].includes(this.toolType)){ //思维导图
        let params = {
          uid:this.userId,
          cid:this.courseId,
          s:this.courseType,
          task:this.taskCount,
          t:this.toolIndex,
          type:"2"
        }
        let _iframe = this.$refs.iframeMainMapRef;


        this.ajax.get(this.$store.state.api+"selectWord2",params).then(res=>{
          let _data = res.data[0]
          // console.log('_data',_data);
          // console.log('_data[0].text',_data[0].text)
          // console.log('JSON.parse(_data[0].text',JSON.parse(_data[0].text))
          console.log("思维导图iframe加载数据👈")

          // if (res.data[0].length > 0) {
            if(_data.length > 0){
              _iframe.contentWindow.editor.minder.importData('json',_data[0].text)
            }else{
                this.getdefaultMind()
            }
          // }

          const scripts = [
            "https://cloud.cocorobo.cn/js/Common/jquery-3.6.0.min.js",
            "https://cloud.cocorobo.cn/js/Common/aws-sdk-2.235.1.min.js",
            "https://cloud.cocorobo.cn/js/Common/html2canvas.min.js",
            "https://cloud.cocorobo.cn/js/Common/jietu22.js"
          ];
          scripts.forEach(src => {
            const script = document.createElement("script");
            script.src = src;
            _iframe.contentWindow.document.body.appendChild(script);
          });


        })
			}else if([1].includes(this.toolType)){ //电子白板ok
        let params = {
          uid:this.userId,
          cid:this.courseId,
          s:this.courseType,
          task:this.taskCount,
          t:this.toolIndex,
          type:"3"
        }
        let _iframe = this.$refs.iframeWhiteBoardRef;
        console.log('电子白板_iframe',_iframe);

        this.ajax.get(this.$store.state.api+"selectWord2",params).then(res=>{
          let _data = res.data[0]
          console.log('_data',_data);

            // this.$nextTick(()=>{
              // _iframe.onload = () =>{
                console.log("电子白板iframe加载数据👈")
                if(_data[0]){
                  _iframe.contentWindow.h.app.updateScene({elements:JSON.parse(_data[0].text)})
                }

                console.log(' _iframe.contentWindow', _iframe.contentWindow);

                const scripts = [
                  "https://cloud.cocorobo.cn/js/Common/jquery-3.6.0.min.js",
                  "https://cloud.cocorobo.cn/js/Common/aws-sdk-2.235.1.min.js",
                  "https://cloud.cocorobo.cn/js/Common/html2canvas.min.js",
                  "https://cloud.cocorobo.cn/js/Common/jietu22.js"
                ];
                scripts.forEach(src => {
                  const script = document.createElement("script");
                  script.src = src;
                  _iframe.contentWindow.document.body.appendChild(script);
                });
              // }
              // if (onloadListener) {
              //   _iframe.contentDocument.location.reload()
              // } else {
              //     _iframe.contentDocument.location.reload()
              // }
            // })

        })
			}else if([57].includes(this.toolType)){

        let params = {
          uid:this.userId,
          cid:this.courseId,
          s:this.courseType,
          task:this.taskCount,
          t:this.toolIndex,
          type:"4"
        }
        let _iframe = this.$refs.iframePiRef;

        this.ajax.get(this.$store.state.api+"selectWordsY",params).then(res=>{
          let _data = res.data[0]
          console.log('_data',_data[0]);

          if (_data.length > 0) {
            _iframe.contentWindow.loadingXml(_data[0].text)
          }

        })
			}else if([7].includes(this.toolType)){ //思维网格ok
        let _iframe = this.$refs.iframeThoughtGridRef;
        _iframe.onload = () =>{
          console.log("思维网格iframe加载数据👈")
          // _iframe.contentWindow.h.app.updateScene({elements:JSON.parse(_data[0].text)})
          const scripts = [
            "https://cloud.cocorobo.cn/js/Common/jquery-3.6.0.min.js",
            "https://cloud.cocorobo.cn/js/Common/aws-sdk-2.235.1.min.js",
            "https://cloud.cocorobo.cn/js/Common/html2canvas.min.js",
            "https://cloud.cocorobo.cn/js/Common/jietu22.js"
          ];
          scripts.forEach(src => {
            const script = document.createElement("script");
            script.src = src;
            _iframe.contentWindow.document.body.appendChild(script);
          });
        }
			}else if([71].includes(this.toolType)){ //AI智能体


         this.AIUrl=`https://cloud.cocorobo.cn/aigpt/?userid=${this.userId}&oid=${this.oid}&org=${this.org}&role=0#/AgentVue`
        console.log("AI智能体iframe加载数据👈")

			}else if([72].includes(this.toolType)){ //AI智能体
        for (let index = 0; index < this.toolList.length; index++) {
          if (this.toolList[index].value == 72) {
            console.log('666',this.chapInfoListData[this.courseType].chapterInfo[0].taskJson[this.taskCount].toolChoose[this.toolIndex].appJson.url);

            this.toolList[index].label = this.chapInfoListData[this.courseType].chapterInfo[0].taskJson[this.taskCount].toolChoose[this.toolIndex].appJson.name
            this.toolList[index].img = this.chapInfoListData[this.courseType].chapterInfo[0].taskJson[this.taskCount].toolChoose[this.toolIndex].appJson.json.icon
            this.appStoreUrl = this.chapInfoListData[this.courseType].chapterInfo[0].taskJson[this.taskCount].toolChoose[this.toolIndex].appJson.url
          }
        }

      }
		},
    getdefaultMind(){
      let _iframe = this.$refs.iframeMainMapRef;

      let params = {
        uid:this.userId,
        cid:this.courseId,
        s:this.courseType,
        task:this.taskCount,
        t:this.toolIndex,
        type:"2"
      }
      this.ajax.get(this.$store.state.api+"selectWordsY",params).then(res=>{
        console.log('res',res);
        let data = res.data[0]

        if(data.length > 0){
          _iframe.contentWindow.editor.minder.importData('json',data[0].text)
        }
      })
    }
  }
};
</script>

<style scoped>
.choseWorksDetailDialog {
  width: 100vw;
  height: 100vh;
}
.choseWorksDetailDialog >>>  .el-dialog.is-fullscreen{
  overflow: visible;
}

.choseWorksDetailDialog >>> .el-dialog__header,
.choseWorksDetailDialog >>> .el-dialog__footer {
  display: none; /* 隐藏头部和底部 */
}

.choseWorksDetailDialog >>> .el-dialog__body {
  padding: 0;
  margin: 0;
  height: 100vh;
  width: 100vw;
  overflow: auto;
}

.s_box {
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  padding: 25px;
  background-color: #f3f7fd;
}

.s_b_main {
  width: 100%;
  height: 100%;
  background-color: #fff;
  border-radius: 10px;
}

.s_b_m_top {
  width: 100%;
  height: 70px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.s_b_m_t_left {
  width: auto;
  height: 100%;
  box-sizing: border-box;
  padding-left: 30px;
  display: flex;
  align-items: center;
  overflow: auto;
  white-space: nowrap;
}

.s_b_m_t_left > .s_b_m_t_leftSp {
  font-size: 20px;
  /* font-weight: bold; */
  cursor: pointer;
  position: relative;
  transition: 0.3s;
}

.s_b_m_t_left > span.s_b_m_t_l_active {
  color: #3681fc;
}

.s_b_m_t_l_active::after {
  content: "";
  display: inline-block;
  width: 100%;
  height: 4px;
  background-color: #3681fc;
  position: absolute;
  bottom: -15px;
  left: 0;
  border-radius: 2px;
}

.s_b_m_t_right {
  width: 100px;
  margin-right: 30px;
  display: flex;
  justify-content: flex-end;
}

.s_b_m_t_right > span {
  font-size: 18px;
  cursor: pointer;
}

.s_b_m_bottom {
  width: 100%;
  height: calc(100% - 70px);
}

.s_b_m_b_item {
  width: 100%;
  height: 100%;
  overflow: auto;
}

.s_b_m_b_i_main {
  width: 90%;
  margin: 0 auto;
  min-width: 600px;
  padding: 10px 0 30px 0;
  height: calc(100% - 40px);
  display: flex;
  flex-direction: column;
}

.s_b_m_b_i_main > span {
  font-size: 26px;
  font-weight: bold;
  display: block;
  margin: 20px 0 ;

}

.s_b_m_b_i_m_title {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.titTop {
  display: flex;
  align-items: center;
}

.s_b_m_b_i_m_title > div > svg {
  width: 60px;
  height: 60px;
  margin-right: 5px;
}

.titTop >img {
  width: 50px;
  height: 50px;
	margin: 5px;
  margin-right: 5px 0;
}

.titTop > span {
  font-size: 20px;
  font-weight: bold;
}

.s_b_m_b_i_m_title > span {
  width: 100%;
  padding: 20px;
  display: block;
  background-color: #f3f7fd;
  border-radius: 5px;
  font-size: 16px;
  box-sizing: border-box;
}

.s_b_m_b_i_m_choseList {
  box-sizing: border-box;
  padding: 0 0 0 20px;
  margin-bottom: 30px;
}

.s_b_m_b_i_m_c_title2 {
  display: flex;
  align-items: center;
}

.s_b_m_b_i_m_c_title2 > span:nth-of-type(1) {
  font-size: 14px;
  /* font-weight: bold; */
  color: #3681fc;
}

.s_b_m_b_i_m_c_title {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
}

.s_b_m_b_i_m_c_title > span:nth-of-type(1) {
  font-size: 30px;
  font-weight: bold;
  color: #3681fc;
}

.s_b_m_b_i_m_c_title > svg {
  width: 30px;
  height: 30px;
  margin: 0 20px 0 5px;
}

.s_b_m_b_i_m_c_title > span:nth-of-type(2) {
  font-size: 20px;
  font-weight: bold;
}

.s_b_m_b_i_m_c_options {
  width: 100%;
  height: auto;
  padding: 15px 15px 15px 15px;
  display: flex;
  flex-wrap: wrap;
  background-color: #f3f7fd;
  border-radius: 30px;
  margin: 10px 0 10px 0px;
  box-sizing: border-box;
}

.s_b_m_b_i_m_c_o_right {
  border: solid 1px #3681fc;
}

.s_b_m_b_i_m_c_o_btn {
  width: 20px;
  height: 100%;
  min-height: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-right: 10px;
}

.s_b_m_b_i_m_c_o_btn > span {
  width: 20px;
  height: 20px;
  display: block;
  box-sizing: border-box;
  border: solid 1px #3681fc;
  overflow: hidden;
}

.s_b_m_b_i_m_c_o_btn > span > span {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: #3681fc;
  position: relative;
}

.s_b_m_b_i_m_c_o_btn1 {
  border-radius: 50%;
}

.s_b_m_b_i_m_c_o_btn1 > span::after {
  content: "";
  width: 8px;
  height: 8px;
  position: absolute;
  background-color: #fff;
  border-radius: 50%;
}

.s_b_m_b_i_m_c_o_btn2 {
  border-radius: 2px;
}

.s_b_m_b_i_m_c_o_btn2 > span > svg {
  width: 12px;
  height: 12px;
}

.s_b_m_b_i_m_c_options > span > img {
  max-height: 150px;
  border-radius: 2px;
  cursor: pointer;
}

.s_b_m_b_i_m_c_options > span {
  font-size: 16px;
  display: block;
  width: calc(100% - 30px);
}

.s_b_m_b_worksSubmit > div {
  width: 100%;
  height: auto;
  box-sizing: border-box;
  padding: 20px 20px 20px 30px;
  margin-bottom: 0px;
}

.s_b_b_i_ws_top {
  width: 100%;
  height: 50px;
  display: flex;
  align-items: center;
}

.s_b_b_i_ws_t_left {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
}

.s_b_b_i_ws_t_left > div {
  width: auto;
  height: auto;
  display: flex;
  align-items: center;
  cursor: pointer;
}

.s_b_b_i_ws_t_left > div > span {
  font-size: 20px;
  font-weight: bold;
  margin-right: 10px;
  color: #000;
}

.s_b_b_i_ws_t_left > div > svg {
  width: 24px;
  height: 24px;
  transition: 0.3s;
  fill: #000;
}

.s_b_b_i_ws_bottom {
  width: 100%;
  height: auto;
  display: flex;
  flex-wrap: wrap;
}

.s_b_b_i_ws_bottom > span {
  margin-top: 10px;
  font-size: 16px;
}

.s_b_b_i_ws_b_noSubmitItem {
  padding: 10px 15px 10px 15px;
  border-radius: 4px;
  background-color: #f3f7fd;
  margin-left: 10px;
  margin-bottom: 10px;
  color: #00000099;
  cursor: default;
}

.s_b_b_i_ws_b_isSubmitItem {
  width: 250px;
  height: 180px;
  border-radius: 8px;
  background-color: #f3f7fd;
  margin-left: 10px;
  margin-bottom: 10px;
  border: solid 1px #e7e7e7;
  overflow: hidden;
}

.s_b_b_i_ws_b_i_s_i_t_top {
  width: 100%;
  height: calc(100% - 50px);
  box-sizing: border-box;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  background-image: linear-gradient(
    45deg,
    #e3eeff 0%,
    #dbe9fd 99%,
    #e3eeff 100%
  );
  position: relative;
	overflow: auto;
}

.s_b_b_i_ws_b_i_s_i_t_t_delIcon {
  width: 70px;
  height: 25px;
  position: absolute;
  display: flex;
  justify-content: space-between;
  align-items: center;
  right: 10px;
  top: 10px;
  cursor: pointer;
}

.s_b_b_i_ws_b_i_s_i_t_t_delIcon > img {
  width: 25px;
  height: 100%;
}

.s_b_b_i_ws_b_i_s_i_t_bottom {
  width: 100%;
  height: 50px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-sizing: border-box;
  padding: 0 10px;
  font-size: 16px;
  font-weight: bold;
  color: #000;
  background-color: #fff;
}

.s_b_b_i_ws_b_i_s_i_t_bottom > span:nth-of-type(1) {
  /* 溢出显示省略 */
  width: 80px;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.s_b_b_i_ws_b_i_s_i_t_bottom > span:nth-of-type(2) {
  font-size: 14px;
  color: #00000099;
}

.s_b_m_b_i_table {
  width: 100%;
  height: auto;
  box-sizing: border-box;
  padding-left: 30px;
  margin-bottom: 30px;
}

.s_b_m_b_i_m_c_accuracyRate{
	margin-top: 20px;
	margin-bottom: 10px;
	font-size: 18px;
	color: #00000099;
}

.tableImage{
	width: auto;
	max-height: 150px;
	border-radius: 2px;
	cursor: pointer;
}

.tableProgress>>>.el-progress-bar>.el-progress-bar__outer{
	height: 10px !important;
}

.tableProgress>>>.el-progress__text{
	font-size: 16px;
	color: #3681FC;
}

.s_b_m_b_i_m_c_table>>>.el-table{
	border: solid 1px #EBEEF5;
	border-bottom: none
}

.s_b_m_b_i_m_c_table>>>.el-table>.el-table__header-wrapper th{
	background-color: #F9FAFB;
	color: #000;
}

.s_b_b_i_ws_b_i_s_i_t_t_answer{
	width: 100%;
	height: 100%;
}

.s_b_b_i_ws_b_i_s_i_t_t_answer>span{
	font-size: 18px;
	font-weight: bold;
	margin: 2px 4px;
	display: block;
	float: left;
}

.s_b_b_i_ws_b_i_s_i_t_t_answer>span>span{
	position: relative;
}

.answer2>span{
	margin:0 1px;
}

.answerWrongLine::after{
	content: '';
	width: 100%;
	height: 2px;
	background-color: #EE3E3E;
	position: absolute;
	bottom: -2px;
	left: 0;
}

.answerRightLine::after{
	content: '';
	width: 100%;
	height: 2px;
	background-color: #5E9AFC;
	position: absolute;
	bottom: -2px;
	left: 0;
}

.answerRight{
	color: #5E9AFC !important;
}

.answerWrong{
	color: #EE3E3E !important;
}




.s_b_m_b_i_eChartsArea{
	width: 100%;
	height: auto;
	box-sizing: border-box;
	padding-left: 30px;
	margin-bottom: 100px;
}

.s_b_m_b_i_e_title{
	width: 100%;
	height: 30px;
	display: flex;
	align-items: center;
	justify-content: flex-end;
}

.s_b_m_b_i_e_title>span{
	font-size: 18px;
	margin-right: 20px;
	color: #000;
	cursor: pointer;
}

.s_b_m_b_i_e_t_active{
	color: #3681FC !important;
	text-decoration: underline !important;
}

.s_b_m_b_i_e_charts{
	width: auto;
	height: 600px;
}

.s_b_m_b_i_e_charts_bottom{
	width: 100%;
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	box-sizing: border-box;
	padding-left: 30px;
}

.s_b_m_b_i_e_charts_bottom>span{
  cursor: pointer;
	padding: 10px 15px;
	background-color: #F3F7FD;
	border-radius: 4px;
	margin-right: 10px;
	margin-bottom: 10px;
	font-size: 18px;
	border-radius: 4px;
}

.questionsAndAnswersSpan{
	font-size: 18px;
}

.s_b_m_b_i_m_question{
	width: 100%;
	height: auto;
	box-sizing: border-box;
	padding: 10px 0 10px 15px;
}

.s_b_m_b_i_m_question>span{
	width: 100%;
	height: 150px;
	display: block;
	margin-top: 15px;
	border-radius: 10px;
	box-sizing: border-box;
	padding: 2px;
	border: solid 1px #d7d9e0;
}

.s_b_m_b_i_m_evaluation>span{
	width: 100%;
	height: 150px;
	display: block;
	margin-top: 15px;
	border-radius: 10px;
	box-sizing: border-box;
	padding: 2px;
	border: solid 1px #d7d9e0;
}

.s_b_m_b_i_m_selectiveMatching{
	width: 100%;
	height: auto;
	display: flex;
}

.sm_left{
	width: calc(100% - 350px);
	height: 100%;
}

.sm_left>img{
	width: 85%;
	height: auto;
	cursor: pointer;
	border-radius: 2px;
}

.sm_right{
	width: 350px;
	min-height: 600px;
	box-sizing: border-box;
	padding: 10px;
	height: auto;
	overflow: auto;
}

.sm_right_item{
	width: 100%;
	height: auto;
	margin-bottom: 20px;
	display: flex;
	align-items: center;
	/* justify-content: center; */
}

.sm_right_item>>>.el-select{
	width: 200px;
}
.sm_right_item >>> .el-input__inner{
	width: 200px;
}
.answerSelect>span{
	font-size: 18px;
	font-weight: bold;
	margin: 2px 4px;
	display: block;
	float: left;

}

.s_b_m_b_i_m_sorting{
	width: 100%;
	height: auto;
	box-sizing: border-box;
}

.sortingItem{
	margin-bottom: 20px;
}

.si_box2{
	width: auto;
	min-height: 100px;
	box-sizing: border-box;
	padding: 10px;
}
.si_box2 > .si_b_top{
	width: 100%;
	margin-top: 20px;
  display: flex;
  flex-wrap: wrap;
}
.si_box2 > .si_b_top > .si_b_t_item{
	font-size: 24px;
	margin-right: 20px;
	padding: 10px 40px;
  height: 47px;
	border: dashed 2px #d7d9e0;
	border-radius: 5px;
	color: #ebedf3;
	font-weight: bold;
	box-sizing: border-box;
}

.si_box2 > .si_b_bottom{
	width: 100%;
  margin: 0;
  display: flex;
  flex-wrap: wrap;

}
.si_box2 > .si_b_bottom > div{
  flex-shrink: 0;
  font-size: 18px;
	margin-right: 20px;
  min-width: 85px;
  height: 25px;
  height: 47px;
  line-height: 47px;
  text-align: center;
	border: solid 2px #A3C7F9;
	border-radius: 5px;
	font-weight: bold;
	color: black;
  line-height: 24px;
	box-sizing: border-box;
  margin-bottom: 10px;
}

.si_box{
	width: 100%;
	height: auto;
	box-sizing: border-box;
	padding: 10px;
}

.si_b_top{
	width: 100%;
	height: auto;
	margin-top: 20px;
}

.si_b_top>span{
	font-size: 24px;
	margin-right: 20px;
	padding: 10px 40px;
	border: dashed 2px #d7d9e0;
	border-radius: 5px;
	color: #ebedf3;
	font-weight: bold;
	box-sizing: border-box;
}

.si_b_bottom{
	width: 100%;
	height: auto;
	margin-top: 40px;
}

.si_b_bottom>span{
	font-size: 24px;
	margin-right: 20px;
	padding: 10px 40px;
	border: solid 2px #A3C7F9;
	border-radius: 5px;
	color: black;
	font-weight: bold;
	box-sizing: border-box;
}

.answerSort>span{
	font-size: 20px;
	margin-right: 10px;
	font-weight: bold;
}

.s_b_m_b_i_m_evaluation{
	box-sizing: border-box;
	/* padding-left: 15px; */
  width: 100%;
  height: 100%;
}

.e_item{
	margin-bottom: 50px;
}

.e_item_content{
	display: flex;
	justify-content: center;
	flex-direction: column;
}

.e_item_content>span{
	padding: 10px 20px;
	background-color: #F3F7FD;
	border-radius: 5px;
	margin: 10px 0;
	font-size: 18px;
}

.e_item_content>>>.el-rate .el-rate__item{
	width: 30px;
	height: 30px;
}

.e_item_content>>>.el-rate .el-rate__item>.el-rate__icon{
	width: 100%;
	height: 100%;
	font-size: 26px;
}

.imageWorks{
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
}

.imageWorks>img{
	width: 100%;
	height: 100%;
	object-fit: fill;
}


/* F9FAFB */

/* .s_b_b_i_noSubmit {
  width: 100%;
  height: auto;
  box-sizing: border-box;
  padding: 20px;
  background-color: red;
}

.s_b_b_i_worksPreview {
  width: 100%;
  height: auto;
  box-sizing: border-box;
  padding: 20px;
  background-color: blue;
} */
.middleBox {
  padding: 5px 0 15px 20px;
}
.pfBox {
  padding-bottom: 30px;
}

.nameAndrate {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  padding-bottom: 10px;
  height: 30px;
  line-height: 30px;
}

.nameAndrate > div {
  margin-left: 10px;
  color: #000;
  height: 30px;
}

.nameAndrate >>> .el-rate__icon {
  font-size: 28px !important;
}

.pfBox > div:nth-child(2) {
  background: #f7f6f9;
  width: 400px;
  min-height: 45px;
  border-radius: 10px;
  font-size: 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  padding: 10px 20px;
  box-sizing: border-box;
  color: #000;
}

.bz {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: flex-start;
}

.bz > div {
  padding: 0 10px;
}
/* table 样式 */
.cont >>> table {
  border-top: 1px solid #ccc;
  border-left: 1px solid #ccc;
}

.cont >>> table td,
.cont >>> table th {
  border-bottom: 1px solid #ccc;
  border-right: 1px solid #ccc;
  /* padding: 20px 5px; */
  padding: 5px 10px;
  max-width: 0px;
  height: 30px;
  vertical-align: baseline;
  box-sizing: border-box;
}

.cont >>> table th {
  border-bottom: 2px solid #ccc;
  text-align: center;
}

/* blockquote 样式 */
.cont >>> blockquote {
  display: block;
  border-left: 8px solid #d0e5f2;
  padding: 5px 10px;
  margin: 10px 0;
  line-height: 1.4;
  font-size: 100%;
  background-color: #f1f1f1;
}

/* code 样式 */
.cont >>> code {
  display: inline-block;
  /* *display: inline; */
  zoom: 1;
  background-color: #f1f1f1;
  border-radius: 3px;
  padding: 3px 5px;
  margin: 0 3px;
}

.cont >>> pre code {
  display: block;
}

/* ul ol 样式 */
.cont >>> ul,
ol {
  margin: 10px 0 10px 20px;
}
.g_d_box {
  display: flex;
  flex-flow: wrap;
  justify-content: space-around;
}

.g_d_box .isChair {
  background-image: url(../../assets/avatar.png) !important;
}
.updateChairBtn {
  position: absolute;
  width: 50px;
  height: 50px;
  overflow: hidden;
  /* display: flex; */
  align-items: center;
  justify-content: center;
  background: #00000087;
  color: #fff;
  border-radius: 50px;
  display: none;
  cursor: pointer;
}
.g_d_group_table {
  background-image: url(../../assets/icon/groupBg.png);
  width: 354px;
  height: 196px;
  background-size: 100% 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  color: #fff;
}

.g_d_group_table > div:nth-child(1) {
  font-size: 24px;
  margin-bottom: 5px;
}

.g_d_group_table > div:nth-child(2) div {
  cursor: pointer;
  background: #2e77bf;
  padding: 4px 10px;
  border-radius: 5px;
}
.g_d_group_chair {
  display: flex;
  align-items: center;
  justify-content: center;
}

.g_d_group_chair > div + div {
  margin-left: 30px;
}

.g_d_group_chair > div,
.g_d_group_chair2 > div {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.g_d_group_chair > div > span:nth-child(1),
.g_d_group_chair2 > div > span:nth-child(1) {
  background-image: url(../../assets/icon/chair.png);
  width: 50px;
  height: 50px;
  display: block;
  background-size: 100% 100%;
}

.g_d_group_tableBox {
  display: flex;
  align-items: center;
  justify-content: center;
}

.g_d_group_chair2 {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.g_d_group_chair2 > div + div {
  margin-top: 10px;
}

.g_d_group_table {
  background-image: url(../../assets/icon/groupBg.png);
  width: 354px;
  height: 196px;
  background-size: 100% 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  color: #fff;
}

.g_d_group_table > div:nth-child(1) {
  font-size: 24px;
  margin-bottom: 5px;
}

.g_d_group_table > div:nth-child(2) div {
  cursor: pointer;
  background: #2e77bf;
  padding: 4px 10px;
  border-radius: 5px;
}

.s_b_m_b_i_m_iframe{
  width: 100%;
  flex: 1;
	margin-top: 10px;
}

.s_b_m_b_i_m_iframe>div{
  width: 100%;
  height: 100%;
	box-sizing: border-box;
	padding-left: 0px;
}

.s_b_m_b_i_m_iframe>div>iframe{
	width: 100%;
	height: 100%;
	border: none;
	border: solid 1px #ccc;
}
.inImg {
  width: 100px;
  cursor: pointer;
}

.inImg > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.timuImgBox {
  margin: 10px 0;
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  align-items: flex-start;
}

.timuImg {
  width: 150px;
  margin: 5px 0;
  cursor: pointer;
}

.timuImg > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.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;
}
.askIndex {
  background: #3681fc;
  border-radius: 50%;
  color: #fff;
  width: 25px;
  height: 25px;
  min-width: 25px;
  min-height: 25px;
  text-align: center;
  line-height: 25px;
  margin-right: 5px;
}
.g_d_btnBox {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-bottom: 20px;
}
.group_switch {
  margin-right: 10px;
  height: 30px;
  display: flex;
  align-items: center;
}

.group_switch > span {
  margin-right: 5px;
}
.switchCss {
  /* width: 100%; */
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  /* justify-content: center; */
}
.returnBtn {
  width: 86px;
  height: 36px;
  background: #3681fc;
  border-radius: 4px;
  color: #fff;
  text-align: center;
  line-height: 36px;
  margin-right: 20px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 400;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
}
.dialog_diy >>> .el-dialog {
  margin-top: 10vh !important;
}
.dialog_diy >>> .el-dialog__header,
.dialog_diy1 >>> .el-dialog__header {
  background: #454545 !important;
  padding: 15px 20px;
}

.dialog_diy >>> .el-dialog__title,
.dialog_diy1 >>> .el-dialog__title {
  color: #fff;
}

.dialog_diy >>> .el-dialog__headerbtn,
.dialog_diy1 >>> .el-dialog__headerbtn {
  top: 19px;
}

.dialog_diy >>> .el-dialog__headerbtn .el-dialog__close,
.dialog_diy1 >>> .el-dialog__headerbtn .el-dialog__close {
  color: #fff;
}

.dialog_diy >>> .el-dialog__headerbtn .el-dialog__close:hover,
.dialog_diy1 >>> .el-dialog__headerbtn .el-dialog__close:hover {
  color: #fff;
}

.dialog_diy1 >>> .el-dialog__body {
  padding: 0;
}

.dialog_diy >>> .el-dialog__body,
.dialog_diy >>> .el-dialog__footer,
.dialog_diy1 >>> .el-dialog__footer {
  background: #fafafa;
}
.groupContent + .groupContent {
  margin-top: 30px;
}
.groupContent >>> .el-input-number.is-without-controls .el-input__inner {
  text-align: left;
}
.groupName {
  display: flex;
  align-items: center;
}

.groupn {
  font-size: 15px;
  margin-right: 10px;
}

.groupName + .groupName {
  margin-top: 15px;
}

.groupBtn {
  margin-left: 10px;
}

.groupContent >>> .el-input-number.is-without-controls .el-input__inner {
  text-align: left;
}
.groupTitle {
  font-size: 24px;
  color: rgb(80, 80, 80);
  margin-bottom: 20px;
}

.a_add_head >>> .katex {
  font-size: 14px;
  width: 100%;
  white-space: normal;
  font-family: '黑体' !important;
}
.a_add_head >>> .katex .base{
  display: inline !important;
  display: contents !important;
}

.a_add_head >>> .katex .base .cjk_fallback{
    white-space: normal !important;
    display: inline !important;
}
.renderedFor >>> .katex {
  font-size: 18px;
  width: 100%;
  white-space: normal;
  font-family: '黑体' !important;
}
.renderedFor >>> .katex .base{
  display: inline !important;
  display: contents !important;
}

.renderedFor>>> .katex .base .cjk_fallback{
    white-space: normal !important;
    display: inline !important;
}
</style>
