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
32f95555
Commit
32f95555
authored
Aug 22, 2022
by
liudong1993
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
9ac13a06
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
54 additions
and
0 deletions
+54
-0
RB_Exam_Score_Extend.cs
EduSpider.Model/Extend/RB_Exam_Score_Extend.cs
+10
-0
ExamService.cs
EduSpider.Services/ExamService.cs
+44
-0
No files found.
EduSpider.Model/Extend/RB_Exam_Score_Extend.cs
View file @
32f95555
...
...
@@ -91,6 +91,16 @@ namespace EduSpider.Model.Extend
/// 分组排序
/// </summary>
public
int
GroupNum
{
get
;
set
;
}
/// <summary>
/// 一试得分
/// </summary>
public
decimal
AScore
{
get
;
set
;
}
/// <summary>
/// 一试排名
/// </summary>
public
decimal
ARank
{
get
;
set
;
}
}
/// <summary>
...
...
EduSpider.Services/ExamService.cs
View file @
32f95555
...
...
@@ -105,6 +105,48 @@ namespace EduSpider.Services
}
}
//组装一试 二试 排名
if
(
examModel
.
Type
==
2
)
{
var
sExamList
=
Exam_ScoreRepository
.
GetList
(
new
RB_Exam_Score_Extend
()
{
ExamId
=
examId
}).
ToList
();
//当前考试的所有信息
foreach
(
var
item
in
sExamList
)
{
item
.
ScoreList
=
JsonHelper
.
Deserialize
<
List
<
ExamQScoreModel
>>(
item
.
Content
);
foreach
(
var
qitem
in
item
.
ScoreList
)
{
var
qmodel
=
qlist
.
Where
(
x
=>
x
.
Sort
==
qitem
.
Sort
).
FirstOrDefault
();
qitem
.
Difficulty
=
qmodel
?.
Difficulty
??
""
;
qitem
.
KnowledgePoint
=
qmodel
?.
KnowledgePoint
??
""
;
qitem
.
QScore
=
qmodel
?.
Score
??
0
;
qitem
.
GroupName
=
qmodel
?.
GroupName
??
""
;
}
}
var
groupList
=
sExamModel
.
ScoreList
.
Select
(
x
=>
x
.
GroupName
).
ToList
();
foreach
(
var
groupName
in
groupList
)
{
foreach
(
var
qitem
in
sExamList
)
{
//计算一试得分
qitem
.
AScore
=
qitem
.
ScoreList
.
Where
(
x
=>
x
.
GroupName
==
groupName
).
Sum
(
x
=>
x
.
Score
);
}
//看分组排名
int
Rank
=
1
;
sExamList
.
OrderByDescending
(
x
=>
x
.
AScore
).
GroupBy
(
x
=>
x
.
AScore
).
ToList
().
ForEach
(
x
=>
{
x
.
ToList
().
ForEach
(
y
=>
{
y
.
ARank
=
Rank
;
});
Rank
+=
x
.
Count
();
});
sExamModel
?.
ScoreList
.
Where
(
x
=>
x
.
GroupName
==
groupName
).
ToList
().
ForEach
(
x
=>
{
x
.
AScore
=
sExamList
.
Where
(
x
=>
x
.
StuId
==
stuId
).
FirstOrDefault
()?.
AScore
??
0
;
x
.
ARank
=
sExamList
.
Where
(
x
=>
x
.
StuId
==
stuId
).
FirstOrDefault
()?.
ARank
??
0
;
});
}
}
//开始组装数据
return
new
...
...
@@ -141,6 +183,8 @@ namespace EduSpider.Services
GroupModuleList
=
examModel
.
Type
==
2
?
sExamModel
?.
ScoreList
.
GroupBy
(
z
=>
new
{
z
.
GroupName
}).
Select
(
z
=>
new
{
GroupName
=
z
.
Key
,
TScore
=
z
.
FirstOrDefault
().
AScore
,
//总分
Rank
=
z
.
FirstOrDefault
().
ARank
,
//排名
GroupList
=
z
.
GroupBy
(
x
=>
new
{
x
.
KnowledgePoint
}).
Select
(
x
=>
new
{
Module
=
x
.
Key
.
KnowledgePoint
.
Length
>
6
?
x
.
Key
.
KnowledgePoint
.
Substring
(
0
,
6
)
+
".."
:
x
.
Key
.
KnowledgePoint
,
...
...
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