|
|
|
@ -17,10 +17,10 @@ namespace ManagerInterfaces
|
|
|
|
|
public interface IQuestionManager<T>
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// get the number of T element
|
|
|
|
|
/// get the number of questions
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns>the number of T element</returns>
|
|
|
|
|
public int getNbElements();
|
|
|
|
|
/// <returns>the number of questions</returns>
|
|
|
|
|
public int getNbQuestions();
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// add a question
|
|
|
|
|
/// </summary>
|
|
|
|
@ -28,66 +28,66 @@ namespace ManagerInterfaces
|
|
|
|
|
/// <returns>the question added</returns>
|
|
|
|
|
public Task<T> addQuestion(T question);
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// delete a T element
|
|
|
|
|
/// delete a question
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="question">the question to remove</param>
|
|
|
|
|
/// <returns>
|
|
|
|
|
/// the T element deleted or
|
|
|
|
|
/// the question deleted or
|
|
|
|
|
/// null if there isn't any
|
|
|
|
|
/// </returns>
|
|
|
|
|
public Task<T?> removeQuestion(T question);
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// delete a T element with an id
|
|
|
|
|
/// delete a question with an id
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="id">the id of the T element</param>
|
|
|
|
|
/// <param name="id">the id of the question</param>
|
|
|
|
|
/// <returns>
|
|
|
|
|
/// the T element deleted that corresponde
|
|
|
|
|
/// the question deleted that corresponde
|
|
|
|
|
/// to the id or null if there isn't any
|
|
|
|
|
/// </returns>
|
|
|
|
|
public Task<T?> removeQuestion(uint id);
|
|
|
|
|
public Task<T?> removeQuestion(int id);
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// get a part of all questions
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="nb">the actual page</param>
|
|
|
|
|
/// <param name="count">number of T element in a page</param>
|
|
|
|
|
/// <param name="count">number of question in a page</param>
|
|
|
|
|
/// <param name="orderCriteria">the order criteria</param>
|
|
|
|
|
/// <returns>
|
|
|
|
|
/// a set of the number of page and
|
|
|
|
|
/// all T element in the database for
|
|
|
|
|
/// all questions in the database for
|
|
|
|
|
/// the page nb (or null if the page
|
|
|
|
|
/// does not exist (<=> (nb-1)*count outside
|
|
|
|
|
/// boundaries (0, getNbElement()-1)))
|
|
|
|
|
/// </returns>
|
|
|
|
|
public Task<(int nbPages, IEnumerable<T>? questions)> getQuestions(int nb, int count, QuestionOrderCriteria orderCriteria = QuestionOrderCriteria.ById);
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// get a T element with an id
|
|
|
|
|
/// get a question with an id
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="id">the id of the T element</param>
|
|
|
|
|
/// <param name="id">the id of the question</param>
|
|
|
|
|
/// <returns>
|
|
|
|
|
/// the T element that corresponde
|
|
|
|
|
/// the question that corresponde
|
|
|
|
|
/// to the id or null if there isn't any
|
|
|
|
|
/// </returns>
|
|
|
|
|
public Task<T?> getQuestion(uint id);
|
|
|
|
|
public Task<T?> getQuestion(int id);
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// modified a T element with an id
|
|
|
|
|
/// modified a question with an id
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="id">the id of the T element</param>
|
|
|
|
|
/// <param name="id">the id of the question</param>
|
|
|
|
|
/// <param name="question">an question that contains all modified properties</param>
|
|
|
|
|
/// <returns>
|
|
|
|
|
/// the T element (modified) that corresponde
|
|
|
|
|
/// the question modified that corresponde
|
|
|
|
|
/// to the id or null if there isn't any
|
|
|
|
|
/// </returns>
|
|
|
|
|
public Task<T?> updateQuestion(uint id, T question);
|
|
|
|
|
public Task<T?> updateQuestion(int id, T question);
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// increase nbFalls of a question by 1
|
|
|
|
|
/// (and change the difficulty of the question)
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="id">the id of the question</param>
|
|
|
|
|
/// <returns>
|
|
|
|
|
/// the T element (modified) that corresponde
|
|
|
|
|
/// the question modified that corresponde
|
|
|
|
|
/// to the id or null if there isn't any
|
|
|
|
|
/// </returns>
|
|
|
|
|
public Task<T?> updateQuestionNbFalls(uint id);
|
|
|
|
|
public Task<T?> updateQuestionNbFalls(int id);
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// add some questions
|
|
|
|
|
/// </summary>
|
|
|
|
@ -100,11 +100,11 @@ namespace ManagerInterfaces
|
|
|
|
|
/// <param name="idChapter">the id of the chapter</param>
|
|
|
|
|
/// <param name="difficulty">the difficulty</param>
|
|
|
|
|
/// <param name="nb">the actual page</param>
|
|
|
|
|
/// <param name="count">number of T element in a page</param>
|
|
|
|
|
/// <param name="count">number of question in a page</param>
|
|
|
|
|
/// <param name="orderCriteria">the order criteria</param>
|
|
|
|
|
/// <returns>
|
|
|
|
|
/// a set of the number of page and
|
|
|
|
|
/// all T element in the database for
|
|
|
|
|
/// all questions in the database for
|
|
|
|
|
/// the page nb (or null if the page
|
|
|
|
|
/// does not exist (<=> (nb-1)*count outside
|
|
|
|
|
/// boundaries (0, getNbElement()-1)))
|
|
|
|
|