Commit b1f0d019 authored by 黄奎's avatar 黄奎

组件修改

parent d060f439
...@@ -102,7 +102,6 @@ ...@@ -102,7 +102,6 @@
} }
}, },
created() { created() {
console.log("this.saveObj", this.saveObj);
this.GetTeacherList(); this.GetTeacherList();
this.getSaleplat(); this.getSaleplat();
}, },
......
...@@ -97,7 +97,6 @@ ...@@ -97,7 +97,6 @@
html += '<img src="' + e[i].fileUrl + '" style="max-width: 100%;">'; html += '<img src="' + e[i].fileUrl + '" style="max-width: 100%;">';
} }
} }
console.log(e,'文件');
if (this.uploadType == 2) { if (this.uploadType == 2) {
for (let i in e) { for (let i in e) {
var type = e[i].fileName.split('.')[1]; var type = e[i].fileName.split('.')[1];
......
...@@ -156,7 +156,7 @@ ...@@ -156,7 +156,7 @@
" :setOption="objOption"> </short-answer> " :setOption="objOption"> </short-answer>
<!--分录题、资料题--> <!--分录题、资料题-->
<entry-problem v-if="questionObj.Key=='entry-problem'|| questionObj.Key=='data-question'" <entry-problem v-if="questionObj.Key=='entry-problem'|| questionObj.Key=='data-question'"
:questionData="AnswerList" @getChild="getChildData"> :questionData="AnswerList" :setOption="objOption" @getChild="getChildData">
</entry-problem> </entry-problem>
<!--连线题--> <!--连线题-->
<matching v-if="questionObj.Key=='matching'" :questionData="AnswerList" @getChild="getChildData"></matching> <matching v-if="questionObj.Key=='matching'" :questionData="AnswerList" @getChild="getChildData"></matching>
...@@ -437,7 +437,6 @@ ...@@ -437,7 +437,6 @@
//保存问题 //保存问题
setQuestion() { setQuestion() {
//验证方法 //验证方法
console.log(this.objOption, 'objOption');
if (this.validateType()) { if (this.validateType()) {
var pointIds = ""; var pointIds = "";
if (this.choosePointArray && this.choosePointArray.length > 0) { if (this.choosePointArray && this.choosePointArray.length > 0) {
...@@ -474,7 +473,6 @@ ...@@ -474,7 +473,6 @@
if (this.objOption.QuestionTypeKey == 'matching') { if (this.objOption.QuestionTypeKey == 'matching') {
if (this.objOption.QuestionContent) { if (this.objOption.QuestionContent) {
var myArr = JSON.parse(this.objOption.QuestionContent); var myArr = JSON.parse(this.objOption.QuestionContent);
console.log(myArr, 'myArr');
for (var i = 0; i < myArr[0].length; i++) { for (var i = 0; i < myArr[0].length; i++) {
if (myArr[0][i].Content == '') { if (myArr[0][i].Content == '') {
this.$q.notify({ this.$q.notify({
...@@ -513,7 +511,6 @@ ...@@ -513,7 +511,6 @@
if (this.objOption.QuestionTypeKey == 'sharing-choose') { if (this.objOption.QuestionTypeKey == 'sharing-choose') {
if (this.objOption.QuestionContent) { if (this.objOption.QuestionContent) {
var myArr = JSON.parse(this.objOption.QuestionContent); var myArr = JSON.parse(this.objOption.QuestionContent);
console.log(myArr, 'myArr');
for (var i = 0; i < myArr[0].length; i++) { for (var i = 0; i < myArr[0].length; i++) {
if (myArr[0][i].Content == '') { if (myArr[0][i].Content == '') {
this.$q.notify({ this.$q.notify({
...@@ -564,7 +561,6 @@ ...@@ -564,7 +561,6 @@
if (this.objOption.QuestionTypeKey == 'listening' || this.objOption.QuestionTypeKey == 'reading-comprehensio') { if (this.objOption.QuestionTypeKey == 'listening' || this.objOption.QuestionTypeKey == 'reading-comprehensio') {
if (this.objOption.QuestionContent) { if (this.objOption.QuestionContent) {
var myArr = JSON.parse(this.objOption.QuestionContent); var myArr = JSON.parse(this.objOption.QuestionContent);
console.log(myArr, 'myArr');
for (var i = 0; i < myArr.length; i++) { for (var i = 0; i < myArr.length; i++) {
if (myArr[i].SubTitle == '') { if (myArr[i].SubTitle == '') {
this.$q.notify({ this.$q.notify({
...@@ -651,7 +647,6 @@ ...@@ -651,7 +647,6 @@
} }
if (this.objOption.QuestionContent) { if (this.objOption.QuestionContent) {
var myArr = JSON.parse(this.objOption.QuestionContent); var myArr = JSON.parse(this.objOption.QuestionContent);
console.log(myArr, 'myArr');
for (var i = 0; i < myArr[0].length; i++) { for (var i = 0; i < myArr[0].length; i++) {
if (myArr[0].Content == '') { if (myArr[0].Content == '') {
this.$q.notify({ this.$q.notify({
...@@ -671,8 +666,9 @@ ...@@ -671,8 +666,9 @@
} }
} }
//资料提 分录题 多选题 //资料提 分录题 多选题
if (this.objOption.QuestionTypeKey == 'data-question' || this.objOption.QuestionTypeKey == 'entry-problem'||this.objOption.QuestionTypeKey == 'multiple' if (this.objOption.QuestionTypeKey == 'data-question' || this.objOption.QuestionTypeKey == 'entry-problem' ||
||this.objOption.QuestionTypeKey == 'single') { this.objOption.QuestionTypeKey == 'multiple' ||
this.objOption.QuestionTypeKey == 'single') {
if (this.objOption.Title == '') { if (this.objOption.Title == '') {
this.$q.notify({ this.$q.notify({
type: 'negative', type: 'negative',
...@@ -684,9 +680,7 @@ ...@@ -684,9 +680,7 @@
} }
if (this.objOption.QuestionContent) { if (this.objOption.QuestionContent) {
var myArr = JSON.parse(this.objOption.QuestionContent); var myArr = JSON.parse(this.objOption.QuestionContent);
console.log(myArr, 'myArrrrrr');
for (var i = 0; i < myArr.length; i++) { for (var i = 0; i < myArr.length; i++) {
console.log(myArr[i].Content);
if (myArr[i].Content == '') { if (myArr[i].Content == '') {
this.$q.notify({ this.$q.notify({
type: 'negative', type: 'negative',
...@@ -705,7 +699,8 @@ ...@@ -705,7 +699,8 @@
} }
} }
//计算题 //计算题
if (this.objOption.QuestionTypeKey == 'calculation'||this.objOption.QuestionTypeKey == 'essay-question'||this.objOption.QuestionTypeKey=='noun-explanation') { if (this.objOption.QuestionTypeKey == 'calculation' || this.objOption.QuestionTypeKey == 'essay-question' ||
this.objOption.QuestionTypeKey == 'noun-explanation') {
if (this.objOption.Title == '') { if (this.objOption.Title == '') {
this.$q.notify({ this.$q.notify({
type: 'negative', type: 'negative',
...@@ -726,7 +721,7 @@ ...@@ -726,7 +721,7 @@
} }
} }
//判断题 //判断题
if(this.objOption.QuestionTypeKey == 'judge'){ if (this.objOption.QuestionTypeKey == 'judge') {
if (this.objOption.Title == '') { if (this.objOption.Title == '') {
this.$q.notify({ this.$q.notify({
type: 'negative', type: 'negative',
...@@ -736,15 +731,6 @@ ...@@ -736,15 +731,6 @@
result = false; result = false;
return; return;
} }
if (this.objOption.AnswerParse == '') {
this.$q.notify({
type: 'negative',
position: "top",
message: `请输入答案解析!`
})
result = false;
return;
}
} }
return result; return result;
}, },
...@@ -768,7 +754,6 @@ ...@@ -768,7 +754,6 @@
break; break;
default: default:
} }
console.log(Arr, 'arrrr');
let num = 0; let num = 0;
for (var i = 0; i < Arr.length - 1; i++) { for (var i = 0; i < Arr.length - 1; i++) {
for (var j = i + 1; j < Arr.length; j++) { for (var j = i + 1; j < Arr.length; j++) {
...@@ -782,13 +767,11 @@ ...@@ -782,13 +767,11 @@
} }
} }
} }
console.log(num, 'numberrer');
if (num > 0) { if (num > 0) {
result = false; result = false;
} else { } else {
result = true; result = true;
} }
console.log(result, '返回');
return result; return result;
} }
}, },
......
<!--分录题--> <!--分录题-->
<style> <style>
.entryProblemQuestion{ .entryProblemQuestion {
width:100%; width: 100%;
} }
.entrytk_info{
.entrytk_info {
color: #A8A8B3; color: #A8A8B3;
font-size: 12px; font-size: 12px;
line-height: 24px; line-height: 24px;
cursor: default; cursor: default;
} }
</style> </style>
<template> <template>
<div class="entryProblemQuestion"> <div class="entryProblemQuestion">
...@@ -23,29 +25,24 @@ ...@@ -23,29 +25,24 @@
</td> </td>
<td style="width:40px;text-align:center;"> <td style="width:40px;text-align:center;">
<i class="iconfont icon-guanbi Tiku_DelIcon" @click="deleteOpion(index)"></i> <i class="iconfont icon-guanbi Tiku_DelIcon" @click="deleteOpion(index)"></i>
<!-- <a style="cursor:pointer;" @click="deleteOpion(index)">删除</a> -->
</td> </td>
</tr> </tr>
<tfoot> </table>
<tr> <br />
<td colspan="3">
<a class="addTiMuList" @click="addOption()"> <a class="addTiMuList" @click="addOption()">
<i class="iconfont icon-add"></i>添加选项 <i class="iconfont icon-add"></i>添加更多
</a> </a>
<!-- <a style="cursor:pointer;" @click="addOption()">添加选项</a> --> <br />
</td> <br />
</tr> <el-checkbox v-model="setOption.IsMutex" :true-label="1" :false-label="0"><span
<tr> style="font-size:12px;">答案顺序打乱也判正确</span></el-checkbox>
<td colspan="3"> <br />
<br />
<div class="entrytk_info"> <div class="entrytk_info">
1. 一个空有多种答案时请用";"隔开。如:水;H2O 1. 一个空有多种答案时请用";"隔开。如:水;H2O
<br /> <br />
2. 若试题答案是数字,可设置范围,两个数字之间用"-"。如:1-9,学生填写1到9之间的数字都算正确(包括1和9) 2. 若试题答案是数字,可设置范围,两个数字之间用"-"。如:1-9,学生填写1到9之间的数字都算正确(包括1和9)
</div> </div>
</td>
</tr>
</tfoot>
</table>
</div> </div>
</template> </template>
<script> <script>
...@@ -55,6 +52,9 @@ ...@@ -55,6 +52,9 @@
questionData: { questionData: {
type: Array, type: Array,
}, },
setOption: {
type: Object,
}
}, },
components: { components: {
UeEditor UeEditor
...@@ -66,7 +66,7 @@ ...@@ -66,7 +66,7 @@
initialFrameWidth: null, initialFrameWidth: null,
initialFrameHeight: 80, initialFrameHeight: 80,
}, },
commonIndex:-1, commonIndex: -1,
}; };
}, },
created() {}, created() {},
...@@ -88,7 +88,7 @@ ...@@ -88,7 +88,7 @@
} }
}).onOk(() => { }).onOk(() => {
this.data.splice(index, 1); this.data.splice(index, 1);
this.commonIndex=-1; this.commonIndex = -1;
}); });
}, },
//新增选项 //新增选项
...@@ -101,7 +101,7 @@ ...@@ -101,7 +101,7 @@
returnDataToParent() { returnDataToParent() {
this.$emit('getChild', this.data); this.$emit('getChild', this.data);
}, },
changeEdit(index){ changeEdit(index) {
this.commonIndex = index; this.commonIndex = index;
} }
}, },
......
<!--判断题--> <!--判断题-->
<style> <style>
.judgeQuestion{ .judgeQuestion {
width:100%; width: 100%;
} }
</style> </style>
<template> <template>
<div class="judgeQuestion"> <div class="judgeQuestion">
...@@ -16,7 +17,6 @@ ...@@ -16,7 +17,6 @@
<td style="vertical-align:middle;"> <td style="vertical-align:middle;">
<span v-if="index==0"></span> <span v-if="index==0"></span>
<span v-if="index==1"></span> <span v-if="index==1"></span>
<!-- <UeEditor v-model="item.Content" :config="config"></UeEditor> -->
</td> </td>
</tr> </tr>
</table> </table>
...@@ -49,6 +49,7 @@ ...@@ -49,6 +49,7 @@
methods: { methods: {
//返回数据到父组件 //返回数据到父组件
returnDataToParent() { returnDataToParent() {
this.getAnswer();
this.$emit('getChild', this.data); this.$emit('getChild', this.data);
}, },
ChangeItem(item) { ChangeItem(item) {
...@@ -58,7 +59,17 @@ ...@@ -58,7 +59,17 @@
}) })
} }
item.IsAnswer = true; item.IsAnswer = true;
this.setOption.Answer=item.Name; },
//获取正确答案
getAnswer() {
this.setOption.Answer = "";
if (this.data && this.data.length > 0) {
this.data.forEach(item => {
if (item.IsAnswer) {
this.setOption.Answer = item.Name;
}
})
}
}, },
}, },
mounted() { mounted() {
......
...@@ -77,7 +77,6 @@ ...@@ -77,7 +77,6 @@
this.data.splice(index, 1); this.data.splice(index, 1);
this.commonIndex = -1; this.commonIndex = -1;
this.calcOptionTitle(); this.calcOptionTitle();
this.getAnswer();
}).onCancel(() => { }).onCancel(() => {
}); });
...@@ -91,7 +90,6 @@ ...@@ -91,7 +90,6 @@
IsAnswer: false IsAnswer: false
}); });
this.calcOptionTitle() this.calcOptionTitle()
this.getAnswer();
} else { } else {
this.$q.notify({ this.$q.notify({
type: 'warning', type: 'warning',
...@@ -116,6 +114,7 @@ ...@@ -116,6 +114,7 @@
}, },
//返回数据到父组件 //返回数据到父组件
returnDataToParent() { returnDataToParent() {
this.getAnswer();
this.$emit('getChild', this.data); this.$emit('getChild', this.data);
}, },
ChangeItem(item) { ChangeItem(item) {
...@@ -125,7 +124,6 @@ ...@@ -125,7 +124,6 @@
}) })
} }
item.IsAnswer = true; item.IsAnswer = true;
this.getAnswer();
}, },
//获取正确答案 //获取正确答案
getAnswer() { getAnswer() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment