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
ebe850a1
Commit
ebe850a1
authored
Aug 10, 2021
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增实体类
parent
b776b5e2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
285 additions
and
57 deletions
+285
-57
RB_Examination_Details.cs
Edu.Model/Entity/Exam/RB_Examination_Details.cs
+5
-0
RB_Examination_Group.cs
Edu.Model/Entity/Exam/RB_Examination_Group.cs
+45
-0
RB_Examination_Paper.cs
Edu.Model/Entity/Exam/RB_Examination_Paper.cs
+7
-1
RB_Examination_Group_ViewModel.cs
Edu.Model/ViewModel/Exam/RB_Examination_Group_ViewModel.cs
+23
-0
RB_Examination_Paper_ViewModel.cs
Edu.Model/ViewModel/Exam/RB_Examination_Paper_ViewModel.cs
+2
-2
PaperModule.cs
Edu.Module.Exam/PaperModule.cs
+93
-28
RB_Examination_DetailsRepository.cs
Edu.Repository/Exam/RB_Examination_DetailsRepository.cs
+1
-0
RB_Examination_GroupRepository.cs
Edu.Repository/Exam/RB_Examination_GroupRepository.cs
+43
-0
RB_Examination_PaperRepository.cs
Edu.Repository/Exam/RB_Examination_PaperRepository.cs
+1
-1
ExamController.cs
Edu.WebApi/Controllers/Exam/ExamController.cs
+65
-25
No files found.
Edu.Model/Entity/Exam/RB_Examination_Details.cs
View file @
ebe850a1
...
...
@@ -122,5 +122,10 @@ namespace Edu.Model.Entity.Exam
/// 考级程度
/// </summary>
public
LevelTypeEnum
?
LevelType
{
get
;
set
;
}
/// <summary>
/// 题目分数
/// </summary>
public
decimal
Score
{
get
;
set
;
}
}
}
Edu.Model/Entity/Exam/RB_Examination_Group.cs
0 → 100644
View file @
ebe850a1
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
using
VT.FW.DB
;
namespace
Edu.Model.Entity.Exam
{
/// <summary>
/// 试卷题目分组实体类
/// </summary>
[
Serializable
]
[
DB
(
ConnectionName
=
"DefaultConnection"
)]
public
class
RB_Examination_Group
{
/// <summary>
/// 试卷分组编号
/// </summary>
public
int
GId
{
get
;
set
;
}
/// <summary>
/// 试卷编号
/// </summary>
public
int
PaperId
{
get
;
set
;
}
/// <summary>
/// 分组名称
/// </summary>
public
string
GroupName
{
get
;
set
;
}
/// <summary>
/// 问题类型编号
/// </summary>
public
int
QuestionTypeId
{
get
;
set
;
}
/// <summary>
/// 问题类型Key
/// </summary>
public
string
QuestionTypeKey
{
get
;
set
;
}
/// <summary>
/// 排序
/// </summary>
public
int
GSortNum
{
get
;
set
;
}
}
}
Edu.Model/Entity/Exam/RB_Examination_Paper.cs
View file @
ebe850a1
using
System
;
using
Edu.Common.Enum.Question
;
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
using
VT.FW.DB
;
...
...
@@ -27,6 +28,11 @@ namespace Edu.Model.Entity.Exam
/// </summary>
public
string
QuestionBandIds
{
get
;
set
;
}
/// <summary>
/// 难易程度(1-易,2-中,3-难)
/// </summary>
public
DifficultyTypeEnum
DifficultyType
{
get
;
set
;
}
/// <summary>
/// 创建时间
/// </summary>
...
...
Edu.Model/ViewModel/Exam/RB_Examination_Group_ViewModel.cs
0 → 100644
View file @
ebe850a1
using
Edu.Model.Entity.Exam
;
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
namespace
Edu.Model.ViewModel.Exam
{
/// <summary>
/// 试卷题目分组视图实体类
/// </summary>
public
class
RB_Examination_Group_ViewModel
:
RB_Examination_Group
{
/// <summary>
/// 试卷分组题目列表
/// </summary>
public
List
<
RB_Examination_Details_ViewModel
>
DetailsList
{
get
;
set
;
}
/// <summary>
/// 试卷编号【查询使用】
/// </summary>
public
string
QPaperIds
{
get
;
set
;
}
}
}
Edu.Model/ViewModel/Exam/RB_Examination_Paper_ViewModel.cs
View file @
ebe850a1
...
...
@@ -21,8 +21,8 @@ namespace Edu.Model.ViewModel.Exam
public
string
CreateTimeStr
{
get
{
return
Common
.
ConvertHelper
.
FormatDate
(
this
.
CreateTime
);
}
}
/// <summary>
/// 试卷
问题
列表
/// 试卷
题目分组
列表
/// </summary>
public
List
<
RB_Examination_
Details_ViewModel
>
Details
List
{
get
;
set
;
}
public
List
<
RB_Examination_
Group_ViewModel
>
Group
List
{
get
;
set
;
}
}
}
Edu.Module.Exam/PaperModule.cs
View file @
ebe850a1
This diff is collapsed.
Click to expand it.
Edu.Repository/Exam/RB_Examination_DetailsRepository.cs
View file @
ebe850a1
...
...
@@ -40,5 +40,6 @@ WHERE 1=1
}
return
Get
<
RB_Examination_Details_ViewModel
>(
builder
.
ToString
()).
ToList
();
}
}
}
Edu.Repository/Exam/RB_Examination_GroupRepository.cs
0 → 100644
View file @
ebe850a1
using
Edu.Model.Entity.Exam
;
using
Edu.Model.ViewModel.Exam
;
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
using
System.Linq
;
namespace
Edu.Repository.Exam
{
/// <summary>
/// 试卷题目分组仓储层
/// </summary>
public
class
RB_Examination_GroupRepository
:
BaseRepository
<
RB_Examination_Group
>
{
/// <summary>
/// 获取试卷题目列表
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public
List
<
RB_Examination_Group_ViewModel
>
GetExaminationGroupListRepository
(
RB_Examination_Group_ViewModel
query
)
{
StringBuilder
builder
=
new
StringBuilder
();
builder
.
AppendFormat
(
@"
SELECT A.*
FROM RB_Examination_Group AS A
WHERE 1=1
"
);
if
(
query
!=
null
)
{
if
(
query
.
PaperId
>
0
)
{
builder
.
AppendFormat
(
@" AND A.{0}={1} "
,
nameof
(
RB_Examination_Group_ViewModel
.
PaperId
),
query
.
PaperId
);
}
if
(!
string
.
IsNullOrEmpty
(
query
.
QPaperIds
))
{
builder
.
AppendFormat
(
@" AND A.{0} IN({1}) "
,
nameof
(
RB_Examination_Group_ViewModel
.
PaperId
),
query
.
QPaperIds
);
}
}
return
Get
<
RB_Examination_Group_ViewModel
>(
builder
.
ToString
()).
ToList
();
}
}
}
Edu.Repository/Exam/RB_Examination_PaperRepository.cs
View file @
ebe850a1
...
...
@@ -27,7 +27,7 @@ namespace Edu.Repository.Exam
StringBuilder
builder
=
new
StringBuilder
();
builder
.
AppendFormat
(
@"
SELECT A.*
FROM RB_Examination_Paper
FROM RB_Examination_Paper
AS A
WHERE 1=1
"
);
if
(
query
!=
null
)
...
...
Edu.WebApi/Controllers/Exam/ExamController.cs
View file @
ebe850a1
...
...
@@ -76,45 +76,72 @@ namespace Edu.WebApi.Controllers.Exam
PaperId
=
base
.
ParmJObj
.
GetInt
(
"PaperId"
),
PaperName
=
base
.
ParmJObj
.
GetStringValue
(
"PaperName"
),
QuestionBandIds
=
base
.
ParmJObj
.
GetStringValue
(
"QuestionBandIds"
),
DifficultyType
=(
DifficultyTypeEnum
)
base
.
ParmJObj
.
GetInt
(
"DifficultyType"
),
CreateBy
=
UserInfo
.
Id
,
CreateTime
=
DateTime
.
Now
,
Group_Id
=
base
.
UserInfo
.
Group_Id
,
};
extModel
.
DetailsList
=
new
List
<
RB_Examination_Details
_ViewModel
>();
string
details
=
base
.
ParmJObj
.
GetStringValue
(
"Details
List"
);
if
(!
string
.
IsNullOrEmpty
(
detail
s
))
extModel
.
GroupList
=
new
List
<
RB_Examination_Group
_ViewModel
>();
string
groups
=
base
.
ParmJObj
.
GetStringValue
(
"Group
List"
);
if
(!
string
.
IsNullOrEmpty
(
group
s
))
{
JArray
jarray
=
JArray
.
Parse
(
detail
s
);
JArray
jarray
=
JArray
.
Parse
(
group
s
);
if
(
jarray
!=
null
&&
jarray
.
Count
>
0
)
{
int
gSortNum
=
0
;
foreach
(
var
jItem
in
jarray
)
{
JObject
jobj
=
JObject
.
Parse
(
jItem
.
ToString
());
extModel
.
DetailsList
.
Add
(
new
RB_Examination_Details
_ViewModel
()
RB_Examination_Group_ViewModel
gModel
=
new
RB_Examination_Group
_ViewModel
()
{
Id
=
jobj
.
GetInt
(
"
Id"
),
GId
=
jobj
.
GetInt
(
"G
Id"
),
PaperId
=
jobj
.
GetInt
(
"PaperId"
),
BankId
=
jobj
.
GetInt
(
"BankId"
),
QuestionId
=
jobj
.
GetInt
(
"QuestionId"
),
Title
=
jobj
.
GetStringValue
(
"Title"
),
QuestionContent
=
jobj
.
GetStringValue
(
"QuestionContent"
),
DifficultyType
=
(
DifficultyTypeEnum
)
jobj
.
GetInt
(
"DifficultyType"
),
AnswerParse
=
jobj
.
GetStringValue
(
"AnswerParse"
),
GroupName
=
jobj
.
GetStringValue
(
"GroupName"
),
QuestionTypeId
=
jobj
.
GetInt
(
"QuestionTypeId"
),
QuestionTypeKey
=
jobj
.
GetStringValue
(
"QuestionTypeKey"
),
Knowledge
=
jobj
.
GetStringValue
(
"Knowledge"
),
CreateBy
=
base
.
UserInfo
.
Id
,
CreateTime
=
DateTime
.
Now
,
UpdateBy
=
base
.
UserInfo
.
Id
,
UpdateTime
=
DateTime
.
Now
,
IsUpdateJobExam
=
base
.
ParmJObj
.
GetInt
(
"IsUpdateJobExam"
),
Status
=
Common
.
Enum
.
DateStateEnum
.
Normal
,
SortNum
=
base
.
ParmJObj
.
GetInt
(
"SortNum"
),
Answer
=
base
.
ParmJObj
.
GetStringValue
(
"Answer"
),
IsMutex
=
base
.
ParmJObj
.
GetInt
(
"IsMutex"
),
Category
=
(
QuestionCategoryEnum
)
base
.
ParmJObj
.
GetInt
(
"Category"
),
LevelType
=
(
LevelTypeEnum
)
base
.
ParmJObj
.
GetInt
(
"LevelType"
),
});
GSortNum
=
gSortNum
,
DetailsList
=
new
List
<
RB_Examination_Details_ViewModel
>(),
};
gSortNum
++;
string
details
=
jobj
.
GetStringValue
(
"DetailsList"
);
if
(!
string
.
IsNullOrEmpty
(
details
))
{
JArray
subArray
=
JArray
.
Parse
(
details
);
int
dSortNum
=
0
;
foreach
(
var
sItem
in
subArray
)
{
JObject
sObj
=
JObject
.
Parse
(
sItem
.
ToString
());
var
detailModel
=
new
RB_Examination_Details_ViewModel
()
{
Id
=
sObj
.
GetInt
(
"Id"
),
PaperId
=
sObj
.
GetInt
(
"PaperId"
),
BankId
=
sObj
.
GetInt
(
"BankId"
),
QuestionId
=
sObj
.
GetInt
(
"QuestionId"
),
Title
=
sObj
.
GetStringValue
(
"Title"
),
QuestionContent
=
sObj
.
GetStringValue
(
"QuestionContent"
),
DifficultyType
=
(
DifficultyTypeEnum
)
sObj
.
GetInt
(
"DifficultyType"
),
AnswerParse
=
sObj
.
GetStringValue
(
"AnswerParse"
),
QuestionTypeId
=
sObj
.
GetInt
(
"QuestionTypeId"
),
QuestionTypeKey
=
sObj
.
GetStringValue
(
"QuestionTypeKey"
),
Knowledge
=
sObj
.
GetStringValue
(
"Knowledge"
),
CreateBy
=
base
.
UserInfo
.
Id
,
CreateTime
=
DateTime
.
Now
,
UpdateBy
=
base
.
UserInfo
.
Id
,
UpdateTime
=
DateTime
.
Now
,
IsUpdateJobExam
=
sObj
.
GetInt
(
"IsUpdateJobExam"
),
Status
=
Common
.
Enum
.
DateStateEnum
.
Normal
,
SortNum
=
dSortNum
,
Answer
=
sObj
.
GetStringValue
(
"Answer"
),
IsMutex
=
sObj
.
GetInt
(
"IsMutex"
),
Category
=
(
QuestionCategoryEnum
)
sObj
.
GetInt
(
"Category"
),
LevelType
=
(
LevelTypeEnum
)
sObj
.
GetInt
(
"LevelType"
),
Score
=
sObj
.
GetDecimal
(
"Score"
),
};
dSortNum
++;
gModel
.
DetailsList
.
Add
(
detailModel
);
}
}
extModel
.
GroupList
.
Add
(
gModel
);
}
}
}
...
...
@@ -133,5 +160,18 @@ namespace Edu.WebApi.Controllers.Exam
var
model
=
paperModule
.
GetExaminationPaperModule
(
PaperId
);
return
ApiResult
.
Success
(
data
:
model
);
}
/// <summary>
/// 根据编号删除试卷题目
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
DeletePaperQuestion
()
{
var
PaperId
=
base
.
ParmJObj
.
GetInt
(
"PaperId"
);
var
model
=
paperModule
.
RemoveExaminationDetailsModule
(
PaperId
);
return
ApiResult
.
Success
(
data
:
model
);
}
}
}
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