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
e08906d4
Commit
e08906d4
authored
Apr 06, 2021
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
534f7a8c
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
1625 additions
and
49 deletions
+1625
-49
questionlist-form.vue
src/components/question/questionlist-form.vue
+1
-1
v-entryproblem.vue
src/components/questiontype/v-entryproblem.vue
+135
-0
v-fillin.vue
src/components/questiontype/v-fillin.vue
+126
-0
v-judge.vue
src/components/questiontype/v-judge.vue
+89
-0
v-matching.vue
src/components/questiontype/v-matching.vue
+258
-0
v-multiple.vue
src/components/questiontype/v-multiple.vue
+148
-0
v-readingcomprehensio.vue
src/components/questiontype/v-readingcomprehensio.vue
+355
-0
v-sharingchoose.vue
src/components/questiontype/v-sharingchoose.vue
+225
-0
v-shortanswer.vue
src/components/questiontype/v-shortanswer.vue
+46
-0
v-sortingproblem.vue
src/components/questiontype/v-sortingproblem.vue
+200
-0
questionInfo.vue
src/pages/course/questionInfo.vue
+42
-48
No files found.
src/components/question/questionlist-form.vue
View file @
e08906d4
...
@@ -90,7 +90,7 @@
...
@@ -90,7 +90,7 @@
</div>
</div>
</
template
>
</
template
>
<
template
v-slot:body-cell-Title=
"props"
>
<
template
v-slot:body-cell-Title=
"props"
>
<td
style=
"width:400px;"
>
<td
style=
"width:400px;
cursor:pointer;
"
>
<div
@
click=
"goDetail(props.row)"
v-html=
"props.row.Title"
class=
"quetion_Title"
>
<div
@
click=
"goDetail(props.row)"
v-html=
"props.row.Title"
class=
"quetion_Title"
>
</div>
</div>
</td>
</td>
...
...
src/components/questiontype/v-entryproblem.vue
0 → 100644
View file @
e08906d4
<!--分录题-->
<
style
>
.entryProblemQuestion
{
width
:
100%
;
}
.entrytk_info
{
color
:
#A8A8B3
;
font-size
:
12px
;
line-height
:
24px
;
cursor
:
default
;
}
</
style
>
<
template
>
<div
class=
"entryProblemQuestion"
>
<table
v-if=
"data&&data.length>0"
class=
"common_TiTable"
>
<tr
v-for=
"(item,index) in data"
>
<td
style=
"width:40px;text-align:center;padding-top:8px;"
>
第
{{
index
+
1
}}
空
</el-checkbox>
</td>
<td>
<div
class=
"InpDIV"
v-html=
"item.Content"
v-if=
"commonIndex!=index"
@
click=
"changeEdit(index)"
></div>
<UeEditor
v-model=
"item.Content"
:config=
"config"
v-else
></UeEditor>
</td>
<td
style=
"width:40px;text-align:center;"
>
<i
class=
"iconfont icon-guanbi Tiku_DelIcon"
@
click=
"deleteOpion(index)"
></i>
</td>
</tr>
</table>
<br
/>
<a
class=
"addTiMuList"
@
click=
"addOption()"
>
<i
class=
"iconfont icon-add"
></i>
添加更多
</a>
<br
/>
<br
/>
<el-checkbox
v-model=
"setOption.IsMutex"
:true-label=
"1"
:false-label=
"0"
><span
style=
"font-size:12px;"
>
答案顺序打乱也判正确
</span></el-checkbox>
<br
/>
<br
/>
<div
class=
"entrytk_info"
>
1. 一个空有多种答案时请用";"隔开。如:水;H2O
<br
/>
2. 若试题答案是数字,可设置范围,两个数字之间用"-"。如:1-9,学生填写1到9之间的数字都算正确(包括1和9)
</div>
</div>
</
template
>
<
script
>
import
UeEditor
from
'../editor/UeEditor'
export
default
{
props
:
{
questionData
:
{
type
:
Array
,
},
setOption
:
{
type
:
Object
,
}
},
components
:
{
UeEditor
},
data
()
{
return
{
data
:
this
.
questionData
,
config
:
{
initialFrameWidth
:
null
,
initialFrameHeight
:
80
,
},
commonIndex
:
-
1
,
};
},
created
()
{},
methods
:
{
//删除选项
deleteOpion
(
index
)
{
this
.
$q
.
dialog
({
title
:
"删除小题"
,
message
:
"确实要删除该选项吗?"
,
persistent
:
true
,
cancel
:
{
label
:
"取消"
,
flat
:
true
},
ok
:
{
label
:
"确认"
,
flat
:
true
,
focus
:
true
}
}).
onOk
(()
=>
{
this
.
data
.
splice
(
index
,
1
);
this
.
commonIndex
=
-
1
;
});
},
//新增选项
addOption
()
{
this
.
data
.
push
({
Content
:
""
,
});
},
//获取答案
getAnswer
()
{
if
(
this
.
data
&&
this
.
data
.
length
>
0
)
{
var
answer
=
""
;
this
.
data
.
forEach
(
item
=>
{
answer
+=
"★"
+
item
.
Content
;
})
if
(
answer
!=
""
)
{
answer
=
answer
.
substring
(
1
);
}
this
.
setOption
.
Answer
=
answer
;
}
},
//返回数据到父组件
returnDataToParent
()
{
this
.
getAnswer
();
this
.
$emit
(
'getChild'
,
this
.
data
);
},
changeEdit
(
index
)
{
this
.
commonIndex
=
index
;
}
},
mounted
()
{
},
watch
:
{
data
:
{
handler
(
newValue
)
{
this
.
returnDataToParent
();
},
deep
:
true
},
}
};
</
script
>
src/components/questiontype/v-fillin.vue
0 → 100644
View file @
e08906d4
<!--填空题-->
<
style
>
.fillInQuestion
{
width
:
100%
;
}
.tk_info
{
color
:
#A8A8B3
;
font-size
:
12px
;
line-height
:
24px
;
cursor
:
default
;
margin-top
:
20px
;
}
</
style
>
<
template
>
<div
class=
"fillInQuestion"
>
<table
v-if=
"data&&data.length>0"
class=
"common_TiTable"
>
<tr
v-for=
"(item,index) in data"
>
<td
style=
"width:50px;text-align:center;padding-top:8px;"
>
第
{{
index
+
1
}}
空
</el-checkbox>
</td>
<td>
<div
class=
"InpDIV"
v-html=
"item.Content"
v-if=
"commonIndex!=index"
@
click=
"changeEdit(index)"
></div>
<UeEditor
v-model=
"item.Content"
:config=
"config"
v-else
></UeEditor>
</td>
<td
style=
"width:30px;text-align:center;"
>
<i
class=
"iconfont icon-guanbi Tiku_DelIcon"
@
click=
"deleteOpion(index)"
></i>
</td>
</tr>
</table>
<a
class=
"addTiMuList"
@
click=
"addOption()"
>
<i
class=
"iconfont icon-add"
></i>
添加更多
</a>
<br
/>
<br
/>
<el-checkbox
v-model=
"setOption.IsMutex"
:true-label=
"1"
:false-label=
"0"
><span
style=
"font-size:12px;"
>
答案顺序打乱也判正确
</span></el-checkbox>
<br
/>
<div
class=
"tk_info"
>
1. 一个空有多种答案时请用";"隔开。如:水;H2O
</br>
2. 若试题答案是数字,可设置范围,两个数字之间用"-"。如:1-9,学生填写1到9之间的数字都算正确(包括1和9)
</div>
</div>
</
template
>
<
script
>
import
UeEditor
from
'../editor/UeEditor'
export
default
{
props
:
{
questionData
:
{
type
:
Array
,
},
setOption
:
{
type
:
Object
,
}
},
components
:
{
UeEditor
},
data
()
{
return
{
data
:
this
.
questionData
,
config
:
{
initialFrameWidth
:
null
,
initialFrameHeight
:
80
,
},
commonIndex
:
-
1
,
};
},
created
()
{},
methods
:
{
//删除选项
deleteOpion
(
index
)
{
this
.
$q
.
dialog
({
title
:
'提示信息'
,
message
:
'是否确定删除?'
,
cancel
:
true
,
persistent
:
true
,
ok
:
"确定"
,
cancel
:
"取消"
,
}).
onOk
(()
=>
{
this
.
data
.
splice
(
index
,
1
);
}).
onCancel
(()
=>
{
});
},
//新增选项
addOption
()
{
this
.
data
.
push
({
Content
:
""
,
});
},
//返回数据到父组件
returnDataToParent
()
{
if
(
this
.
data
&&
this
.
data
.
length
>
0
)
{
var
answer
=
""
;
this
.
data
.
forEach
(
item
=>
{
answer
+=
"★"
+
item
.
Content
;
})
if
(
answer
!=
""
)
{
answer
=
answer
.
substring
(
1
);
}
this
.
setOption
.
Answer
=
answer
;
}
this
.
$emit
(
'getChild'
,
this
.
data
);
},
//点击切换输入
changeEdit
(
index
)
{
this
.
commonIndex
=
index
;
}
},
mounted
()
{
},
watch
:
{
data
:
{
handler
(
newValue
)
{
this
.
returnDataToParent
();
},
deep
:
true
},
}
};
</
script
>
src/components/questiontype/v-judge.vue
0 → 100644
View file @
e08906d4
<!--判断题-->
<
style
>
.judgeQuestion
{
width
:
100%
;
}
</
style
>
<
template
>
<div
class=
"judgeQuestion"
>
<table
v-if=
"data&&data.length>0"
class=
"common_TiTable"
>
<tr
v-for=
"(item,index) in data"
>
<td
style=
"width:50px;text-align:center;"
>
<div
class=
"Answer_List"
@
click=
"ChangeItem(item)"
:class=
"
{'Is_Answer':item.IsAnswer}">
{{
item
.
Name
}}
</div>
</td>
<td
style=
"vertical-align:middle;"
>
<span
v-if=
"index==0"
>
对
</span>
<span
v-if=
"index==1"
>
错
</span>
</td>
</tr>
</table>
</div>
</
template
>
<
script
>
import
UeEditor
from
'../editor/UeEditor'
export
default
{
props
:
{
questionData
:
{
type
:
Array
,
},
setOption
:
{
type
:
Object
,
}
},
components
:
{
UeEditor
},
data
()
{
return
{
data
:
this
.
questionData
,
config
:
{
initialFrameWidth
:
null
,
initialFrameHeight
:
80
,
},
};
},
created
()
{},
methods
:
{
//返回数据到父组件
returnDataToParent
()
{
this
.
getAnswer
();
this
.
$emit
(
'getChild'
,
this
.
data
);
},
ChangeItem
(
item
)
{
if
(
this
.
data
&&
this
.
data
.
length
>
0
)
{
this
.
data
.
forEach
(
item
=>
{
item
.
IsAnswer
=
false
;
})
}
item
.
IsAnswer
=
true
;
this
.
getAnswer
();
},
//获取正确答案
getAnswer
()
{
this
.
setOption
.
Answer
=
""
;
if
(
this
.
data
&&
this
.
data
.
length
>
0
)
{
this
.
data
.
forEach
(
item
=>
{
if
(
item
.
IsAnswer
)
{
this
.
setOption
.
Answer
=
item
.
Name
;
}
})
}
},
},
mounted
()
{
},
watch
:
{
data
:
{
handler
(
newValue
)
{
this
.
returnDataToParent
();
},
deep
:
true
},
}
};
</
script
>
src/components/questiontype/v-matching.vue
0 → 100644
View file @
e08906d4
<!--连线题-->
<
style
>
.matchingQuestion
{
width
:
100%
;
}
.team_tit
{
display
:
inline-block
;
font-size
:
14px
;
color
:
#A8A8B3
;
padding-bottom
:
20px
;
margin-left
:
13px
;
}
.line_center
{
display
:
inline-block
;
width
:
28px
;
height
:
10px
;
border-top
:
1px
solid
#E1E1E5
;
margin
:
13px
12px
0
0
;
}
.selectBox2
{
display
:
inline-block
;
vertical-align
:
top
;
text-align
:
left
;
position
:
relative
;
cursor
:
pointer
;
width
:
58px
;
line-height
:
24px
;
height
:
24px
;
background
:
#FFFFFF
;
border
:
1px
solid
#E1E1E5
;
border-radius
:
4px
;
font-size
:
12px
;
color
:
#181E33
;
outline
:
none
;
}
</
style
>
<
template
>
<div
class=
"matchingQuestion"
>
<span
class=
"team_tit"
style=
"margin-top:20px;padding-bottom:0;"
>
第1组:
</span>
<table
v-if=
"data&&data.length>0"
class=
"common_TiTable"
>
<tr
v-for=
"(item,index) in data[0]"
>
<td
style=
"width:40px;text-align:center;padding-top:10px;"
>
{{
item
.
Name
}}
</td>
<td>
<div
class=
"InpDIV"
v-html=
"item.Content"
v-if=
"commonIndex!=index"
@
click=
"changeEdit(index)"
></div>
<UeEditor
v-model=
"item.Content"
:config=
"config"
v-else
></UeEditor>
</td>
<td
style=
"width:40px;text-align:center;"
>
<i
class=
"iconfont icon-guanbi Tiku_DelIcon"
@
click=
"deleteOpion(0,index)"
></i>
</td>
</tr>
<tfoot>
<tr>
<td
colspan=
"3"
>
<a
class=
"addTiMuList"
style=
"margin-left:13px;"
@
click=
"addOption(0)"
>
<i
class=
"iconfont icon-add"
></i>
添加更多
</a>
</td>
</tr>
</tfoot>
</table>
<span
class=
"team_tit"
>
第2组:
</span>
<table
v-if=
"data&&data.length>1"
class=
"common_TiTable"
>
<tr
v-for=
"(item,index) in data[1]"
>
<td
style=
"width:40px;text-align:center;padding-top:10px;"
>
{{
item
.
Name
}}
</td>
<td>
<div
class=
"InpDIV"
v-html=
"item.Content"
v-if=
"commonIndex2!=index"
@
click=
"changeEdit2(index)"
></div>
<UeEditor
v-model=
"item.Content"
:config=
"config"
v-else
></UeEditor>
</td>
<td
style=
"width:40px;text-align:center;"
>
<i
class=
"iconfont icon-guanbi Tiku_DelIcon"
@
click=
"deleteOpion(1,index)"
></i>
</td>
</tr>
<tfoot>
<tr>
<td
colspan=
"3"
>
<a
class=
"addTiMuList"
style=
"margin-left:13px;"
@
click=
"addOption(1)"
>
<i
class=
"iconfont icon-add"
></i>
添加更多
</a>
</td>
</tr>
</tfoot>
</table>
<span
class=
"team_tit"
>
答案
</span>
<table
v-if=
"data&&data.length>2"
style=
"padding-left:13px;"
>
<tr
v-for=
"(item,index) in data[0]"
>
<td
style=
"width:30px;"
>
{{
item
.
Name
}}
</td>
<td>
<span
class=
"line_center"
></span>
</td>
<td>
<select
v-model=
"data[2][index].Content"
class=
"selectBox2"
>
<template
v-for=
"(cItem,cIndex) in data[1]"
>
<option
:key=
"cIndex"
:label=
"cItem.Name"
:value=
"cItem.Name"
>
</option>
</
template
>
</select>
</td>
</tr>
</table>
</div>
</template>
<
script
>
import
{
getOptionList
,
//获取选择标签【A,B,C,D....】
}
from
'../../api/question/questionconfig'
import
UeEditor
from
'../editor/UeEditor'
export
default
{
props
:
{
questionData
:
{
type
:
Array
,
},
setOption
:
{
type
:
Object
,
}
},
components
:
{
UeEditor
},
data
()
{
return
{
data
:
this
.
questionData
,
config
:
{
initialFrameWidth
:
null
,
initialFrameHeight
:
80
,
},
optionTitleList
:
[],
commonIndex
:
-
1
,
commonIndex2
:
-
1
};
},
computed
:
{
},
created
()
{
this
.
initConfig
();
},
methods
:
{
initConfig
()
{
this
.
optionTitleList
=
getOptionList
();
},
//删除选项
deleteOpion
(
index
,
subIndex
)
{
this
.
$q
.
dialog
({
title
:
'提示信息'
,
message
:
'是否确定删除?'
,
cancel
:
true
,
persistent
:
true
,
ok
:
"确定"
,
cancel
:
"取消"
,
}).
onOk
(()
=>
{
//删除第一组是,也删除答案里面的
if
(
index
==
0
)
{
this
.
data
[
2
].
splice
(
subIndex
,
1
);
}
this
.
data
[
index
].
splice
(
subIndex
,
1
);
//删除的第二组
if
(
index
==
1
)
{
var
temp1
=
this
.
data
[
1
];
this
.
data
[
2
].
forEach
(
item
=>
{
var
isExists
=
false
;
if
(
temp1
&&
temp1
.
length
>
0
)
{
temp1
.
forEach
(
subItem
=>
{
if
(
subItem
.
Name
==
item
.
Content
)
{
isExists
=
true
;
}
})
}
if
(
!
isExists
)
{
item
.
Content
=
""
;
}
})
}
this
.
commonIndex
=
-
1
;
this
.
commonIndex2
=
-
1
;
this
.
calcOptionTitle
();
}).
onCancel
(()
=>
{
});
},
//新增选项
addOption
(
index
)
{
if
(
index
==
0
)
{
this
.
data
[
2
].
push
({
Name
:
""
,
Content
:
"A"
,
});
}
this
.
data
[
index
].
push
({
Name
:
""
,
Content
:
""
,
});
this
.
calcOptionTitle
();
},
//重新计算选择Title[A,B,C,D....]
calcOptionTitle
()
{
if
(
this
.
data
&&
this
.
data
.
length
>
0
)
{
this
.
data
.
forEach
((
item
,
index
)
=>
{
item
.
forEach
((
subItem
,
subIndex
)
=>
{
if
(
index
==
0
||
index
==
2
)
{
subItem
.
Name
=
subIndex
+
1
;
}
else
if
(
index
==
1
)
{
subItem
.
Name
=
this
.
optionTitleList
[
subIndex
];
}
})
})
}
},
//返回数据到父组件
returnDataToParent
()
{
this
.
getAnswer
();
this
.
$emit
(
'getChild'
,
this
.
data
);
},
//获取正确答案
getAnswer
()
{
this
.
setOption
.
Answer
=
""
;
if
(
this
.
data
&&
this
.
data
.
length
>
0
)
{
var
answer
=
""
;
this
.
data
[
2
].
forEach
(
item
=>
{
answer
+=
","
+
item
.
Content
;
})
if
(
answer
!=
""
)
{
answer
=
answer
.
substring
(
1
);
}
this
.
setOption
.
Answer
=
answer
;
}
},
//点击切换输入
changeEdit
(
index
)
{
this
.
commonIndex
=
index
;
this
.
commonIndex2
=
-
1
;
},
changeEdit2
(
index
)
{
this
.
commonIndex2
=
index
;
this
.
commonIndex
=
-
1
;
}
},
mounted
()
{},
watch
:
{
data
:
{
handler
(
newValue
)
{
this
.
returnDataToParent
();
},
deep
:
true
},
}
};
</
script
>
src/components/questiontype/v-multiple.vue
0 → 100644
View file @
e08906d4
<!--多选题-->
<
style
>
.multipleQuestion
{
width
:
100%
;
}
</
style
>
<
template
>
<div
class=
"multipleQuestion"
>
<table
v-if=
"data&&data.length>0"
class=
"common_TiTable"
>
<tr
v-for=
"(item,index) in data"
>
<td
style=
"width:40px;text-align:center;"
>
<div
class=
"num_option_dx"
@
click=
"ChangeItem(item)"
:class=
"
{'Is_Answer':item.IsAnswer}">
{{
item
.
Name
}}
</div>
</td>
<td>
<div
class=
"InpDIV"
v-html=
"item.Content"
v-if=
"commonIndex!=index"
@
click=
"changeEdit(index)"
></div>
<UeEditor
v-model=
"item.Content"
:config=
"config"
v-else
></UeEditor>
</td>
<td
style=
"width:40px;text-align:center;"
>
<i
class=
"iconfont icon-guanbi Tiku_DelIcon"
@
click=
"deleteOpion(index)"
></i>
</td>
</tr>
</table>
<a
class=
"addTiMuList"
@
click=
"addOption()"
>
<i
class=
"iconfont icon-add"
></i>
添加选项
</a>
</div>
</
template
>
<
script
>
import
{
getOptionList
,
//获取选择标签【A,B,C,D....】
}
from
'../../api/question/questionconfig'
import
UeEditor
from
'../editor/UeEditor'
export
default
{
props
:
{
questionData
:
{
type
:
Array
,
},
setOption
:
{
type
:
Object
,
}
},
components
:
{
UeEditor
},
data
()
{
return
{
data
:
this
.
questionData
,
config
:
{
initialFrameWidth
:
null
,
initialFrameHeight
:
80
,
},
optionTitleList
:
[],
commonIndex
:
-
1
,
};
},
created
()
{
this
.
initConfig
();
},
methods
:
{
initConfig
()
{
this
.
optionTitleList
=
getOptionList
();
},
//删除选项
deleteOpion
(
index
)
{
this
.
$q
.
dialog
({
title
:
'提示信息'
,
message
:
'是否确定删除?'
,
cancel
:
true
,
persistent
:
true
,
ok
:
"确定"
,
cancel
:
"取消"
,
}).
onOk
(()
=>
{
this
.
data
.
splice
(
index
,
1
);
this
.
commonIndex
=
-
1
;
this
.
calcOptionTitle
();
}).
onCancel
(()
=>
{
});
},
//新增选项
addOption
()
{
if
(
this
.
data
.
length
<
7
)
{
this
.
data
.
push
({
Name
:
""
,
Content
:
""
,
IsAnswer
:
false
});
this
.
calcOptionTitle
()
}
else
{
this
.
$q
.
notify
({
type
:
'warning'
,
position
:
'center'
,
timeout
:
1500
,
message
:
`最多只能添加7个选项`
})
return
}
},
//重新计算选择Title[A,B,C,D....]
calcOptionTitle
()
{
if
(
this
.
data
&&
this
.
data
.
length
>
0
)
{
this
.
data
.
forEach
((
item
,
index
)
=>
{
item
.
Name
=
this
.
optionTitleList
[
index
];
})
}
},
//返回数据到父组件
returnDataToParent
()
{
if
(
this
.
data
&&
this
.
data
.
length
>
0
)
{
var
answer
=
""
;
this
.
data
.
forEach
(
item
=>
{
if
(
item
.
IsAnswer
)
{
answer
+=
","
+
item
.
Name
;
}
})
if
(
answer
!=
""
)
{
answer
=
answer
.
substring
(
1
);
}
this
.
setOption
.
Answer
=
answer
;
}
this
.
$emit
(
'getChild'
,
this
.
data
);
},
//点击设为答案
ChangeItem
(
item
)
{
item
.
IsAnswer
=
!
item
.
IsAnswer
;
},
//点击切换输入
changeEdit
(
index
)
{
this
.
commonIndex
=
index
;
}
},
mounted
()
{
},
watch
:
{
data
:
{
handler
(
newValue
)
{
this
.
returnDataToParent
();
},
deep
:
true
},
}
};
</
script
>
src/components/questiontype/v-readingcomprehensio.vue
0 → 100644
View file @
e08906d4
This diff is collapsed.
Click to expand it.
src/components/questiontype/v-sharingchoose.vue
0 → 100644
View file @
e08906d4
<!--共用选择题-->
<
style
>
.sharingChooseQuestion
{
width
:
100%
;
}
.B-info
{
font-size
:
14
PX
;
color
:
#A8A8B3
;
padding-bottom
:
10px
;
margin-left
:
13px
;
}
</
style
>
<
template
>
<div
class=
"sharingChooseQuestion"
>
<table
v-if=
"data&&data.length>0"
class=
"common_TiTable"
>
<tr
v-for=
"(item,index) in data[0]"
>
<td
style=
"width:40px;text-align:center;padding-top:8px;"
>
{{
item
.
Name
}}
</td>
<td>
<div
class=
"InpDIV"
v-html=
"item.Content"
v-if=
"commonIndex!=index"
@
click=
"changeEdit(index)"
></div>
<UeEditor
v-model=
"item.Content"
:config=
"config"
v-else
></UeEditor>
</td>
<td
style=
"width:40px;text-align:center;"
>
<i
v-if=
"index>0"
class=
"iconfont icon-guanbi Tiku_DelIcon"
@
click=
"deleteOpion(index)"
></i>
</td>
</tr>
<tfoot>
<tr>
<td
colspan=
"3"
>
<a
class=
"addTiMuList"
style=
"margin-left:13px;"
@
click=
"addOption()"
>
<i
class=
"iconfont icon-add"
></i>
添加选项
</a>
</td>
</tr>
</tfoot>
</table>
<table
v-if=
"data&&data.length>0"
class=
"common_TiTable"
>
<tr
v-for=
"(item,index) in data[1]"
>
<td
style=
"width:40px;text-align:center;padding-top:8px;"
>
{{
index
+
1
}}
</td>
<td>
<div
class=
"InpDIV"
v-html=
"item.Content"
v-if=
"commonIndex2!=index"
@
click=
"changeEdit2(index)"
></div>
<UeEditor
v-model=
"item.Content"
:config=
"config"
v-else
></UeEditor>
</td>
<td
style=
"width:40px;text-align:center;"
>
<i
v-if=
"index>0"
class=
"iconfont icon-guanbi Tiku_DelIcon"
@
click=
"deleteQuestion(index)"
></i>
</td>
</tr>
<tfoot>
<tr>
<td
colspan=
"3"
>
<a
class=
"addTiMuList"
style=
"margin-left:13px;"
@
click=
"addQuestion()"
>
<i
class=
"iconfont icon-add"
></i>
添加题干
</a>
</td>
</tr>
</tfoot>
</table>
<div
class=
"B-info"
>
答案:
</div>
<table
v-if=
"data&&data.length>0"
style=
"margin-bottom:20px;"
>
<tr
v-for=
"(item,index) in data[1]"
>
<td
style=
"padding:12px 0 0 13px;"
>
{{
index
+
1
}}
</td>
<td>
<select
v-model=
"item.Name"
class=
"selectBox"
style=
"margin:10px 0 0 0;outline:none;"
>
<template
v-for=
"(cItem,cIndex) in data[0]"
>
<option
:key=
"cIndex"
:label=
"cItem.Name"
:value=
"cItem.Name"
>
</option>
</
template
>
</select>
</td>
</tr>
</table>
</div>
</template>
<
script
>
import
{
getOptionList
,
//获取选择标签【A,B,C,D....】
}
from
'../../api/question/questionconfig'
import
UeEditor
from
'../editor/UeEditor'
export
default
{
props
:
{
questionData
:
{
type
:
Array
,
},
setOption
:
{
type
:
Object
}
},
components
:
{
UeEditor
},
data
()
{
return
{
data
:
this
.
questionData
,
config
:
{
initialFrameWidth
:
null
,
initialFrameHeight
:
80
,
},
optionTitleList
:
[],
commonIndex
:
-
1
,
commonIndex2
:
-
2
};
},
created
()
{
this
.
initConfig
();
},
methods
:
{
initConfig
()
{
this
.
optionTitleList
=
getOptionList
();
},
//删除选项
deleteOpion
(
index
)
{
this
.
$q
.
dialog
({
title
:
'提示信息'
,
message
:
'是否确定删除?'
,
cancel
:
true
,
persistent
:
true
,
ok
:
"确定"
,
cancel
:
"取消"
,
}).
onOk
(()
=>
{
this
.
data
[
0
].
splice
(
index
,
1
);
this
.
commonIndex
=
-
1
;
this
.
calcOptionTitle
();
}).
onCancel
(()
=>
{
});
},
//新增选项
addOption
()
{
if
(
this
.
data
.
length
<
26
)
{
this
.
data
[
0
].
push
({
Name
:
""
,
Content
:
""
,
});
this
.
calcOptionTitle
();
}
else
{
this
.
$q
.
notify
({
type
:
'warning'
,
position
:
'center'
,
timeout
:
1500
,
message
:
`最多只能添加26个选项`
})
return
}
},
//删除题干
deleteQuestion
(
index
)
{
this
.
$q
.
dialog
({
title
:
'提示信息'
,
message
:
'是否确定删除?'
,
cancel
:
true
,
persistent
:
true
,
ok
:
"确定"
,
cancel
:
"取消"
,
}).
onOk
(()
=>
{
this
.
data
[
1
].
splice
(
index
,
1
);
this
.
commonIndex2
=
-
1
;
this
.
calcOptionTitle
();
}).
onCancel
(()
=>
{
});
},
//添加题干
addQuestion
()
{
this
.
data
[
1
].
push
({
Name
:
""
,
Content
:
""
,
});
this
.
calcOptionTitle
();
},
//重新计算选择Title[A,B,C,D....]
calcOptionTitle
()
{
if
(
this
.
data
&&
this
.
data
.
length
>
0
)
{
this
.
data
[
0
].
forEach
((
item
,
index
)
=>
{
item
.
Name
=
this
.
optionTitleList
[
index
];
})
}
},
//返回数据到父组件
returnDataToParent
()
{
this
.
$emit
(
'getChild'
,
this
.
data
);
},
getAnswer
()
{
this
.
setOption
.
Answer
=
""
;
if
(
this
.
data
&&
this
.
data
.
length
>
1
)
{
var
answer
=
""
;
this
.
data
[
1
].
forEach
(
item
=>
{
answer
+=
","
+
item
.
Name
;
})
if
(
answer
!=
""
)
{
answer
=
answer
.
substring
(
1
);
}
this
.
setOption
.
Answer
=
answer
;
}
},
changeEdit
(
index
)
{
this
.
commonIndex
=
index
;
this
.
commonIndex2
=
-
1
;
},
changeEdit2
(
index
)
{
this
.
commonIndex
=
-
1
;
this
.
commonIndex2
=
index
;
}
},
mounted
()
{
},
watch
:
{
data
:
{
handler
(
newValue
)
{
this
.
setOption
.
Title
=
this
.
data
[
1
][
0
].
Content
;
this
.
returnDataToParent
();
},
deep
:
true
},
}
};
</
script
>
src/components/questiontype/v-shortanswer.vue
0 → 100644
View file @
e08906d4
<!--简答题-->
<
style
>
.shortAnswerQuestion
{
width
:
100%
;
margin-bottom
:
20px
;
}
</
style
>
<
template
>
<div
class=
"shortAnswerQuestion"
>
<br
/>
答案
<br
/>
<UeEditor
v-model=
"setOption.Answer"
:config=
"config"
></UeEditor>
</div>
</
template
>
<
script
>
import
UeEditor
from
'../editor/UeEditor'
export
default
{
props
:
{
setOption
:
{
type
:
Object
,
}
},
components
:
{
UeEditor
},
data
()
{
return
{
config
:
{
initialFrameWidth
:
null
,
initialFrameHeight
:
80
,
},
};
},
created
()
{},
methods
:
{
},
mounted
()
{
},
};
</
script
>
src/components/questiontype/v-sortingproblem.vue
0 → 100644
View file @
e08906d4
<!--排序题-->
<
style
>
.sortingProblemQuestion
{
width
:
100%
}
.team_tit
{
font-size
:
14px
;
color
:
#A8A8B3
;
padding-bottom
:
20px
;
}
.selectBox
{
display
:
inline-block
;
vertical-align
:
top
;
text-align
:
left
;
position
:
relative
;
cursor
:
pointer
;
width
:
58px
;
line-height
:
24px
;
height
:
24px
;
background
:
#FFFFFF
;
border
:
1px
solid
#E1E1E5
;
border-radius
:
4px
;
font-size
:
12px
;
color
:
#181E33
;
margin
:
0
20px
14px
0
;
}
.blue-border
{
border
:
1px
solid
#FFFFFF
;
box-shadow
:
0
0
7px
1px
#75BAFF
;
}
</
style
>
<
template
>
<div
class=
"sortingProblemQuestion"
>
<table
v-if=
"data&&data.length>0"
class=
"common_TiTable"
>
<tr
v-for=
"(item,index) in data[0]"
>
<td
style=
"width:40px;text-align:center;"
>
{{
item
.
Name
}}
</td>
<td>
<div
class=
"InpDIV"
v-html=
"item.Content"
v-if=
"commonIndex!=index"
@
click=
"changeEdit(index)"
></div>
<UeEditor
v-model=
"item.Content"
:config=
"config"
v-else
></UeEditor>
</td>
<td
style=
"width:40px;text-align:center;"
>
<i
class=
"iconfont icon-guanbi Tiku_DelIcon"
@
click=
"deleteOpion(index)"
></i>
</td>
</tr>
</table>
<br
/>
<a
class=
"addTiMuList"
@
click=
"addOption()"
>
<i
class=
"iconfont icon-add"
></i>
添加更多
</a>
<br
/>
<div
class=
"team_tit"
>
答案:请在下方下拉框中对选项进行排序(顺序从左到右)
</div>
<table
v-if=
"data&&data.length>0"
>
<tr>
<td>
<template
v-for=
"(item,index) in data[1]"
>
<select
v-model=
"item.Name"
class=
"selectBox"
:class=
"
{'blue-border':index==clickIndex}"
@click="clickIndex=index">
<template
v-for=
"(cItem,cIndex) in data[0]"
>
<option
:key=
"cIndex"
:label=
"cItem.Name"
:value=
"cItem.Name"
>
</option>
</
template
>
</select>
</template>
</td>
</tr>
</table>
</div>
</template>
<
script
>
import
{
getOptionList
,
//获取选择标签【A,B,C,D....】
}
from
'../../api/question/questionconfig'
import
UeEditor
from
'../editor/UeEditor'
export
default
{
props
:
{
questionData
:
{
type
:
Array
,
},
setOption
:
{
type
:
Object
,
}
},
components
:
{
UeEditor
},
data
()
{
return
{
data
:
this
.
questionData
,
config
:
{
initialFrameWidth
:
null
,
initialFrameHeight
:
80
,
},
optionTitleList
:
[],
commonIndex
:
-
1
,
clickIndex
:
-
1
,
};
},
created
()
{
this
.
initConfig
();
},
methods
:
{
initConfig
()
{
this
.
optionTitleList
=
getOptionList
();
},
//删除选项
deleteOpion
(
index
)
{
this
.
$q
.
dialog
({
title
:
"删除小题"
,
message
:
"确实要删除该选项吗?"
,
persistent
:
true
,
cancel
:
{
label
:
"取消"
,
flat
:
true
},
ok
:
{
label
:
"确认"
,
flat
:
true
,
focus
:
true
}
}).
onOk
(()
=>
{
this
.
data
[
0
].
splice
(
index
,
1
);
this
.
data
[
1
].
splice
(
index
,
1
);
this
.
commonIndex
=
-
1
;
this
.
calcOptionTitle
();
});
},
//新增选项
addOption
()
{
if
(
this
.
data
.
length
<
26
)
{
this
.
data
[
0
].
push
({
Name
:
""
,
Content
:
""
,
});
this
.
data
[
1
].
push
({
Name
:
"A"
,
Content
:
""
,
});
this
.
calcOptionTitle
();
}
else
{
this
.
$q
.
notify
({
type
:
'warning'
,
position
:
'center'
,
timeout
:
1500
,
message
:
`最多只能添加26个选项`
})
return
}
},
//重新计算选择Title[A,B,C,D....]
calcOptionTitle
()
{
if
(
this
.
data
&&
this
.
data
.
length
>
0
)
{
this
.
data
[
0
].
forEach
((
item
,
index
)
=>
{
item
.
Name
=
this
.
optionTitleList
[
index
];
})
}
},
//返回数据到父组件
returnDataToParent
()
{
this
.
getAnswer
();
this
.
$emit
(
'getChild'
,
this
.
data
);
},
//获取正确答案
getAnswer
()
{
this
.
setOption
.
Answer
=
""
;
if
(
this
.
data
&&
this
.
data
.
length
>
0
)
{
var
answer
=
""
;
this
.
data
[
1
].
forEach
(
item
=>
{
answer
+=
","
+
item
.
Name
;
})
if
(
answer
!=
""
)
{
answer
=
answer
.
substring
(
1
);
}
this
.
setOption
.
Answer
=
answer
;
}
},
//点击切换输入
changeEdit
(
index
)
{
this
.
commonIndex
=
index
;
},
},
mounted
()
{
},
watch
:
{
data
:
{
handler
(
newValue
)
{
this
.
returnDataToParent
();
},
deep
:
true
},
}
};
</
script
>
src/pages/course/questionInfo.vue
View file @
e08906d4
...
@@ -131,46 +131,45 @@
...
@@ -131,46 +131,45 @@
<span
class=
"question_number"
>
选项处用##题号##替换,如##1##
</span>
<span
class=
"question_number"
>
选项处用##题号##替换,如##1##
</span>
</
template
>
</
template
>
<div
v-html=
"objOption.Title"
@
click=
"clickQuestion($event)"
></div>
<div
v-html=
"objOption.Title"
@
click=
"clickQuestion($event)"
></div>
<!-- <UeEditor v-if="questionObj.Key!='sharing-choose'" v-model="objOption.Title" :config="config"
ref="UE_Title"></UeEditor> -->
</div>
</div>
<br
/>
<br
/>
<!--单选题-->
<!--单选题-->
<v-single
v-if=
"questionObj.Key=='single'||questionObj.Key=='single-number'"
:questionData=
"AnswerList"
<v-single
v-if=
"questionObj.Key=='single'||questionObj.Key=='single-number'"
:questionData=
"AnswerList"
@
getChild=
"getChildData"
:setOption=
"objOption"
></v-single>
@
getChild=
"getChildData"
:setOption=
"objOption"
></v-single>
<!--多选题-->
<!--多选题-->
<multiple
v-if=
"questionObj.Key=='multiple'"
:questionData=
"AnswerList"
@
getChild=
"getChildData"
<
v-
multiple
v-if=
"questionObj.Key=='multiple'"
:questionData=
"AnswerList"
@
getChild=
"getChildData"
:setOption=
"objOption"
></multiple>
:setOption=
"objOption"
></
v-
multiple>
<!--填空题-->
<!--填空题-->
<
fill-
in
v-if=
"questionObj.Key=='fill-in'"
:questionData=
"AnswerList"
@
getChild=
"getChildData"
<
v-fill
in
v-if=
"questionObj.Key=='fill-in'"
:questionData=
"AnswerList"
@
getChild=
"getChildData"
:setOption=
"objOption"
></
fill-
in>
:setOption=
"objOption"
></
v-fill
in>
<!--判断题-->
<!--判断题-->
<judge
v-if=
"questionObj.Key=='judge'"
:questionData=
"AnswerList"
@
getChild=
"getChildData"
<
v-
judge
v-if=
"questionObj.Key=='judge'"
:questionData=
"AnswerList"
@
getChild=
"getChildData"
:setOption=
"objOption"
></judge>
:setOption=
"objOption"
></
v-
judge>
<!--简答题、名词解释、论述题、计算题、口语题、其它-->
<!--简答题、名词解释、论述题、计算题、口语题、其它-->
<
short-
answer
v-if=
"questionObj.Key=='short-answer'||questionObj.Key=='noun-explanation'||questionObj.Key=='essay-question'
<
v-short
answer
v-if=
"questionObj.Key=='short-answer'||questionObj.Key=='noun-explanation'||questionObj.Key=='essay-question'
||questionObj.Key=='calculation' || questionObj.Key=='spoken'|| questionObj.Key=='other'
||questionObj.Key=='calculation' || questionObj.Key=='spoken'|| questionObj.Key=='other'
"
:setOption=
"objOption"
>
</
short-
answer>
"
:setOption=
"objOption"
>
</
v-short
answer>
<!--分录题、资料题-->
<!--分录题、资料题-->
<
entry-
problem
v-if=
"questionObj.Key=='entry-problem'|| questionObj.Key=='data-question'"
<
v-entry
problem
v-if=
"questionObj.Key=='entry-problem'|| questionObj.Key=='data-question'"
:questionData=
"AnswerList"
:setOption=
"objOption"
@
getChild=
"getChildData"
>
:questionData=
"AnswerList"
:setOption=
"objOption"
@
getChild=
"getChildData"
>
</
entry-
problem>
</
v-entry
problem>
<!--连线题-->
<!--连线题-->
<matching
v-if=
"questionObj.Key=='matching'"
:questionData=
"AnswerList"
:setOption=
"objOption"
<
v-
matching
v-if=
"questionObj.Key=='matching'"
:questionData=
"AnswerList"
:setOption=
"objOption"
@
getChild=
"getChildData"
></matching>
@
getChild=
"getChildData"
></
v-
matching>
<!--排序题-->
<!--排序题-->
<
sorting-
problem
v-if=
"questionObj.Key=='sorting-problem'"
:questionData=
"AnswerList"
:setOption=
"objOption"
<
v-sorting
problem
v-if=
"questionObj.Key=='sorting-problem'"
:questionData=
"AnswerList"
:setOption=
"objOption"
@
getChild=
"getChildData"
></
sorting-
problem>
@
getChild=
"getChildData"
></
v-sorting
problem>
<!--完型填空-->
<!--完型填空-->
<cloze
v-if=
"questionObj.Key=='cloze'"
:questionData=
"AnswerList"
:setOption=
"objOption"
<
v-
cloze
v-if=
"questionObj.Key=='cloze'"
:questionData=
"AnswerList"
:setOption=
"objOption"
@
getChild=
"getChildData"
></cloze>
@
getChild=
"getChildData"
></
v-
cloze>
<!--阅读理解、听力题-->
<!--阅读理解、听力题-->
<
reading-
comprehensio
v-if=
"questionObj.Key=='reading-comprehensio'||questionObj.Key=='listening'"
<
v-reading
comprehensio
v-if=
"questionObj.Key=='reading-comprehensio'||questionObj.Key=='listening'"
:questionData=
"AnswerList"
:setOption=
"objOption"
@
getChild=
"getChildData"
></
reading-
comprehensio>
:questionData=
"AnswerList"
:setOption=
"objOption"
@
getChild=
"getChildData"
></
v-reading
comprehensio>
<!--共用选择题-->
<!--共用选择题-->
<
sharing-
choose
v-if=
"questionObj.Key=='sharing-choose'"
:questionData=
"AnswerList"
@
getChild=
"getChildData"
<
v-sharing
choose
v-if=
"questionObj.Key=='sharing-choose'"
:questionData=
"AnswerList"
@
getChild=
"getChildData"
:setOption=
"objOption"
>
:setOption=
"objOption"
>
</
sharing-
choose>
</
v-sharing
choose>
<br
/>
<br
/>
<div
class=
"col-12"
>
<div
class=
"col-12"
>
<div
style=
"margin:20px 0;"
>
答案解析
</div>
<div
style=
"margin:20px 0;"
>
答案解析
</div>
...
@@ -181,12 +180,7 @@
...
@@ -181,12 +180,7 @@
<br
/>
<br
/>
<span
class=
"difficulty_Degree"
>
难度
</span>
<span
class=
"difficulty_Degree"
>
难度
</span>
<span>
{{objOption.DifficultyTypeStr}}
</span>
<span>
{{objOption.DifficultyTypeStr}}
</span>
<!-- <select v-model="objOption.DifficultyType" class="selectBox blue-border">
<template v-for="(cItem,cIndex) in questionDifficultyTypeList">
<option :key="cIndex" :label="cItem.Name" :value="cItem.Id">
</option>
</template>
</select> -->
</div>
</div>
<div
class=
"col-12"
>
<div
class=
"col-12"
>
<br
/>
<br
/>
...
@@ -249,31 +243,31 @@
...
@@ -249,31 +243,31 @@
import
questionpoint
from
'../../components/question/questionpoint'
import
questionpoint
from
'../../components/question/questionpoint'
import
vSingle
from
'../../components/questiontype/v-single'
import
vSingle
from
'../../components/questiontype/v-single'
import
multiple
from
'../../components/questiontype/
multiple'
import
vMultiple
from
'../../components/questiontype/v-
multiple'
import
fillIn
from
'../../components/questiontype/fill-
in'
import
vFillIn
from
'../../components/questiontype/v-fill
in'
import
judge
from
'../../components/questiontype/
judge'
import
vJudge
from
'../../components/questiontype/v-
judge'
import
shortAnswer
from
'../../components/questiontype/short-
answer'
import
vShortAnswer
from
'../../components/questiontype/v-short
answer'
import
entryProblem
from
'../../components/questiontype/entry-
problem'
import
vEntryProblem
from
'../../components/questiontype/v-entry
problem'
import
matching
from
'../../components/questiontype/
matching'
import
vMatching
from
'../../components/questiontype/v-
matching'
import
sortingProblem
from
'../../components/questiontype/sorting-
problem'
import
vSortingProblem
from
'../../components/questiontype/v-sorting
problem'
import
cloze
from
'../../components/questiontype/
cloze'
import
vCloze
from
'../../components/questiontype/v-
cloze'
import
readingComprehensio
from
'../../components/questiontype/reading-
comprehensio'
import
vReadingComprehensio
from
'../../components/questiontype/v-reading
comprehensio'
import
sharingChoose
from
'../../components/questiontype/sharing-
choose'
import
vSharingChoose
from
'../../components/questiontype/v-sharing
choose'
export
default
{
export
default
{
components
:
{
components
:
{
UeEditor
,
UeEditor
,
questionpoint
,
//知识点
questionpoint
,
//知识点
vSingle
,
//单选题
vSingle
,
//单选题
m
ultiple
,
//多选题
vM
ultiple
,
//多选题
f
illIn
,
//填空题
vF
illIn
,
//填空题
j
udge
,
//判断题
vJ
udge
,
//判断题
s
hortAnswer
,
//简答题
vS
hortAnswer
,
//简答题
e
ntryProblem
,
//分录题
vE
ntryProblem
,
//分录题
m
atching
,
//连线题
vM
atching
,
//连线题
s
ortingProblem
,
//排序题
vS
ortingProblem
,
//排序题
c
loze
,
//完型填空
vC
loze
,
//完型填空
r
eadingComprehensio
,
//阅读理解
vR
eadingComprehensio
,
//阅读理解
s
haringChoose
,
//共用选择题
vS
haringChoose
,
//共用选择题
},
},
props
:
{
props
:
{
setingObj
:
{
setingObj
:
{
...
...
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