29 lines
710 B
C#
29 lines
710 B
C#
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>();
|
|
}
|