Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
Education
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
黄奎
Education
Commits
9d84d3c0
Commit
9d84d3c0
authored
Jan 06, 2021
by
liudong1993
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://gitlab.oytour.com/Kui2/education
parents
8e12519e
40299cf4
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
78 additions
and
31 deletions
+78
-31
RB_Question_Type.cs
Edu.Model/Entity/Question/RB_Question_Type.cs
+5
-0
RB_Question_Point_ViewModel.cs
Edu.Model/ViewModel/Question/RB_Question_Point_ViewModel.cs
+5
-0
RB_Question_Type_ViewModel.cs
Edu.Model/ViewModel/Question/RB_Question_Type_ViewModel.cs
+0
-27
RB_Question_ViewModel.cs
Edu.Model/ViewModel/Question/RB_Question_ViewModel.cs
+5
-0
AnalysisQuestionTypeModule.cs
Edu.Module.Question/AnalysisQuestionTypeModule.cs
+36
-0
QuestionModule.cs
Edu.Module.Question/QuestionModule.cs
+17
-1
RB_Question_PointRepository.cs
Edu.Repository/Question/RB_Question_PointRepository.cs
+10
-3
No files found.
Edu.Model/Entity/Question/RB_Question_Type.cs
View file @
9d84d3c0
...
...
@@ -35,5 +35,10 @@ namespace Edu.Model.Entity.Question
/// 删除状态
/// </summary>
public
DateStateEnum
Status
{
get
;
set
;
}
/// <summary>
/// JSON配置
/// </summary>
public
string
JsonConfig
{
get
;
set
;
}
}
}
Edu.Model/ViewModel/Question/RB_Question_Point_ViewModel.cs
View file @
9d84d3c0
...
...
@@ -31,5 +31,10 @@ namespace Edu.Model.ViewModel.Question
/// 问题知识点编号【查询使用】
/// </summary>
public
string
QPointIds
{
get
;
set
;
}
/// <summary>
/// 是否选中
/// </summary>
public
bool
IsCheck
{
get
;
set
;
}
}
}
Edu.Model/ViewModel/Question/RB_Question_Type_ViewModel.cs
View file @
9d84d3c0
...
...
@@ -47,31 +47,4 @@ namespace Edu.Model.ViewModel.Question
public
bool
IsAnswer
{
get
;
set
;
}
}
/// <summary>
/// 单选题
/// </summary>
public
class
singleQuestion
{
/// <summary>
/// 题目名称
/// </summary>
public
string
Title
{
get
;
set
;
}
/// <summary>
/// 答案解析
/// </summary>
public
string
AnswerAnalysis
{
get
;
set
;
}
/// <summary>
/// 选项列表
/// </summary>
public
List
<
optionItem
>
AnswerOptionList
{
get
;
set
;
}
/// <summary>
/// 难易程度
/// </summary>
public
DifficultyTypeEnum
EasyType
{
get
;
set
;
}
}
}
\ No newline at end of file
Edu.Model/ViewModel/Question/RB_Question_ViewModel.cs
View file @
9d84d3c0
...
...
@@ -53,5 +53,10 @@ namespace Edu.Model.ViewModel.Question
/// </summary>
public
string
QDifficultyType
{
get
;
set
;
}
/// <summary>
/// 选项
/// </summary>
public
object
AnswerObj
{
get
;
set
;
}
}
}
\ No newline at end of file
Edu.Module.Question/AnalysisQuestionTypeModule.cs
0 → 100644
View file @
9d84d3c0
using
Edu.Model.ViewModel.Question
;
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
namespace
Edu.Module.Question
{
/// <summary>
/// 解析问题
/// </summary>
public
class
AnalysisQuestionTypeModule
{
/// <summary>
/// 问题解析
/// </summary>
/// <param name="key"></param>
/// <param name="data"></param>
/// <returns></returns>
public
object
ParsingQuestion
(
string
key
,
string
data
)
{
var
obj
=
new
object
();
switch
(
key
)
{
//单选题
case
"single"
:
obj
=
Common
.
Plugin
.
JsonHelper
.
DeserializeObject
<
List
<
optionItem
>>(
data
);
break
;
//多选题
case
"multiple"
:
obj
=
Common
.
Plugin
.
JsonHelper
.
DeserializeObject
<
List
<
optionItem
>>(
data
);
break
;
}
return
obj
;
}
}
}
Edu.Module.Question/QuestionModule.cs
View file @
9d84d3c0
...
...
@@ -29,6 +29,11 @@ namespace Edu.Module.Question
/// </summary>
private
readonly
RB_Question_PointRepository
question_PointRepository
=
new
RB_Question_PointRepository
();
/// <summary>
/// 问题解析处理类
/// </summary>
private
readonly
AnalysisQuestionTypeModule
analysisQuestion
=
new
AnalysisQuestionTypeModule
();
/// <summary>
/// 获取题目类型列表
/// </summary>
...
...
@@ -143,9 +148,20 @@ namespace Edu.Module.Question
/// <returns></returns>
public
RB_Question_ViewModel
GetQuestionModule
(
object
QuestionId
)
{
return
questionRepository
.
GetEntity
<
RB_Question_ViewModel
>(
QuestionId
);
var
extModel
=
questionRepository
.
GetEntity
<
RB_Question_ViewModel
>(
QuestionId
);
if
(
extModel
!=
null
)
{
extModel
.
AnswerObj
=
analysisQuestion
.
ParsingQuestion
(
extModel
.
QuestionTypeKey
,
extModel
.
Answer
);
if
(!
string
.
IsNullOrEmpty
(
extModel
.
Knowledge
))
{
extModel
.
QuestionPointList
=
GetPointListModule
(
new
RB_Question_Point_ViewModel
()
{
QPointIds
=
extModel
.
Knowledge
});
}
}
return
extModel
;
}
/// <summary>
/// 获取问题知识点列表
/// </summary>
...
...
Edu.Repository/Question/RB_Question_PointRepository.cs
View file @
9d84d3c0
...
...
@@ -3,6 +3,7 @@ using Edu.Model.ViewModel.Question;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
VT.FW.DB.Dapper
;
namespace
Edu.Repository.Question
{
...
...
@@ -33,7 +34,7 @@ WHERE 1=1
}
if
(!
string
.
IsNullOrEmpty
(
query
.
QPointIds
))
{
builder
.
AppendFormat
(
" AND {0} IN({1}) "
,
nameof
(
RB_Question_Point_ViewModel
.
Course
Id
),
query
.
QPointIds
);
builder
.
AppendFormat
(
" AND {0} IN({1}) "
,
nameof
(
RB_Question_Point_ViewModel
.
Point
Id
),
query
.
QPointIds
);
}
}
return
Get
<
RB_Question_Point_ViewModel
>(
builder
.
ToString
()).
ToList
();
...
...
@@ -49,6 +50,7 @@ WHERE 1=1
/// <returns></returns>
public
List
<
RB_Question_Point_ViewModel
>
GetPointPageListRepository
(
int
pageIndex
,
int
pageSize
,
out
long
rowsCount
,
RB_Question_Point_ViewModel
query
)
{
var
parameters
=
new
DynamicParameters
();
StringBuilder
builder
=
new
StringBuilder
();
builder
.
AppendFormat
(
@"
SELECT *
...
...
@@ -64,10 +66,15 @@ WHERE 1=1
}
if
(!
string
.
IsNullOrEmpty
(
query
.
QPointIds
))
{
builder
.
AppendFormat
(
" AND {0} IN({1}) "
,
nameof
(
RB_Question_Point_ViewModel
.
CourseId
),
query
.
QPointIds
);
builder
.
AppendFormat
(
" AND {0} IN({1}) "
,
nameof
(
RB_Question_Point_ViewModel
.
PointId
),
query
.
QPointIds
);
}
if
(!
string
.
IsNullOrEmpty
(
query
.
PointName
))
{
builder
.
AppendFormat
(
" AND {0} LIKE @PointName "
,
nameof
(
RB_Question_Point_ViewModel
.
PointName
));
parameters
.
Add
(
"PointName"
,
"%"
+
query
.
PointName
.
Trim
()
+
"%"
);
}
}
return
GetPage
<
RB_Question_Point_ViewModel
>(
pageIndex
,
pageSize
,
out
rowsCount
,
builder
.
ToString
()).
ToList
();
return
GetPage
<
RB_Question_Point_ViewModel
>(
pageIndex
,
pageSize
,
out
rowsCount
,
builder
.
ToString
()
,
parameters
).
ToList
();
}
}
}
\ No newline at end of file
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