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
abb5ed66
Commit
abb5ed66
authored
Aug 16, 2021
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
11ada4b4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
121 additions
and
62 deletions
+121
-62
examEdit.vue
src/pages/exam/examEdit.vue
+121
-62
No files found.
src/pages/exam/examEdit.vue
View file @
abb5ed66
...
@@ -113,6 +113,7 @@
...
@@ -113,6 +113,7 @@
justify-content
:
space-between
;
justify-content
:
space-between
;
align-items
:
center
;
align-items
:
center
;
}
}
.List-bt
{
.List-bt
{
width
:
318px
;
width
:
318px
;
height
:
27px
;
height
:
27px
;
...
@@ -121,22 +122,27 @@
...
@@ -121,22 +122,27 @@
line-height
:
27px
;
line-height
:
27px
;
padding-left
:
10px
;
padding-left
:
10px
;
}
}
.List-bt
i
{
.List-bt
i
{
position
:
relative
;
position
:
relative
;
top
:
1px
;
top
:
1px
;
left
:
5px
;
left
:
5px
;
}
}
.List-bt
i
:hover
{
color
:
#2961fe
;
.List-bt
i
:hover
{
color
:
#2961fe
;
cursor
:
pointer
;
cursor
:
pointer
;
}
}
.List-ul
li
:hover
{
.List-ul
li
:hover
{
background
:
#a6a6a6
;
background
:
#a6a6a6
;
color
:
#333
;
color
:
#333
;
}
}
.List-ul
li
:hover
.exam_ListSHow
{
.List-ul
li
:hover
.exam_ListSHow
{
display
:
block
;
display
:
block
;
}
}
.left-btn-list
{
.left-btn-list
{
padding
:
5px
10px
;
padding
:
5px
10px
;
display
:
inline-block
;
display
:
inline-block
;
...
@@ -158,6 +164,7 @@
...
@@ -158,6 +164,7 @@
text-align
:
right
;
text-align
:
right
;
line-height
:
56px
;
line-height
:
56px
;
}
}
.Left-list
::-webkit-scrollbar
{
.Left-list
::-webkit-scrollbar
{
width
:
3px
;
width
:
3px
;
height
:
3px
;
height
:
3px
;
...
@@ -177,32 +184,39 @@
...
@@ -177,32 +184,39 @@
-webkit-box-shadow
:
-webkit-gradient
(
linear
,
0
0
,
0
100%
,
color-stop
(
.5
,
rgba
(
255
,
255
,
255
,
.2
)),
color-stop
(
.5
,
transparent
),
to
(
transparent
));
-webkit-box-shadow
:
-webkit-gradient
(
linear
,
0
0
,
0
100%
,
color-stop
(
.5
,
rgba
(
255
,
255
,
255
,
.2
)),
color-stop
(
.5
,
transparent
),
to
(
transparent
));
background-color
:
#0ae
;
background-color
:
#0ae
;
}
}
.commonDalei
{
.commonDalei
{
display
:
flex
;
display
:
flex
;
align-content
:
center
;
align-content
:
center
;
margin-bottom
:
20px
;
margin-bottom
:
20px
;
}
}
.examPaper
.edui-editor
{
z-index
:
99
!important
;
.examPaper
.edui-editor
{
z-index
:
99
!important
;
}
}
.List-bt
input
{
.List-bt
input
{
outline
:
none
;
outline
:
none
;
height
:
25px
;
height
:
25px
;
}
}
.exam_DetailList
{
width
:
220px
;
.exam_DetailList
{
width
:
220px
;
display
:
inline-block
;
display
:
inline-block
;
overflow
:
hidden
;
overflow
:
hidden
;
white-space
:
nowrap
;
white-space
:
nowrap
;
text-overflow
:
ellipsis
;
text-overflow
:
ellipsis
;
margin-left
:
5px
;
margin-left
:
5px
;
}
}
.exam_ListSHow
{
.exam_ListSHow
{
display
:
none
;
display
:
none
;
}
}
.exam_ListSHow
i
:hover
{
color
:
#2961fe
;
.exam_ListSHow
i
:hover
{
color
:
#2961fe
;
}
}
</
style
>
</
style
>
<
template
>
<
template
>
<div
class=
"examPaper page-body"
>
<div
class=
"examPaper page-body"
>
...
@@ -238,19 +252,26 @@
...
@@ -238,19 +252,26 @@
<input
style=
"width:40px;"
filled
v-model=
"gItem.GSortNum"
/>
<input
style=
"width:40px;"
filled
v-model=
"gItem.GSortNum"
/>
</
template
>
</
template
>
</strong>
</strong>
<i
class=
"iconfont icon-edit"
title=
"编辑"
style=
"font-size:18px;margin-right:5px;"
@
click=
"getNameEdit(DataObj.GroupList,gIndex)"
></i>
<i
class=
"iconfont icon-edit"
title=
"编辑"
style=
"font-size:18px;margin-right:5px;"
<i
class=
"iconfont icon-ico_commodity_defaul"
v-if=
"gItem.isShowEdit"
title=
"保存"
style=
"top:0;margin-right:5px;"
@
click=
"saveExamName(DataObj.GroupList)"
></i>
@
click=
"getNameEdit(DataObj.GroupList,gIndex)"
></i>
<i
class=
"iconfont icon-shangyi2"
style=
"margin-right:5px;"
@
click
.
stop=
"MoveFatherItem(gIndex,0)"
v-if=
"gIndex!=0"
></i>
<i
class=
"iconfont icon-ico_commodity_defaul"
v-if=
"gItem.isShowEdit"
title=
"保存"
<i
class=
"iconfont icon-xiayi"
@
click
.
stop=
"MoveFatherItem(gIndex,1)"
v-if=
"gIndex!=DataObj.GroupList.length-1"
></i>
style=
"top:0;margin-right:5px;"
@
click=
"saveExamName(DataObj.GroupList)"
></i>
<i
class=
"iconfont icon-shangyi2"
style=
"margin-right:5px;"
@
click
.
stop=
"MoveFatherItem(gIndex,0)"
v-if=
"gIndex!=0"
></i>
<i
class=
"iconfont icon-xiayi"
@
click
.
stop=
"MoveFatherItem(gIndex,1)"
v-if=
"gIndex!=DataObj.GroupList.length-1"
></i>
</div>
</div>
<ul
class=
"List-ul"
v-if=
"gItem.DetailsList&&gItem.DetailsList.length>0"
>
<ul
class=
"List-ul"
v-if=
"gItem.DetailsList&&gItem.DetailsList.length>0"
>
<li
class=
""
style=
"cursor:pointer;"
v-for=
"(dItem,dIndex) in gItem.DetailsList"
:key=
"dIndex"
<li
class=
""
style=
"cursor:pointer;"
v-for=
"(dItem,dIndex) in gItem.DetailsList"
:key=
"dIndex"
@
click=
"ClickItem(dItem)"
>
@
click=
"ClickItem(dItem)"
>
{{dIndex+1}}
<span
class=
"exam_DetailList"
@
click=
"ClickItem(dItem)"
v-html=
"dItem.ShowTitle"
></span>
{{dIndex+1}}
<span
class=
"exam_DetailList"
@
click=
"ClickItem(dItem)"
v-html=
"dItem.ShowTitle"
></span>
<span
class=
"exam_ListSHow"
>
<span
class=
"exam_ListSHow"
>
<i
class=
"iconfont icon-shangyi2"
@
click
.
stop=
"MoveChildItem(gIndex,dIndex,0)"
style=
"margin-right:5px;"
v-if=
"dIndex!=0"
></i>
<i
class=
"iconfont icon-shangyi2"
@
click
.
stop=
"MoveChildItem(gIndex,dIndex,0)"
<i
class=
"iconfont icon-xiayi"
@
click
.
stop=
"MoveChildItem(gIndex,dIndex,1)"
v-if=
"dIndex!=gItem.DetailsList.length-1"
></i>
style=
"margin-right:5px;"
v-if=
"dIndex!=0"
></i>
<i
class=
"iconfont icon-shanchu2"
@
click
.
stop=
"delExam(gItem.DetailsList,dIndex)"
style=
"margin-left:5px;font-size:17px;"
></i>
<i
class=
"iconfont icon-xiayi"
@
click
.
stop=
"MoveChildItem(gIndex,dIndex,1)"
v-if=
"dIndex!=gItem.DetailsList.length-1"
></i>
<i
class=
"iconfont icon-shanchu2"
@
click
.
stop=
"delExam(gItem.DetailsList,dIndex)"
style=
"margin-left:5px;font-size:17px;"
></i>
</span>
</span>
</li>
</li>
</ul>
</ul>
...
@@ -297,14 +318,14 @@
...
@@ -297,14 +318,14 @@
<single
v-if=
"ChooseItem.QuestionTypeKey=='single'||ChooseItem.QuestionTypeKey=='single-number'"
<single
v-if=
"ChooseItem.QuestionTypeKey=='single'||ChooseItem.QuestionTypeKey=='single-number'"
:questionData=
"ChooseItem.QuestionContentObj"
@
getChild=
"getChildData"
:setOption=
"ChooseItem"
></single>
:questionData=
"ChooseItem.QuestionContentObj"
@
getChild=
"getChildData"
:setOption=
"ChooseItem"
></single>
<!--多选题-->
<!--多选题-->
<multiple
v-if=
"ChooseItem.QuestionTypeKey=='multiple'"
:questionData=
"ChooseItem.QuestionContentObj"
@
getChild=
"getChildData"
<multiple
v-if=
"ChooseItem.QuestionTypeKey=='multiple'"
:questionData=
"ChooseItem.QuestionContentObj"
:setOption=
"ChooseItem"
></multiple>
@
getChild=
"getChildData"
:setOption=
"ChooseItem"
></multiple>
<!--填空题-->
<!--填空题-->
<fill-in
v-if=
"ChooseItem.QuestionTypeKey=='fill-in'"
:questionData=
"ChooseItem.QuestionContentObj"
@
getChild=
"getChildData"
<fill-in
v-if=
"ChooseItem.QuestionTypeKey=='fill-in'"
:questionData=
"ChooseItem.QuestionContentObj"
:setOption=
"ChooseItem"
></fill-in>
@
getChild=
"getChildData"
:setOption=
"ChooseItem"
></fill-in>
<!--判断题-->
<!--判断题-->
<judge
v-if=
"ChooseItem.QuestionTypeKey=='judge'"
:questionData=
"ChooseItem.QuestionContentObj"
@
getChild=
"getChildData"
<judge
v-if=
"ChooseItem.QuestionTypeKey=='judge'"
:questionData=
"ChooseItem.QuestionContentObj"
:setOption=
"ChooseItem"
></judge>
@
getChild=
"getChildData"
:setOption=
"ChooseItem"
></judge>
<!--简答题、名词解释、论述题、计算题、口语题、其它-->
<!--简答题、名词解释、论述题、计算题、口语题、其它-->
<short-answer
v-if=
"ChooseItem.QuestionTypeKey=='short-answer'||ChooseItem.QuestionTypeKey=='noun-explanation'||ChooseItem.QuestionTypeKey=='essay-question'
<short-answer
v-if=
"ChooseItem.QuestionTypeKey=='short-answer'||ChooseItem.QuestionTypeKey=='noun-explanation'||ChooseItem.QuestionTypeKey=='essay-question'
||ChooseItem.QuestionTypeKey=='calculation' || ChooseItem.QuestionTypeKey=='spoken'|| ChooseItem.QuestionTypeKey=='other'
||ChooseItem.QuestionTypeKey=='calculation' || ChooseItem.QuestionTypeKey=='spoken'|| ChooseItem.QuestionTypeKey=='other'
...
@@ -314,21 +335,23 @@
...
@@ -314,21 +335,23 @@
:questionData=
"ChooseItem.QuestionContentObj"
:setOption=
"ChooseItem"
@
getChild=
"getChildData"
>
:questionData=
"ChooseItem.QuestionContentObj"
:setOption=
"ChooseItem"
@
getChild=
"getChildData"
>
</entry-problem>
</entry-problem>
<!--连线题-->
<!--连线题-->
<matching
v-if=
"ChooseItem.QuestionTypeKey=='matching'"
:questionData=
"ChooseItem.QuestionContentObj"
:setOption=
"ChooseItem"
<matching
v-if=
"ChooseItem.QuestionTypeKey=='matching'"
:questionData=
"ChooseItem.QuestionContentObj"
@
getChild=
"getChildData"
></matching>
:setOption=
"ChooseItem"
@
getChild=
"getChildData"
></matching>
<!--排序题-->
<!--排序题-->
<sorting-problem
v-if=
"ChooseItem.QuestionTypeKey=='sorting-problem'"
:questionData=
"ChooseItem.QuestionContentObj"
<sorting-problem
v-if=
"ChooseItem.QuestionTypeKey=='sorting-problem'"
:setOption=
"ChooseItem"
@
getChild=
"getChildData"
></sorting-problem>
:questionData=
"ChooseItem.QuestionContentObj"
:setOption=
"ChooseItem"
@
getChild=
"getChildData"
>
</sorting-problem>
<!--完型填空-->
<!--完型填空-->
<cloze
v-if=
"ChooseItem.QuestionTypeKey=='cloze'"
:questionData=
"ChooseItem.QuestionContentObj"
:setOption=
"ChooseItem"
<cloze
v-if=
"ChooseItem.QuestionTypeKey=='cloze'"
:questionData=
"ChooseItem.QuestionContentObj"
@
getChild=
"getChildData"
></cloze>
:setOption=
"ChooseItem"
@
getChild=
"getChildData"
></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"
></reading-comprehensio>
:questionData=
"ChooseItem.QuestionContentObj"
:setOption=
"ChooseItem"
@
getChild=
"getChildData"
>
</reading-comprehensio>
<!--共用选择题-->
<!--共用选择题-->
<sharing-choose
v-if=
"ChooseItem.QuestionTypeKey=='sharing-choose'"
:questionData=
"ChooseItem.QuestionContentObj"
<sharing-choose
v-if=
"ChooseItem.QuestionTypeKey=='sharing-choose'"
@
getChild=
"getChildData"
:setOption=
"ChooseItem"
>
:questionData=
"ChooseItem.QuestionContentObj"
@
getChild=
"getChildData"
:setOption=
"ChooseItem"
>
</sharing-choose>
</sharing-choose>
<br
/>
<br
/>
<div
class=
"col-12"
>
<div
class=
"col-12"
>
...
@@ -390,6 +413,9 @@
...
@@ -390,6 +413,9 @@
GetPaper
,
GetPaper
,
savePaperInfo
,
savePaperInfo
,
}
from
'../../api/teacher/index'
;
}
from
'../../api/teacher/index'
;
import
{
CreateQuestion
,
//生成问题
}
from
'../../api/question/questionconfig'
import
{
import
{
queryQuestionTypeList
,
queryQuestionTypeList
,
queryDifficultyType
,
queryDifficultyType
,
...
@@ -437,8 +463,8 @@
...
@@ -437,8 +463,8 @@
secondTypeList
:
[],
//第二类题型
secondTypeList
:
[],
//第二类题型
isShowQuestion
:
false
,
isShowQuestion
:
false
,
commonIndex
:
-
1
,
commonIndex
:
-
1
,
examNum
:
0
,
//题量
examNum
:
0
,
//题量
examScore
:
0
//总分
examScore
:
0
//总分
}
}
},
},
created
()
{
created
()
{
...
@@ -476,7 +502,7 @@
...
@@ -476,7 +502,7 @@
}
}
},
},
//移动子项
//移动子项
MoveChildItem
(
Index
,
subIndex
,
IsUp
)
{
MoveChildItem
(
Index
,
subIndex
,
IsUp
)
{
var
currentItem
=
this
.
DataObj
.
GroupList
[
Index
].
DetailsList
[
subIndex
];
var
currentItem
=
this
.
DataObj
.
GroupList
[
Index
].
DetailsList
[
subIndex
];
//上移
//上移
if
(
IsUp
==
0
)
{
if
(
IsUp
==
0
)
{
...
@@ -497,21 +523,21 @@
...
@@ -497,21 +523,21 @@
}
}
},
},
//删除题目
//删除题目
delExam
(
item
,
index
)
{
delExam
(
item
,
index
)
{
item
.
splice
(
index
,
1
);
item
.
splice
(
index
,
1
);
},
},
//点击修改标题名字和分数
//点击修改标题名字和分数
getNameEdit
(
item
,
index
)
{
getNameEdit
(
item
,
index
)
{
item
.
forEach
(
x
=>
{
item
.
forEach
(
x
=>
{
x
.
isShowEdit
=
false
;
x
.
isShowEdit
=
false
;
})
})
item
[
index
].
isShowEdit
=
true
;
item
[
index
].
isShowEdit
=
true
;
this
.
$forceUpdate
();
this
.
$forceUpdate
();
},
},
//鼠标移开输入框 保存数据 还有隐藏输入框
//鼠标移开输入框 保存数据 还有隐藏输入框
saveExamName
(
item
){
saveExamName
(
item
)
{
item
.
forEach
(
x
=>
{
item
.
forEach
(
x
=>
{
x
.
isShowEdit
=
false
;
x
.
isShowEdit
=
false
;
})
})
this
.
$forceUpdate
();
this
.
$forceUpdate
();
},
},
...
@@ -533,18 +559,51 @@
...
@@ -533,18 +559,51 @@
}
}
});
});
},
},
//题型点击
//题型点击
【添加问题】
onItemClick
(
item
,
index
)
{
onItemClick
(
item
,
index
)
{
// this.AnswerList = [];
var
questionObj
=
this
.
getDetailsObj
();
// this.questionObj = item;
questionObj
.
QuestionTypeId
=
item
.
QId
;
// this.objOption.QuestionTypeId = item.QId;
questionObj
.
QuestionTypeKey
=
item
.
Key
;
// this.objOption.QuestionTypeKey = item.Key;
var
obj
=
CreateQuestion
(
item
.
Key
);
// var obj = CreateQuestion(item.Key);
questionObj
.
QuestionContentObj
=
obj
;
// this.AnswerList = obj;
if
(
obj
)
{
// if (obj) {
questionObj
.
QuestionContent
=
JSON
.
stringify
(
obj
);
// this.objOption.QuestionContent = JSON.stringify(obj);
}
// }
console
.
log
(
"questionObj"
,
questionObj
);
this
.
commonIndex
=
index
if
(
this
.
DataObj
&&
this
.
DataObj
.
GroupList
&&
this
.
DataObj
.
GroupList
.
length
>
0
)
{
this
.
DataObj
.
GroupList
.
forEach
((
gItem
,
gIndex
)
=>
{
if
(
gItem
.
QuestionTypeId
==
item
.
QId
)
{
if
(
!
gItem
.
DetailsList
)
{
gItem
.
DetailsList
=
[];
}
gItem
.
DetailsList
.
push
(
questionObj
);
}
})
}
},
getDetailsObj
()
{
var
objOption
=
{
Id
:
0
,
//试卷详情编号
PaperId
:
0
,
//试卷编号
BankId
:
0
,
//题库编号
QuestionId
:
0
,
//问题编号
Title
:
""
,
//问题标题
QuestionContent
:
""
,
//问题内容
DifficultyType
:
1
,
//问题难易程度
AnswerParse
:
""
,
//答案解析
QuestionTypeId
:
0
,
//问题类型编号
QuestionTypeKey
:
""
,
//问题类型Key
Knowledge
:
""
,
//知识点
IsUpdateJobExam
:
0
,
//是否同步修改引用此题目的作业和考试(1-是)
SortNum
:
0
,
//排序
Answer
:
''
,
//问题答案【JSON字符串】
QuestionContentObj
:[],
//问题选项
IsMutex
:
1
,
//填空题(答案顺序打乱也判正确)
Category
:
0
,
//问题大类,
LevelType
:
1
,
//考级程度
Score
:
0
,
//分数
};
return
objOption
;
},
},
//获取问题大类
//获取问题大类
getQuestionCategory
()
{
getQuestionCategory
()
{
...
@@ -574,10 +633,10 @@
...
@@ -574,10 +633,10 @@
}
}
this
.
examScore
=
0
;
this
.
examScore
=
0
;
this
.
examNum
=
0
;
this
.
examNum
=
0
;
this
.
DataObj
.
GroupList
.
forEach
(
x
=>
{
this
.
DataObj
.
GroupList
.
forEach
(
x
=>
{
x
.
isShowEdit
=
false
;
x
.
isShowEdit
=
false
;
this
.
examNum
+=
x
.
DetailsList
.
length
;
this
.
examNum
+=
x
.
DetailsList
.
length
;
x
.
DetailsList
.
forEach
(
y
=>
{
x
.
DetailsList
.
forEach
(
y
=>
{
this
.
examScore
+=
y
.
Score
;
this
.
examScore
+=
y
.
Score
;
})
})
})
})
...
@@ -586,12 +645,12 @@
...
@@ -586,12 +645,12 @@
//点击问题
//点击问题
ClickItem
(
questionItem
)
{
ClickItem
(
questionItem
)
{
this
.
ChooseItem
=
questionItem
;
this
.
ChooseItem
=
questionItem
;
},
},
//保存题目
//保存题目
SavePaper
()
{
SavePaper
()
{
savePaperInfo
(
this
.
DataObj
).
then
(
res
=>
{
savePaperInfo
(
this
.
DataObj
).
then
(
res
=>
{
})
})
},
},
closeQuestForm
()
{
closeQuestForm
()
{
...
...
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