Skip to content

Commit

Permalink
Merge pull request #74 from lageIBUSP/develop
Browse files Browse the repository at this point in the history
Develop besteirinhas E BUGFIX
  • Loading branch information
adalardo authored Jun 6, 2022
2 parents ab8174c + 81dad1c commit 8dccdfe
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 9 deletions.
20 changes: 13 additions & 7 deletions app/Http/Controllers/ExercicioController.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,15 +134,21 @@ public function show(Exercicio $exercicio)
* @return Array
*/
private function getInstalledPackages () {
$cnx = new Connection('r');
try {
$cnx = new Connection('r');

$rcode = 'pkgs <- installed.packages();'
. 'pkgs[,1];'
;
// resposta do R
$r = $cnx->evalString($rcode);
$rcode = 'pkgs <- installed.packages();'
. 'pkgs[,1];'
;
// resposta do R
$r = $cnx->evalString($rcode);

return ($r);
return ($r);
}
catch (Exception $e) {
Log::error('Erro de conexão em getInstalledPackages');
return null;
}
}

/**
Expand Down
3 changes: 3 additions & 0 deletions app/Rules/Emails.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ public function __construct()
*/
public function passes($attribute, $value)
{
if (!$value) {
return true;
}
$rules = [
'email' => 'required|email',
];
Expand Down
4 changes: 3 additions & 1 deletion resources/views/exercicio/create.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@
</div>

<div class="form-group">
<label for="precondicoes"><h2>Pré-condições</h2></label>
<label for="precondicoes"><h2>Precondições</h2></label>
@if ($pacotesR ?? '')
<div>
<label for="pacotes">Veja a lista de pacotes disponíveis:</label>
<select name="pacotes" id="pacotes">
Expand All @@ -52,6 +53,7 @@
@endforeach
</select>
</div>
@endif

<textarea class="form-control @error('precondicoes') is-invalid @enderror" id="precondicoes" name="precondicoes" placeholder="Código rodado antes da correção">{{ old('precondicoes') }}</textarea>
@error('precondicoes')
Expand Down
4 changes: 3 additions & 1 deletion resources/views/exercicio/edit.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@
</div>

<div class="form-group">
<label for="precondicoes"><h2>Pré-condições</h2></label>
<label for="precondicoes"><h2>Precondições</h2></label>
@if ($pacotesR ?? '')
<div>
<label for="pacotes">Veja a lista de pacotes disponíveis:</label>
<select name="pacotes" id="pacotes">
Expand All @@ -52,6 +53,7 @@
@endforeach
</select>
</div>
@endif

<textarea class="form-control @error('precondicoes') is-invalid @enderror" id="precondicoes" name="precondicoes" placeholder="Código rodado antes da correção">{{ old('precondicoes', $exercicio->precondicoes) }}</textarea>
@error('precondicoes')
Expand Down

0 comments on commit 8dccdfe

Please sign in to comment.