75 lines
1.6 KiB
C#
75 lines
1.6 KiB
C#
using Microsoft.EntityFrameworkCore;
|
|
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("submission_details")]
|
|
public class SubmissionDetail
|
|
{
|
|
[Key]
|
|
[Column("id")]
|
|
public Guid Id { get; set; }
|
|
|
|
[Required]
|
|
[Column("submission_id")]
|
|
[ForeignKey("Submission")]
|
|
public Guid SubmissionId { get; set; }
|
|
|
|
[Required]
|
|
[Column("student_id")]
|
|
public Guid StudentId { get; set; }
|
|
|
|
[Required]
|
|
[Column("assignment_question_id")]
|
|
[ForeignKey("AssignmentQuestion")]
|
|
public Guid AssignmentQuestionId { get; set; }
|
|
|
|
[Column("student_answer")]
|
|
public string? StudentAnswer { get; set; }
|
|
|
|
[Column("is_correct")]
|
|
public bool? IsCorrect { get; set; }
|
|
|
|
[Column("points_awarded")]
|
|
public float? PointsAwarded { get; set; } // score
|
|
|
|
[Column("teacher_feedback")]
|
|
public string? TeacherFeedback { 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; }
|
|
|
|
[Required]
|
|
[Column("status")]
|
|
public SubmissionStatus Status { get; set; }
|
|
|
|
|
|
|
|
[ForeignKey(nameof(StudentId))]
|
|
public User Student { get; set; }
|
|
|
|
[ForeignKey(nameof(SubmissionId))]
|
|
public Submission Submission { get; set; }
|
|
|
|
[ForeignKey(nameof(AssignmentQuestionId))]
|
|
public AssignmentQuestion AssignmentQuestion { get; set; }
|
|
|
|
public SubmissionDetail()
|
|
{
|
|
Id = Guid.NewGuid();
|
|
}
|
|
}
|
|
}
|