using Entities.Contracts;
using TechHelper.Services;

namespace TechHelper.Server.Services
{
	public interface ISubmissionServices : IBaseService<Submission, Guid>
	{
		/// <summary>
		/// 异步获取指定用户的指定试题的错题。
		/// </summary>
		/// <param name="assignmentId">作业ID。</param>
		/// <param name="userId">用户ID。</param>
		/// <returns>包含操作结果的ApiResponse。</returns>
		Task<ApiResponse> GetAssignmentErrorQuestionsAsync(Guid assignmentId, Guid userId);

		/// <summary>
		/// 异步获取指定用户的所有错题。
		/// </summary>
		/// <param name="userId">用户ID。</param>
		/// <returns>包含操作结果的ApiResponse。</returns>
		Task<ApiResponse> GetAllErrorQuestionsAsync(Guid userId);

		/// <summary>
		/// 异步获取指定作业和用户的错题类型分布。
		/// </summary>
		/// <param name="assignmentId">作业ID。</param>
		/// <param name="userId">用户ID。</param>
		/// <returns>包含操作结果的ApiResponse。</returns>
		Task<ApiResponse> GetAssignmentErrorQuestionTypeDisAsync(Guid assignmentId, Guid userId);

		/// <summary>
		/// 异步获取指定作业中所有错题的类型分布。（注意：原始方法签名GetAllErrorQuestionTypeDisAsync参数中含有assignmentId，结合方法名推断此处可能应为获取所有错题的类型分布，而非特定作业的，请根据实际业务需求确认是否需要移除assignmentId参数或修改方法名。）
		/// </summary>
		/// <param name="assignmentId">作业ID。</param>
		/// <param name="userId">用户ID。</param>
		/// <returns>包含操作结果的ApiResponse。</returns>
		Task<ApiResponse> GetAllErrorQuestionTypeDisAsync(Guid assignmentId, Guid userId);

		/// <summary>
		/// 异步获取指定作业中所有学生的错题情况。
		/// </summary>
		/// <param name="assignmentId">作业ID。</param>
		/// <param name="teacherId">教师ID。</param>
		/// <returns>包含操作结果的ApiResponse。</returns>
		Task<ApiResponse> GetAssignmentAllStudentsError(Guid assignmentId, Guid teacherId);

		/// <summary>
		/// 异步获取指定作业中出现错题的学生列表。
		/// </summary>
		/// <param name="assignmentId">作业ID。</param>
		/// <returns>包含操作结果的ApiResponse。</returns>
		Task<ApiResponse> GetQuestionErrorStudents(Guid assignmentId);



		/// <summary>
		/// 判断是否已经存在Submission
		/// </summary>
		/// <param name="assignment"></param>
		/// <param name="studentId"></param>
		/// <returns></returns>
		Task<byte> IsHasSubmissionAsync(Guid assignment, Guid studentId);
	}
}
