重构项目结构,移除Assignment相关功能,优化Submission模块
Some checks failed
TechAct / explore-gitea-actions (push) Failing after 12s
Some checks failed
TechAct / explore-gitea-actions (push) Failing after 12s
This commit is contained in:
71
Entities/Contracts/ExamQuestion.cs
Normal file
71
Entities/Contracts/ExamQuestion.cs
Normal file
@@ -0,0 +1,71 @@
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using Entities.DTO;
|
||||
|
||||
namespace Entities.Contracts
|
||||
{
|
||||
[Table("exam_questions")]
|
||||
public class ExamQuestion
|
||||
{
|
||||
[Key]
|
||||
[Column("id")]
|
||||
public Guid Id { get; set; }
|
||||
|
||||
[Column("title")]
|
||||
[MaxLength(1024)]
|
||||
public string? Title { get; set; }
|
||||
|
||||
[Column("question_id")]
|
||||
public Guid? QuestionId { get; set; }
|
||||
[ForeignKey(nameof(QuestionId))]
|
||||
public virtual Question? Question { get; set; }
|
||||
|
||||
[Column("description")]
|
||||
public Guid? QuestionContextId { get; set; }
|
||||
[ForeignKey(nameof(QuestionContextId))]
|
||||
public virtual QuestionContext? QuestionContext { get; set; }
|
||||
|
||||
[Required]
|
||||
[Column("question_number")]
|
||||
public byte Index { get; set; }
|
||||
|
||||
[Column("sequence")]
|
||||
public string Sequence { get; set; } = string.Empty;
|
||||
|
||||
[Column("parent_question_group_id")]
|
||||
public Guid? ParentExamQuestionId { get; set; }
|
||||
[ForeignKey(nameof(ParentExamQuestionId))]
|
||||
public virtual ExamQuestion? ParentExamQuestion { get; set; }
|
||||
|
||||
public Guid QuestionTypeId { get;set; }
|
||||
[ForeignKey(nameof(QuestionTypeId))]
|
||||
public virtual QuestionType Type { get; set; }
|
||||
|
||||
[Column("created_at")]
|
||||
public DateTime CreatedAt { get; set; }
|
||||
|
||||
[Column("exam_struct_type")]
|
||||
public ExamStructType ExamStructType { get; set; }
|
||||
|
||||
[Column("score")]
|
||||
public float? Score { get; set; }
|
||||
|
||||
[Column("deleted")]
|
||||
public bool IsDeleted { get; set; }
|
||||
|
||||
|
||||
public virtual Exam? Exam { get; set; }
|
||||
|
||||
|
||||
[InverseProperty(nameof(SubmissionDetail.ExamQuestion))]
|
||||
public virtual ICollection<SubmissionDetail> SubmissionDetails { get; set; }
|
||||
[InverseProperty(nameof(ParentExamQuestion))]
|
||||
public virtual ICollection<ExamQuestion> ChildExamQuestions { get; set; } = new List<ExamQuestion>();
|
||||
|
||||
public ExamQuestion()
|
||||
{
|
||||
Id = Guid.NewGuid();
|
||||
SubmissionDetails = new HashSet<SubmissionDetail>();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user