using Exam.Application.Interface.Exam;
using Exam.Share;
using Exam.Share.Dtos.ExamManage;
using Exam.Share.ViewResponses.Exam;
using Hotline.Exams.ExamManages;
using Hotline.Repository.SqlSugar.Exam.Interface;
using Hotline.Share.Dtos.ExamManages;
using Hotline.Share.Requests.Exam;
using Hotline.Share.ViewResponses.Exam;

namespace Hotline.Application.Exam.Interface.ExamManages
{
    public interface IUserExamService:IQueryService<UserExamResultViewResponse,UserExamDto,UserExamPagedRequest>,IApiService<AddUserExamDto,UpdateUserExamDto,ExamUserExam>
    {
        /// <summary>
        /// 交卷
        /// </summary>
        /// <param name="submitExamDto"></param>
        /// <param name="cancellationToken"></param>
        /// <returns></returns>
        Task SubmitAsync(SubmitExamDto submitExamDto,CancellationToken cancellationToken);

        
        /// <summary>
        /// 阅卷
        /// </summary>
        /// <param name="gradingExtamItemDto"></param>
        /// <param name="cancellationToken"></param>
        /// <returns></returns>
        Task<GradingExamQuestionDto> GradingAsync(GradingExamItemDto gradingExtamItemDto, CancellationToken cancellationToken);

        /// <summary>
        /// 获取考试试题类型和Id
        /// </summary>
        /// <param name="examQuestionRequest"></param>
        /// <returns></returns>
        Task<List<ExamQuestionViewResponse>> GetExamQuestionViewResponses(ExamQuestionGroupRequest examQuestionGroupRequest);

        /// <summary>
        /// 获取已阅卷的考试试题类型和Id
        /// </summary>
        /// <param name="examQuestionGroupRequest"></param>
        /// <returns></returns>
        Task<List<GradingQuestionViewResponce>> GetGradingQuestionViewResponces(ExamQuestionGroupRequest examQuestionGroupRequest);

        /// <summary>
        /// 获取考试试题
        /// </summary>
        /// <param name="examQuestionRequest"></param>
        /// <returns></returns>
        Task<ExamQuestionDto> GetExamQuestionDto(ExamQuestionRequest examQuestionRequest);

        /// <summary>
        /// 初次考试
        /// </summary>
        /// <param name="addUserExamItemDto"></param>
        /// <returns></returns>
        Task<StartExamViewResponse> ExamAsync(UpdateUserExamItemDto addUserExamItemDto, CancellationToken cancellationToken);

        /// <summary>
        /// 开始考试
        /// </summary>
        /// <param name="startUserExamDto"></param>
        /// <param name="CancellationToken"></param>
        /// <returns></returns>
        Task<StartExamViewResponse> StartUserExamAsync(StartUserExamDto startUserExamDto,CancellationToken cancellationToken);

        /// <summary>
        /// 完成阅卷
        /// </summary>
        /// <param name="gradingExtamDto"></param>
        /// <param name="cancellationToken"></param>
        /// <returns></returns>
        Task CompleteGradingAsync(GradingExamDto gradingExtamDto,CancellationToken cancellationToken);

        /// <summary>
        /// 获取阅卷试题
        /// </summary>
        /// <param name="gradingExamRequest"></param>
        /// <returns></returns>
        Task<List<GradingExamQuestionDto>> GetGradingExamQuestion(GradingExamRequest gradingExamRequest);

        /// <summary>
        /// 查看已阅卷考试试题
        /// </summary>
        /// <param name="viewGradingExamRequest"></param>
        /// <returns></returns>
        Task<GradingExamQuestionDto> ViewGradingExamQuestion(ViewGradingExamRequest viewGradingExamRequest);

        /// <summary>
        /// 获取缺考考生名单
        /// </summary>
        /// <param name="unExamUserReportPagedRequest"></param>
        /// <returns></returns>
        Task<UnExamUserPageViewResponse> GetUnExamUsersPaged(UnExamUserReportPagedRequest unExamUserReportPagedRequest);

        /// <summary>
        /// 获取缺考考生名单(不分页)
        /// </summary>
        /// <param name="unExamUserReportPagedRequest"></param>
        /// <returns></returns>
        Task<List<UnExamUserViewResponse>> GetUnExamUsers(UnExamUserReportPagedRequest unExamUserReportPagedRequest);

        /// <summary>
        /// 获取用户考试成绩
        /// </summary>
        /// <param name="userExamResultReportPagedRequest"></param>
        /// <returns></returns>
        Task<UserExamResultPageViewResponse> GetUserExamResults(UserExamResultReportPagedRequest userExamResultReportPagedRequest);

        Task<GradingResultPageViewResponse> GetGradingResultPagedList(GradingPagedRequest gradingPagedRequest);

        /// <summary>
        /// 批量阅卷
        /// </summary>
        /// <param name="batchGradingExamItemDto"></param>
        /// <param name="requestAborted"></param>
        /// <returns></returns>
        Task BatchGradingAsync(BatchGradingExamItemDto batchGradingExamItemDto, CancellationToken requestAborted);

        /// <summary>
        /// 获取用户列表
        /// </summary>
        /// <param name="examUserQueryRequest"></param>
        /// <returns></returns>
        Task<List<ExamUserViewResponse>> GetUserListAsync(ExamUserQueryRequest examUserQueryRequest);
        
        /// <summary>
        /// 查看考试
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        Task<ViewExamQuestionDto> View(string id,string questionId);

        /// <summary>
        /// 查看考试
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        Task<List<ViewExamQuestionDto>> View(string id);
    }
}
