Commit b9effd4a authored by 黄奎's avatar 黄奎

页面修改

parent ca1218f3
......@@ -8,7 +8,7 @@
<template>
<div class="judgeQuestion">
<table v-if="data&&data.length>0" class="common_TiTable">
<tr v-for="(item,index) in data">
<tr v-for="(item,index) in data" :key="index">
<td style="width:50px;text-align:center;">
<div class="Answer_List" @click="ChangeItem(item)" :class="{'Is_Answer':item.IsAnswer}">
{{item.Name}}
......
......@@ -7,6 +7,7 @@
</style>
<template>
<div class="v_judgeQuestion">
{{data}}
<table v-if="data&&data.QuestionContentObj&&data.QuestionContentObj.length>0" class="common_TiTable">
<tbody v-for="(item,index) in data.QuestionContentObj" :key="index">
<tr>
......
<!--阅读理解-->
<style>
.readingComprehensioQuestion {
.v_readingComprehensioQuestion {
width: 100%;
}
.edui-editor-toolbarbox {
text-align: left;
}
.readingComprehensioQuestion .clozeTest_question_tit {
.v_readingComprehensioQuestion .clozeTest_question_tit {
width: 100%;
height: 40px;
background: #F7F8FA;
......@@ -21,17 +18,16 @@
align-items: center;
}
.clozeTest_question_tit i {
.v_readingComprehensioQuestion .clozeTest_question_tit i {
color: #acbfd9;
cursor: pointer;
}
</style>
<template>
<div class="readingComprehensioQuestion">
<template v-if="data&&data.QuestionContentObj&&data.QuestionContentObj.length>0" v-for="(item,index) in data.QuestionContentObj">
<table class="common_TiTable">
<div class="v_readingComprehensioQuestion">
<template v-if="data&&data.QuestionContentObj&&data.QuestionContentObj.length>0">
<table class="common_TiTable" v-for="(item,index) in data.QuestionContentObj" :key="index">
<thead>
<tr>
<th colspan="3" style="text-align:left;">
......@@ -54,7 +50,7 @@
<!--选择题-->
<template
v-if="item.QuestionKey=='single' ||item.QuestionKey=='multiple'|| item.QuestionKey=='single-number'">
<tr v-for="(subItem,subIndex) in item.SubAnwser">
<tr v-for="(subItem,subIndex) in item.SubAnwser" :key="subIndex">
<td style="width:40px;text-align:center;">
<template
v-if="item.QuestionKey=='single'||item.QuestionKey=='multiple'|| item.QuestionKey=='single-number'">
......
......@@ -98,18 +98,21 @@
padding-bottom: 12px;
display: inline-block;
}
.questionMain{
width:1200px;
margin:20px auto;
padding:25px;
.questionMain {
width: 1200px;
margin: 20px auto;
padding: 25px;
background-color: #fff;
border-radius: 8px;
margin-bottom:20px;
margin-bottom: 20px;
box-shadow: 0px 2px 10px 0px rgba(237, 238, 240, 0.5);
}
.qussTionTitDiv img{
width:100%;
.qussTionTitDiv img {
width: 100%;
}
</style>
<template>
<div class="questionMain">
......@@ -122,47 +125,37 @@
<div v-html="objOption.Title" @click="clickQuestion($event)"></div>
</div>
<!--单选题-->
<v-single v-if="questionObj.Key=='single'||questionObj.Key=='single-number'" :questionData="AnswerList"
@getChild="getChildData" :setOption="objOption"></v-single>
<v-single v-if="objOption.QuestionTypeKey=='single'||objOption.QuestionTypeKey=='single-number'" :questionObj="objOption"
:isShowAnswer="isShowAnswer"></v-single>
<!--多选题-->
<v-multiple v-if="questionObj.Key=='multiple'" :questionData="AnswerList" @getChild="getChildData"
:setOption="objOption"></v-multiple>
<v-multiple v-if="objOption.QuestionTypeKey=='multiple'" :questionObj="objOption" :isShowAnswer="isShowAnswer"></v-multiple>
<!--填空题-->
<v-fillin v-if="questionObj.Key=='fill-in'" :questionData="AnswerList" @getChild="getChildData"
:setOption="objOption"></v-fillin>
<v-fillin v-if="objOption.QuestionTypeKey=='fill-in'" :questionObj="objOption" :isShowAnswer="isShowAnswer"></v-fillin>
<!--判断题-->
<v-judge v-if="questionObj.Key=='judge'" :questionData="AnswerList" @getChild="getChildData"
:setOption="objOption"></v-judge>
<v-judge v-if="objOption.QuestionTypeKey=='judge'" :questionObj="objOption" :isShowAnswer="isShowAnswer"></v-judge>
<!--简答题、名词解释、论述题、计算题、口语题、其它-->
<v-shortanswer v-if="questionObj.Key=='short-answer'||questionObj.Key=='noun-explanation'||questionObj.Key=='essay-question'
||questionObj.Key=='calculation' || questionObj.Key=='spoken'|| questionObj.Key=='other'
" :setOption="objOption"> </v-shortanswer>
<v-shortanswer v-if="objOption.QuestionTypeKey=='short-answer'||objOption.QuestionTypeKey=='noun-explanation'||objOption.QuestionTypeKey=='essay-question'
||objOption.QuestionTypeKey=='calculation' || objOption.QuestionTypeKey=='spoken'|| objOption.QuestionTypeKey=='other'
" :questionObj="objOption" :isShowAnswer="isShowAnswer"> </v-shortanswer>
<!--分录题、资料题-->
<v-entryproblem v-if="questionObj.Key=='entry-problem'|| questionObj.Key=='data-question'"
:questionData="AnswerList" :setOption="objOption" @getChild="getChildData">
<v-entryproblem v-if="objOption.QuestionTypeKey=='entry-problem'|| objOption.QuestionTypeKey=='data-question'" :questionObj="objOption"
:isShowAnswer="isShowAnswer">
</v-entryproblem>
<!--连线题-->
<v-matching v-if="questionObj.Key=='matching'" :questionData="AnswerList" :setOption="objOption"
@getChild="getChildData"></v-matching>
<v-matching v-if="objOption.QuestionTypeKey=='matching'" :questionObj="objOption" :isShowAnswer="isShowAnswer"></v-matching>
<!--排序题-->
<v-sortingproblem v-if="questionObj.Key=='sorting-problem'" :questionData="AnswerList" :setOption="objOption"
@getChild="getChildData"></v-sortingproblem>
<v-sortingproblem v-if="objOption.QuestionTypeKey=='sorting-problem'" :questionObj="objOption" :isShowAnswer="isShowAnswer">
</v-sortingproblem>
<!--完型填空-->
<v-cloze v-if="questionObj.Key=='cloze'" :questionData="AnswerList" :setOption="objOption"
@getChild="getChildData"></v-cloze>
<v-cloze v-if="objOption.QuestionTypeKey=='cloze'" :questionObj="objOption" :isShowAnswer="isShowAnswer"></v-cloze>
<!--阅读理解、听力题-->
<v-readingcomprehensio v-if="questionObj.Key=='reading-comprehensio'||questionObj.Key=='listening'"
:questionData="AnswerList" :setOption="objOption" @getChild="getChildData"></v-readingcomprehensio>
<v-readingcomprehensio
v-if="objOption.QuestionTypeKey=='reading-comprehensio'||objOption.QuestionTypeKey=='listening'"
:questionObj="objOption" :isShowAnswer="isShowAnswer"></v-readingcomprehensio>
<!--共用选择题-->
<v-sharingchoose v-if="questionObj.Key=='sharing-choose'" :questionData="AnswerList" @getChild="getChildData"
:setOption="objOption">
<v-sharingchoose v-if="objOption.QuestionTypeKey=='sharing-choose'" :questionObj="objOption" :isShowAnswer="isShowAnswer">
</v-sharingchoose>
<br />
<div class="col-12">
<div style="margin:20px 0;">答案解析</div>
<div v-html="objOption.AnswerParse"></div>
</div>
<br />
<div class="col-4">
<br />
<span class="difficulty_Degree">难度: </span>
......@@ -193,7 +186,7 @@
import {
queryQuestionInfo,
} from '../../api/question/question'
import vSingle from '../../components/questiontype/v-single'
import vMultiple from '../../components/questiontype/v-multiple'
import vFillin from '../../components/questiontype/v-fillin'
......@@ -255,26 +248,16 @@
CategoryName: "", //分类
DifficultyTypeStr: "", //难易程度
LevelTypeName: "", //考级程度
QuestionContentObj: [], //选项列表
},
AnswerList: [],
questionObj: {}, //题目类型对象
isShowAnswer: true, //显示答案
choosePointArray: [], //知识点列表
}
},
computed: {
},
created() {},
mounted() {
this.initObj()
},
methods: {
//获取子组件内容
getChildData(obj) {
if (obj) {
this.objOption.QuestionContent = JSON.stringify(obj);
}
},
//初始化表单
initObj() {
var qId = 0;
......@@ -283,7 +266,7 @@
}
queryQuestionInfo({
QuestionId: qId,
isReplaceClozeTitle:1
isReplaceClozeTitle: 1
}).then(res => {
this.objOption.QuestionId = res.Data.QuestionId;
this.objOption.Title = res.Data.Title;
......@@ -296,8 +279,6 @@
this.objOption.SortNum = res.Data.SortNum;
this.objOption.Answer = res.Data.Answer;
this.objOption.IsMutex = res.Data.IsMutex;
this.questionObj.Key = res.Data.QuestionTypeKey;
this.questionObj.QId = res.Data.QuestionTypeId;
this.objOption.Category = res.Data.Category;
this.objOption.LevelType = res.Data.LevelType;
this.objOption.QuestionTypeName = res.Data.QuestionTypeName;
......@@ -305,14 +286,12 @@
this.objOption.DifficultyTypeStr = res.Data.DifficultyTypeStr;
this.objOption.LevelTypeName = res.Data.LevelTypeName;
if (res.Data.QuestionContentObj) {
this.AnswerList = res.Data.QuestionContentObj;
this.objOption.QuestionContent = JSON.stringify(res.Data.QuestionContentObj);
this.objOption.QuestionContentObj = res.Data.QuestionContentObj;
}
if (res.Data.QuestionPointList && res.Data.QuestionPointList.length > 0) {
this.choosePointArray = res.Data.QuestionPointList;
}
})
},
//标题点击事件
clickQuestion(e) {
......
......@@ -521,7 +521,7 @@
this.GetPaperInfo()
}
},
methods: {
methods: {
//大类改变分数
changeGroupScore(gItem) {
var subScore = 0;
......@@ -793,23 +793,23 @@
this.ComCheckIndex = index2;
this.ChooseItem = questionItem;
this.ChooseItem.QuestionContentObj = questionItem.QuestionContentObj;
if (questionItem.QuestionTypeKey != 'sharing-choose') {
if (questionItem.QuestionTypeKey != 'sharing-choose' && this.$refs.UE_Title) {
this.$refs.UE_Title.reloadNewValue();
}
this.$refs.UE_AnswerParse.reloadNewValue();
if (this.$refs.UE_AnswerParse) {
this.$refs.UE_AnswerParse.reloadNewValue();
}
this.ChooseItem.AnswerParse = questionItem.AnswerParse;
this.$forceUpdate();
},
//正则匹配替换
getRegItem(val){
let Item = val.replace(/<iframe(([\s\S])*?)<\/iframe>/ig,'[音频]').replace(/<img.*?(?:>|\/>)/gi,'[图片]');
getRegItem(val) {
let Item = val.replace(/<iframe(([\s\S])*?)<\/iframe>/ig, '[音频]').replace(/<img.*?(?:>|\/>)/gi, '[图片]');
return Item
},
//保存题目
SavePaper() {
if (this.validateType()) {
console.log('进入');
return;
savePaperInfo(this.DataObj).then(res => {
if (res.Code == 1) {
this.$q.notify({
......@@ -856,7 +856,8 @@
}
}
//单选题 多选题
if (this.DataObj.GroupList[k].QuestionTypeKey == 'single'||this.DataObj.GroupList[k].QuestionTypeKey == 'multiple') {
if (this.DataObj.GroupList[k].QuestionTypeKey == 'single' || this.DataObj.GroupList[k].QuestionTypeKey ==
'multiple') {
for (let i = 0; i < this.DataObj.GroupList[k].DetailsList.length; i++) {
var Num = 0;
if (this.DataObj.GroupList[k].DetailsList[i].Title == '') {
......@@ -894,7 +895,7 @@
}
}
//填空题
}
return result;
},
......
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