Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
confucius
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
罗超
confucius
Commits
fc15b75f
Commit
fc15b75f
authored
Jan 07, 2021
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增插件
parent
a234574b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
134 additions
and
25 deletions
+134
-25
questionconfig.js
src/api/question/questionconfig.js
+17
-3
question-form.vue
src/components/question/question-form.vue
+6
-5
reading-comprehensio.vue
src/components/questiontype/reading-comprehensio.vue
+111
-17
No files found.
src/api/question/questionconfig.js
View file @
fc15b75f
...
...
@@ -54,11 +54,11 @@ export function CreateQuestion(questionKey) {
case
"judge"
:
AnswerList
.
push
({
Name
:
"A"
,
Content
:
""
,
Content
:
"
对
"
,
IsAnswer
:
true
},
{
Name
:
"B"
,
Content
:
""
,
Content
:
"
错
"
,
IsAnswer
:
false
})
break
;
...
...
@@ -128,7 +128,7 @@ export function CreateQuestion(questionKey) {
var
tempArray
=
optionListConfig
();
AnswerList
.
push
(
tempArray
);
break
;
//阅读理解
//阅读理解
case
"reading-comprehensio"
:
AnswerList
.
push
({
QuestionType
:
1
,
...
...
@@ -138,6 +138,20 @@ export function CreateQuestion(questionKey) {
SubAnwser
:
optionListConfig
()
});
break
;
//听力题
case
"listening"
:
AnswerList
.
push
({
QuestionType
:
1
,
QuestionKey
:
"single"
,
QuestionName
:
"单选题"
,
SubTitle
:
""
,
//题目内容
SubAnwser
:
optionListConfig
()
});
break
;
//共用选择题
case
"sharing-choose"
:
break
;
}
return
AnswerList
;
}
src/components/question/question-form.vue
View file @
fc15b75f
...
...
@@ -44,9 +44,9 @@
:setOption=
"objOption"
></fill-in>
<!--判断题-->
<judge
v-if=
"questionObj.Key=='judge'"
:questionData=
"AnswerList"
@
getChild=
"getChildData"
></judge>
<!--简答题、名词解释、论述题、计算题-->
<!--简答题、名词解释、论述题、计算题
、口语题、其它
-->
<short-answer
v-if=
"questionObj.Key=='short-answer'||questionObj.Key=='noun-explanation'||questionObj.Key=='essay-question'
||questionObj.Key=='calculation'
||questionObj.Key=='calculation'
|| questionObj.Key=='spoken'|| questionObj.Key=='other'
"
:setOption=
"objOption"
>
</short-answer>
<!--分录题、资料题-->
<entry-problem
v-if=
"questionObj.Key=='entry-problem'|| questionObj.Key=='data-question'"
...
...
@@ -59,9 +59,9 @@
@
getChild=
"getChildData"
></sorting-problem>
<!--完型填空-->
<cloze
v-if=
"questionObj.Key=='cloze'"
:questionData=
"AnswerList"
@
getChild=
"getChildData"
></cloze>
<!--阅读理解-->
<reading-comprehensio
v-if=
"questionObj.Key=='reading-comprehensio'
"
:questionData=
"AnswerList
"
@
getChild=
"getChildData"
></reading-comprehensio>
<!--阅读理解
、听力题
-->
<reading-comprehensio
v-if=
"questionObj.Key=='reading-comprehensio'
||questionObj.Key=='listening'
"
:questionData=
"AnswerList"
@
getChild=
"getChildData"
></reading-comprehensio>
<br
/>
<div
class=
"col-12"
>
答案解析
<UeEditor
v-model=
"objOption.AnswerParse"
:config=
"config"
ref=
"AnswerParse"
></UeEditor>
...
...
@@ -235,6 +235,7 @@
this
.
objOption
.
QuestionTypeKey
=
item
.
Key
;
var
obj
=
CreateQuestion
(
item
.
Key
);
this
.
AnswerList
=
obj
;
console
.
log
(
"this.AnswerList "
,
this
.
AnswerList
);
},
//获取题型列表
getQuestionType
()
{
...
...
src/components/questiontype/reading-comprehensio.vue
View file @
fc15b75f
...
...
@@ -5,17 +5,93 @@
<
template
>
<div
class=
"readingComprehensioQuestion"
>
<template
v-if=
"data&&data.length>0"
v-for=
"(item,index) in data"
>
<div>
<span>
第
{{
index
+
1
}}
题 (
{{
item
.
QuestionName
}}
)
</span>
<UeEditor
v-model=
"item.SubTitle"
:config=
"config"
></UeEditor>
<span
style=
"display:block"
v-for=
"(subItem,subIndex) in item.SubAnwser"
>
<el-checkbox
v-model=
"subItem.IsAnswer"
@
change=
"ChangeItem(item,subItem)"
>
{{
subItem
.
Name
}}
</el-checkbox>
<UeEditor
v-model=
"subItem.Content"
:config=
"config"
></UeEditor>
<a
style=
"cursor:pointer;"
@
click=
"deleteOpion(item,subIndex)"
>
删除
</a>
</span>
</div>
<a
style=
"cursor:pointer;"
@
click=
"addOption(item)"
>
添加选项
</a>
<table>
<thead>
<tr>
<th
colspan=
"3"
style=
"text-align:left;"
>
第
{{
index
+
1
}}
题 (
{{
item
.
QuestionName
}}
)
</th>
</tr>
<tr>
<th
colspan=
"3"
>
<UeEditor
v-model=
"item.SubTitle"
:config=
"config"
></UeEditor>
</th>
</tr>
</thead>
<tbody>
<!--选择题-->
<template
v-if=
"item.QuestionKey=='single' ||item.QuestionKey=='multiple'"
>
<tr
v-for=
"(subItem,subIndex) in item.SubAnwser"
>
<td>
<template
v-if=
"item.QuestionKey=='single'"
>
<el-checkbox
v-model=
"subItem.IsAnswer"
@
change=
"ChangeItem(item,subItem)"
>
{{
subItem
.
Name
}}
</el-checkbox>
</
template
>
<
template
v-else-if=
"item.QuestionKey=='multiple'"
>
<el-checkbox
v-model=
"subItem.IsAnswer"
>
{{
subItem
.
Name
}}
</el-checkbox>
</
template
>
</td>
<td>
<UeEditor
v-model=
"subItem.Content"
:config=
"config"
></UeEditor>
</td>
<td>
<a
style=
"cursor:pointer;"
@
click=
"deleteOpion(item,subIndex)"
>
删除
</a>
</td>
</tr>
</template>
<!--填空题-->
<
template
v-if=
"item.QuestionKey=='fill-in'"
>
<tr
v-for=
"(subItem,subIndex) in item.SubAnwser"
>
<td>
第
{{
subIndex
+
1
}}
空
</td>
<td>
<UeEditor
v-model=
"subItem.Content"
:config=
"config"
></UeEditor>
</td>
<td>
<a
style=
"cursor:pointer;"
@
click=
"deleteOpion(item,subIndex)"
>
删除
</a>
</td>
</tr>
</
template
>
<!--判断题-->
<
template
v-if=
"item.QuestionKey=='judge'"
>
<tr
v-for=
"(subItem,subIndex) in item.SubAnwser"
>
<td>
<el-checkbox
v-model=
"subItem.IsAnswer"
@
change=
"ChangeItem(item,subItem)"
>
{{
subItem
.
Name
}}
</el-checkbox>
</td>
<td
colspan=
"2"
style=
"text-align:left;"
>
{{
subItem
.
Content
}}
</td>
</tr>
</
template
>
<!--简答题-->
<
template
v-if=
"item.QuestionKey=='short-answer'"
>
<tr
v-for=
"(subItem,subIndex) in item.SubAnwser"
>
<td
colspan=
"3"
>
<UeEditor
v-model=
"subItem.Content"
:config=
"config"
></UeEditor>
</td>
</tr>
</
template
>
</tbody>
<tfoot>
<tr>
<td
colspan=
"3"
>
<!--选择题-->
<
template
v-if=
"item.QuestionKey=='single' ||item.QuestionKey=='multiple'"
>
<a
style=
"cursor:pointer;"
@
click=
"addOption(item)"
>
添加选项
</a>
</
template
>
<!--填空题-->
<
template
v-if=
"item.QuestionKey=='fill-in'"
>
<a
style=
"cursor:pointer;"
@
click=
"addFillIn(item)"
>
添加更多
</a>
</
template
>
<a
style=
"cursor:pointer;"
@
click=
"deleteQuestion(index)"
>
删除问题
</a>
</td>
</tr>
</tfoot>
</table>
</template>
<br
/>
<q-btn-dropdown
color=
"primary"
label=
"添加小题"
style=
"margin-left:5px;"
>
...
...
@@ -34,6 +110,7 @@
import
{
getOptionList
,
//获取选择标签【A,B,C,D....】
optionListConfig
,
CreateQuestion
}
from
'../../api/question/questionconfig'
import
{
queryQuestionTypeList
,
...
...
@@ -62,7 +139,6 @@
created
()
{
this
.
initConfig
();
this
.
getQuestionType
();
console
.
log
(
"questionData"
,
this
.
questionData
);
},
methods
:
{
//获取题型列表
...
...
@@ -79,6 +155,10 @@
initConfig
()
{
this
.
optionTitleList
=
getOptionList
();
},
//删除小题
deleteQuestion
(
index
)
{
this
.
data
.
splice
(
index
,
1
);
},
//添加小题
onItemClick
(
item
)
{
var
qObj
=
{
...
...
@@ -88,7 +168,14 @@
SubTitle
:
""
,
//题目内容
SubAnwser
:
""
};
qObj
.
SubAnwser
=
CreateQuestion
(
item
.
Key
);
if
(
item
.
Key
==
"short-answer"
)
{
qObj
.
SubAnwser
=
[];
qObj
.
SubAnwser
.
push
({
Content
:
""
})
}
else
{
qObj
.
SubAnwser
=
CreateQuestion
(
item
.
Key
);
}
this
.
data
.
push
(
qObj
);
},
//删除选项
...
...
@@ -104,7 +191,7 @@
Content
:
""
,
IsAnswer
:
false
});
this
.
calcOptionTitle
()
this
.
calcOptionTitle
()
;
}
else
{
this
.
$q
.
notify
({
type
:
'warning'
,
...
...
@@ -115,6 +202,12 @@
return
}
},
//添加填空
addFillIn
(
item
)
{
item
.
SubAnwser
.
push
({
Content
:
""
,
});
},
//添加小题
addQuestion
()
{
this
.
data
.
push
(
optionListConfig
());
...
...
@@ -124,7 +217,7 @@
if
(
this
.
data
&&
this
.
data
.
length
>
0
)
{
this
.
data
.
forEach
((
item
,
index
)
=>
{
if
(
item
.
QuestionKey
==
"single"
||
item
.
QuestionKey
==
"multiple"
)
item
.
forEach
((
subItem
,
subIndex
)
=>
{
item
.
SubAnwser
.
forEach
((
subItem
,
subIndex
)
=>
{
subItem
.
Name
=
this
.
optionTitleList
[
subIndex
];
})
})
...
...
@@ -134,9 +227,10 @@
returnDataToParent
()
{
this
.
$emit
(
'getChild'
,
this
.
data
);
},
//单选
ChangeItem
(
item
,
subItem
)
{
if
(
item
&&
item
.
length
>
0
)
{
item
.
forEach
(
childItem
=>
{
if
(
item
.
SubAnwser
&&
item
.
SubAnwser
.
length
>
0
)
{
item
.
SubAnwser
.
forEach
(
childItem
=>
{
childItem
.
IsAnswer
=
false
;
})
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment