38 lines
901 B
C#
38 lines
901 B
C#
using System.ComponentModel.DataAnnotations;
|
|
using System.ComponentModel.DataAnnotations.Schema;
|
|
|
|
namespace backend.Models;
|
|
|
|
public class QuizQuestion
|
|
{
|
|
[Key]
|
|
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
|
public int Id { get; set; }
|
|
|
|
[Required]
|
|
[MaxLength(500)]
|
|
public string QuestionText { get; set; } = string.Empty;
|
|
|
|
[Required]
|
|
[MaxLength(200)]
|
|
public string Option1 { get; set; } = string.Empty;
|
|
|
|
[Required]
|
|
[MaxLength(200)]
|
|
public string Option2 { get; set; } = string.Empty;
|
|
|
|
[Required]
|
|
[MaxLength(200)]
|
|
public string Option3 { get; set; } = string.Empty;
|
|
|
|
[Required]
|
|
[MaxLength(200)]
|
|
public string Option4 { get; set; } = string.Empty;
|
|
|
|
[Required]
|
|
public int CorrectOption { get; set; } // 1-4
|
|
|
|
// Navigation
|
|
public ICollection<UserQuizAnswer> Answers { get; set; } = new List<UserQuizAnswer>();
|
|
}
|