Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
EduSpider
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
viitto
EduSpider
Commits
9f372145
Commit
9f372145
authored
Aug 18, 2022
by
liudong1993
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
4e70c537
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
975 additions
and
51 deletions
+975
-51
IExamRepository.cs
EduSpider.IRepository/IExamRepository.cs
+1
-0
IExamService.cs
EduSpider.IServices/IExamService.cs
+7
-2
RB_Exam.cs
EduSpider.Model/Entity/RB_Exam.cs
+5
-0
RB_Exam_Questions.cs
EduSpider.Model/Entity/RB_Exam_Questions.cs
+5
-0
RB_Exam_Questions_Extend.cs
EduSpider.Model/Extend/RB_Exam_Questions_Extend.cs
+8
-0
RB_Exam_Score_Extend.cs
EduSpider.Model/Extend/RB_Exam_Score_Extend.cs
+99
-0
ExamRepository.cs
EduSpider.Repository/ExamRepository.cs
+32
-0
Exam_QuestionsRepository.cs
EduSpider.Repository/Exam_QuestionsRepository.cs
+5
-0
Exam_ScoreRepository.cs
EduSpider.Repository/Exam_ScoreRepository.cs
+4
-0
ExamService.cs
EduSpider.Services/ExamService.cs
+460
-8
StuExamScoreHelper.cs
EduSpider.Utility/Data/StuExamScoreHelper.cs
+259
-37
ExamController.cs
EduSpider.WebApi/Controllers/Student/ExamController.cs
+88
-2
UploadController.cs
EduSpider.WebApi/Controllers/Upload/UploadController.cs
+2
-2
No files found.
EduSpider.IRepository/IExamRepository.cs
View file @
9f372145
...
...
@@ -16,5 +16,6 @@ namespace EduSpider.Repository
public
interface
IExamRepository
:
IDBRepository
<
RB_Exam
>,
IDependency
{
List
<
RB_Exam_Extend
>
GetExamPageList
(
int
pageIndex
,
int
pageSize
,
out
long
count
,
RB_Exam_Extend
demodel
);
List
<
RB_Exam_Extend
>
GetExamList
(
RB_Exam_Extend
rB_Exam_Extend
);
}
}
EduSpider.IServices/IExamService.cs
View file @
9f372145
using
EduSpider.Model.Extend
;
using
EduSpider.Model.Cache
;
using
EduSpider.Model.Extend
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
...
...
@@ -15,8 +16,12 @@ namespace EduSpider.IServices
{
string
ImportExcelForStuExamScore
(
string
path_server
,
int
courseId
,
string
examName
,
int
userId
);
List
<
RB_Exam_Extend
>
GetExamPageList
(
int
pageIndex
,
int
pageSize
,
out
long
count
,
RB_Exam_Extend
demodel
);
object
GetExamStuScoreInfo
(
int
examId
,
int
stuId
,
int
stuUId
);
object
GetExamStuScoreInfo
(
int
examId
,
int
stuId
,
int
stuUId
,
out
string
msg
);
object
GetExamStuScoreInfo_Group
(
int
examId
,
int
stuId
,
int
stuUId
);
List
<
RB_Exam_Score_Extend
>
GetExamStuList
(
RB_Exam_Score_Extend
demodel
);
string
DelExamInfo
(
int
examId
,
int
baseUserId
);
string
SetExamStatAnalysis
(
int
courseId
,
UserInfo
userInfo
);
object
GetExamStatAnalysisInfo
(
int
examId
,
int
stuId
,
int
stuUId
,
out
string
msg
);
}
}
EduSpider.Model/Entity/RB_Exam.cs
View file @
9f372145
...
...
@@ -53,5 +53,10 @@ namespace EduSpider.Model.Entity
/// 更新时间
/// </summary>
public
DateTime
UpdateTime
{
get
;
set
;
}
/// <summary>
/// 类型 1正常考试 2分组试题 3统计分析
/// </summary>
public
int
Type
{
get
;
set
;
}
}
}
EduSpider.Model/Entity/RB_Exam_Questions.cs
View file @
9f372145
...
...
@@ -43,5 +43,10 @@ namespace EduSpider.Model.Entity
/// 分数
/// </summary>
public
decimal
Score
{
get
;
set
;
}
/// <summary>
/// 分组
/// </summary>
public
string
GroupName
{
get
;
set
;
}
}
}
EduSpider.Model/Extend/RB_Exam_Questions_Extend.cs
View file @
9f372145
...
...
@@ -9,6 +9,14 @@ namespace EduSpider.Model.Extend
/// </summary>
public
class
RB_Exam_Questions_Extend
:
RB_Exam_Questions
{
/// <summary>
/// 考试ids
/// </summary>
public
string
ExamIds
{
get
;
set
;
}
/// <summary>
/// 分组排序
/// </summary>
public
int
GroupNum
{
get
;
set
;
}
}
}
EduSpider.Model/Extend/RB_Exam_Score_Extend.cs
View file @
9f372145
...
...
@@ -22,6 +22,26 @@ namespace EduSpider.Model.Extend
/// 考试导入时间
/// </summary>
public
DateTime
ExamCreateTime
{
get
;
set
;
}
/// <summary>
/// 考试ids
/// </summary>
public
string
ExamIds
{
get
;
set
;
}
/// <summary>
/// 1-8题得分
/// </summary>
public
decimal
PartScore
{
get
;
set
;
}
/// <summary>
/// 一试得分
/// </summary>
public
decimal
AScore
{
get
;
set
;
}
/// <summary>
/// 一试排名
/// </summary>
public
int
ARank
{
get
;
set
;
}
}
/// <summary>
...
...
@@ -56,5 +76,84 @@ namespace EduSpider.Model.Extend
/// 题目分数
/// </summary>
public
decimal
QScore
{
get
;
set
;
}
/// <summary>
/// 分组名称
/// </summary>
public
string
GroupName
{
get
;
set
;
}
/// <summary>
/// 分组排序
/// </summary>
public
int
GroupNum
{
get
;
set
;
}
}
/// <summary>
/// 1-8题得分
/// </summary>
public
class
ExamPartScoreModel
{
/// <summary>
/// 学生ID
/// </summary>
public
int
StuId
{
get
;
set
;
}
/// <summary>
/// 第几次考试
/// </summary>
public
int
Sort
{
get
;
set
;
}
/// <summary>
/// 考试名称 /知识点名称
/// </summary>
public
string
ExamName
{
get
;
set
;
}
/// <summary>
/// 个人得分/ 考试排名
/// </summary>
public
decimal
Score
{
get
;
set
;
}
/// <summary>
/// 平均得分
/// </summary>
public
decimal
AvgScore
{
get
;
set
;
}
/// <summary>
/// 分组名称
/// </summary>
public
string
GroupName
{
get
;
set
;
}
/// <summary>
/// 分组次数
/// </summary>
public
int
GroupNum
{
get
;
set
;
}
/// <summary>
/// 总分
/// </summary>
public
decimal
TScore
{
get
;
set
;
}
}
/// <summary>
/// 统计分析
/// </summary>
public
class
ExamStatModel
{
/// <summary>
/// 1-8题
/// </summary>
public
List
<
ExamPartScoreModel
>
PartScoreList
{
get
;
set
;
}
/// <summary>
/// 分组排名
/// </summary>
public
List
<
ExamPartScoreModel
>
GroupScoreList
{
get
;
set
;
}
/// <summary>
/// 总排名
/// </summary>
public
List
<
ExamPartScoreModel
>
TRankScoreList
{
get
;
set
;
}
/// <summary>
/// 模块分析
/// </summary>
public
List
<
ExamPartScoreModel
>
ModuleScoreList
{
get
;
set
;
}
}
}
EduSpider.Repository/ExamRepository.cs
View file @
9f372145
...
...
@@ -47,5 +47,37 @@ LEFT JOIN (
where
{
where
}
order by e.ExamId desc"
;
return
GetPage
<
RB_Exam_Extend
>(
pageIndex
,
pageSize
,
out
count
,
sql
,
parameters
).
ToList
();
}
/// <summary>
/// 获取考试列表
/// </summary>
/// <param name="demodel"></param>
/// <returns></returns>
public
List
<
RB_Exam_Extend
>
GetExamList
(
RB_Exam_Extend
demodel
)
{
var
parameters
=
new
DynamicParameters
();
string
where
=
" 1=1 and e.Status =0"
;
if
(
demodel
.
CourseId
>
0
)
{
where
+=
$@" and e.
{
nameof
(
RB_Exam_Extend
.
CourseId
)}
=
{
demodel
.
CourseId
}
"
;
}
if
(!
string
.
IsNullOrEmpty
(
demodel
.
ExamName
))
{
where
+=
$@" and e.
{
nameof
(
RB_Exam_Extend
.
ExamName
)}
like @ExamName"
;
parameters
.
Add
(
"ExamName"
,
"%"
+
demodel
.
ExamName
.
Trim
()
+
"%"
);
}
if
(
demodel
.
CreateBy
>
0
)
{
where
+=
$@" and e.
{
nameof
(
RB_Exam_Extend
.
CreateBy
)}
=
{
demodel
.
CreateBy
}
"
;
}
if
(
demodel
.
Type
>
0
)
{
where
+=
$@" and e.
{
nameof
(
RB_Exam_Extend
.
Type
)}
=
{
demodel
.
Type
}
"
;
}
string
sql
=
$@"select e.* FROM rb_exam e
where
{
where
}
order by e.ExamId desc"
;
return
Get
<
RB_Exam_Extend
>(
sql
,
parameters
).
ToList
();
}
}
}
EduSpider.Repository/Exam_QuestionsRepository.cs
View file @
9f372145
...
...
@@ -26,6 +26,11 @@ namespace EduSpider.Repository
{
where
+=
$" and
{
nameof
(
RB_Exam_Questions_Extend
.
ExamId
)}
=
{
dmodel
.
ExamId
}
"
;
}
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
ExamIds
))
{
where
+=
$" and
{
nameof
(
RB_Exam_Questions_Extend
.
ExamId
)}
in(
{
dmodel
.
ExamIds
}
)"
;
}
string
sql
=
$"select * from RB_Exam_Questions where
{
where
}
"
;
return
Get
<
RB_Exam_Questions_Extend
>(
sql
).
ToList
();
}
...
...
EduSpider.Repository/Exam_ScoreRepository.cs
View file @
9f372145
...
...
@@ -50,6 +50,10 @@ WHERE 1=1 and B.Status =0
{
where
+=
$" and
{
nameof
(
RB_Exam_Score_Extend
.
ExamId
)}
=
{
dmodel
.
ExamId
}
"
;
}
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
ExamIds
))
{
where
+=
$" and
{
nameof
(
RB_Exam_Score_Extend
.
ExamId
)}
in(
{
dmodel
.
ExamIds
}
)"
;
}
if
(
dmodel
.
StuId
>
0
)
{
where
+=
$" and
{
nameof
(
RB_Exam_Score_Extend
.
StuId
)}
=
{
dmodel
.
StuId
}
"
;
...
...
EduSpider.Services/ExamService.cs
View file @
9f372145
This diff is collapsed.
Click to expand it.
EduSpider.Utility/Data/StuExamScoreHelper.cs
View file @
9f372145
This diff is collapsed.
Click to expand it.
EduSpider.WebApi/Controllers/Student/ExamController.cs
View file @
9f372145
...
...
@@ -45,7 +45,8 @@ namespace EduSpider.WebApi.Controllers
x
.
FailNum
,
x
.
TScore
,
AvgScore
=
x
.
StuNum
>
0
?
Math
.
Round
(
x
.
TScore
/
x
.
StuNum
,
2
,
MidpointRounding
.
AwayFromZero
)
:
0
,
CreateTime
=
x
.
CreateTime
.
ToString
(
"yyyy-MM-dd HH:mm"
)
CreateTime
=
x
.
CreateTime
.
ToString
(
"yyyy-MM-dd HH:mm"
),
x
.
Type
});
return
ApiResult
.
Success
(
""
,
pmodel
);
}
...
...
@@ -92,7 +93,34 @@ namespace EduSpider.WebApi.Controllers
return
ApiResult
.
ParamIsNull
();
}
var
robj
=
ExamService
.
GetExamStuScoreInfo
(
ExamId
,
StuId
,
StuUId
);
var
robj
=
ExamService
.
GetExamStuScoreInfo
(
ExamId
,
StuId
,
StuUId
,
out
string
msg
);
if
(
msg
==
""
)
{
return
ApiResult
.
Success
(
""
,
robj
);
}
else
{
return
ApiResult
.
Failed
(
msg
);
}
}
/// <summary>
/// 获取学生考试明细(分组的)
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
GetExamStuScoreInfo_Group
()
{
int
ExamId
=
ReqParameters
.
GetInt
(
"ExamId"
);
//考试ID
int
StuId
=
ReqParameters
.
GetInt
(
"StuId"
);
//学生id
int
StuUId
=
ReqParameters
.
GetInt
(
"StuUId"
);
//学生Uid
if
(
ExamId
<=
0
||
(
StuId
<=
0
&&
StuUId
<=
0
))
{
return
ApiResult
.
ParamIsNull
();
}
var
robj
=
ExamService
.
GetExamStuScoreInfo_Group
(
ExamId
,
StuId
,
StuUId
);
return
ApiResult
.
Success
(
""
,
robj
);
}
...
...
@@ -122,5 +150,63 @@ namespace EduSpider.WebApi.Controllers
}
}
#
region
统计分析
/// <summary>
/// 新增统计分析
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
SetExamStatAnalysis
()
{
int
CourseId
=
ReqParameters
.
GetInt
(
"CourseId"
);
//课程ID
if
(
CourseId
<=
0
)
{
return
ApiResult
.
ParamIsNull
(
"请传递课程ID"
);
}
if
(
UserInfo
.
AccountType
!=
Utility
.
Enum
.
AccountTypeEnum
.
Teacher
)
{
return
ApiResult
.
ParamIsNull
(
"非老师账户,无法操作"
);
}
string
rmsg
=
ExamService
.
SetExamStatAnalysis
(
CourseId
,
base
.
UserInfo
);
if
(
rmsg
==
""
)
{
return
ApiResult
.
Success
();
}
else
{
return
ApiResult
.
Failed
(
rmsg
);
}
}
/// <summary>
/// 获取统计分析详情
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
GetExamStatAnalysisInfo
()
{
int
ExamId
=
ReqParameters
.
GetInt
(
"ExamId"
);
//考试ID
int
StuId
=
ReqParameters
.
GetInt
(
"StuId"
);
//学生id
int
StuUId
=
ReqParameters
.
GetInt
(
"StuUId"
);
//学生Uid
if
(
ExamId
<=
0
||
(
StuId
<=
0
&&
StuUId
<=
0
))
{
return
ApiResult
.
ParamIsNull
();
}
var
robj
=
ExamService
.
GetExamStatAnalysisInfo
(
ExamId
,
StuId
,
StuUId
,
out
string
msg
);
if
(
msg
==
""
)
{
return
ApiResult
.
Success
(
""
,
robj
);
}
else
{
return
ApiResult
.
Failed
(
msg
);
}
}
#
endregion
}
}
EduSpider.WebApi/Controllers/Upload/UploadController.cs
View file @
9f372145
...
...
@@ -126,10 +126,10 @@ namespace EduSpider.WebApi.Controllers
{
try
{
string
path_server
=
"C:/Users/Administrator/Desktop/TempFile/
化学成绩查询表
.xlsx"
;
string
path_server
=
"C:/Users/Administrator/Desktop/TempFile/
进阶小程序考试导入/初中鸿志班第三次测试3组
.xlsx"
;
#
region
解析文档数据并保存
string
rmsg
=
ExamService
.
ImportExcelForStuExamScore
(
path_server
,
44977497
,
"测试考试化学2"
,
11759328
);
string
rmsg
=
ExamService
.
ImportExcelForStuExamScore
(
path_server
,
208720463
,
"测试考试化学2"
,
646277
);
if
(
rmsg
==
""
)
{
return
ApiResult
.
Success
();
...
...
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