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
b08793cd
Commit
b08793cd
authored
Mar 11, 2022
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
98c1e4b0
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
298 additions
and
19 deletions
+298
-19
ConvertHelper.cs
Edu.Common/Plugin/ConvertHelper.cs
+10
-2
RB_Student_ExamDetails.cs
Edu.Model/Entity/Exam/RB_Student_ExamDetails.cs
+15
-0
RB_Student_Practice_Extend.cs
Edu.Model/ViewModel/Exam/RB_Student_Practice_Extend.cs
+19
-0
CourseExamModule.cs
Edu.Module.Exam/CourseExamModule.cs
+165
-16
RB_Student_ExamDetailsRepository.cs
Edu.Repository/Exam/RB_Student_ExamDetailsRepository.cs
+14
-0
RB_Student_PracticeRepository.cs
Edu.Repository/Exam/RB_Student_PracticeRepository.cs
+37
-0
ExamController.cs
Edu.WebApi/Controllers/Exam/ExamController.cs
+38
-1
No files found.
Edu.Common/Plugin/ConvertHelper.cs
View file @
b08793cd
...
...
@@ -286,8 +286,16 @@ namespace Edu.Common
/// <returns></returns>
public
static
int
CalcMinutes
(
DateTime
start
,
DateTime
end
)
{
int
minutes
=
Convert
.
ToInt32
((
end
-
start
).
TotalSeconds
);
minutes
/=
60
;
int
minutes
=
0
;
try
{
minutes
=
Convert
.
ToInt32
((
end
-
start
).
TotalSeconds
);
minutes
/=
60
;
}
catch
{
}
return
minutes
;
}
...
...
Edu.Model/Entity/Exam/RB_Student_ExamDetails.cs
View file @
b08793cd
...
...
@@ -66,5 +66,20 @@ namespace Edu.Model.Entity.Exam
/// 是否作答错误(1-是)
/// </summary>
public
int
IsWrong
{
get
;
set
;
}
/// <summary>
/// 学生答案
/// </summary>
public
string
StudentAnswer
{
get
;
set
;
}
/// <summary>
/// 学生得分
/// </summary>
public
decimal
Score
{
get
;
set
;
}
/// <summary>
/// 学生得分
/// </summary>
public
decimal
StudentScore
{
get
;
set
;
}
}
}
Edu.Model/ViewModel/Exam/RB_Student_Practice_Extend.cs
View file @
b08793cd
...
...
@@ -10,5 +10,24 @@ namespace Edu.Model.ViewModel.Exam
/// </summary>
public
class
RB_Student_Practice_Extend
:
RB_Student_Practice
{
/// <summary>
/// 错题数量
/// </summary>
public
int
WrongCount
{
get
;
set
;
}
/// <summary>
/// 开始编号
/// </summary>
public
int
StartId
{
get
;
set
;
}
/// <summary>
/// 是否只查询错题
/// </summary>
public
int
IsQueryWrong
{
get
;
set
;
}
/// <summary>
/// 分类编号
/// </summary>
public
string
QCategoryIds
{
get
;
set
;
}
}
}
Edu.Module.Exam/CourseExamModule.cs
View file @
b08793cd
This diff is collapsed.
Click to expand it.
Edu.Repository/Exam/RB_Student_ExamDetailsRepository.cs
View file @
b08793cd
...
...
@@ -38,5 +38,19 @@ WHERE 1=1
}
return
Get
<
RB_Student_ExamDetails_Extend
>(
builder
.
ToString
()).
ToList
();
}
/// <summary>
/// 批量提交考试
/// </summary>
/// <param name="list"></param>
/// <returns></returns>
public
bool
BatchStudentExamDetailsRepository
(
List
<
RB_Student_ExamDetails_Extend
>
list
)
{
StringBuilder
builder
=
new
StringBuilder
();
builder
.
Append
(
"INSERT INTO RB_Student_ExamDetails (ExamId,QuestionId,Title,QuestionContent,QuestionTypeId,QuestionTypeKey,Answer,AnswerParse,IsAnswer,IsWrong,StudentAnswer,Score,StudentScore) "
);
builder
.
Append
(
" VALUES(@ExamId,@QuestionId,@Title,@QuestionContent,@QuestionTypeId,@QuestionTypeKey,@Answer,@AnswerParse,@IsAnswer,@IsWrong,@StudentAnswer,@Score,@StudentScore) "
);
return
base
.
Execute
(
builder
.
ToString
(),
list
)
>
0
;
}
}
}
Edu.Repository/Exam/RB_Student_PracticeRepository.cs
View file @
b08793cd
...
...
@@ -77,8 +77,45 @@ WHERE 1=1
{
builder
.
AppendFormat
(
" AND A.{0}={1} "
,
nameof
(
RB_Student_Practice_Extend
.
LevelType
),
(
int
)
query
.
LevelType
);
}
if
(
query
.
IsQueryWrong
==
1
)
{
builder
.
AppendFormat
(
" AND A.{0}={1} "
,
nameof
(
RB_Student_Practice_Extend
.
IsWrong
),
1
);
}
if
(!
string
.
IsNullOrEmpty
(
query
.
QCategoryIds
))
{
builder
.
AppendFormat
(
" AND A.{0} IN({1}) "
,
nameof
(
RB_Student_Practice_Extend
.
Category
),
query
.
QCategoryIds
);
}
}
return
GetPage
<
RB_Student_Practice_Extend
>(
pageIndex
,
pageSize
,
out
rowsCount
,
builder
.
ToString
()).
ToList
();
}
/// <summary>
/// 获取学员练习错题统计
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public
List
<
RB_Student_Practice_Extend
>
GetStudentPracticeWrongStaticRepository
(
RB_Student_Practice_Extend
query
)
{
StringBuilder
builder
=
new
StringBuilder
();
builder
.
AppendFormat
(
@"
SELECT Category,COUNT(1) AS WrongCount
FROM rb_student_practice
WHERE 1=1
"
);
builder
.
AppendFormat
(
" AND IsWrong=1 "
);
if
(
query
!=
null
)
{
if
(
query
.
StudentId
>
0
)
{
builder
.
AppendFormat
(
" AND {0}={1} "
,
nameof
(
RB_Student_Practice_Extend
.
StudentId
),
query
.
StudentId
);
}
if
(
query
.
LevelType
>
0
)
{
builder
.
AppendFormat
(
" AND {0}={1} "
,
nameof
(
RB_Student_Practice_Extend
.
LevelType
),
(
int
)
query
.
LevelType
);
}
}
builder
.
AppendFormat
(
" GROUP BY Category "
);
return
Get
<
RB_Student_Practice_Extend
>(
builder
.
ToString
()).
ToList
();
}
}
}
Edu.WebApi/Controllers/Exam/ExamController.cs
View file @
b08793cd
...
...
@@ -1140,7 +1140,6 @@ namespace Edu.WebApi.Controllers.Exam
Id
=
base
.
ParmJObj
.
GetInt
(
"Id"
),
BankId
=
base
.
ParmJObj
.
GetInt
(
"BankId"
),
StudentId
=
base
.
ParmJObj
.
GetInt
(
"StudentId"
),
StartTime
=
base
.
ParmJObj
.
GetDateTime
(
"StartTime"
),
CreateTime
=
DateTime
.
Now
,
GroupId
=
base
.
ParmJObj
.
GetInt
(
"GroupId"
)
};
...
...
@@ -1191,6 +1190,8 @@ namespace Edu.WebApi.Controllers.Exam
AnswerParse
=
sObj
.
GetStringValue
(
"AnswerParse"
),
IsAnswer
=
sObj
.
GetInt
(
"IsAnswer"
),
IsWrong
=
sObj
.
GetInt
(
"IsWrong"
),
StudentAnswer
=
sObj
.
GetStringValue
(
"StudentAnswer"
),
Score
=
sObj
.
GetDecimal
(
"Score"
),
};
model
.
ExamDetailsList
.
Add
(
sModel
);
}
...
...
@@ -1200,6 +1201,42 @@ namespace Edu.WebApi.Controllers.Exam
return
flag
?
ApiResult
.
Success
()
:
ApiResult
.
Failed
();
}
/// <summary>
/// 获取错题练习统计
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
GetPracticeWrongStatic
()
{
var
query
=
new
RB_Student_Practice_Extend
()
{
StudentId
=
base
.
ParmJObj
.
GetInt
(
"StudentId"
),
LevelType
=
(
LevelTypeEnum
)
base
.
ParmJObj
.
GetInt
(
"LevelType"
),
};
var
obj
=
courseExamModule
.
GetPracticeWrongStaticModule
(
query
);
return
ApiResult
.
Success
(
data
:
obj
);
}
/// <summary>
/// 获取错题分页列表
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
GetPracticeWrongPage
()
{
var
pageModel
=
JsonHelper
.
DeserializeObject
<
ResultPageModel
>(
RequestParm
.
Msg
.
ToString
());
var
query
=
new
RB_Student_Practice_Extend
()
{
StudentId
=
base
.
ParmJObj
.
GetInt
(
"StudentId"
),
LevelType
=
(
LevelTypeEnum
)
base
.
ParmJObj
.
GetInt
(
"LevelType"
),
StartId
=
base
.
ParmJObj
.
GetInt
(
"StartId"
),
};
query
.
IsQueryWrong
=
1
;
var
list
=
courseExamModule
.
GetPracticeWrongPageModule
(
pageModel
.
PageIndex
,
pageModel
.
PageSize
,
out
long
rowsCount
,
query
);
pageModel
.
Count
=
rowsCount
;
pageModel
.
PageData
=
list
;
return
ApiResult
.
Success
(
data
:
pageModel
);
}
#
endregion
}
}
\ 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