重构试卷相关内容

This commit is contained in:
SpecialX
2025-06-13 19:01:32 +08:00
parent b77ed0b30f
commit bcf351ff25
23 changed files with 980 additions and 84 deletions

View File

@@ -0,0 +1,79 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Entities.Contracts
{
[Table("question_groups")]
public class QuestionGroup
{
[Key]
[Column("id")]
public Guid Id { get; set; }
[Column("title")]
[MaxLength(255)]
public string Title { get; set; }
[Required]
[Column("description")]
[MaxLength(65535)]
public string Description { get; set; }
[Column("type")]
[MaxLength(50)]
public string Type { get; set; }
[Column("difficulty_level")]
[MaxLength(10)]
public DifficultyLevel DifficultyLevel { get; set; }
[Column("subject_area")]
public SubjectAreaEnum SubjectArea { get; set; }
[Column("total_questions")]
public int TotalQuestions { get; set; } = 0;
[Column("parent_question_group")]
public Guid? ParentQG { get; set; }
[Required]
[Column("created_by")]
[ForeignKey("Creator")]
public Guid CreatedBy { get; set; }
[Column("created_at")]
public DateTime CreatedAt { get; set; }
[Column("updated_at")]
public DateTime UpdatedAt { get; set; }
[Column("deleted")]
public bool IsDeleted { get; set; }
[Column("valid_group")]
public bool ValidGroup { get; set; }
public User Creator { get; set; }
public QuestionGroup ParentQuestionGroup { get; set; }
public ICollection<QuestionGroup> ChildQuestionGroups { get; set; }
public ICollection<AssignmentQuestion> AssignmentQuestions { get; set; }
public ICollection<Question> Questions { get; set; }
public QuestionGroup()
{
Id = Guid.NewGuid();
Questions = new HashSet<Question>();
CreatedAt = DateTime.UtcNow;
UpdatedAt = DateTime.UtcNow;
IsDeleted = false;
ValidGroup = true;
}
}
}