diff --git a/Entities/Contracts/ClassTeacher.cs b/Entities/Contracts/ClassTeacher.cs index 3434624..5b1e5ab 100644 --- a/Entities/Contracts/ClassTeacher.cs +++ b/Entities/Contracts/ClassTeacher.cs @@ -14,11 +14,13 @@ namespace Entities.Contracts [Key] [Column("class_id")] public Guid ClassId { get; set; } + [ForeignKey(nameof(ClassId))] public Class Class { get; set; } [Key] [Column("teacher_id")] public Guid TeacherId { get; set; } + [ForeignKey(nameof(TeacherId))] public User Teacher { get; set; } [Column("subject_taught")] diff --git a/Entities/Contracts/User.cs b/Entities/Contracts/User.cs index 52352db..4054383 100644 --- a/Entities/Contracts/User.cs +++ b/Entities/Contracts/User.cs @@ -21,7 +21,9 @@ namespace Entities.Contracts [Column("deleted")] public bool IsDeleted { get; set; } + [InverseProperty(nameof(ClassTeacher.Teacher))] public ICollection TaughtClassesLink { get; set; } + [InverseProperty(nameof(ClassStudent.Student))] public ICollection EnrolledClassesLink { get; set; } public ICollection CreatedQuestions { get; set; } diff --git a/TechHelper.Client/Exam/ExamStruct.cs b/TechHelper.Client/Exam/ExamStruct.cs index 7ecdd33..9e36b90 100644 --- a/TechHelper.Client/Exam/ExamStruct.cs +++ b/TechHelper.Client/Exam/ExamStruct.cs @@ -24,9 +24,9 @@ namespace TechHelper.Client.Exam public class QuestionAnswerStatus { - public string QuestionSequence { get; set; } = string.Empty; // 题目序号,例如 "1.1" - public string QuestionText { get; set; } = string.Empty; // 题目文本 - public float QuestionScore { get; set; } // 题目分值 + public string QuestionSequence { get; set; } = string.Empty; // 题目序号,例如 "1.1" + public string QuestionText { get; set; } = string.Empty; // 题目文本 + public float QuestionScore { get; set; } // 题目分值 public Dictionary StudentCorrectStatus { get; set; } = new Dictionary(); // Key: Student.Id, Value: true 表示正确,false 表示错误 } diff --git a/TechHelper.Client/Exam/QuestionSimple.cs b/TechHelper.Client/Exam/QuestionSimple.cs deleted file mode 100644 index da098b6..0000000 --- a/TechHelper.Client/Exam/QuestionSimple.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Xml.Serialization; - -namespace TechHelper.Client.Exam.QuestionSimple -{ - - [XmlRoot("QG")] - public class QuestionGroup - { - [XmlElement("T")] - public string Title { get; set; } - [XmlElement("QR")] - public string QuestionReference { get; set; } = ""; - [XmlArray("SQs")] - [XmlArrayItem("SQ")] - public List SubQuestions { get; set; } = new List(); - [XmlArray("SQGs")] - [XmlArrayItem("QG")] - public List SubQuestionGroups { get; set; } = new List(); - } - public class SubQuestion - { - [XmlElement("T")] - public string Stem { get; set; } - [XmlArray("Os")] - [XmlArrayItem("O")] - public List