chore: removed everything related to instructions

This commit is contained in:
2025-09-20 22:42:33 +03:00
parent b6778046c2
commit 8ea18f1096
50 changed files with 0 additions and 1953 deletions

View File

@@ -1,14 +0,0 @@
using System.ComponentModel.DataAnnotations;
namespace GamificationService.Models.DTO;
public class InstructionCategoryCreateDTO
{
public long? Id { get; set; }
[Required(ErrorMessage = "Title is required")]
public string Title { get; set; } = null!;
}

View File

@@ -1,10 +0,0 @@
namespace GamificationService.Models.DTO;
public class InstructionCategoryDTO
{
public long? Id { get; set; }
public string? Title { get; set; } = null!;
}

View File

@@ -1,38 +0,0 @@
using System.ComponentModel.DataAnnotations;
namespace GamificationService.Models.DTO;
public class InstructionCreateDTO
{
public long? Id { get; set; }
[Required(ErrorMessage = "Title is required")]
public string Title { get; set; } = null!;
public string? Description { get; set; }
[Required(ErrorMessage = "Paragraphs are required")]
public List<InstructionParagraphCreateDTO> Paragraphs { get; set; } = null!;
[Required(ErrorMessage = "Category id is required")]
public long CategoryId { get; set; }
/// <summary>
/// If AssignDate is set, the instruction will be automatically enabled
/// when the date is reached. If it's not set, the test will automatically
/// obtain the current date as its AssignDate as soon as the instruction
/// will be enabled by the IsEnabled parameter.
/// </summary>
public DateTime? AssignDate { get; set; }
/// <summary>
/// When deadline is reached, no more submissions are allowed for this instruction.
/// </summary>
public DateTime? DeadlineDate { get; set; }
/// <summary>
/// Disabled instructions cannot be seen by users.
/// Tests for such instructions cannot be submitted either.
/// </summary>
public bool IsEnabled { get; set; } = false;
}

View File

@@ -1,21 +0,0 @@
namespace GamificationService.Models.DTO;
public class InstructionDTO
{
public long? Id { get; set; }
public string? Title { get; set; }
public string? Description { get; set; }
public List<InstructionParagraphDTO> Paragraphs { get; set; } = new List<InstructionParagraphDTO>();
public long? CategoryId { get; set; }
public DateTime? AssignDate { get; set; }
public DateTime? DeadlineDate { get; set; }
public bool IsEnabled { get; set; }
}

View File

@@ -1,25 +0,0 @@
using System.ComponentModel.DataAnnotations;
namespace GamificationService.Models.DTO;
public class InstructionParagraphCreateDTO
{
public long? Id { get; set; }
public long? InstructionId { get; set; }
/// <summary>
/// Order defines the order of the paragraphs inside the instruction.
/// There must not be two paragraphs with the same order.
/// </summary>
public int Order { get; set; }
[Required(ErrorMessage = "Text is required")]
public string Text { get; set; } = null!;
public string? ImageUrl { get; set; }
public string? VideoUrl { get; set; }
}

View File

@@ -1,21 +0,0 @@
namespace GamificationService.Models.DTO;
public class InstructionParagraphDTO
{
public long? Id { get; set; }
public long? InstructionId { get; set; }
/// <summary>
/// Order defines the order of the paragraphs inside the instruction.
/// There must not be two paragraphs with the same order.
/// </summary>
public int Order { get; set; }
public string? Text { get; set; } = null!;
public string? ImageUrl { get; set; }
public string? VideoUrl { get; set; }
}

View File

@@ -1,20 +0,0 @@
using System.ComponentModel.DataAnnotations;
using GamificationService.Utils.Enums;
namespace GamificationService.Models.DTO;
public class InstructionTestCreateDTO
{
public long? Id { get; set; }
public string? Title { get; set; }
[Required(ErrorMessage = "Questions must be specified")]
public ICollection<InstructionTestQuestionCreateDTO> Questions { get; set; } = null!;
public int MaxAttempts { get; set; } = 10;
[Range(0, 1.0, ErrorMessage = "Minimum score must be between 0.6 and 1.0")]
public double MinScore { get; set; } = 0.6;
public InstructionTestScoreCalcMethod ScoreCalcMethod { get; set; } = InstructionTestScoreCalcMethod.MaxGrade;
}

View File

@@ -1,23 +0,0 @@
using System.ComponentModel.DataAnnotations;
using GamificationService.Utils.Enums;
namespace GamificationService.Models.DTO;
public class InstructionTestDTO
{
public long? Id { get; set; }
// Reserved just in case
[StringLength(300, ErrorMessage = "Title cannot be longer than 300 characters")]
public string? Title { get; set; }
public int MaxAttempts { get; set; } = 10;
public double MinScore { get; set; } = 0.6;
public List<InstructionTestQuestionDTO> Questions { get; set; } = new List<InstructionTestQuestionDTO>();
public InstructionTestScoreCalcMethod ScoreCalcMethod { get; set; } = InstructionTestScoreCalcMethod.MaxGrade;
}

View File

@@ -1,26 +0,0 @@
using System.ComponentModel.DataAnnotations;
namespace GamificationService.Models.DTO;
public class InstructionTestQuestionCreateDTO
{
public long? Id { get; set; }
public bool IsMultipleAnswer { get; set; }
/// <summary>
/// Question will be displayed in the paragraph with the same order number.
/// There can be multiple questions attached to the same paragraph.
/// </summary>
public int Order { get; set; }
[Required(ErrorMessage = "Must have question text")]
public string Question { get; set; } = null!;
[Required(ErrorMessage = "Must have answer options")]
public ICollection<string> Answers { get; set; } = null!;
[Required(ErrorMessage = "Must have correct answers")]
public ICollection<int> CorrectAnswers { get; set; } = null!;
}

View File

@@ -1,25 +0,0 @@
using System.ComponentModel.DataAnnotations;
namespace GamificationService.Models.DTO;
public class InstructionTestQuestionDTO
{
public long? Id { get; set; }
public bool IsMultipleAnswer { get; set; }
/// <summary>
/// Question will be displayed in the paragraph with the same order number.
/// There can be multiple questions attached to the same paragraph.
/// </summary>
public int Order { get; set; }
[Required(ErrorMessage = "Must have question text")]
public string Question { get; set; } = null!;
[Required(ErrorMessage = "Must have answer options")]
public ICollection<string> Answers { get; set; } = null!;
public ICollection<int>? CorrectAnswers { get; set; }
}

View File

@@ -1,12 +0,0 @@
namespace GamificationService.Models.DTO;
public class InstructionTestResultDTO
{
public long? Id { get; set; }
public long? InstructionTestId { get; set; }
public long? UserId { get; set; }
public int Score { get; set; }
}

View File

@@ -1,12 +0,0 @@
using System.ComponentModel.DataAnnotations;
namespace GamificationService.Models.DTO;
public class InstructionTestSubmissionDTO
{
[Required(ErrorMessage = "InstructionTestId is required")]
public int InstructionTestId { get; set; }
[Required(ErrorMessage = "Answers must be provided")]
public List<List<int>> Answers { get; set; } = null!;
}