Add quizz !
This commit is contained in:
parent
8da8e5f593
commit
e61b334f02
38
Manager.Interfaces/DTO/SubSection/QuizzDTO.cs
Normal file
38
Manager.Interfaces/DTO/SubSection/QuizzDTO.cs
Normal file
@ -0,0 +1,38 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace Manager.Interfaces.DTO
|
||||
{
|
||||
public class QuizzDTO
|
||||
{
|
||||
public List<QuestionDTO> questions { get; set; }
|
||||
public LevelDTO bad_level { get; set; }
|
||||
public LevelDTO medium_level { get; set; }
|
||||
public LevelDTO good_level { get; set; }
|
||||
public LevelDTO great_level { get; set; }
|
||||
}
|
||||
|
||||
public class QuestionDTO
|
||||
{
|
||||
public List<TranslationDTO> label { get; set; }
|
||||
public List<ResponseDTO> responses { get; set; }
|
||||
public string resourceId { get; set; } // question image
|
||||
public string source { get; set; }
|
||||
public int order { get; set; } // Order to show
|
||||
}
|
||||
|
||||
public class ResponseDTO
|
||||
{
|
||||
public List<TranslationDTO> label { get; set; }
|
||||
public bool isGood { get; set; }
|
||||
public int order { get; set; } // Order to show
|
||||
}
|
||||
|
||||
public class LevelDTO
|
||||
{
|
||||
public List<TranslationDTO> label { get; set; }
|
||||
public string resourceId { get; set; } // level result image
|
||||
public string source { get; set; }
|
||||
}
|
||||
}
|
||||
@ -88,6 +88,7 @@ namespace Manager.Interfaces.Models
|
||||
Slider,
|
||||
Video,
|
||||
Web,
|
||||
Menu
|
||||
Menu,
|
||||
Quizz
|
||||
}
|
||||
}
|
||||
|
||||
@ -286,6 +286,7 @@ namespace ManagerService.Controllers
|
||||
}
|
||||
}
|
||||
break;
|
||||
case SectionType.Quizz:
|
||||
case SectionType.Menu:
|
||||
case SectionType.Web:
|
||||
case SectionType.Video:
|
||||
|
||||
@ -333,6 +333,11 @@ namespace ManagerService.Controllers
|
||||
menuDTO.Sections.Add(section1DTO);*/
|
||||
section.Data = JsonConvert.SerializeObject(menuDTO); // Include all info from specific section as JSON
|
||||
break;
|
||||
case SectionType.Quizz:
|
||||
QuizzDTO quizzDTO = new QuizzDTO();
|
||||
quizzDTO.questions = new List<QuestionDTO>();
|
||||
section.Data = JsonConvert.SerializeObject(quizzDTO); // Include all info from specific section as JSON
|
||||
break;
|
||||
}
|
||||
|
||||
Section sectionCreated = _sectionService.Create(section);
|
||||
@ -606,5 +611,15 @@ namespace ManagerService.Controllers
|
||||
{
|
||||
return new ObjectResult("PlayerMessageDTO") { StatusCode = 200 };
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Useless, just to generate dto code
|
||||
/// </summary>
|
||||
[ProducesResponseType(typeof(QuizzDTO), 200)]
|
||||
[HttpGet("QuizzDTO")]
|
||||
public ObjectResult GetQuizzDTO()
|
||||
{
|
||||
return new ObjectResult("QuizzDTO") { StatusCode = 200 };
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,7 +1,8 @@
|
||||
{
|
||||
"ConnectionStrings": {
|
||||
//"TabletDb": "mongodb://admin:MioTech4ever!@localhost:27017" //DEV
|
||||
//"TabletDb": "mongodb://admin:MioTech4ever!@localhost:27017" //PROD - Thomas
|
||||
//"TabletDb": "mongodb://admin:MioTech4ever!@localhost:27017", //PROD - Thomas
|
||||
//"TabletDb": "mongodb://admin:MioTech4ever!@192.168.31.140:27017" //PROD - Thomas
|
||||
"TabletDb": "mongodb://admin:mdlf2021!@localhost:27017" //PROD
|
||||
},
|
||||
"Logging": {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user