generated from karsten.jeppesen/KAJE-Template
61 lines
1.5 KiB
C#
61 lines
1.5 KiB
C#
using Dapper.Contrib.Extensions;
|
|
|
|
namespace Quizzer.Models
|
|
{
|
|
/// <summary>
|
|
/// Multiple Choice Question
|
|
/// Missing: image upload
|
|
/// CREATE TABLE `Questions` (
|
|
/// `QId` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
|
|
/// `Txt` VARCHAR(512) NOT NULL DEFAULT '0' COLLATE 'utf8mb4_general_ci',
|
|
/// PRIMARY KEY(`QId`) USING BTREE
|
|
/// )
|
|
/// COMMENT='The headline'
|
|
/// COLLATE='utf8mb4_general_ci'
|
|
/// ENGINE=InnoDB
|
|
/// AUTO_INCREMENT = 2
|
|
/// ;
|
|
/// </summary>
|
|
public class Question
|
|
{
|
|
[Key]
|
|
public string QuestionID { get; set; }
|
|
public string Category { get; set; }
|
|
public string QuestionText { get; set; }
|
|
public string QuestionType { get; set; }
|
|
public string ContentJson { get; set; }
|
|
|
|
public Question()
|
|
{
|
|
QuestionID = String.Empty;
|
|
Category = String.Empty;
|
|
QuestionText = String.Empty;
|
|
QuestionType = String.Empty;
|
|
ContentJson = String.Empty;
|
|
}
|
|
}
|
|
public class MCQuestion : Question
|
|
{
|
|
public List<Alternative> AList { get; set; }
|
|
public MCQuestion()
|
|
{
|
|
AList = new List<Alternative>();
|
|
}
|
|
|
|
}
|
|
|
|
public class Alternative
|
|
{
|
|
public string Atxt { get; set; }
|
|
public bool Aok { get; set; }
|
|
public int Counter { get; set; }
|
|
|
|
public Alternative()
|
|
{
|
|
Counter = 0;
|
|
Atxt = String.Empty;
|
|
Aok = false;
|
|
}
|
|
}
|
|
}
|