Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Walter Felipe
pad-upe
Commits
d608aa83
Commit
d608aa83
authored
Apr 30, 2023
by
Yuri Resende
Browse files
Adicionando botão para cancelar avaliação
parent
090e9f87
Changes
2
Hide whitespace changes
Inline
Side-by-side
app/Http/Controllers/AvaliadorController.php
View file @
d608aa83
...
...
@@ -26,6 +26,21 @@ class AvaliadorController extends Controller
]);
}
//Retorna uma mensagem de acordo com o status da avaliação
private
function
msg
(
$status
)
{
switch
(
$status
)
{
case
3
:
return
"Avaliação cancelada!"
;
case
6
:
return
"Atividade reprovada!"
;
case
7
:
return
"Atividade aprovada!"
;
default
:
break
;
}
}
public
function
avaliar
(
Request
$req
)
{
$validated
=
$req
->
validate
(
...
...
@@ -58,9 +73,8 @@ class AvaliadorController extends Controller
$avaliacao
->
avaliador_id
=
$user
->
id
;
$avaliacao
->
descricao
=
$req
->
descricao
?
$req
->
descricao
:
NULL
;
$avaliacao
->
horas_reajuste
=
$req
->
hora_reajuste
;
if
(
$avaliacao
->
save
())
{
return
redirect
()
->
back
()
->
with
([
'mensage'
=>
'Atividade avaliada!'
]);
return
redirect
()
->
back
()
->
with
([
'mensage'
=>
$this
->
msg
(
$req
->
status
)
]);
}
}
}
...
...
resources/views/pad/avaliacao/taferas_professor.blade.php
View file @
d608aa83
...
...
@@ -87,6 +87,19 @@
<
input
type
=
"submit"
class
=
"btn btn-primary"
value
=
"Aprovar"
>
</
form
>
</
div
>
@
else
<
div
class
=
"btns-avaliar mt-4 d-flex justify-content-end"
>
<
form
action
=
"
{
{route('avaliador_avaliar')}
}
"
method
=
"POST"
>
@
csrf
@
method
(
"PUT"
)
<
input
type
=
"hidden"
name
=
"avaliacao_id"
id
=
"avaliacao_id_cancelar"
value
=
"
{
{$avaliacao->id}
}
"
>
<
input
type
=
"hidden"
name
=
"tarefa_id"
id
=
"tarefa_id_cancelar"
value
=
"
{
{$avaliacao->tarefa->id}
}
"
>
<
input
type
=
"hidden"
name
=
"professor_id"
id
=
"professor_id_cancelar"
value
=
"
{
{$avaliacao->tarefa->userPad->user->id}
}
"
>
<
input
type
=
"hidden"
name
=
"status"
id
=
"status_cancelar"
value
=
'3'
>
<
input
type
=
"hidden"
name
=
"atividade_type"
id
=
"atividade_type_cancelar"
value
=
"
{
{$avaliacao->type}
}
"
>
<
input
type
=
"submit"
class
=
"btn btn-secondary"
value
=
"Cancelar Avaliação"
>
</
form
>
</
div
>
@
endif
</
div
>
...
...
@@ -146,6 +159,19 @@
</
form
>
</
div
>
@
else
<
div
class
=
"btns-avaliar mt-4 d-flex justify-content-end"
>
<
form
action
=
"
{
{route('avaliador_avaliar')}
}
"
method
=
"POST"
>
@
csrf
@
method
(
"PUT"
)
<
input
type
=
"hidden"
name
=
"avaliacao_id"
id
=
"avaliacao_id_cancelar"
value
=
"
{
{$avaliacao->id}
}
"
>
<
input
type
=
"hidden"
name
=
"tarefa_id"
id
=
"tarefa_id_cancelar"
value
=
"
{
{$avaliacao->tarefa->id}
}
"
>
<
input
type
=
"hidden"
name
=
"professor_id"
id
=
"professor_id_cancelar"
value
=
"
{
{$avaliacao->tarefa->userPad->user->id}
}
"
>
<
input
type
=
"hidden"
name
=
"status"
id
=
"status_cancelar"
value
=
'3'
>
<
input
type
=
"hidden"
name
=
"atividade_type"
id
=
"atividade_type_cancelar"
value
=
"
{
{$avaliacao->type}
}
"
>
<
input
type
=
"submit"
class
=
"btn btn-secondary"
value
=
"Cancelar Avaliação"
>
</
form
>
</
div
>
@
endif
</
div
>
...
...
@@ -203,6 +229,19 @@
</
form
>
</
div
>
@
else
<
div
class
=
"btns-avaliar mt-4 d-flex justify-content-end"
>
<
form
action
=
"
{
{route('avaliador_avaliar')}
}
"
method
=
"POST"
>
@
csrf
@
method
(
"PUT"
)
<
input
type
=
"hidden"
name
=
"avaliacao_id"
id
=
"avaliacao_id_cancelar"
value
=
"
{
{$avaliacao->id}
}
"
>
<
input
type
=
"hidden"
name
=
"tarefa_id"
id
=
"tarefa_id_cancelar"
value
=
"
{
{$avaliacao->tarefa->id}
}
"
>
<
input
type
=
"hidden"
name
=
"professor_id"
id
=
"professor_id_cancelar"
value
=
"
{
{$avaliacao->tarefa->userPad->user->id}
}
"
>
<
input
type
=
"hidden"
name
=
"status"
id
=
"status_cancelar"
value
=
'3'
>
<
input
type
=
"hidden"
name
=
"atividade_type"
id
=
"atividade_type_cancelar"
value
=
"
{
{$avaliacao->type}
}
"
>
<
input
type
=
"submit"
class
=
"btn btn-secondary"
value
=
"Cancelar Avaliação"
>
</
form
>
</
div
>
@
endif
</
div
>
...
...
@@ -218,7 +257,7 @@
</
div
>
<!--
Gestão
-->
<
div
class
=
"tab-pane fade"
id
=
"gestao"
role
=
"tabpanel"
aria
-
labelledby
=
"gestao-tab"
>
@
if
(
isset
(
$avaliacoes_gestao
)
&&
!
empty
(
$avaliacoes_gestao
))
...
...
@@ -264,6 +303,19 @@
</
form
>
</
div
>
@
else
<
div
class
=
"btns-avaliar mt-4 d-flex justify-content-end"
>
<
form
action
=
"
{
{route('avaliador_avaliar')}
}
"
method
=
"POST"
>
@
csrf
@
method
(
"PUT"
)
<
input
type
=
"hidden"
name
=
"avaliacao_id"
id
=
"avaliacao_id_cancelar"
value
=
"
{
{$avaliacao->id}
}
"
>
<
input
type
=
"hidden"
name
=
"tarefa_id"
id
=
"tarefa_id_cancelar"
value
=
"
{
{$avaliacao->tarefa->id}
}
"
>
<
input
type
=
"hidden"
name
=
"professor_id"
id
=
"professor_id_cancelar"
value
=
"
{
{$avaliacao->tarefa->userPad->user->id}
}
"
>
<
input
type
=
"hidden"
name
=
"status"
id
=
"status_cancelar"
value
=
'3'
>
<
input
type
=
"hidden"
name
=
"atividade_type"
id
=
"atividade_type_cancelar"
value
=
"
{
{$avaliacao->type}
}
"
>
<
input
type
=
"submit"
class
=
"btn btn-secondary"
value
=
"Cancelar Avaliação"
>
</
form
>
</
div
>
@
endif
</
div
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment