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
056a0cc8
Commit
056a0cc8
authored
Nov 23, 2022
by
liudong1993
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
893902aa
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
18 deletions
+21
-18
ExamService.cs
EduSpider.Services/ExamService.cs
+21
-18
No files found.
EduSpider.Services/ExamService.cs
View file @
056a0cc8
...
...
@@ -80,10 +80,11 @@ namespace EduSpider.Services
public
object
GetExamStuScoreInfo
(
int
examId
,
int
stuId
,
int
stuUId
,
out
string
msg
)
{
msg
=
""
;
if
(
stuUId
>
0
)
{
var
accountModel
=
AccountRepository
.
GetAccountList
(
new
rb_account_hk_Extend
()
{
AccountId
=
stuUId
,
AccountType
=
Utility
.
Enum
.
AccountTypeEnum
.
Student
}).
FirstOrDefault
();
if
(
accountModel
==
null
)
{
msg
=
"账号不存在"
;
return
""
;
}
stuId
=
accountModel
.
Id
;
// 因为可能涉及多个student 使用 stuUID 作为唯一标识
if
(
stuUId
<=
0
)
{
stuUId
=
StudentRepository
.
GetEntity
(
stuId
)?.
StudentUid
??
0
;
if
(
stuUId
<=
0
)
{
msg
=
"未查到账号信息"
;
return
""
;
}
}
var
stuModel
=
StudentRepository
.
GetEntity
(
stuId
);
if
(
stuModel
==
null
)
{
msg
=
"学生信息不存在"
;
return
""
;
}
...
...
@@ -93,7 +94,7 @@ namespace EduSpider.Services
//考试题目
var
qlist
=
Exam_QuestionsRepository
.
GetList
(
new
RB_Exam_Questions_Extend
()
{
ExamId
=
examId
});
//考试成绩
var
sExamModel
=
Exam_ScoreRepository
.
GetList
(
new
RB_Exam_Score_Extend
()
{
ExamId
=
examId
,
Stu
Id
=
stu
Id
}).
FirstOrDefault
();
var
sExamModel
=
Exam_ScoreRepository
.
GetList
(
new
RB_Exam_Score_Extend
()
{
ExamId
=
examId
,
Stu
UId
=
stuU
Id
}).
FirstOrDefault
();
if
(
sExamModel
!=
null
)
{
sExamModel
.
ScoreList
=
JsonHelper
.
Deserialize
<
List
<
ExamQScoreModel
>>(
sExamModel
.
Content
);
foreach
(
var
qitem
in
sExamModel
.
ScoreList
)
{
...
...
@@ -141,8 +142,8 @@ namespace EduSpider.Services
sExamModel
?.
ScoreList
.
Where
(
x
=>
x
.
GroupName
==
groupName
).
ToList
().
ForEach
(
x
=>
{
x
.
AScore
=
sExamList
.
Where
(
x
=>
x
.
Stu
Id
==
stu
Id
).
FirstOrDefault
()?.
AScore
??
0
;
x
.
ARank
=
sExamList
.
Where
(
x
=>
x
.
Stu
Id
==
stu
Id
).
FirstOrDefault
()?.
ARank
??
0
;
x
.
AScore
=
sExamList
.
Where
(
x
=>
x
.
Stu
UId
==
stuU
Id
).
FirstOrDefault
()?.
AScore
??
0
;
x
.
ARank
=
sExamList
.
Where
(
x
=>
x
.
Stu
UId
==
stuU
Id
).
FirstOrDefault
()?.
ARank
??
0
;
});
}
...
...
@@ -152,6 +153,7 @@ namespace EduSpider.Services
return
new
{
StuId
=
stuModel
.
StudId
,
StuUId
=
stuUId
,
StuName
=
stuModel
.
StudentName
,
examModel
.
ExamName
,
examModel
.
Type
,
...
...
@@ -219,11 +221,11 @@ namespace EduSpider.Services
/// <returns></returns>
public
object
GetExamStuScoreInfo_Group
(
int
examId
,
int
stuId
,
int
stuUId
)
{
if
(
stuUId
>
0
)
// 因为可能涉及多个student 使用 stuUID 作为唯一标识
if
(
stuUId
<=
0
)
{
var
accountModel
=
AccountRepository
.
GetAccountList
(
new
rb_account_hk_Extend
()
{
AccountId
=
stuUId
,
AccountType
=
Utility
.
Enum
.
AccountTypeEnum
.
Student
}).
FirstOrDefault
();
if
(
accountModel
==
null
)
{
return
""
;
}
stuId
=
accountModel
.
Id
;
stuUId
=
StudentRepository
.
GetEntity
(
stuId
)?.
StudentUid
??
0
;
if
(
stuUId
<=
0
)
{
return
""
;
}
}
var
stuModel
=
StudentRepository
.
GetEntity
(
stuId
);
if
(
stuModel
==
null
)
{
return
""
;
}
...
...
@@ -232,7 +234,7 @@ namespace EduSpider.Services
//考试题目
var
qlist
=
Exam_QuestionsRepository
.
GetList
(
new
RB_Exam_Questions_Extend
()
{
ExamId
=
examId
});
//考试成绩
var
sExamModel
=
Exam_ScoreRepository
.
GetList
(
new
RB_Exam_Score_Extend
()
{
ExamId
=
examId
,
Stu
Id
=
stu
Id
}).
FirstOrDefault
();
var
sExamModel
=
Exam_ScoreRepository
.
GetList
(
new
RB_Exam_Score_Extend
()
{
ExamId
=
examId
,
Stu
UId
=
stuU
Id
}).
FirstOrDefault
();
if
(
sExamModel
!=
null
)
{
sExamModel
.
ScoreList
=
JsonHelper
.
Deserialize
<
List
<
ExamQScoreModel
>>(
sExamModel
.
Content
);
...
...
@@ -250,6 +252,7 @@ namespace EduSpider.Services
return
new
{
StuId
=
stuModel
.
StudId
,
StuUId
=
stuUId
,
StuName
=
stuModel
.
StudentName
,
examModel
.
ExamName
,
sExamModel
?.
TScore
,
...
...
@@ -781,12 +784,11 @@ namespace EduSpider.Services
/// <returns></returns>
public
object
GetExamStatAnalysisInfo
(
int
examId
,
int
stuId
,
int
stuUId
,
out
string
msg
)
{
msg
=
""
;
if
(
stuUId
>
0
)
msg
=
""
;
if
(
stuUId
<=
0
)
{
var
accountModel
=
AccountRepository
.
GetAccountList
(
new
rb_account_hk_Extend
()
{
AccountId
=
stuUId
,
AccountType
=
Utility
.
Enum
.
AccountTypeEnum
.
Student
}).
FirstOrDefault
();
if
(
accountModel
==
null
)
{
msg
=
"账号不存在"
;
return
""
;
}
stuId
=
accountModel
.
Id
;
stuUId
=
StudentRepository
.
GetEntity
(
stuId
)?.
StudentUid
??
0
;
if
(
stuUId
<=
0
)
{
msg
=
"账号不存在"
;
return
""
;
}
}
var
stuModel
=
StudentRepository
.
GetEntity
(
stuId
);
if
(
stuModel
==
null
)
{
msg
=
"学生信息不存在"
;
return
""
;
}
...
...
@@ -794,7 +796,7 @@ namespace EduSpider.Services
if
(
examModel
==
null
)
{
msg
=
"考试信息不存在"
;
return
""
;
}
if
(
examModel
.
Type
!=
3
)
{
msg
=
"非统计分析请求"
;
return
""
;
}
//考试成绩
var
sExamModel
=
Exam_ScoreRepository
.
GetList
(
new
RB_Exam_Score_Extend
()
{
ExamId
=
examId
,
Stu
Id
=
stu
Id
}).
FirstOrDefault
();
var
sExamModel
=
Exam_ScoreRepository
.
GetList
(
new
RB_Exam_Score_Extend
()
{
ExamId
=
examId
,
Stu
UId
=
stuU
Id
}).
FirstOrDefault
();
ExamStatModel
statList
=
new
ExamStatModel
();
if
(
sExamModel
!=
null
)
{
...
...
@@ -805,6 +807,7 @@ namespace EduSpider.Services
return
new
{
StuId
=
stuModel
.
StudId
,
StuUId
=
stuUId
,
StuName
=
stuModel
.
StudentName
,
examModel
.
ExamName
,
examModel
.
AnalysisType
,
...
...
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