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
e5e6daac
Commit
e5e6daac
authored
May 26, 2022
by
liudong1993
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
5b87deca
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
1 deletion
+24
-1
RB_Exam_Score.cs
EduSpider.Model/Entity/RB_Exam_Score.cs
+10
-0
ExamService.cs
EduSpider.Services/ExamService.cs
+4
-1
ExamController.cs
EduSpider.WebApi/Controllers/Student/ExamController.cs
+10
-0
No files found.
EduSpider.Model/Entity/RB_Exam_Score.cs
View file @
e5e6daac
...
...
@@ -29,6 +29,11 @@ namespace EduSpider.Model.Entity
/// </summary>
public
int
StuId
{
get
;
set
;
}
/// <summary>
/// 学生账户ID
/// </summary>
public
int
StuUId
{
get
;
set
;
}
/// <summary>
/// 导入的姓名
/// </summary>
...
...
@@ -53,5 +58,10 @@ namespace EduSpider.Model.Entity
/// 百分比排名
/// </summary>
public
decimal
RankRate
{
get
;
set
;
}
/// <summary>
/// 考试总分
/// </summary>
public
decimal
ExamScore
{
get
;
set
;
}
}
}
EduSpider.Services/ExamService.cs
View file @
e5e6daac
...
...
@@ -94,7 +94,7 @@ namespace EduSpider.Services
sExamModel
?.
TScore
,
sExamModel
?.
Rank
,
sExamModel
?.
RankRate
,
ScoreRate
=
Math
.
Round
((
sExamModel
?.
TScore
??
0
)
/
qlist
.
Sum
(
x
=>
x
.
Score
),
2
,
MidpointRounding
.
AwayFromZero
),
ScoreRate
=
Math
.
Round
((
sExamModel
?.
TScore
??
0
)
/
(
sExamModel
?.
ExamScore
??
1
),
2
,
MidpointRounding
.
AwayFromZero
),
ScoreList
=
sExamModel
?.
ScoreList
.
Select
(
x
=>
new
{
x
.
Sort
,
...
...
@@ -176,6 +176,7 @@ namespace EduSpider.Services
}
exam_QuestionsRepository
.
BatchInsert
(
InsertEQ
);
decimal
ExamScore
=
InsertEQ
.
Sum
(
x
=>
x
.
Score
);
List
<
Model
.
Entity
.
RB_Exam_Score
>
InsertScore
=
new
();
foreach
(
var
Name
in
StuList
.
Select
(
x
=>
x
.
Name
).
Distinct
())
{
var
clist
=
StuList
.
Where
(
x
=>
x
.
Name
==
Name
).
ToList
();
...
...
@@ -185,6 +186,7 @@ namespace EduSpider.Services
Id
=
0
,
ExamId
=
ExamId
,
StuId
=
stuModel
?.
StudId
??
0
,
//匹配学生失败 可能要在后台给与提示, 重新导入
StuUId
=
stuModel
?.
StudentUid
??
0
,
StuName
=
Name
,
Content
=
JsonHelper
.
Serialize
(
clist
.
Where
(
x
=>
x
.
Id
>
0
).
Select
(
x
=>
new
{
...
...
@@ -195,6 +197,7 @@ namespace EduSpider.Services
TScore
=
clist
.
Where
(
x
=>
x
.
Id
==
-
1
).
FirstOrDefault
()?.
Score
??
0
,
Rank
=
Convert
.
ToInt32
(
clist
.
Where
(
x
=>
x
.
Id
==
-
2
).
FirstOrDefault
()?.
Score
??
0
),
RankRate
=
clist
.
Where
(
x
=>
x
.
Id
==
-
3
).
FirstOrDefault
()?.
Score
??
0
,
ExamScore
=
ExamScore
});
}
//InsertScore = InsertScore.Where(x => x.StuId > 0).ToList();//暂时只插入匹配到学生的
...
...
EduSpider.WebApi/Controllers/Student/ExamController.cs
View file @
e5e6daac
...
...
@@ -46,6 +46,16 @@ namespace EduSpider.WebApi.Controllers
return
ApiResult
.
Success
(
""
,
pmodel
);
}
/// <summary>
/// 获取考试学生列表
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
GetExamStuList
()
{
return
ApiResult
.
Success
();
}
/// <summary>
/// 获取学生考试明细
/// </summary>
...
...
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