using AutoMapper; using Entities.Contracts; using Microsoft.EntityFrameworkCore; using SharedDATA.Api; using TechHelper.Services; namespace TechHelper.Server.Services { public class SubmissionServices : ISubmissionServices { private readonly IUnitOfWork _unitOfWork; private readonly IMapper _mapper; private readonly IRepository _submissionRepository; private readonly IRepository _submissionDetailRepository; public SubmissionServices(IMapper mapper, IUnitOfWork unitOfWork) { _mapper = mapper; _unitOfWork = unitOfWork; _submissionRepository = _unitOfWork.GetRepository(); _submissionDetailRepository = _unitOfWork.GetRepository(); } public Task AddAsync(Submission model) { throw new NotImplementedException(); } public Task DeleteAsync(Guid id) { throw new NotImplementedException(); } public Task GetAllAsync(QueryParameter query) { throw new NotImplementedException(); } public async Task GetAllErrorQuestionsAsync(Guid userId) { try { var errorSDs = await _submissionDetailRepository.GetPagedListAsync(predicate: sd => sd.StudentId == userId && sd.IsCorrect == false, include: i => i .Include(s => s.AssignmentQuestion) .ThenInclude(aq => aq.Question)); var errorQuestion = errorSDs.Items.Select(sd => sd.AssignmentQuestion).ToList(); return ApiResponse.Success(); } catch (Exception ex) { return ApiResponse.Error(); } } public Task GetAllErrorQuestionTypeDisAsync(Guid assignmentId, Guid userId) { throw new NotImplementedException(); } public Task GetAssignmentAllStudentsError(Guid assignmentId, Guid teacherId) { throw new NotImplementedException(); } public Task GetAssignmentErrorQuestionsAsync(Guid assignmentId, Guid userId) { throw new NotImplementedException(); } public Task GetAssignmentErrorQuestionTypeDisAsync(Guid assignmentId, Guid userId) { throw new NotImplementedException(); } public Task GetAsync(Guid id) { throw new NotImplementedException(); } public Task GetQuestionErrorStudents(Guid assignmentId) { throw new NotImplementedException(); } public Task UpdateAsync(Submission model) { throw new NotImplementedException(); } } }