Skip to content

Commit

Permalink
ajustada consulta dos alunos da prova.
Browse files Browse the repository at this point in the history
  • Loading branch information
FernandoGroeler committed Dec 20, 2023
1 parent 6975cb6 commit 1d1e23b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public async Task<bool> Executar(long provaId, QuestaoAlunoRespostaSincronizarDt
.ToList();

//-> obter alternativas e respostas
var alunoRespostas = (await mediator.Send(new ObterAlternativaAlunoRespostaQuery(provaId, alunoRa))).ToList();
var alunoRespostas = await mediator.Send(new ObterAlternativaAlunoRespostaQuery(provaId, alunoRa));

if(!questoesAluno.Any(t => t.Id == questaoAlunoRespostaSincronizarDto.QuestaoId))
throw new NegocioException($"Questão respondida não pertence ao aluno logado. Questão: {questaoAlunoRespostaSincronizarDto.QuestaoId}");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,10 @@ from aluno a
left join caderno_aluno ca on ca.aluno_id = a.id
left join questao q on q.caderno = ca.caderno and q.prova_id = ca.prova_id
left join alternativa al on al.questao_id = q.id and al.correta
where a.ra = @alunoRa and q.prova_id = @provaId and a.situacao = 1";
where a.ra = @alunoRa and q.prova_id = @provaId";

// todo: durante a execução da prova TAI de 2023, foi filtrado apenas por alunos ativos
// and a.situacao = 1

return await conn.QueryAsync<QuestaoAlternativaAlunoRespostaDto>(query, new { alunoRa, provaId });
}
Expand Down

0 comments on commit 1d1e23b

Please sign in to comment.