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
872978a1
Commit
872978a1
authored
Jun 07, 2022
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
2dbba6a2
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
162 additions
and
146 deletions
+162
-146
StuHomeWorkRepository.cs
EduSpider.Repository/StuHomeWorkRepository.cs
+148
-146
LoginController.cs
EduSpider.WebApi/Controllers/User/LoginController.cs
+12
-0
Startup.cs
EduSpider.WebApi/Startup.cs
+2
-0
No files found.
EduSpider.Repository/StuHomeWorkRepository.cs
View file @
872978a1
...
@@ -83,7 +83,6 @@ WHERE 1=1
...
@@ -83,7 +83,6 @@ WHERE 1=1
{
{
List
<
ExamWorkResult
>
list
=
new
();
List
<
ExamWorkResult
>
list
=
new
();
var
dataList
=
GetStuHomeWorkDetailsListRepository
(
new
CourseQuery
()
{
CourseId
=
CourseId
});
var
dataList
=
GetStuHomeWorkDetailsListRepository
(
new
CourseQuery
()
{
CourseId
=
CourseId
});
var
courseList
=
dataList
.
GroupBy
(
qitem
=>
new
{
qitem
.
course_id
,
qitem
.
CourseName
}).
Select
(
qitem
=>
new
{
qitem
.
Key
.
course_id
,
qitem
.
Key
.
CourseName
});
var
courseList
=
dataList
.
GroupBy
(
qitem
=>
new
{
qitem
.
course_id
,
qitem
.
CourseName
}).
Select
(
qitem
=>
new
{
qitem
.
Key
.
course_id
,
qitem
.
Key
.
CourseName
});
if
(
courseList
!=
null
&&
courseList
.
Any
())
if
(
courseList
!=
null
&&
courseList
.
Any
())
{
{
...
@@ -92,7 +91,9 @@ WHERE 1=1
...
@@ -92,7 +91,9 @@ WHERE 1=1
var
stuList
=
dataList
.
Where
(
qitem
=>
qitem
.
course_id
==
cItem
.
course_id
).
GroupBy
(
qitem
=>
new
{
qitem
.
student_uid
}).
Select
(
qitem
=>
new
{
qitem
.
Key
.
student_uid
});
var
stuList
=
dataList
.
Where
(
qitem
=>
qitem
.
course_id
==
cItem
.
course_id
).
GroupBy
(
qitem
=>
new
{
qitem
.
student_uid
}).
Select
(
qitem
=>
new
{
qitem
.
Key
.
student_uid
});
//课程配置评论列表
//课程配置评论列表
var
courseCommentList
=
new
CourseCommentRepository
().
GetCourseCommentListRepository
(
new
CourseQuery
()
{
QCourseIds
=
cItem
.
course_id
.
ToString
()
});
var
courseCommentList
=
new
CourseCommentRepository
().
GetCourseCommentListRepository
(
new
CourseQuery
()
{
QCourseIds
=
cItem
.
course_id
.
ToString
()
});
var
defaultCommentList
=
new
CommentRepository
().
GetCommentListRepository
(
new
CourseQuery
()
{
KeyWords
=
cItem
.
CourseName
});
if
((
courseCommentList
!=
null
&&
courseCommentList
.
Count
>
0
)
||
(
defaultCommentList
!=
null
&&
defaultCommentList
.
Count
>
0
))
{
foreach
(
var
sItem
in
stuList
)
foreach
(
var
sItem
in
stuList
)
{
{
List
<
ExamWorkResult
>
homeWorkList
=
new
();
List
<
ExamWorkResult
>
homeWorkList
=
new
();
...
@@ -131,11 +132,11 @@ WHERE 1=1
...
@@ -131,11 +132,11 @@ WHERE 1=1
var
firstList
=
homeWorkList
.
Where
(
qitem
=>
qitem
.
RowNum
<=
5
).
ToList
();
var
firstList
=
homeWorkList
.
Where
(
qitem
=>
qitem
.
RowNum
<=
5
).
ToList
();
var
firstSubmitCount
=
firstList
.
Where
(
qitem
=>
qitem
.
HomeWorkStatus
==
0
).
Count
();
var
firstSubmitCount
=
firstList
.
Where
(
qitem
=>
qitem
.
HomeWorkStatus
==
0
).
Count
();
//第一阶段有提交作业情况(至少一次)
//第一阶段有提交作业情况(至少一次)
if
(
firstList
.
Count
!=
firstSubmitCount
)
if
(
firstList
.
Count
!=
firstSubmitCount
)
{
{
var
firstScore
=
firstList
.
Average
(
qitem
=>
qitem
.
Score_p
)
*
100
;
var
firstScore
=
firstList
.
Average
(
qitem
=>
qitem
.
Score_p
)
*
100
;
string
title
=
firstList
.
LastOrDefault
().
ThName
+
"老师的评语"
;
string
title
=
firstList
.
LastOrDefault
().
ThName
+
"老师的评语"
;
info
=
GetCommentInfo
(
courseCommentList
,
cItem
.
CourseName
,
1
,
firstScore
);
info
=
GetCommentInfo
(
courseCommentList
,
cItem
.
CourseName
,
1
,
firstScore
);
if
(!
string
.
IsNullOrEmpty
(
info
))
if
(!
string
.
IsNullOrEmpty
(
info
))
{
{
var
First_Stu_HomeWork_Id
=
firstList
.
LastOrDefault
().
Stu_HomeWork_Id
;
var
First_Stu_HomeWork_Id
=
firstList
.
LastOrDefault
().
Stu_HomeWork_Id
;
...
@@ -179,7 +180,7 @@ WHERE 1=1
...
@@ -179,7 +180,7 @@ WHERE 1=1
var
secondList
=
homeWorkList
.
Where
(
qitem
=>
qitem
.
RowNum
>
5
&&
qitem
.
RowNum
<=
9
).
ToList
();
var
secondList
=
homeWorkList
.
Where
(
qitem
=>
qitem
.
RowNum
>
5
&&
qitem
.
RowNum
<=
9
).
ToList
();
var
secondSubmitCount
=
secondList
.
Where
(
qitem
=>
qitem
.
HomeWorkStatus
==
0
).
Count
();
var
secondSubmitCount
=
secondList
.
Where
(
qitem
=>
qitem
.
HomeWorkStatus
==
0
).
Count
();
//第二阶段有提交作业情况(至少一次)
//第二阶段有提交作业情况(至少一次)
if
(
secondList
.
Count
!=
secondSubmitCount
)
if
(
secondList
.
Count
!=
secondSubmitCount
)
{
{
var
secondScore
=
secondList
.
Average
(
qitem
=>
qitem
.
Score_p
)
*
100
;
var
secondScore
=
secondList
.
Average
(
qitem
=>
qitem
.
Score_p
)
*
100
;
info
=
GetCommentInfo
(
courseCommentList
,
cItem
.
CourseName
,
2
,
secondScore
);
info
=
GetCommentInfo
(
courseCommentList
,
cItem
.
CourseName
,
2
,
secondScore
);
...
@@ -226,7 +227,7 @@ WHERE 1=1
...
@@ -226,7 +227,7 @@ WHERE 1=1
var
thirdList
=
homeWorkList
.
Where
(
qitem
=>
qitem
.
RowNum
>
9
&&
qitem
.
RowNum
<=
13
).
ToList
();
var
thirdList
=
homeWorkList
.
Where
(
qitem
=>
qitem
.
RowNum
>
9
&&
qitem
.
RowNum
<=
13
).
ToList
();
var
thirdSubmitCount
=
thirdList
.
Where
(
qitem
=>
qitem
.
HomeWorkStatus
==
0
).
Count
();
var
thirdSubmitCount
=
thirdList
.
Where
(
qitem
=>
qitem
.
HomeWorkStatus
==
0
).
Count
();
//第三阶段有提交作业情况(至少一次)
//第三阶段有提交作业情况(至少一次)
if
(
thirdList
.
Count
!=
thirdSubmitCount
)
if
(
thirdList
.
Count
!=
thirdSubmitCount
)
{
{
var
thirdScore
=
thirdList
.
Average
(
qitem
=>
qitem
.
Score_p
)
*
100
;
var
thirdScore
=
thirdList
.
Average
(
qitem
=>
qitem
.
Score_p
)
*
100
;
info
=
GetCommentInfo
(
courseCommentList
,
cItem
.
CourseName
,
3
,
thirdScore
);
info
=
GetCommentInfo
(
courseCommentList
,
cItem
.
CourseName
,
3
,
thirdScore
);
...
@@ -270,6 +271,7 @@ WHERE 1=1
...
@@ -270,6 +271,7 @@ WHERE 1=1
}
}
}
}
}
}
}
return
list
;
return
list
;
}
}
...
...
EduSpider.WebApi/Controllers/User/LoginController.cs
View file @
872978a1
...
@@ -30,6 +30,18 @@ namespace EduSpider.WebApi.Controllers
...
@@ -30,6 +30,18 @@ namespace EduSpider.WebApi.Controllers
[
Autowired
]
[
Autowired
]
public
IAccountService
AccountService
{
get
;
set
;
}
public
IAccountService
AccountService
{
get
;
set
;
}
/// <summary>
/// 心跳检测
/// </summary>
/// <returns></returns>
[
HttpGet
]
[
HttpPost
]
[
AllowAnonymous
]
public
ApiResult
Heart
()
{
return
ApiResult
.
Success
();
}
#
region
账号密码登录
#
region
账号密码登录
/// <summary>
/// <summary>
/// 账号密码登录
/// 账号密码登录
...
...
EduSpider.WebApi/Startup.cs
View file @
872978a1
using
Autofac
;
using
Autofac
;
using
Edu.WebApi.Filter
;
using
Edu.WebApi.Filter
;
using
EduSpider.WebApi.Timers
;
using
Microsoft.AspNetCore.Builder
;
using
Microsoft.AspNetCore.Builder
;
using
Microsoft.AspNetCore.Hosting
;
using
Microsoft.AspNetCore.Hosting
;
using
Microsoft.AspNetCore.Mvc.Controllers
;
using
Microsoft.AspNetCore.Mvc.Controllers
;
...
@@ -49,6 +50,7 @@ namespace EduSpider.WebApi
...
@@ -49,6 +50,7 @@ namespace EduSpider.WebApi
options
.
JsonSerializerOptions
.
Encoder
=
System
.
Text
.
Encodings
.
Web
.
JavaScriptEncoder
.
Create
(
System
.
Text
.
Unicode
.
UnicodeRanges
.
All
);
options
.
JsonSerializerOptions
.
Encoder
=
System
.
Text
.
Encodings
.
Web
.
JavaScriptEncoder
.
Create
(
System
.
Text
.
Unicode
.
UnicodeRanges
.
All
);
options
.
JsonSerializerOptions
.
PropertyNamingPolicy
=
null
;
options
.
JsonSerializerOptions
.
PropertyNamingPolicy
=
null
;
});
});
services
.
AddHostedService
<
TimedTaskServices
>();
}
}
/// <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