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
8fdcbd5d
Commit
8fdcbd5d
authored
Jun 02, 2022
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
自定生成评语修改
parent
fdbefa06
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
11 deletions
+15
-11
StuHomeWorkRepository.cs
EduSpider.Repository/StuHomeWorkRepository.cs
+15
-11
No files found.
EduSpider.Repository/StuHomeWorkRepository.cs
View file @
8fdcbd5d
...
...
@@ -148,19 +148,15 @@ WHERE 1=1
var
secondModel
=
homeWorkList
.
Where
(
qitem
=>
qitem
.
RowNum
==
6
).
FirstOrDefault
();
if
(
secondModel
!=
null
)
{
double
seconds
=
(
secondModel
.
CreateTime
-
firstStartTime
).
TotalSeconds
;
Random
rnd
=
new
();
var
newSeconds
=
rnd
.
Next
(
0
,
Convert
.
ToInt32
(
seconds
));
var
newSeconds
=
CreateRandomSecondNum
(
firstStartTime
,
secondModel
.
CreateTime
);
firstStartTime
=
firstStartTime
.
AddSeconds
(
newSeconds
);
}
else
{
firstStartTime
=
firstStartTime
.
AddMinutes
(
firstNum
);
}
if
(
tempModel
==
null
||
(
tempModel
!=
null
&&
tempModel
.
Id
<=
0
))
{
//新增系统生成评价
stuCommentRepository
.
SetStuCommentRepository
(
new
RB_Stu_Comment
()
{
...
...
@@ -195,9 +191,7 @@ WHERE 1=1
var
thirdModel
=
homeWorkList
.
Where
(
qitem
=>
qitem
.
RowNum
==
10
).
FirstOrDefault
();
if
(
thirdModel
!=
null
)
{
double
seconds
=
(
thirdModel
.
CreateTime
-
secondTime
).
TotalSeconds
;
Random
rnd
=
new
();
var
newSeconds
=
rnd
.
Next
(
0
,
Convert
.
ToInt32
(
seconds
));
var
newSeconds
=
CreateRandomSecondNum
(
secondTime
,
thirdModel
.
CreateTime
);
secondTime
=
secondTime
.
AddSeconds
(
newSeconds
);
}
else
...
...
@@ -240,9 +234,7 @@ WHERE 1=1
var
fourthModel
=
homeWorkList
.
Where
(
qitem
=>
qitem
.
RowNum
==
14
).
FirstOrDefault
();
if
(
fourthModel
!=
null
)
{
double
seconds
=
(
fourthModel
.
CreateTime
-
thirdTime
).
TotalSeconds
;
Random
rnd
=
new
();
var
newSeconds
=
rnd
.
Next
(
0
,
Convert
.
ToInt32
(
seconds
));
var
newSeconds
=
CreateRandomSecondNum
(
thirdTime
,
fourthModel
.
CreateTime
);
thirdTime
=
thirdTime
.
AddSeconds
(
newSeconds
);
}
else
...
...
@@ -275,6 +267,18 @@ WHERE 1=1
return
list
;
}
/// <summary>
/// 生成随机秒数
/// </summary>
/// <returns></returns>
private
static
int
CreateRandomSecondNum
(
DateTime
startTime
,
DateTime
endTime
)
{
double
seconds
=
(
endTime
-
startTime
).
TotalSeconds
;
Random
rnd
=
new
();
var
newSeconds
=
rnd
.
Next
(
0
,
Convert
.
ToInt32
(
seconds
));
return
newSeconds
;
}
/// <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