Commit fdbefa06 authored by 黄奎's avatar 黄奎

自动生成评语修改

parent bd6ab0fa
...@@ -143,9 +143,24 @@ WHERE 1=1 ...@@ -143,9 +143,24 @@ WHERE 1=1
info = GetCommentInfo(courseCommentModel, firstScore); info = GetCommentInfo(courseCommentModel, firstScore);
var First_Stu_HomeWork_Id = firstList.LastOrDefault().Stu_HomeWork_Id; var First_Stu_HomeWork_Id = firstList.LastOrDefault().Stu_HomeWork_Id;
var tempModel = GetSystemCreateComment(commentList, cItem.course_id, First_Stu_HomeWork_Id); var tempModel = GetSystemCreateComment(commentList, cItem.course_id, First_Stu_HomeWork_Id);
var firstNum = CreateRandomNum();
var firstStartTime = firstList.LastOrDefault().CreateTime;
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));
firstStartTime = firstStartTime.AddSeconds(newSeconds);
}
else
{
firstStartTime = firstStartTime.AddMinutes(firstNum);
}
if (tempModel == null || (tempModel != null && tempModel.Id <= 0)) if (tempModel == null || (tempModel != null && tempModel.Id <= 0))
{ {
var firstNum = CreateRandomNum();
//新增系统生成评价 //新增系统生成评价
stuCommentRepository.SetStuCommentRepository(new RB_Stu_Comment() stuCommentRepository.SetStuCommentRepository(new RB_Stu_Comment()
{ {
...@@ -157,7 +172,7 @@ WHERE 1=1 ...@@ -157,7 +172,7 @@ WHERE 1=1
Info = info, Info = info,
CreateType = 1, CreateType = 1,
CreateByName = firstList.LastOrDefault().ThName, CreateByName = firstList.LastOrDefault().ThName,
CreateTime = firstList.LastOrDefault().CreateTime.AddMinutes(firstNum), CreateTime = firstStartTime,
ShowType = 3, ShowType = 3,
}); });
} }
...@@ -175,9 +190,23 @@ WHERE 1=1 ...@@ -175,9 +190,23 @@ WHERE 1=1
info = GetCommentInfo(courseCommentModel, secondScore); info = GetCommentInfo(courseCommentModel, secondScore);
var Second_Stu_HomeWork_Id = secondList.LastOrDefault().Stu_HomeWork_Id; var Second_Stu_HomeWork_Id = secondList.LastOrDefault().Stu_HomeWork_Id;
var secondModel = GetSystemCreateComment(commentList, cItem.course_id, Second_Stu_HomeWork_Id); var secondModel = GetSystemCreateComment(commentList, cItem.course_id, Second_Stu_HomeWork_Id);
var secondNum = CreateRandomNum();
var secondTime = secondList.LastOrDefault().CreateTime;
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));
secondTime = secondTime.AddSeconds(newSeconds);
}
else
{
secondTime = secondTime.AddMinutes(secondNum);
}
if (secondModel == null || (secondModel != null && secondModel.Id <= 0)) if (secondModel == null || (secondModel != null && secondModel.Id <= 0))
{ {
var secondNum = CreateRandomNum();
stuCommentRepository.SetStuCommentRepository(new RB_Stu_Comment() stuCommentRepository.SetStuCommentRepository(new RB_Stu_Comment()
{ {
Id = 0, Id = 0,
...@@ -188,7 +217,7 @@ WHERE 1=1 ...@@ -188,7 +217,7 @@ WHERE 1=1
Info = info, Info = info,
CreateType = 1, CreateType = 1,
CreateByName = secondList.LastOrDefault().ThName, CreateByName = secondList.LastOrDefault().ThName,
CreateTime = secondList.LastOrDefault().CreateTime.AddMinutes(secondNum), CreateTime = secondTime,
ShowType = 3, ShowType = 3,
}); });
} }
...@@ -206,9 +235,22 @@ WHERE 1=1 ...@@ -206,9 +235,22 @@ WHERE 1=1
info = GetCommentInfo(courseCommentModel, thirdScore); info = GetCommentInfo(courseCommentModel, thirdScore);
var Third_Stu_HomeWork_Id = thirdList.LastOrDefault().Stu_HomeWork_Id; var Third_Stu_HomeWork_Id = thirdList.LastOrDefault().Stu_HomeWork_Id;
var thirdModel = GetSystemCreateComment(commentList, cItem.course_id, Third_Stu_HomeWork_Id); var thirdModel = GetSystemCreateComment(commentList, cItem.course_id, Third_Stu_HomeWork_Id);
var thirdNum = CreateRandomNum();
var thirdTime = thirdList.LastOrDefault().CreateTime;
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));
thirdTime = thirdTime.AddSeconds(newSeconds);
}
else
{
thirdTime = thirdTime.AddMinutes(thirdNum);
}
if (thirdModel == null || (thirdModel != null && thirdModel.Id <= 0)) if (thirdModel == null || (thirdModel != null && thirdModel.Id <= 0))
{ {
var thirdNum = CreateRandomNum();
stuCommentRepository.SetStuCommentRepository(new RB_Stu_Comment() stuCommentRepository.SetStuCommentRepository(new RB_Stu_Comment()
{ {
Id = 0, Id = 0,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment