using Entities.DTO;

namespace TechHelper.Services.Beta
{
    /// <summary>
    /// 提交服务接口（Beta版本）
    /// 提供提交相关的业务逻辑操作
    /// </summary>
    public interface ISubmissionService : IBaseService<SubmissionDto, Guid>
    {
        /// <summary>
        /// 获取用户的错题列表
        /// </summary>
        /// <param name="userId">用户ID</param>
        /// <returns>错题列表</returns>
        Task<ApiResponse> GetAllErrorQuestionsAsync(Guid userId);

        /// <summary>
        /// 获取指定作业的错题列表
        /// </summary>
        /// <param name="assignmentId">作业ID</param>
        /// <param name="userId">用户ID</param>
        /// <returns>错题列表</returns>
        Task<ApiResponse> GetAssignmentErrorQuestionsAsync(Guid assignmentId, Guid userId);

        /// <summary>
        /// 获取错题类型分布
        /// </summary>
        /// <param name="assignmentId">作业ID</param>
        /// <param name="userId">用户ID</param>
        /// <returns>错题类型分布</returns>
        Task<ApiResponse> GetAssignmentErrorQuestionTypeDisAsync(Guid assignmentId, Guid userId);

        /// <summary>
        /// 获取所有错题类型分布
        /// </summary>
        /// <param name="assignmentId">作业ID</param>
        /// <param name="userId">用户ID</param>
        /// <returns>错题类型分布</returns>
        Task<ApiResponse> GetAllErrorQuestionTypeDisAsync(Guid assignmentId, Guid userId);

        /// <summary>
        /// 获取作业中所有学生的错题情况
        /// </summary>
        /// <param name="assignmentId">作业ID</param>
        /// <param name="teacherId">教师ID</param>
        /// <returns>学生错题情况</returns>
        Task<ApiResponse> GetAssignmentAllStudentsError(Guid assignmentId, Guid teacherId);

        /// <summary>
        /// 获取出现错题的学生列表
        /// </summary>
        /// <param name="assignmentQuestionId">作业题目ID</param>
        /// <returns>错题学生列表</returns>
        Task<ApiResponse> GetQuestionErrorStudents(Guid assignmentQuestionId);

        /// <summary>
        /// 判断是否已经存在提交记录
        /// </summary>
        /// <param name="assignmentId">作业ID</param>
        /// <param name="studentId">学生ID</param>
        /// <returns>提交记录数量</returns>
        Task<byte> IsHasSubmissionAsync(Guid assignmentId, Guid studentId);

        /// <summary>
        /// 获取学生提交摘要
        /// </summary>
        /// <param name="userId">用户ID</param>
        /// <returns>学生提交摘要列表</returns>
        Task<ApiResponse> GetStudentSubmissionSummariesAsync(Guid userId);

        /// <summary>
        /// 获取学生提交详情
        /// </summary>
        /// <param name="submissionId">提交ID</param>
        /// <returns>学生提交详情</returns>
        Task<ApiResponse> GetStudentSubmissionDetailAsync(Guid submissionId);

        /// <summary>
        /// 批改的试卷
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
		Task<ApiResponse> GradeExam(SubmissionTeacherUpdateDto model);
	}
}
