58 lines
1.4 KiB
C#
58 lines
1.4 KiB
C#
using Manager.DTOs;
|
|
using ManagerService.DTOs;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel.DataAnnotations;
|
|
using System.ComponentModel.DataAnnotations.Schema;
|
|
|
|
namespace ManagerService.Data.SubSection
|
|
{
|
|
/// <summary>
|
|
/// Quiz question
|
|
/// </summary>
|
|
public class QuizQuestion
|
|
{
|
|
[Key]
|
|
[Required]
|
|
public int Id { get; set; }
|
|
|
|
[Required]
|
|
[Column(TypeName = "jsonb")]
|
|
public List<TranslationAndResourceDTO> Label { get; set; }
|
|
|
|
public string ResourceId { get; set; } // Background image id
|
|
|
|
public Resource Resource { get; set; } // Background image
|
|
|
|
public int Order { get; set; } // Order to show
|
|
|
|
[Required]
|
|
[Column(TypeName = "jsonb")]
|
|
public List<ResponseDTO> Responses { get; set; } // TODO check
|
|
|
|
public string SectionQuizId { get; set; }
|
|
|
|
[ForeignKey("SectionQuizId")]
|
|
public SectionQuiz SectionQuiz { get; set; }
|
|
|
|
// TODO
|
|
/*public TranslationDTO ToDTO()
|
|
{
|
|
return new TranslationDTO()
|
|
{
|
|
language = Language,
|
|
value = Value
|
|
};
|
|
}
|
|
|
|
public Translation FromDTO(TranslationDTO translationDTO)
|
|
{
|
|
return new Translation()
|
|
{
|
|
Language = translationDTO.language,
|
|
Value = translationDTO.value
|
|
};
|
|
}*/
|
|
}
|
|
}
|