67 lines
2.0 KiB
C#
67 lines
2.0 KiB
C#
using Manager.DTOs;
|
|
using ManagerService.DTOs;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel.DataAnnotations;
|
|
using System.ComponentModel.DataAnnotations.Schema;
|
|
using System.Linq;
|
|
|
|
|
|
namespace ManagerService.Data.SubSection
|
|
{
|
|
/// <summary>
|
|
/// Section quiz
|
|
/// </summary>
|
|
public class SectionQuiz : Section
|
|
{
|
|
[Required]
|
|
public List<QuizQuestion> QuizQuestions { get; set; }
|
|
|
|
[Required]
|
|
[Column(TypeName = "jsonb")]
|
|
public List<TranslationAndResourceDTO> QuizBadLevel { get; set; }
|
|
|
|
[Required]
|
|
[Column(TypeName = "jsonb")]
|
|
public List<TranslationAndResourceDTO> QuizMediumLevel { get; set; }
|
|
|
|
[Required]
|
|
[Column(TypeName = "jsonb")]
|
|
public List<TranslationAndResourceDTO> QuizGoodLevel { get; set; }
|
|
|
|
[Required]
|
|
[Column(TypeName = "jsonb")]
|
|
public List<TranslationAndResourceDTO> QuizGreatLevel { get; set; }
|
|
|
|
|
|
public QuizDTO ToDTO()
|
|
{
|
|
return new QuizDTO()
|
|
{
|
|
id = Id,
|
|
label = Label,
|
|
title = Title.ToList(),
|
|
description = Description.ToList(),
|
|
order = Order,
|
|
type = Type,
|
|
imageId = ImageId,
|
|
imageSource = ImageSource,
|
|
configurationId = ConfigurationId,
|
|
isSubSection = IsSubSection,
|
|
parentId = ParentId,
|
|
dateCreation = DateCreation,
|
|
instanceId = InstanceId,
|
|
isBeacon = IsBeacon,
|
|
beaconId = BeaconId,
|
|
latitude = Latitude,
|
|
longitude = Longitude,
|
|
meterZoneGPS = MeterZoneGPS,
|
|
bad_level = QuizBadLevel.ToList(),
|
|
medium_level = QuizMediumLevel.ToList(),
|
|
good_level = QuizGoodLevel.ToList(),
|
|
great_level = QuizGreatLevel.ToList()
|
|
};
|
|
}
|
|
}
|
|
}
|