This commit is contained in:
SpecialX
2025-06-27 19:03:10 +08:00
parent 14fbe6397a
commit a21ca80782
57 changed files with 3872 additions and 611 deletions

View File

@@ -0,0 +1,91 @@
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<Submission> _submissionRepository;
private readonly IRepository<SubmissionDetail> _submissionDetailRepository;
public SubmissionServices(IMapper mapper, IUnitOfWork unitOfWork)
{
_mapper = mapper;
_unitOfWork = unitOfWork;
_submissionRepository = _unitOfWork.GetRepository<Submission>();
_submissionDetailRepository = _unitOfWork.GetRepository<SubmissionDetail>();
}
public Task<ApiResponse> AddAsync(Submission model)
{
throw new NotImplementedException();
}
public Task<ApiResponse> DeleteAsync(Guid id)
{
throw new NotImplementedException();
}
public Task<ApiResponse> GetAllAsync(QueryParameter query)
{
throw new NotImplementedException();
}
public async Task<ApiResponse> 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<ApiResponse> GetAllErrorQuestionTypeDisAsync(Guid assignmentId, Guid userId)
{
throw new NotImplementedException();
}
public Task<ApiResponse> GetAssignmentAllStudentsError(Guid assignmentId, Guid teacherId)
{
throw new NotImplementedException();
}
public Task<ApiResponse> GetAssignmentErrorQuestionsAsync(Guid assignmentId, Guid userId)
{
throw new NotImplementedException();
}
public Task<ApiResponse> GetAssignmentErrorQuestionTypeDisAsync(Guid assignmentId, Guid userId)
{
throw new NotImplementedException();
}
public Task<ApiResponse> GetAsync(Guid id)
{
throw new NotImplementedException();
}
public Task<ApiResponse> GetQuestionErrorStudents(Guid assignmentId)
{
throw new NotImplementedException();
}
public Task<ApiResponse> UpdateAsync(Submission model)
{
throw new NotImplementedException();
}
}
}