|
@@ -28,22 +28,130 @@
|
|
|
</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">
|
|
|
+ <div class="s_b_m_b_i_main" ref="imgWork">
|
|
|
<div class="s_b_m_b_i_m_title" v-if="testData">
|
|
|
- <div>
|
|
|
-
|
|
|
- <img :src="toolList.find(item=>item.value===toolType).img" alt/>
|
|
|
-
|
|
|
- <span>{{ toolList.find(item=>item.value===toolType).label }}</span>
|
|
|
+ <div style="display: flex;justify-content: space-between;align-items: center;">
|
|
|
+ <div class="titTop">
|
|
|
+ <img :src="toolList.find(item=>item.value===toolType).img" alt/>
|
|
|
+ <span>{{ toolList.find(item=>item.value===toolType).label }}</span>
|
|
|
+ </div>
|
|
|
+ <!-- <el-button type="primary"
|
|
|
+ size="small"
|
|
|
+ v-if="[7,1,3].includes(toolType)"
|
|
|
+ @click="submitWork2">作业提交</el-button> -->
|
|
|
+
|
|
|
+ <el-button type="primary"
|
|
|
+ size="small"
|
|
|
+ v-if="[7,1,3,49].indexOf(toolType) == -1"
|
|
|
+ @click="submitWork">作业提交</el-button>
|
|
|
</div>
|
|
|
+
|
|
|
<span v-if="testData.toolDetail">{{ testData.toolDetail }}</span>
|
|
|
<span v-else>无</span>
|
|
|
</div>
|
|
|
|
|
|
<span v-if="![7,1,3].includes(toolType)">题目内容</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"
|
|
|
+ >
|
|
|
+ (单选题)
|
|
|
+ </div>
|
|
|
+ <div
|
|
|
+ v-if="item1.type == '2'"
|
|
|
+ style="margin-right: 5px; min-width: 70px"
|
|
|
+ >
|
|
|
+ (多选题)
|
|
|
+ </div>
|
|
|
+ <div>题目:{{ item1.teststitle }}</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"
|
|
|
+ >
|
|
|
+ <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"
|
|
|
+ >
|
|
|
+ <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
|
|
|
class="s_b_m_b_i_m_choseList"
|
|
|
v-for="(item, index) in testJson"
|
|
|
>
|
|
@@ -76,40 +184,16 @@
|
|
|
v-for="(item2, index2) in item.checkList"
|
|
|
|
|
|
>
|
|
|
- <!-- :class="{
|
|
|
- s_b_m_b_i_m_c_o_right:
|
|
|
- item.type == 1
|
|
|
- ? testJsonCopy.anwer[index] == index2
|
|
|
- : testJsonCopy.anwer[index].includes(index2)
|
|
|
- }" -->
|
|
|
+
|
|
|
<div class="s_b_m_b_i_m_c_o_btn">
|
|
|
<span
|
|
|
class="s_b_m_b_i_m_c_o_btn1"
|
|
|
v-if="item.type == 1"
|
|
|
>
|
|
|
- <!-- {{testJson}} -->
|
|
|
- <!-- <span ></span> -->
|
|
|
- <!-- v-if="testJson.anwer[index] == index2" -->
|
|
|
+
|
|
|
</span>
|
|
|
<span class="s_b_m_b_i_m_c_o_btn2" v-else>
|
|
|
|
|
|
- <!-- <span v-if="testJson.anwer[index].includes(index2)"> -->
|
|
|
- <!-- <svg
|
|
|
- width="8"
|
|
|
- height="6"
|
|
|
- viewBox="0 0 8 6"
|
|
|
- fill="none"
|
|
|
- xmlns="http://www.w3.org/2000/svg"
|
|
|
- >
|
|
|
- <path
|
|
|
- fill-rule="evenodd"
|
|
|
- clip-rule="evenodd"
|
|
|
- d="M7.44194 0.558058C7.68602 0.802136 7.68602 1.19786 7.44194 1.44194L3.44194 5.44194C3.19786 5.68602 2.80214 5.68602 2.55806 5.44194L0.558058 3.44194C0.313981 3.19786 0.313981 2.80214 0.558058 2.55806C0.802136 2.31398 1.19786 2.31398 1.44194 2.55806L3 4.11612L6.55806 0.558058C6.80214 0.313981 7.19786 0.313981 7.44194 0.558058Z"
|
|
|
- fill="white"
|
|
|
- />
|
|
|
- </svg> -->
|
|
|
- <!-- </span> -->
|
|
|
-
|
|
|
</span>
|
|
|
</div>
|
|
|
<span>
|
|
@@ -122,44 +206,36 @@
|
|
|
<span v-else>{{ item2 }}</span>
|
|
|
</span>
|
|
|
</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>
|
|
|
- <!-- <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>提问:{{ testData.answerQ }}</span>
|
|
|
</div>
|
|
|
- <!-- v-if="testJsonCopy && testJsonCopy.answer" -->
|
|
|
- <span style="padding: 10px;">
|
|
|
- <!-- {{ testJsonCopy.answer }} -->
|
|
|
- </span>
|
|
|
+ <el-input
|
|
|
+ type="textarea"
|
|
|
+ :rows="10"
|
|
|
+ placeholder="请输入内容"
|
|
|
+ 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">
|
|
|
- <el-select v-model="testData.selectJson.answer[index]" placeholder="请选择">
|
|
|
+ <el-select v-model="radioS[index]" placeholder="请选择">
|
|
|
<el-option
|
|
|
v-for="(item2,index2) in testData.selectJson.select"
|
|
|
- :disabled="item!==index2"
|
|
|
:key="index2"
|
|
|
:label="item2"
|
|
|
:value="index2">
|
|
@@ -168,7 +244,7 @@
|
|
|
</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">
|
|
@@ -177,42 +253,46 @@
|
|
|
</div>
|
|
|
|
|
|
<div class="si_box2">
|
|
|
- <div class="si_b_top">
|
|
|
- <div class="si_b_t_item" v-for="(item2,index2) in item.addSentence" :key="index2"></div>
|
|
|
+ <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" v-for="(item2,index2) in item.rightAnswer" :key="index2">{{ item2 }}</div>
|
|
|
+ <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
|
|
|
- disabled
|
|
|
+ v-model="radioS[eIndex]"
|
|
|
></el-rate>
|
|
|
</div>
|
|
|
<div v-if="e.detail">{{ e.detail }}</div>
|
|
|
</div>
|
|
|
- <div class="easy_comment" v-if="false">
|
|
|
- <div
|
|
|
- v-for="(p, pIndex) in PlTextList"
|
|
|
- :key="pIndex"
|
|
|
- @click="fastText(p, 2)"
|
|
|
- >
|
|
|
- {{ p }}
|
|
|
- </div>
|
|
|
- </div>
|
|
|
+
|
|
|
<div class="bz">
|
|
|
<textarea
|
|
|
- disabled
|
|
|
rows="4"
|
|
|
class="pj"
|
|
|
style="
|
|
@@ -225,6 +305,7 @@
|
|
|
"
|
|
|
cols
|
|
|
placeholder="请输入评价内容..."
|
|
|
+ v-model="questionsData"
|
|
|
></textarea>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -255,16 +336,27 @@
|
|
|
<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>
|
|
|
- <div class="cont" v-if="testData && testData.tableJson && testData.tableJson.text" v-html="testData.tableJson.text"></div>
|
|
|
- </el-form>
|
|
|
+ <!-- <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">
|
|
|
- <div v-if="testData && testData.wordJson && testData.wordJson.text">
|
|
|
- <div v-html="testData.wordJson.text"></div>
|
|
|
- </div>
|
|
|
+ <!-- <div v-if="testData && testData.wordJson && testData.wordJson.text"> -->
|
|
|
+ <!-- <div v-html="testData.wordJson.text"></div> -->
|
|
|
+ <editor-bar
|
|
|
+ v-model="questionsData"
|
|
|
+ ></editor-bar>
|
|
|
+
|
|
|
+ <!-- </div> -->
|
|
|
</div>
|
|
|
+ <!-- 思维网格 电子白板 思维导图 -->
|
|
|
<div v-if="[7,1,3].includes(toolType)" class="s_b_m_b_i_m_iframe">
|
|
|
<div v-if="[3].includes(toolType)">
|
|
|
<iframe
|
|
@@ -290,6 +382,7 @@
|
|
|
></iframe>
|
|
|
</div>
|
|
|
</div>
|
|
|
+ <!-- 学生分组 -->
|
|
|
<div v-if="[49].includes(toolType)" class="s_b_m_b_i_m_evaluation">
|
|
|
<div>
|
|
|
<div
|
|
@@ -635,12 +728,14 @@
|
|
|
import eChartsView from './eChartsView.vue'
|
|
|
import choseWordCloud from './choseWordCloud.vue'
|
|
|
import studentWorkPreviewDialog from './studentWorkPreviewDialog.vue';
|
|
|
+import EditorBar from "../tools/wangEnduit.vue";
|
|
|
export default {
|
|
|
components:{
|
|
|
eChartsView1:eChartsView,
|
|
|
eChartsView2:eChartsView,
|
|
|
choseWordCloud,
|
|
|
- studentWorkPreviewDialog
|
|
|
+ studentWorkPreviewDialog,
|
|
|
+ EditorBar
|
|
|
},
|
|
|
props: {
|
|
|
worksStudentData: {
|
|
@@ -660,8 +755,8 @@ export default {
|
|
|
default: 0
|
|
|
},
|
|
|
tType:{
|
|
|
- type: Number,
|
|
|
- default: 0
|
|
|
+ type: String ,
|
|
|
+ default: '0'
|
|
|
},
|
|
|
sIsOpen:{
|
|
|
type: Boolean,
|
|
@@ -674,16 +769,21 @@ export default {
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
+ radioS:[], //提交作业数组容器
|
|
|
+ questionsData:'', //提交作业字符串容器
|
|
|
+ isShowList:[], //排序判断的显示容器
|
|
|
+
|
|
|
show: false,
|
|
|
showType: 0,
|
|
|
userId: this.$route.query.userid,
|
|
|
courseId:this.$route.query.courseId,
|
|
|
+ id: this.$route.query.courseId,
|
|
|
wordCloudData:[], //词云数据
|
|
|
dialogVisibleWordCloud:false,
|
|
|
showStatisticsType:0,
|
|
|
data: null,
|
|
|
testJson: null,
|
|
|
- testJsonCopy: null,
|
|
|
+ testJsonCopy: [],
|
|
|
screenCopy:'',
|
|
|
testData: null,
|
|
|
toolIndex: null,
|
|
@@ -914,6 +1014,7 @@ export default {
|
|
|
return _result;
|
|
|
}
|
|
|
},
|
|
|
+
|
|
|
cy(){
|
|
|
let _result = ''
|
|
|
if(this.toolType==15){
|
|
@@ -924,9 +1025,9 @@ export default {
|
|
|
|
|
|
return _result;
|
|
|
},
|
|
|
+ // 选择题正确率百分比
|
|
|
accuracy(){
|
|
|
return data=>{
|
|
|
- console.log('data',JSON.parse(data.works));
|
|
|
|
|
|
let allData = JSON.parse(data.works)[0]
|
|
|
let answerData = []
|
|
@@ -941,16 +1042,6 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
|
|
|
-
|
|
|
-
|
|
|
- // let _result = "";
|
|
|
- // if([15].includes(this.toolType)){
|
|
|
- // let _work = data.works?JSON.parse(data.works)[0]:null;
|
|
|
- // if(_work){
|
|
|
- // _result = _work.answer;
|
|
|
- // }
|
|
|
- // }
|
|
|
-
|
|
|
let et = ((num / answerData.length).toFixed(1)) * 100
|
|
|
return et+'%';
|
|
|
}
|
|
@@ -959,30 +1050,120 @@ export default {
|
|
|
watch: {
|
|
|
worksStudentData: {
|
|
|
handler(newValue) {
|
|
|
+
|
|
|
+ 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(newValue[this.toolIndex])
|
|
|
+ JSON.stringify(workSData)
|
|
|
) {
|
|
|
- // this.worksStudent = JSON.parse(
|
|
|
- // JSON.stringify(newValue[this.toolIndex])
|
|
|
- // );
|
|
|
+ // if (newValue[this.toolIndex].length) {
|
|
|
+ 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
|
|
|
+ })
|
|
|
+ // }
|
|
|
+ // console.log('this.testData222',this.testData);
|
|
|
+ // console.log('this.testJsonCopy222',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{
|
|
|
+ // 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('')
|
|
|
+ // })
|
|
|
+ // })
|
|
|
+ // console.log('this.testData.sentenceList',this.testData.sentenceList);
|
|
|
+
|
|
|
+ // //把题目选项点击隐藏写好
|
|
|
+ // this.testData.sentenceList.forEach((e,i)=>{
|
|
|
+ // this.isShowList.push([])
|
|
|
+ // e.addSentence.forEach((k,l)=>{
|
|
|
+ // this.isShowList[i].push(true)
|
|
|
+ // })
|
|
|
+ // })
|
|
|
+ // }
|
|
|
+
|
|
|
+
|
|
|
+ this.dialogTypeList[2].loading = false;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ deep: true
|
|
|
+ },
|
|
|
+ // 监视是否开启学生查看所有作业
|
|
|
+ sIsOpen:{
|
|
|
+ handler(newl,oldl){
|
|
|
let yym = JSON.parse(
|
|
|
- JSON.stringify(this.newValue[this.toolIndex])
|
|
|
+ JSON.stringify(this.worksStudentData[this.toolIndex])
|
|
|
);
|
|
|
-
|
|
|
- if (this.tType == 2 && !this.sIsOpen) {
|
|
|
+ // 判断是否开启学生查看作业
|
|
|
+ if (this.tType == 2 && !newl) {
|
|
|
this.worksStudent = yym.filter( e =>{
|
|
|
return this.userId == e.userid
|
|
|
})
|
|
|
}else{
|
|
|
this.worksStudent = JSON.parse(
|
|
|
- JSON.stringify(newValue[this.toolIndex])
|
|
|
+ JSON.stringify(this.worksStudentData[this.toolIndex])
|
|
|
);
|
|
|
}
|
|
|
- this.dialogTypeList[2].loading = false;
|
|
|
- }
|
|
|
},
|
|
|
deep: true
|
|
|
},
|
|
@@ -1004,13 +1185,252 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ // 截图类提交作业
|
|
|
+ async submitWork2(){
|
|
|
+
|
|
|
+ // html2canvas(this.$refs.imgWork,{
|
|
|
+ // useCORS:true,logging:true,backgroundColor:'#fff',y:this.$refs.imgWork.offsetTop
|
|
|
+ // }).then(canvas => {
|
|
|
+ // // 从canvas提取Blob
|
|
|
+ // canvas.toBlob(blob => {
|
|
|
+ // // 创建FileList
|
|
|
+ // let fileList = new DataTransfer();
|
|
|
+ // fileList.items.add(new File([blob], "screenshot.png"));
|
|
|
+
|
|
|
+ // console.log('fileList.files',fileList.files);
|
|
|
+
|
|
|
+ // // 此时fileList就是包含截图的FileList对象
|
|
|
+ // this.beforeUpload(fileList.files[0])
|
|
|
+ // });
|
|
|
+ // });
|
|
|
+
|
|
|
+ },
|
|
|
+
|
|
|
+ beforeUpload(event) {
|
|
|
+
|
|
|
+ // return console.log("event.target.files", event.target);
|
|
|
+ var file = event;
|
|
|
+ console.log('file',file);
|
|
|
+
|
|
|
+ var credentials = {
|
|
|
+ accessKeyId: "AKIATLPEDU37QV5CHLMH",
|
|
|
+ secretAccessKey: "Q2SQw37HfolS7yeaR1Ndpy9Jl4E2YZKUuuy2muZR"
|
|
|
+ }; //秘钥形式的登录上传
|
|
|
+ window.AWS.config.update(credentials);
|
|
|
+ window.AWS.config.region = "cn-northwest-1"; //设置区域
|
|
|
+
|
|
|
+ var bucket = new window.AWS.S3({ params: { Bucket: "ccrb" } }); //选择桶
|
|
|
+ var imgA = [
|
|
|
+ "png",
|
|
|
+ "jpg",
|
|
|
+ "jpeg",
|
|
|
+ "bmp",
|
|
|
+ "gif",
|
|
|
+ "webp",
|
|
|
+ "psd",
|
|
|
+ "svg",
|
|
|
+ "tiff"
|
|
|
+ ];
|
|
|
+ // if (
|
|
|
+ // imgA.indexOf(file.name.split(".")[file.name.split(".").length - 1]) ==
|
|
|
+ // -1
|
|
|
+ // ) {
|
|
|
+ // this.$message.error("图片格式错误");
|
|
|
+ // return;
|
|
|
+ // }
|
|
|
+ var _this = this;
|
|
|
+
|
|
|
+ _this.$forceUpdate();
|
|
|
+
|
|
|
+ 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) {
|
|
|
+ //这里可以写进度条
|
|
|
+ // _this.progress = parseInt((evt.loaded / evt.total) * 100);
|
|
|
+ // _this.isFinishSize = (evt.loaded / 1024 / 1024).toFixed(2);
|
|
|
+ // _this.$forceUpdate();
|
|
|
+ })
|
|
|
+ .send(function(err, data) {
|
|
|
+ console.log(data.Location);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ // var file = event.target.files[0];
|
|
|
+ },
|
|
|
+ // 提交作业
|
|
|
+ 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("请选择选项");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (this.testJson[i].type == '1' && (!this.radioS[i] && this.radioS[i] !== 0)) {
|
|
|
+ this.$message.error("请选择选项");
|
|
|
+ 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('请填写答案')
|
|
|
+ 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('请选择答案')
|
|
|
+ answerType = 7
|
|
|
+ answerData = this.radioS
|
|
|
+ }else if(this.toolType == 52){// 文档
|
|
|
+ if (!this.questionsData) return this.$message.error('请填写答案')
|
|
|
+
|
|
|
+ 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('请填写答案')
|
|
|
+ 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("请将答案填写完整!");
|
|
|
+ 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)
|
|
|
+ }
|
|
|
+
|
|
|
+ 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
|
|
|
+ },
|
|
|
+ ];
|
|
|
+ }
|
|
|
+
|
|
|
+ // return console.log('params',params);
|
|
|
+
|
|
|
+ this.ajax
|
|
|
+ .post(this.$store.state.api + urlT, params)
|
|
|
+ .then((res) => {
|
|
|
+ this.$message({
|
|
|
+ message: "提交成功",
|
|
|
+ type: "success",
|
|
|
+ });
|
|
|
+ // this.askList = [];
|
|
|
+ this.$emit("selectStudent")
|
|
|
+ this.$emit("selectSWorks")
|
|
|
+ this.$emit("selectSLook")
|
|
|
+ })
|
|
|
+ .catch((err) => {
|
|
|
+ this.$message.error("提交失败");
|
|
|
+ console.error(err);
|
|
|
+ });
|
|
|
+
|
|
|
+ },
|
|
|
+ // 排序操作答案
|
|
|
+ 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;
|
|
@@ -1082,32 +1502,87 @@ export default {
|
|
|
},
|
|
|
setData() {
|
|
|
if (this.show && this.toolIndex !== null) {
|
|
|
- let yym = JSON.parse(
|
|
|
- JSON.stringify(this.worksStudentData[this.toolIndex])
|
|
|
- );
|
|
|
-
|
|
|
- if (this.tType == 2 && !this.sIsOpen) {
|
|
|
- this.worksStudent = yym.filter( e =>{
|
|
|
- return this.userId == e.userid
|
|
|
- })
|
|
|
- }else{
|
|
|
- this.worksStudent = JSON.parse(
|
|
|
+
|
|
|
+ // 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])
|
|
|
);
|
|
|
- // if(![52].includes(this.toolType)){
|
|
|
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{
|
|
|
+ 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('')
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
close() {
|
|
@@ -1121,6 +1596,9 @@ export default {
|
|
|
this.showStatisticsType = 0;
|
|
|
this.testJson = null;
|
|
|
this.testJsonCopy = null;
|
|
|
+ this.radioS = [];
|
|
|
+ this.questionsData = '';
|
|
|
+ this.isShowList=[],
|
|
|
this.worksStudent = [];
|
|
|
this.noWorksStudent = [];
|
|
|
this.toolIndex = null;
|
|
@@ -1371,7 +1849,7 @@ export default {
|
|
|
justify-content: center;
|
|
|
}
|
|
|
|
|
|
-.s_b_m_b_i_m_title > div {
|
|
|
+.titTop {
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
}
|
|
@@ -1382,14 +1860,14 @@ export default {
|
|
|
margin-right: 5px;
|
|
|
}
|
|
|
|
|
|
-.s_b_m_b_i_m_title > div >img {
|
|
|
+.titTop >img {
|
|
|
width: 50px;
|
|
|
height: 50px;
|
|
|
margin: 5px;
|
|
|
margin-right: 5px;
|
|
|
}
|
|
|
|
|
|
-.s_b_m_b_i_m_title > div > span {
|
|
|
+.titTop > span {
|
|
|
font-size: 20px;
|
|
|
font-weight: bold;
|
|
|
}
|
|
@@ -1424,6 +1902,7 @@ export default {
|
|
|
.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) {
|
|
@@ -1938,8 +2417,11 @@ export default {
|
|
|
flex-shrink: 0;
|
|
|
font-size: 18px;
|
|
|
margin-right: 20px;
|
|
|
- padding: 10px 40px;
|
|
|
+ min-width: 85px;
|
|
|
+ height: 25px;
|
|
|
height: 47px;
|
|
|
+ line-height: 47px;
|
|
|
+ text-align: center;
|
|
|
border: solid 2px #A3C7F9;
|
|
|
border-radius: 5px;
|
|
|
font-weight: bold;
|
|
@@ -2300,4 +2782,90 @@ ol {
|
|
|
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;
|
|
|
+}
|
|
|
</style>
|