Commit 29224253296f83e0df6cbb8f1f1bfd680a5aa7c9
1 parent
b3b5475c
Exists in
2.8
and in
6 other branches
Ajusta validação de nota máxima e mínima
Caso a nota seja conceitual, usa o campo notaOriginal para a validação. Se for numérica usa a nota calculada
Showing
1 changed file
with
8 additions
and
3 deletions
Show diff stats
ieducar/modules/Api/Views/DiarioController.php
... | ... | @@ -231,7 +231,12 @@ class DiarioController extends ApiCoreController |
231 | 231 | |
232 | 232 | $valorNota = $serviceBoletim->calculateStageScore($etapa, $notaOriginal, $notaRecuperacao); |
233 | 233 | |
234 | - if ($etapa == 'Rc' && $notaOriginal > $regra->notaMaximaExameFinal) { | |
234 | + $notaValidacao = $notaOriginal; | |
235 | + if (is_numeric($valorNota)) { | |
236 | + $notaValidacao = $valorNota; | |
237 | + } | |
238 | + | |
239 | + if ($etapa == 'Rc' && $notaValidacao > $regra->notaMaximaExameFinal) { | |
235 | 240 | $this->messenger->append("A nota {$valorNota} está acima da configurada para nota máxima para exame que é {$regra->notaMaximaExameFinal}.", 'error'); |
236 | 241 | $this->appendResponse('error', [ |
237 | 242 | 'code' => Error::EXAM_SCORE_GREATER_THAN_MAX_ALLOWED, |
... | ... | @@ -241,7 +246,7 @@ class DiarioController extends ApiCoreController |
241 | 246 | return false; |
242 | 247 | } |
243 | 248 | |
244 | - if ($etapa != 'Rc' && $notaOriginal > $regra->notaMaximaGeral) { | |
249 | + if ($etapa != 'Rc' && $notaValidacao > $regra->notaMaximaGeral) { | |
245 | 250 | $this->messenger->append("A nota {$valorNota} está acima da configurada para nota máxima geral que é {$regra->notaMaximaGeral}.", 'error'); |
246 | 251 | $this->appendResponse('error', [ |
247 | 252 | 'code' => Error::SCORE_GREATER_THAN_MAX_ALLOWED, |
... | ... | @@ -251,7 +256,7 @@ class DiarioController extends ApiCoreController |
251 | 256 | return false; |
252 | 257 | } |
253 | 258 | |
254 | - if ($notaOriginal < $regra->notaMinimaGeral) { | |
259 | + if ($notaValidacao < $regra->notaMinimaGeral) { | |
255 | 260 | $this->messenger->append("A nota {$valorNota} está abaixo da configurada para nota mínima geral que é {$regra->notaMinimaGeral}.", 'error'); |
256 | 261 | $this->appendResponse('error', [ |
257 | 262 | 'code' => Error::SCORE_LESSER_THAN_MIN_ALLOWED, | ... | ... |