first commit
This commit is contained in:
28
backend/Models/UserQuizAttempt.cs
Normal file
28
backend/Models/UserQuizAttempt.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace backend.Models;
|
||||
|
||||
public class UserQuizAttempt
|
||||
{
|
||||
[Key]
|
||||
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public int Id { get; set; }
|
||||
|
||||
[Required]
|
||||
public int UserId { get; set; }
|
||||
|
||||
public int ParticipationPoints { get; set; }
|
||||
|
||||
public int CorrectAnswersCount { get; set; }
|
||||
|
||||
public int TotalQuizPoints { get; set; }
|
||||
|
||||
public DateTime CompletedAt { get; set; } = DateTime.UtcNow;
|
||||
|
||||
// Navigation
|
||||
[ForeignKey(nameof(UserId))]
|
||||
public User User { get; set; } = null!;
|
||||
|
||||
public ICollection<UserQuizAnswer> Answers { get; set; } = new List<UserQuizAnswer>();
|
||||
}
|
||||
Reference in New Issue
Block a user