38 lines
1.4 KiB
C#
38 lines
1.4 KiB
C#
namespace QuestionsApi.Models;
|
|
|
|
public class QuestionResponse
|
|
{
|
|
public string Id { get; set; } = "";
|
|
public string ExternalId { get; set; } = "";
|
|
public string Stem { get; set; } = "";
|
|
public string LeadIn { get; set; } = "";
|
|
public List<QuestionChoice> Choices { get; set; } = [];
|
|
public string CorrectChoiceId { get; set; } = "";
|
|
public string Explanation { get; set; } = "";
|
|
public Dictionary<string, string> ChoiceExplanations { get; set; } = [];
|
|
public string Discipline { get; set; } = "";
|
|
public string System { get; set; } = "";
|
|
public int Difficulty { get; set; }
|
|
public List<QuestionLab> Labs { get; set; } = [];
|
|
public List<string> Media { get; set; } = [];
|
|
public List<string> Tags { get; set; } = [];
|
|
|
|
public static QuestionResponse FromModel(Question question) => new()
|
|
{
|
|
Id = question.Id ?? "",
|
|
ExternalId = question.ExternalId,
|
|
Stem = question.Stem,
|
|
LeadIn = question.LeadIn,
|
|
Choices = question.Choices,
|
|
CorrectChoiceId = question.CorrectChoiceId,
|
|
Explanation = question.Explanation,
|
|
ChoiceExplanations = question.ChoiceExplanations,
|
|
Discipline = question.Discipline,
|
|
System = question.System,
|
|
Difficulty = question.Difficulty,
|
|
Labs = question.Labs,
|
|
Media = question.Media,
|
|
Tags = question.Tags
|
|
};
|
|
}
|