Commit 659b0687 authored by 黄奎's avatar 黄奎

页面修改

parent b3d37ab9
...@@ -131,10 +131,14 @@ export function CreateQuestion(questionKey) { ...@@ -131,10 +131,14 @@ export function CreateQuestion(questionKey) {
AnswerList.push(tempArray); AnswerList.push(tempArray);
AnswerList.push(array2); AnswerList.push(array2);
break; break;
//完型 //完型
case "cloze": case "cloze":
var tempArray = optionListConfig(); var tempArray = optionListConfig();
AnswerList.push(tempArray); var clozeObj = {
SubScore: 0,
OptionList: tempArray,
};
AnswerList.push(clozeObj);
break; break;
//阅读理解 //阅读理解
case "reading-comprehensio": case "reading-comprehensio":
...@@ -143,6 +147,7 @@ export function CreateQuestion(questionKey) { ...@@ -143,6 +147,7 @@ export function CreateQuestion(questionKey) {
QuestionKey: "single", QuestionKey: "single",
QuestionName: "单选题", QuestionName: "单选题",
SubTitle: "", //题目内容 SubTitle: "", //题目内容
SubScore:0,
SubAnwser: optionListConfig() SubAnwser: optionListConfig()
}); });
break; break;
...@@ -325,6 +330,7 @@ export function sortingproblemValidate(gName, detailsList) { ...@@ -325,6 +330,7 @@ export function sortingproblemValidate(gName, detailsList) {
*【完型填空】验证 *【完型填空】验证
*/ */
export function clozeValidate(gName, detailsList) { export function clozeValidate(gName, detailsList) {
console.log("detailsList",detailsList);
var message = ""; var message = "";
if (detailsList && detailsList.length > 0) { if (detailsList && detailsList.length > 0) {
for (let i = 0; i < detailsList.length; i++) { for (let i = 0; i < detailsList.length; i++) {
...@@ -334,13 +340,13 @@ export function clozeValidate(gName, detailsList) { ...@@ -334,13 +340,13 @@ export function clozeValidate(gName, detailsList) {
} }
for (let j = 0; j < detailsList[i].QuestionContentObj.length; j++) { for (let j = 0; j < detailsList[i].QuestionContentObj.length; j++) {
var Num = 0; var Num = 0;
for (var k = 0; k < detailsList[i].QuestionContentObj[j].length; k++) { for (var k = 0; k < detailsList[i].QuestionContentObj[j].OptionList.length; k++) {
if (detailsList[i].QuestionContentObj[j][k].Content == '') { if (detailsList[i].QuestionContentObj[j].OptionList[k].Content == '') {
message = message =
`请填写【${gName}】第 ${i+1} 题,第 ${j+1} 小题 选项 ${detailsList[i].QuestionContentObj[j][k].Name} 内容!`; `请填写【${gName}】第 ${i+1} 题,第 ${j+1} 小题 选项 ${detailsList[i].QuestionContentObj[j].OptionList[k].Name} 内容!`;
return message; return message;
} }
if (detailsList[i].QuestionContentObj[j][k].IsAnswer) { if (detailsList[i].QuestionContentObj[j].OptionList[k].IsAnswer) {
Num++ Num++
} }
} }
......
...@@ -61,6 +61,10 @@ ...@@ -61,6 +61,10 @@
<i class="iconfont icon-arrowright" v-else></i> <i class="iconfont icon-arrowright" v-else></i>
{{index+1}}小题 {{index+1}}小题
</div> </div>
<div v-if="isShowScore">
<q-input filled stack-label maxlength="5" :dense="false" @keyup.native="checkPrice(item,'SubScore')"
v-model="item.SubScore" class="col-12 q-pb-lg" label="分数" @input="getQuestionScore" />
</div>
<div> <div>
<i class="iconfont icon-img_delete_small" @click.stop="deleteQuestion(index)"></i> <i class="iconfont icon-img_delete_small" @click.stop="deleteQuestion(index)"></i>
</div> </div>
...@@ -69,7 +73,7 @@ ...@@ -69,7 +73,7 @@
</tr> </tr>
</thead> </thead>
<tbody class="contant" v-if="(commonIndex==index)&&!isShow"> <tbody class="contant" v-if="(commonIndex==index)&&!isShow">
<tr v-for="(subItem,subIndex) in item"> <tr v-for="(subItem,subIndex) in item.OptionList" :key="subIndex">
<td style="width:40px;text-align:center;"> <td style="width:40px;text-align:center;">
<div class="Answer_List" @click="ChangeItem(item,subItem)" :class="{'Is_Answer':subItem.IsAnswer}"> <div class="Answer_List" @click="ChangeItem(item,subItem)" :class="{'Is_Answer':subItem.IsAnswer}">
{{subItem.Name}} {{subItem.Name}}
...@@ -114,6 +118,11 @@ ...@@ -114,6 +118,11 @@
}, },
setOption: { setOption: {
type: Object, type: Object,
},
//是否显示小题分数
isShowScore: {
type: Boolean,
default: false,
} }
}, },
components: { components: {
...@@ -138,6 +147,11 @@ ...@@ -138,6 +147,11 @@
this.initConfig(); this.initConfig();
}, },
methods: { methods: {
//计算分数
getQuestionScore()
{
this.$emit('getScore');
},
initConfig() { initConfig() {
this.optionTitleList = getOptionList(); this.optionTitleList = getOptionList();
}, },
...@@ -202,13 +216,18 @@ ...@@ -202,13 +216,18 @@
}, },
//添加小题 //添加小题
addQuestion() { addQuestion() {
this.data.push(optionListConfig()); var tempArray = optionListConfig();
var clozeObj = {
SubScore: 0,
OptionList: tempArray,
};
this.data.push(clozeObj);
}, },
//重新计算选择Title[A,B,C,D....] //重新计算选择Title[A,B,C,D....]
calcOptionTitle() { calcOptionTitle() {
if (this.data && this.data.length > 0) { if (this.data && this.data.length > 0) {
this.data.forEach((item, index) => { this.data.forEach((item, index) => {
item.forEach((subItem, subIndex) => { item.OptionList.forEach((subItem, subIndex) => {
subItem.Name = this.optionTitleList[subIndex]; subItem.Name = this.optionTitleList[subIndex];
}) })
}) })
...@@ -225,7 +244,7 @@ ...@@ -225,7 +244,7 @@
if (this.data && this.data.length > 0) { if (this.data && this.data.length > 0) {
var answer = ""; var answer = "";
this.data.forEach((item) => { this.data.forEach((item) => {
item.forEach((subItem) => { item.OptionList.forEach((subItem) => {
if (subItem.IsAnswer) { if (subItem.IsAnswer) {
answer += "," + subItem.Name; answer += "," + subItem.Name;
} }
...@@ -239,7 +258,7 @@ ...@@ -239,7 +258,7 @@
}, },
ChangeItem(item, subItem) { ChangeItem(item, subItem) {
if (item && item.length > 0) { if (item && item.length > 0) {
item.forEach(childItem => { item.OptionList.forEach(childItem => {
childItem.IsAnswer = false; childItem.IsAnswer = false;
}) })
} }
......
...@@ -29,8 +29,8 @@ ...@@ -29,8 +29,8 @@
</style> </style>
<template> <template>
<div class="readingComprehensioQuestion"> <div class="readingComprehensioQuestion">
<template v-if="data&&data.length>0" v-for="(item,index) in data"> <template v-if="data&&data.length>0">
<table class="common_TiTable"> <table class="common_TiTable" v-for="(item,index) in data" :key="index">
<thead> <thead>
<tr> <tr>
<th colspan="3" style="text-align:left;"> <th colspan="3" style="text-align:left;">
...@@ -40,6 +40,10 @@ ...@@ -40,6 +40,10 @@
<i class="iconfont icon-arrowright" v-else></i> <i class="iconfont icon-arrowright" v-else></i>
{{index+1}}小题<span style="color:#A8A8B3;">({{item.QuestionName}})</span> {{index+1}}小题<span style="color:#A8A8B3;">({{item.QuestionName}})</span>
</div> </div>
<div v-if="isShowScore">
<q-input filled stack-label maxlength="5" :dense="false" @keyup.native="checkPrice(item,'SubScore')"
v-model="item.SubScore" class="col-12 q-pb-lg" label="分数" @input="getQuestionScore" />
</div>
<div> <div>
<i class="iconfont icon-img_delete_small" @click.stop="deleteQuestion(index)"></i> <i class="iconfont icon-img_delete_small" @click.stop="deleteQuestion(index)"></i>
</div> </div>
...@@ -56,7 +60,7 @@ ...@@ -56,7 +60,7 @@
<!--选择题--> <!--选择题-->
<template <template
v-if="item.QuestionKey=='single' ||item.QuestionKey=='multiple'|| item.QuestionKey=='single-number'"> 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;"> <td style="width:40px;text-align:center;">
<template v-if="item.QuestionKey=='single'||item.QuestionKey=='single-number'"> <template v-if="item.QuestionKey=='single'||item.QuestionKey=='single-number'">
<div class="Answer_List" @click="ChangeItem(item,subItem)" :class="{'Is_Answer':subItem.IsAnswer}"> <div class="Answer_List" @click="ChangeItem(item,subItem)" :class="{'Is_Answer':subItem.IsAnswer}">
...@@ -166,6 +170,11 @@ ...@@ -166,6 +170,11 @@
props: { props: {
questionData: { questionData: {
type: Array, type: Array,
},
//是否显示小题分数
isShowScore: {
type: Boolean,
default: false,
} }
}, },
components: { components: {
...@@ -191,6 +200,10 @@ ...@@ -191,6 +200,10 @@
this.getQuestionType(); this.getQuestionType();
}, },
methods: { methods: {
//计算分数
getQuestionScore() {
this.$emit('getScore');
},
//获取题型列表 //获取题型列表
getQuestionType() { getQuestionType() {
queryQuestionTypeList({}).then(res => { queryQuestionTypeList({}).then(res => {
......
...@@ -54,6 +54,9 @@ ...@@ -54,6 +54,9 @@
<q-btn flat color="primary" size="xs" style="font-weight:400;" class="q-mr-md" label="阅卷" <q-btn flat color="primary" size="xs" style="font-weight:400;" class="q-mr-md" label="阅卷"
@click="gotoExamTestReview(props.row)" /> @click="gotoExamTestReview(props.row)" />
<q-btn flat color="primary" size="xs" style="font-weight:400;" class="q-mr-md" label="详情"
@click="gotoExamTestInfo(props.row)" />
</q-td> </q-td>
</template> </template>
</q-table> </q-table>
...@@ -142,7 +145,7 @@ ...@@ -142,7 +145,7 @@
var qMsg = { var qMsg = {
GuestId: item.GuestId, GuestId: item.GuestId,
PaperId: item.PaperId, PaperId: item.PaperId,
PublishId:item.PublishId, PublishId: item.PublishId,
}; };
this.OpenNewUrl('/exam/examtest', qMsg); this.OpenNewUrl('/exam/examtest', qMsg);
}, },
...@@ -150,10 +153,19 @@ ...@@ -150,10 +153,19 @@
var qMsg = { var qMsg = {
GuestId: item.GuestId, GuestId: item.GuestId,
PaperId: item.PaperId, PaperId: item.PaperId,
PublishId:item.PublishId, PublishId: item.PublishId,
}; };
this.OpenNewUrl('/exam/examtestreview', qMsg); this.OpenNewUrl('/exam/examtestreview', qMsg);
} },
//考生试卷详情
gotoExamTestInfo(item) {
var qMsg = {
GuestId: item.GuestId,
PaperId: item.PaperId,
PublishId: item.PublishId,
};
this.OpenNewUrl('/exam/examtestinfo', qMsg);
},
}, },
}; };
......
...@@ -372,7 +372,8 @@ ...@@ -372,7 +372,8 @@
<div class="row wrap" v-if="ChooseItem" style="padding:20px;"> <div class="row wrap" v-if="ChooseItem" style="padding:20px;">
<div class="edit_stem"> <div class="edit_stem">
<q-input filled stack-label maxlength="5" :dense="false" @keyup.native="checkPrice(ChooseItem,'Score')" <q-input filled stack-label maxlength="5" :dense="false" @keyup.native="checkPrice(ChooseItem,'Score')"
v-model="ChooseItem.Score" class="col-12 q-pb-lg" label="分数" /> v-model="ChooseItem.Score" class="col-12 q-pb-lg" label="分数"
:disable="ChooseItem.QuestionTypeKey=='cloze'||ChooseItem.QuestionTypeKey=='listening'||ChooseItem.QuestionTypeKey=='reading-comprehensio'" />
</div> </div>
<div class="col-12"> <div class="col-12">
<template v-if="ChooseItem.QuestionTypeKey=='cloze'"> <template v-if="ChooseItem.QuestionTypeKey=='cloze'">
...@@ -412,15 +413,17 @@ ...@@ -412,15 +413,17 @@
</sorting-problem> </sorting-problem>
<!--完型填空--> <!--完型填空-->
<cloze v-if="ChooseItem.QuestionTypeKey=='cloze'" :questionData="ChooseItem.QuestionContentObj" <cloze v-if="ChooseItem.QuestionTypeKey=='cloze'" :questionData="ChooseItem.QuestionContentObj"
:setOption="ChooseItem" @getChild="getChildData"></cloze> :setOption="ChooseItem" @getChild="getChildData" :isShowScore="true" @getScore="calcPaper"></cloze>
<!--阅读理解、听力题--> <!--阅读理解、听力题-->
<reading-comprehensio <reading-comprehensio
v-if="ChooseItem.QuestionTypeKey=='reading-comprehensio'||ChooseItem.QuestionTypeKey=='listening'" v-if="ChooseItem.QuestionTypeKey=='reading-comprehensio'||ChooseItem.QuestionTypeKey=='listening'"
:questionData="ChooseItem.QuestionContentObj" :setOption="ChooseItem" @getChild="getChildData"> :questionData="ChooseItem.QuestionContentObj" :setOption="ChooseItem" @getChild="getChildData"
:isShowScore="true" @getScore="calcPaper">
</reading-comprehensio> </reading-comprehensio>
<!--共用选择题--> <!--共用选择题-->
<sharing-choose v-if="ChooseItem.QuestionTypeKey=='sharing-choose'" <sharing-choose v-if="ChooseItem.QuestionTypeKey=='sharing-choose'"
:questionData="ChooseItem.QuestionContentObj" @getChild="getChildData" :setOption="ChooseItem"> :questionData="ChooseItem.QuestionContentObj" @getChild="getChildData" :setOption="ChooseItem"
:isShowScore="true" @getScore="calcPaper">
</sharing-choose> </sharing-choose>
<br /> <br />
<div class="col-12"> <div class="col-12">
...@@ -923,6 +926,24 @@ ...@@ -923,6 +926,24 @@
if (x.DetailsList && x.DetailsList.length > 0) { if (x.DetailsList && x.DetailsList.length > 0) {
this.examNum += x.DetailsList.length; this.examNum += x.DetailsList.length;
x.DetailsList.forEach(y => { x.DetailsList.forEach(y => {
if (y.QuestionTypeKey == "cloze") {
var clozeScore = 0;
if (y.QuestionContentObj && y.QuestionContentObj.length > 0) {
y.QuestionContentObj.forEach(qItem => {
clozeScore += Number(qItem.SubScore);
})
}
y.Score = clozeScore;
}
if (y.QuestionTypeKey == "reading-comprehensio" || y.QuestionTypeKey == "listening") {
var readScore = 0;
if (y.QuestionContentObj && y.QuestionContentObj.length > 0) {
y.QuestionContentObj.forEach(qItem => {
readScore += Number(qItem.SubScore);
})
}
y.Score = readScore;
}
if (y.Score) { if (y.Score) {
tempGScore += Number(y.Score); tempGScore += Number(y.Score);
this.examScore += Number(y.Score); this.examScore += Number(y.Score);
......
...@@ -1082,6 +1082,11 @@ const routes = [{ ...@@ -1082,6 +1082,11 @@ const routes = [{
component: () => component: () =>
import("pages/exam/examtestreview") import("pages/exam/examtestreview")
}, },
{
path: "/exam/examtestinfo", //考生试卷详情
component: () =>
import("pages/exam/examtestinfo")
},
{ {
path: "/exam/paperCreate", //试卷组卷 path: "/exam/paperCreate", //试卷组卷
component: () => component: () =>
......
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