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
c0679509
Commit
c0679509
authored
Jan 06, 2021
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增插件
parent
ed023699
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
134 additions
and
11 deletions
+134
-11
questionconfig.js
src/api/question/questionconfig.js
+33
-6
question-form.vue
src/components/question/question-form.vue
+5
-0
matching.vue
src/components/questiontype/matching.vue
+9
-5
sorting-problem.vue
src/components/questiontype/sorting-problem.vue
+87
-0
No files found.
src/api/question/questionconfig.js
View file @
c0679509
...
...
@@ -76,12 +76,39 @@ export function CreateQuestion(questionKey) {
break
;
//连线题
case
"matching"
:
var
array1
=
[{
Name
:
"1"
,
Content
:
""
}];
var
array2
=
[{
Name
:
"A"
,
Content
:
""
}];
var
array3
=
[{
Name
:
"1"
,
Content
:
"A"
}];
AnswerList
.
push
(
array1
);
AnswerList
.
push
(
array2
);
AnswerList
.
push
(
array3
);
var
array1
=
[{
Name
:
"1"
,
Content
:
""
}];
var
array2
=
[{
Name
:
"A"
,
Content
:
""
}];
var
array3
=
[{
Name
:
"1"
,
Content
:
"A"
}];
AnswerList
.
push
(
array1
);
AnswerList
.
push
(
array2
);
AnswerList
.
push
(
array3
);
break
;
//排序题
case
"sorting-problem"
:
var
tempArray
=
[{
Name
:
"A"
,
Content
:
""
},
{
Name
:
"B"
,
Content
:
""
},
{
Name
:
"C"
,
Content
:
""
},
{
Name
:
"D"
,
Content
:
""
}];
AnswerList
.
push
(
tempArray
);
break
;
}
return
AnswerList
;
...
...
src/components/question/question-form.vue
View file @
c0679509
...
...
@@ -51,6 +51,9 @@
</entry-problem>
<!--连线题-->
<matching
v-if=
"questionObj.Key=='matching'"
:questionData=
"AnswerList"
@
getChild=
"getChildData"
></matching>
<!--排序题-->
<sorting-problem
v-if=
"questionObj.Key=='sorting-problem '"
:questionData=
"AnswerList"
@
getChild=
"getChildData"
></sorting-problem>
<br
/>
<div
class=
"col-12"
>
答案解析
<UeEditor
v-model=
"objOption.AnswerParse"
:config=
"config"
ref=
"AnswerParse"
></UeEditor>
...
...
@@ -107,6 +110,7 @@
import
shortAnswer
from
'../questiontype/short-answer'
import
entryProblem
from
'../questiontype/entry-problem'
import
matching
from
'../questiontype/matching'
import
sortingProblem
from
'../questiontype/sorting-problem'
export
default
{
components
:
{
UeEditor
,
...
...
@@ -118,6 +122,7 @@
shortAnswer
,
//简答题
entryProblem
,
//分录题
matching
,
//连线题
sortingProblem
,
//排序题
},
props
:
{
setingObj
:
{
...
...
src/components/questiontype/matching.vue
View file @
c0679509
...
...
@@ -56,11 +56,12 @@
-----
</td>
<td>
{{
data
[
1
]
}}
<el-select
v-model=
"item.Content"
>
<el-option
v-for=
"(cItem,cIndex) in data[1]"
:key=
"cIndex"
:label=
"cItem.Name"
:value=
"cItem.Name"
>
</el-option>
</el-select>
<select
v-model=
"item.Content"
>
<template
v-for=
"(cItem,cIndex) in data[1]"
>
<option
:key=
"cIndex"
:label=
"cItem.Name"
:value=
"cItem.Name"
>
</option>
</
template
>
</select>
</td>
</tr>
</table>
...
...
@@ -89,6 +90,9 @@
},
optionTitleList
:
[],
};
},
computed
:
{
},
created
()
{
this
.
initConfig
();
...
...
src/components/questiontype/sorting-problem.vue
0 → 100644
View file @
c0679509
<!--排序题-->
<
style
>
</
style
>
<
template
>
<div
class=
"sortingProblemQuestion"
>
<table
v-if=
"data&&data.length>0"
>
<tr
v-for=
"(item,index) in data"
>
<td>
第
{{
index
+
1
}}
空
</el-checkbox>
</td>
<td>
<UeEditor
v-model=
"item.Content"
:config=
"config"
></UeEditor>
</td>
<td>
<a
style=
"cursor:pointer;"
@
click=
"deleteOpion(index)"
>
删除
</a>
</td>
</tr>
<tfoot>
<tr>
<td
colspan=
"3"
>
<a
style=
"cursor:pointer;"
@
click=
"addOption()"
>
添加选项
</a>
</td>
</tr>
<tr>
<td
colspan=
"3"
>
1. 一个空有多种答案时请用";"隔开。如:水;H2O
<br
/>
2. 若试题答案是数字,可设置范围,两个数字之间用"-"。如:1-9,学生填写1到9之间的数字都算正确(包括1和9)
</td>
</tr>
</tfoot>
</table>
</div>
</
template
>
<
script
>
import
UeEditor
from
'../editor/UeEditor'
export
default
{
props
:
{
questionData
:
{
type
:
Array
,
},
},
components
:
{
UeEditor
},
data
()
{
return
{
data
:
this
.
questionData
,
config
:
{
initialFrameWidth
:
null
,
initialFrameHeight
:
80
,
},
};
},
created
()
{},
methods
:
{
//删除选项
deleteOpion
(
index
)
{
this
.
data
.
splice
(
index
,
1
);
this
.
calcOptionTitle
();
},
//新增选项
addOption
()
{
this
.
data
.
push
({
Content
:
""
,
});
},
//返回数据到父组件
returnDataToParent
()
{
this
.
$emit
(
'getChild'
,
this
.
data
);
},
},
mounted
()
{
},
watch
:
{
data
:
{
handler
(
newValue
)
{
this
.
returnDataToParent
();
},
deep
:
true
},
}
};
</
script
>
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