diff --git a/Model/Tiobon.Web.pdm b/Model/Tiobon.Web.pdm index d66bafb8..9c3c3f6e 100644 --- a/Model/Tiobon.Web.pdm +++ b/Model/Tiobon.Web.pdm @@ -1,5 +1,5 @@ - + @@ -108817,11 +108817,11 @@ LABL 0 Arial Unicode MS,8,N ImageUrl 1714101462 Administrator -1714101683 +1723109984 Administrator 图片地址 -nvarchar(64) -64 +nvarchar(128) +128 7A58B7A7-4156-4865-85C6-E997C3C3A410 diff --git a/Tiobon.Core.Api/Tiobon.Core.Model.xml b/Tiobon.Core.Api/Tiobon.Core.Model.xml index 434f33dc..347427e8 100644 --- a/Tiobon.Core.Api/Tiobon.Core.Model.xml +++ b/Tiobon.Core.Api/Tiobon.Core.Model.xml @@ -12687,6 +12687,21 @@ 随机出题 + + + 试卷管理-评分方式 + + + + + 手动评分 + + + + + 系统评分 + + 考试管理-状态 diff --git a/Tiobon.Core.Model/Base/Ghre/Ghre_QuestionAnswer.Dto.Base.cs b/Tiobon.Core.Model/Base/Ghre/Ghre_QuestionAnswer.Dto.Base.cs index 3087473d..3d3847d9 100644 --- a/Tiobon.Core.Model/Base/Ghre/Ghre_QuestionAnswer.Dto.Base.cs +++ b/Tiobon.Core.Model/Base/Ghre/Ghre_QuestionAnswer.Dto.Base.cs @@ -51,7 +51,7 @@ namespace Tiobon.Core.Model.Models /// /// 图片地址 /// - [Display(Name = "ImageUrl"), Description("图片地址"), MaxLength(64, ErrorMessage = "图片地址 不能超过 64 个字符")] + [Display(Name = "ImageUrl"), Description("图片地址"), MaxLength(64, ErrorMessage = "图片地址 不能超过 128 个字符")] public string ImageUrl { get; set; } /// diff --git a/Tiobon.Core.Model/Consts.cs b/Tiobon.Core.Model/Consts.cs index 2dc7db16..7022d52a 100644 --- a/Tiobon.Core.Model/Consts.cs +++ b/Tiobon.Core.Model/Consts.cs @@ -66,6 +66,23 @@ public class Consts /// public const string RANDOM = "random"; + } + + /// + /// 试卷管理-评分方式 + /// + public static class DIC_EXAM_PAPER_SCORE_METHOD + { + /// + /// 手动评分 + /// + public const string MANUAL = "Manual"; + + /// + /// 系统评分 + /// + public const string SYSTEM = "System"; + } #endregion diff --git a/Tiobon.Core.Model/Models/Ghre/Ghre_QuestionAnswer.cs b/Tiobon.Core.Model/Models/Ghre/Ghre_QuestionAnswer.cs index c9fef913..84eb0e10 100644 --- a/Tiobon.Core.Model/Models/Ghre/Ghre_QuestionAnswer.cs +++ b/Tiobon.Core.Model/Models/Ghre/Ghre_QuestionAnswer.cs @@ -53,7 +53,7 @@ namespace Tiobon.Core.Model.Models /// /// 图片地址 /// - [Display(Name = "ImageUrl"), Description("图片地址"), MaxLength(64, ErrorMessage = "图片地址 不能超过 64 个字符")] + [Display(Name = "ImageUrl"), Description("图片地址"), MaxLength(64, ErrorMessage = "图片地址 不能超过 128 个字符")] public string ImageUrl { get; set; } /// diff --git a/Tiobon.Core.Model/ViewModels/Extend/Ghre_StudyRecordCourse.cs b/Tiobon.Core.Model/ViewModels/Extend/Ghre_StudyRecordCourse.cs index 041407c1..ccda42eb 100644 --- a/Tiobon.Core.Model/ViewModels/Extend/Ghre_StudyRecordCourse.cs +++ b/Tiobon.Core.Model/ViewModels/Extend/Ghre_StudyRecordCourse.cs @@ -21,6 +21,8 @@ public class Ghre_StudyRecordCourse public string TeacherPhotoUrl { get; set; } public string DeptOrSchoolName { get; set; } public string TeacherRemarkSz { get; set; } + public DateTime? CourseBeginTime { get; set; } + public DateTime? CourseEndTime { get; set; } public List CourseWareList { get; set; } diff --git a/Tiobon.Core.Services/Ghre/Ghre_CourseServices.cs b/Tiobon.Core.Services/Ghre/Ghre_CourseServices.cs index 8a20e1c6..fa998efd 100644 --- a/Tiobon.Core.Services/Ghre/Ghre_CourseServices.cs +++ b/Tiobon.Core.Services/Ghre/Ghre_CourseServices.cs @@ -386,9 +386,12 @@ public class Ghre_CourseServices : BaseServices().FirstAsync(x => x.Id == entity.CourseWareId); - if (!string.IsNullOrWhiteSpace(ware.CourseIds)) + if (ware != null) { - var courseIds2 = JsonConvert.DeserializeObject>(ware.CourseIds); + var courseIds2 = new List(); + if (!string.IsNullOrWhiteSpace(ware.CourseIds)) + courseIds2 = JsonConvert.DeserializeObject>(ware.CourseIds); + if (!courseIds2.Any(x => x == result)) { courseIds2.Add(result); @@ -397,7 +400,6 @@ public class Ghre_CourseServices : BaseServices().SetColumns(it => it.CourseIds == ware.CourseIds).Where(it => it.Id == ware.Id).ExecuteCommandAsync(); } } - } #endregion @@ -449,9 +451,12 @@ public class Ghre_CourseServices : BaseServices().FirstAsync(x => x.Id == editModel.CourseWareId); - if (!string.IsNullOrWhiteSpace(ware.CourseIds)) + if (ware != null) { - var courseIds2 = JsonConvert.DeserializeObject>(ware.CourseIds); + var courseIds2 = new List(); + if (!string.IsNullOrWhiteSpace(ware.CourseIds)) + courseIds2 = JsonConvert.DeserializeObject>(ware.CourseIds); + if (!courseIds2.Any(x => x == Id)) { courseIds2.Add(Id); @@ -460,7 +465,6 @@ public class Ghre_CourseServices : BaseServices().SetColumns(it => it.CourseIds == ware.CourseIds).Where(it => it.Id == ware.Id).ExecuteCommandAsync(); } } - } #endregion return result; diff --git a/Tiobon.Core.Services/Ghre/Ghre_ExamRecordServices.cs b/Tiobon.Core.Services/Ghre/Ghre_ExamRecordServices.cs index a3e7ead2..bc13e676 100644 --- a/Tiobon.Core.Services/Ghre/Ghre_ExamRecordServices.cs +++ b/Tiobon.Core.Services/Ghre/Ghre_ExamRecordServices.cs @@ -242,6 +242,7 @@ public class Ghre_ExamRecordServices : BaseServices a.Id == x.QuestionId)?.QuestionAnalysis; x.detail = detail; @@ -659,7 +660,6 @@ public class Ghre_ExamRecordServices : BaseServices RetakeExamAsync(long examRecordId) { var entity = await base.QuerySingle(examRecordId); @@ -691,6 +691,7 @@ public class Ghre_ExamRecordServices : BaseServices x.Id == studyRecordId); if (record is null) return ServiceResult.OprateFailed("无效的考试ID"); using var _context = ContextFactory.CreateContext(); + var exampaper = await Db.Queryable().FirstAsync(x => x.Id == record.ExamPaperId); var dt = Db.GetDate(); var endTime = record.EndTime.Value.AddDays(1).AddSeconds(9); @@ -818,7 +819,7 @@ public class Ghre_ExamRecordServices : BaseServices().Where(x => x.CourseWareId == course.CourseWareList[j].Id).ToListAsync(); } + if (course.CourseBeginTime != null && course.CourseEndTime != null) + course.CourseDateString = DateTimeHelper.ConvertToDayString(course.CourseBeginTime) + "~" + DateTimeHelper.ConvertToDayString(course.CourseEndTime); + return ServiceResult.OprateSuccess("查询成功!", course); } @@ -544,10 +549,17 @@ namespace Tiobon.Core.Services var studyStatus = DicStudyRecordStudyStatus.NO_FINISH; if (studyProgress == 100) studyStatus = DicStudyRecordStudyStatus.HAS_FINISH; - sql = $"UPDATE Ghre_StudyRecord SET StudyProgress = ISNULL(StudyProgress, 0)+{studyProgress},StudyStatus='{studyStatus}' WHERE Id='{studyRecordId}'"; + + sql = $"UPDATE Ghre_StudyRecord SET StudyProgress = {studyProgress},StudyStatus='{studyStatus}' WHERE Id='{studyRecordId}'"; if (studyProgress > 0) await Db.Ado.ExecuteCommandAsync(sql); sql = $"UPDATE Ghre_StudyRecord SET BeginTime=GETDATE(),StudyStatus='{studyStatus}' WHERE BeginTime IS NULL AND Id='{studyRecordId}'"; await Db.Ado.ExecuteCommandAsync(sql); + + if (studyProgress == 100) + { + sql = $"UPDATE Ghre_StudyRecord SET EndTime=GETDATE() WHERE EndTime IS NULL AND Id='{studyRecordId}'"; + await Db.Ado.ExecuteCommandAsync(sql); + } return true; } #endregion diff --git a/Tiobon.Core/Tiobon.Core.Model.xml b/Tiobon.Core/Tiobon.Core.Model.xml index 84ebd9ec..347427e8 100644 --- a/Tiobon.Core/Tiobon.Core.Model.xml +++ b/Tiobon.Core/Tiobon.Core.Model.xml @@ -1308,7 +1308,7 @@ 课件ID - + @@ -2400,6 +2400,16 @@ 预留字段12 + + + 是否使用默认封面 + + + + + 默认封面图Name + + 考试通知记录 (Dto.Base) @@ -7084,7 +7094,7 @@ 课件ID - + @@ -8176,6 +8186,16 @@ 预留字段12 + + + 是否使用默认封面 + + + + + 默认封面图Name + + 考试通知记录 (Model) @@ -12667,6 +12687,21 @@ 随机出题 + + + 试卷管理-评分方式 + + + + + 手动评分 + + + + + 系统评分 + + 考试管理-状态