main.php ➔ listarResultados()   B
last analyzed

Complexity

Conditions 6
Paths 16

Size

Total Lines 105
Code Lines 70

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 6
eloc 70
nc 16
nop 0
dl 0
loc 105
rs 8.1463
c 0
b 0
f 0

How to fix   Long Method   

Long Method

Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.

For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.

Commonly applied refactorings include:

1
<?php
0 ignored issues
show
Coding Style Compatibility introduced by
For compatibility and reusability of your code, PSR1 recommends that a file should introduce either new symbols (like classes, functions, etc.) or have side-effects (like outputting something, or including other files), but not both at the same time. The first symbol is defined on line 102 and the first side effect is on line 43.

The PSR-1: Basic Coding Standard recommends that a file should either introduce new symbols, that is classes, functions, constants or similar, or have side effects. Side effects are anything that executes logic, like for example printing output, changing ini settings or writing to a file.

The idea behind this recommendation is that merely auto-loading a class should not change the state of an application. It also promotes a cleaner style of programming and makes your code less prone to errors, because the logic is not spread out all over the place.

To learn more about the PSR-1, please see the PHP-FIG site on the PSR-1.

Loading history...
2
// $Id: index.php,v 1.22 2007/03/24 17:50:52 marcellobrandao Exp $
3
//  ------------------------------------------------------------------------ //
4
//                XOOPS - PHP Content Management System                      //
5
//                    Copyright (c) 2000 XOOPS.org                           //
6
//                       <http://www.xoops.org/>                             //
7
//  ------------------------------------------------------------------------ //
8
//  This program is free software; you can redistribute it and/or modify     //
9
//  it under the terms of the GNU General Public License as published by     //
10
//  the Free Software Foundation; either version 2 of the License, or        //
11
//  (at your option) any later version.                                      //
12
//                                                                           //
13
//  You may not change or alter any portion of this comment or credits       //
14
//  of supporting developers from this source code or any supporting         //
15
//  source code which is considered copyrighted (c) material of the          //
16
//  original comment or credit authors.                                      //
17
//                                                                           //
18
//  This program is distributed in the hope that it will be useful,          //
19
//  but WITHOUT ANY WARRANTY; without even the implied warranty of           //
20
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the            //
21
//  GNU General Public License for more details.                             //
22
//                                                                           //
23
//  You should have received a copy of the GNU General Public License        //
24
//  along with this program; if not, write to the Free Software              //
25
//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA //
26
//  ------------------------------------------------------------------------ //
27
/**
28
 * index.php, Principal arquivo da administração
29
 *
30
 * Este arquivo foi implementado da seguinte forma
31
 * Primeiro você tem várias funções
32
 * Depois você tem um case que vai chamar algumas destas funções de acordo com
33
 * o paramentro $op
34
 *
35
 * @author  Marcello Brandão <[email protected]>
36
 * @version 1.0
37
 * @package assessment
38
 */
39
/**
40
 * Arquivo de cabeçalho da administração do Xoops
41
 */
42
43
$currentFile = basename(__FILE__);
44
45
include_once __DIR__ . '/admin_header.php';
46
include dirname(dirname(dirname(__DIR__))) . '/include/cp_header.php';
47
48
/**
49
 * Função que desenha o cabeçalho da administração do Xoops
50
 */
51
xoops_cp_header();
52
53
/**
54
 * Arquivo que contém várias funções interessantes , principalmente a de
55
 * criar o cabeçalho do menu com as abinhas
56
 * Verificando Versão do xoops Editor e do Frameworks,
57
 * não estando corretas mensagem com links para baixar
58
 * falta: colocando tb o link para o mastop editor
59
 */
60
61
//if ((!@file_exists(XOOPS_ROOT_PATH."/Frameworks/art/functions.admin.php"))||(!@file_exists(XOOPS_ROOT_PATH."/class/xoopseditor/xoops_version.php"))) {
0 ignored issues
show
Unused Code Comprehensibility introduced by
58% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
62
//     echo _AM_ASSESSMENT_REQUERIMENTOS;
63
//
64
//} else {
65
include_once XOOPS_ROOT_PATH . '/Frameworks/art/functions.admin.php';
66
//   include_once(XOOPS_ROOT_PATH."/Frameworks/xoops_version.php");
0 ignored issues
show
Unused Code Comprehensibility introduced by
55% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
67
//   include_once(XOOPS_ROOT_PATH."/class/xoopseditor/xoops_version.php");
68
//   if ((XOOPS_FRAMEWORKS_VERSION<floatval(1.10))||(XOOPS_FRAMEWORKS_XOOPSEDITOR_VERSION<floatval(1.10))) {
69
//    echo _AM_ASSESSMENT_REQUERIMENTOS;
70
//    } else {
71
72
/**
73
 * Criação das Fábricas de objetos que vamos precisar
74
 */
75
include dirname(__DIR__) . '/class/assessment_perguntas.php';
76
include dirname(__DIR__) . '/class/assessment_provas.php';
77
include dirname(__DIR__) . '/class/assessment_respostas.php';
78
include dirname(__DIR__) . '/class/assessment_resultados.php';
79
include dirname(__DIR__) . '/class/assessment_documentos.php';
80
include_once dirname(dirname(dirname(__DIR__))) . '/class/pagenav.php';
81
82
//$myts = MyTextSanitizer::getInstance();
0 ignored issues
show
Unused Code Comprehensibility introduced by
50% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
83
84
/**
85
 * Verificações de segurança e atribuição de variáveis recebidas por get
86
 */
87
$op       = isset($_GET['op']) ? $_GET['op'] : '';
88
$start    = isset($_GET['start']) ? $_GET['start'] : '';
89
$startper = isset($_GET['startper']) ? $_GET['startper'] : '';
90
$startdoc = isset($_GET['startdoc']) ? $_GET['startdoc'] : '';
91
92
/**
93
 * Para termos as configs dentro da parte de admin
94
 */
95
global $xoopsModuleConfig;
0 ignored issues
show
Compatibility Best Practice introduced by
Use of global functionality is not recommended; it makes your code harder to test, and less reusable.

Instead of relying on global state, we recommend one of these alternatives:

1. Pass all data via parameters

function myFunction($a, $b) {
    // Do something
}

2. Create a class that maintains your state

class MyClass {
    private $a;
    private $b;

    public function __construct($a, $b) {
        $this->a = $a;
        $this->b = $b;
    }

    public function myFunction() {
        // Do something
    }
}
Loading history...
96
97
/**
98
 * Essa função lista na tabela dentro de uma tabela os titulos das
99
 * provas com botões para editar a prova, excluir a prova ou ver as
100
 * respostas dos alunos às provas
101
 */
102
function listarprovas()
0 ignored issues
show
Coding Style introduced by
listarprovas uses the super-global variable $GLOBALS which is generally not recommended.

Instead of super-globals, we recommend to explicitly inject the dependencies of your class. This makes your code less dependent on global state and it becomes generally more testable:

// Bad
class Router
{
    public function generate($path)
    {
        return $_SERVER['HOST'].$path;
    }
}

// Better
class Router
{
    private $host;

    public function __construct($host)
    {
        $this->host = $host;
    }

    public function generate($path)
    {
        return $this->host.$path;
    }
}

class Controller
{
    public function myAction(Request $request)
    {
        // Instead of
        $page = isset($_GET['page']) ? intval($_GET['page']) : 1;

        // Better (assuming you use the Symfony2 request)
        $page = $request->query->get('page', 1);
    }
}
Loading history...
103
{
104
    /**
105
     * Declaração de variáveis globais
106
     */
107
    global $xoopsDB, $start, $xoopsModuleConfig, $pathIcon16;
0 ignored issues
show
Compatibility Best Practice introduced by
Use of global functionality is not recommended; it makes your code harder to test, and less reusable.

Instead of relying on global state, we recommend one of these alternatives:

1. Pass all data via parameters

function myFunction($a, $b) {
    // Do something
}

2. Create a class that maintains your state

class MyClass {
    private $a;
    private $b;

    public function __construct($a, $b) {
        $this->a = $a;
        $this->b = $b;
    }

    public function myFunction() {
        // Do something
    }
}
Loading history...
108
109
    /**
110
     * Criação da fábrica de provas
111
     */
112
    $fabrica_de_provas = new Xoopsassessment_provasHandler($xoopsDB);
113
114
    /**
115
     * Criação dos objetos critérios para repassar para a fábrica de provas
116
     */
117
    $criteria = new Criteria('cod_prova');
118
    $criteria->setLimit($xoopsModuleConfig['qtditens']);
119
    $criteria->setStart($start);
120
121
    /**
122
     * Contamos quantas provas existem e se nenhuma existir informamos
123
     */
124
    $total_items = $fabrica_de_provas->getCount();
125
    if ($total_items == 0) {
126
        echo _AM_ASSESSMENT_SEMPROVAS;
127
    } else {
128
        /**
129
         * Caso exista ao menos uma prova então buscamos esta(s) prova(s)
130
         * na fábrica
131
         */
132
        $vetor_provas = $fabrica_de_provas->getObjects($criteria);
133
        /**
134
         * Abre-se a tabela
135
         */
136
        echo "<table class='outer' width='100%'><tr><th colspan='5'>" . _AM_ASSESSMENT_LISTAPROVAS . '</th></tr>';
137
        /**
138
         * Loop nas provas montando as linhas das tabelas com os botões
139
         */
140
        foreach ($vetor_provas as $prova) {
141
            $x = '<tr><td>' . $prova->getVar('titulo', 's') . "</td><td width='50'>";
142
143
            $x .= '<a href="main.php?op=editar_prova&amp;cod_prova=' . $prova->getVar('cod_prova', 's');
144
            $x .= '"><img src="' . $pathIcon16 . '/edit.png" alt="' . _AM_ASSESSMENT_EDITARPROVAS . '" title="' . _AM_ASSESSMENT_EDITARPROVAS . '"></a><br /></td>';
145
            $x .= '<td width="50"> <form action="clonar.php" method="post">
146
            <input type="hidden" value="' . $prova->getVar('cod_prova', 's') . '" name="cod_prova" id="cod_prova">
147
            <input type="image" src="' . $pathIcon16 . '/editcopy.png" alt="' . _AM_ASSESSMENT_CLONE . '" title="' . _AM_ASSESSMENT_CLONE . '">
148
            </form></td>';
149
            $x .= '<td width="50"><a href="main.php?op=resultados_prova&amp;cod_prova='
150
                  . $prova->getVar('cod_prova', 's')
151
                  . '"><img src="'
152
                  . $pathIcon16
153
                  . '/view.png" alt="'
154
                  . _AM_ASSESSMENT_VERRESULT
155
                  . '" title="'
156
                  . _AM_ASSESSMENT_VERRESULT
157
                  . '"style="border-color:#E6E6E6"></a></td>';
158
            $x .= '<td width="50"><form action="excluirprova.php" method="post">'
159
                  . $GLOBALS['xoopsSecurity']->getTokenHTML()
160
                  . '<input type="image" src="'
161
                  . $pathIcon16
162
                  . '/delete.png" alt="'
163
                  . _AM_ASSESSMENT_EXCLUIRPROVAS
164
                  . '" title="'
165
                  . _AM_ASSESSMENT_EXCLUIRPROVAS
166
                  . '" /><input type="hidden" value="'
167
                  . $prova->getVar('cod_prova', 's')
168
                  . '" name="cod_prova" id="cod_prova"></form></td></tr>';
169
            echo $x;
170
        }
171
        /**
172
         * Fecha-se a tabela
173
         */
174
        echo '</table>';
175
        /**
176
         * Criando a barra de navegação caso tenha muitas provas
177
         */
178
        $barra_navegacao = new XoopsPageNav($total_items, $xoopsModuleConfig['qtditens'], $start);
179
        echo $barra_navegacao->renderImageNav(2);
180
    }
181
}
182
183
/**
184
 * Função que exibe uma pergunta com suas respostas e destaca a resposta
185
 * certa e a resposta que o usuário deu. Ela é acionada de dentro da função
186
 * editar resultado
187
 * @param $cod_pergunta
188
 * @param $cod_resposta
189
 */
190
function verDetalhePergunta($cod_pergunta, $cod_resposta)
191
{
192
    /**
193
     * Declaração de variáveis globais
194
     */
195
    global $xoopsDB, $xoopsUser;
0 ignored issues
show
Compatibility Best Practice introduced by
Use of global functionality is not recommended; it makes your code harder to test, and less reusable.

Instead of relying on global state, we recommend one of these alternatives:

1. Pass all data via parameters

function myFunction($a, $b) {
    // Do something
}

2. Create a class that maintains your state

class MyClass {
    private $a;
    private $b;

    public function __construct($a, $b) {
        $this->a = $a;
        $this->b = $b;
    }

    public function myFunction() {
        // Do something
    }
}
Loading history...
196
197
    /**
198
     * Criação da fábrica de provas
199
     */
200
    $fabrica_de_respostas = new Xoopsassessment_respostasHandler($xoopsDB);
201
    $fabrica_de_perguntas = new Xoopsassessment_perguntasHandler($xoopsDB);
202
203
    /**
204
     * Criação dos objetos critérios para repassar para a fábrica de provas
205
     */
206
    $criteria = new Criteria('cod_pergunta', $cod_pergunta);
207
208
    /**
209
     * Buscando na fábrica as respostas e a pergunta
210
     */
211
    $respostas = $fabrica_de_respostas->getObjects($criteria);
212
    $pergunta  = $fabrica_de_perguntas->get($cod_pergunta);
213
214
    /**
215
     * Montando a apresentação da pergunta e das respostas
216
     */
217
    echo "<div class='odd outer'><h3>" . _AM_ASSESSMENT_PERGUNTA . ' ' . $pergunta->getVar('titulo') . '</h3><p><ul>';
218
    foreach ($respostas as $resposta) {
219
        echo '<li>' . $resposta->getVar('titulo');
220
        if ($resposta->getVar('iscerta') == 1) { // se for a resposta certa
221
            echo '<span style="color:#009900;font-weight:bold"> <- ' . _AM_ASSESSMENT_RESPCERTA . ' </span>';
222
        }
223
        if ($resposta->getVar('cod_resposta') == $cod_resposta) { //se for a resposta do usuário
224
            echo ' <span style="font-weight:bold"> <-  ' . _AM_ASSESSMENT_RESPUSR . '  </span> ';
225
        }
226
        echo '</li>';
227
    }
228
    echo '</ul></div>';
229
}
230
231
/**
232
 * Função que monta o formulário de edição do resultado(prova feita pelo aluno)
233
 * tem que arrumar ela para que tenha um parametro $cod_resultado
234
 */
235
function editarResultado()
0 ignored issues
show
Coding Style introduced by
editarResultado uses the super-global variable $_GET which is generally not recommended.

Instead of super-globals, we recommend to explicitly inject the dependencies of your class. This makes your code less dependent on global state and it becomes generally more testable:

// Bad
class Router
{
    public function generate($path)
    {
        return $_SERVER['HOST'].$path;
    }
}

// Better
class Router
{
    private $host;

    public function __construct($host)
    {
        $this->host = $host;
    }

    public function generate($path)
    {
        return $this->host.$path;
    }
}

class Controller
{
    public function myAction(Request $request)
    {
        // Instead of
        $page = isset($_GET['page']) ? intval($_GET['page']) : 1;

        // Better (assuming you use the Symfony2 request)
        $page = $request->query->get('page', 1);
    }
}
Loading history...
236
{
237
    /**
238
     * Declaração de variáveis globais
239
     */
240
    global $xoopsDB, $xoopsUser;
0 ignored issues
show
Compatibility Best Practice introduced by
Use of global functionality is not recommended; it makes your code harder to test, and less reusable.

Instead of relying on global state, we recommend one of these alternatives:

1. Pass all data via parameters

function myFunction($a, $b) {
    // Do something
}

2. Create a class that maintains your state

class MyClass {
    private $a;
    private $b;

    public function __construct($a, $b) {
        $this->a = $a;
        $this->b = $b;
    }

    public function myFunction() {
        // Do something
    }
}
Loading history...
241
242
    /**
243
     * Buscando os dados passados via GET
244
     */
245
    $cod_resultado = $_GET['cod_resultado'];
246
247
    /**
248
     * Criação das fábricas dos objetos que vamos precisar
249
     */
250
    $fabrica_de_resultados = new Xoopsassessment_resultadosHandler($xoopsDB);
251
    $fabrica_de_provas     = new Xoopsassessment_provasHandler($xoopsDB);
252
    $fabrica_de_perguntas  = new Xoopsassessment_perguntasHandler($xoopsDB);
253
254
    /**
255
     * Buscando na fábrica o resultado a ser editado
256
     */
257
    $resultado = $fabrica_de_resultados->get($cod_resultado);
258
    $cod_prova = $resultado->getVar('cod_prova', 's');
259
    $uid_aluno = $resultado->getVar('uid_aluno', 's');
260
261
    /**
262
     * Criação dos objetos critéria para repassar para a fábrica de provas
263
     */
264
    $criteria_prova = new Criteria('cod_prova', $cod_prova);
265
    $criteria_aluno = new Criteria('uid_aluno', $uid_aluno);
266
    $criteria       = new criteriaCompo($criteria_prova);
267
    $criteria->add($criteria_aluno);
268
269
    /**
270
     * Buscando nas fábricas a prova a ser editada e a qtd de perguntas
271
     */
272
    $prova = $fabrica_de_provas->get($cod_prova);
273
    $qtd   = $fabrica_de_perguntas->getCount($criteria_prova);
274
275
    /**
276
     * Mandando a Fabrica gerar um formulário de edição
277
     */
278
    $fabrica_de_resultados->renderFormEditar($resultado, $prova, $qtd, 'editar_resultado.php');
279
}
280
281
/**
282
 * Função que lista os resultados e permite que se vá para a edição de recultados
283
 * tem que arrumar ela para que tenha um parametro $cod_prova
284
 */
285
function listarResultados()
0 ignored issues
show
Coding Style introduced by
listarResultados uses the super-global variable $_GET which is generally not recommended.

Instead of super-globals, we recommend to explicitly inject the dependencies of your class. This makes your code less dependent on global state and it becomes generally more testable:

// Bad
class Router
{
    public function generate($path)
    {
        return $_SERVER['HOST'].$path;
    }
}

// Better
class Router
{
    private $host;

    public function __construct($host)
    {
        $this->host = $host;
    }

    public function generate($path)
    {
        return $this->host.$path;
    }
}

class Controller
{
    public function myAction(Request $request)
    {
        // Instead of
        $page = isset($_GET['page']) ? intval($_GET['page']) : 1;

        // Better (assuming you use the Symfony2 request)
        $page = $request->query->get('page', 1);
    }
}
Loading history...
286
{
287
    /**
288
     * Declaração de variáveis globais
289
     */
290
    global $xoopsDB, $xoopsUser, $start, $xoopsModuleConfig, $pathIcon16;
0 ignored issues
show
Compatibility Best Practice introduced by
Use of global functionality is not recommended; it makes your code harder to test, and less reusable.

Instead of relying on global state, we recommend one of these alternatives:

1. Pass all data via parameters

function myFunction($a, $b) {
    // Do something
}

2. Create a class that maintains your state

class MyClass {
    private $a;
    private $b;

    public function __construct($a, $b) {
        $this->a = $a;
        $this->b = $b;
    }

    public function myFunction() {
        // Do something
    }
}
Loading history...
291
292
    /**
293
     * Buscando os dados passados via GET
294
     */
295
    $cod_prova = isset($_GET['$cod_prova']) ? $_GET['$cod_prova'] : '';
296
297
    /**
298
     * Criação das fábricas dos objetos que vamos precisar
299
     */
300
    $fabrica_de_provas     = new Xoopsassessment_provasHandler($xoopsDB);
301
    $fabrica_de_resultados = new Xoopsassessment_resultadosHandler($xoopsDB);
302
303
    /**
304
     * Criação dos objetos critéria para repassar para a fábrica de provas
305
     * Vamos limitar para começar do start e buscar 5 na prova de cod_prova
306
     */
307
    $criteria_prova = new Criteria('cod_prova', $cod_prova);
308
    $criteria_prova->setLimit($xoopsModuleConfig['qtditens']);
309
    if (isset($_GET['start'])) {
310
        $criteria_prova->setStart($_GET['start']);
311
    }
312
313
    /**
314
     * Buscando na fabrica os resultados (só os 5 que serão mostrados)
315
     */
316
    $vetor_resultados = $fabrica_de_resultados->getObjects($criteria_prova);
317
318
    /**
319
     * Mudança nos critérios para agora tirar o limiote de começo e de 5
320
     * assim podemos buscar a quantidade total de resultados para a prova
321
     * para poder passar para o a barra de navegação
322
     */
323
    $criteria_prova->setLimit('');
324
    $criteria_prova->setStart(0);
325
    $total_items = $fabrica_de_resultados->getCount($criteria_prova);
326
327
    if ($total_items == 0) { // teste para ver se tem provas se não tiver faz
328
        echo _AM_ASSESSMENT_SEMRESULT;
329
    } else {
330
        $estatisticas = $fabrica_de_resultados->stats($cod_prova);
331
332
        echo "<table class='outer' width='100%'><tr><th colspan='2'>" . _AM_ASSESSMENT_STATS . ' </th></tr>';
333
        echo '<tr><td class="odd"><img src="../assets/images/stats.png" title="'
334
             . _AM_ASSESSMENT_STATS
335
             . '" alt="'
336
             . _AM_ASSESSMENT_STATS
337
             . '">'
338
             . '</td<td class="odd">'
339
             . _AM_ASSESSMENT_QTDRESULT
340
             . ':'
341
             . $estatisticas['qtd']
342
             . _AM_ASSESSMENT_NOTAMAX
343
             . $estatisticas['max']
344
             . _AM_ASSESSMENT_NOTAMIN
345
             . $estatisticas['min']
346
             . _AM_ASSESSMENT_MEDIA
347
             . $estatisticas['media']
348
             . ' </td></tr>';
349
        echo '</table>';
350
351
        $barra_navegacao = new XoopsPageNav($total_items, $xoopsModuleConfig['qtditens'], $start, 'start', 'op=' . $_GET['op']);
352
        $prova           = $fabrica_de_provas->getObjects($criteria_prova);
353
        $titulo          = $prova[0]->getVar('titulo');
0 ignored issues
show
Unused Code introduced by
$titulo is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
354
        echo "<table class='outer' width='100%'><tr><th colspan='2'>" . _AM_ASSESSMENT_LISTARESULTADOS . '</th></tr>';
355
        foreach ($vetor_resultados as $resultado) {
356
            $uid             = $resultado->getVar('uid_aluno', 's');
357
            $cod_resultado   = $resultado->getVar('cod_resultado', 's');
358
            $data_fim        = $resultado->getVar('data_fim', 's');
359
            $uname           = $xoopsUser->getUnameFromId($uid);
360
            $cod_prova_atual = $resultado->getVar('cod_prova', 's');
361
            $terminoutexto   = _AM_ASSESSMENT_PROVAANDAMENTO;
362
            if ($resultado->getVar('terminou') == 1) {
363
                $terminoutexto = _AM_ASSESSMENT_TERMINADA;
364
            }
365
            $x = '<tr><td> '
366
                 . _AM_ASSESSMENT_NOMEALUNO
367
                 . ' '
368
                 . $uname
369
                 . '<br /> '
370
                 . _AM_ASSESSMENT_DATA
371
                 . ' <strong>'
372
                 . $data_fim
373
                 . '</strong><br />'
374
                 . _AM_ASSESSMENT_CODPROVA
375
                 . '<a href="main.php?op=editar_prova&cod_prova='
376
                 . $cod_prova_atual
377
                 . '">'
378
                 . $cod_prova_atual
379
                 . '</a>  '
380
                 . $terminoutexto
381
                 . '</td>';
382
            $x .= '<td width="50"><a href="main.php?op=editar_resultado&amp;cod_resultado=' . $cod_resultado . '"><img src="' . $pathIcon16 . '/view.png" alt=""></a></td>';
383
            $x .= '</tr>';
384
            echo $x;
385
        }
386
        echo '</table>';
387
        echo $barra_navegacao->renderImageNav(2);
388
    }
389
}
390
391
function listarperguntas()
0 ignored issues
show
Coding Style introduced by
listarperguntas uses the super-global variable $_GET which is generally not recommended.

Instead of super-globals, we recommend to explicitly inject the dependencies of your class. This makes your code less dependent on global state and it becomes generally more testable:

// Bad
class Router
{
    public function generate($path)
    {
        return $_SERVER['HOST'].$path;
    }
}

// Better
class Router
{
    private $host;

    public function __construct($host)
    {
        $this->host = $host;
    }

    public function generate($path)
    {
        return $this->host.$path;
    }
}

class Controller
{
    public function myAction(Request $request)
    {
        // Instead of
        $page = isset($_GET['page']) ? intval($_GET['page']) : 1;

        // Better (assuming you use the Symfony2 request)
        $page = $request->query->get('page', 1);
    }
}
Loading history...
Coding Style introduced by
listarperguntas uses the super-global variable $GLOBALS which is generally not recommended.

Instead of super-globals, we recommend to explicitly inject the dependencies of your class. This makes your code less dependent on global state and it becomes generally more testable:

// Bad
class Router
{
    public function generate($path)
    {
        return $_SERVER['HOST'].$path;
    }
}

// Better
class Router
{
    private $host;

    public function __construct($host)
    {
        $this->host = $host;
    }

    public function generate($path)
    {
        return $this->host.$path;
    }
}

class Controller
{
    public function myAction(Request $request)
    {
        // Instead of
        $page = isset($_GET['page']) ? intval($_GET['page']) : 1;

        // Better (assuming you use the Symfony2 request)
        $page = $request->query->get('page', 1);
    }
}
Loading history...
392
{
393
    global $xoopsDB, $startper, $xoopsModuleConfig, $pathIcon16;
0 ignored issues
show
Compatibility Best Practice introduced by
Use of global functionality is not recommended; it makes your code harder to test, and less reusable.

Instead of relying on global state, we recommend one of these alternatives:

1. Pass all data via parameters

function myFunction($a, $b) {
    // Do something
}

2. Create a class that maintains your state

class MyClass {
    private $a;
    private $b;

    public function __construct($a, $b) {
        $this->a = $a;
        $this->b = $b;
    }

    public function myFunction() {
        // Do something
    }
}
Loading history...
394
    $fabrica_de_perguntas = new Xoopsassessment_perguntasHandler($xoopsDB);
395
    $cod_prova            = $_GET['cod_prova'];
396
    $criteria             = new Criteria('cod_prova', $cod_prova);
397
    $criteria->setSort('ordem');
398
    $criteria->setOrder('ASC');
399
    $criteria->setLimit($xoopsModuleConfig['qtditens']);
400
    $criteria->setStart($startper);
401
    $vetor_perguntas = $fabrica_de_perguntas->getObjects($criteria);
402
    $criteria->setLimit('');
403
    $criteria->setStart(0);
404
    $total_items     = $fabrica_de_perguntas->getCount($criteria);
405
    $barra_navegacao = new XoopsPageNav($total_items, $xoopsModuleConfig['qtditens'], $startper, 'startper', 'op=' . $_GET['op'] . '&' . 'cod_prova=' . $_GET['cod_prova']);
406
407
    echo "<table class='outer' width='100%'><tr><th colspan=3>" . _AM_ASSESSMENT_LISTAPERGASSOC . '</th></tr>';
408
    if ($vetor_perguntas == null) {
409
        echo "<tr><td class='odd'>" . _AM_ASSESSMENT_SEMPERGUNTA . '</td></tr>';
410
    }
411
    foreach ($vetor_perguntas as $pergunta) {
412
        $x = "<tr><td class='odd'>" . $pergunta->getVar('titulo', 's');
413
        $x .= '</td><td width="50" class="odd"><a href="main.php?op=editar_pergunta&amp;cod_pergunta=' . $pergunta->getVar('cod_pergunta', 's');
414
        $x .= '"><img src="' . $pathIcon16 . '/edit.png" alt="' . _AM_ASSESSMENT_EDITARPERGUNTAS . '" title="' . _AM_ASSESSMENT_EDITARPERGUNTAS . '"></a></td>';
415
        $x .= '<td class="odd" width="50"><form action="excluirpergunta.php" method="post">'
416
              . $GLOBALS['xoopsSecurity']->getTokenHTML()
417
              . '<input type="image" src="'
418
              . $pathIcon16
419
              . '/delete.png" alt="'
420
              . _AM_ASSESSMENT_EXCLUIRPERGUNTAS
421
              . '" title="'
422
              . _AM_ASSESSMENT_EXCLUIRPERGUNTAS
423
              . '" /><input type="hidden" value="'
424
              . $pergunta->getVar('cod_pergunta', 's')
425
              . '" name="cod_pergunta" id="cod_pergunta"></form></td></tr>';
426
        echo $x;
427
    }
428
    echo '</table>';
429
    echo $barra_navegacao->renderImageNav(2);
430
}
431
432
function cadastrarpergunta()
0 ignored issues
show
Coding Style introduced by
cadastrarpergunta uses the super-global variable $_GET which is generally not recommended.

Instead of super-globals, we recommend to explicitly inject the dependencies of your class. This makes your code less dependent on global state and it becomes generally more testable:

// Bad
class Router
{
    public function generate($path)
    {
        return $_SERVER['HOST'].$path;
    }
}

// Better
class Router
{
    private $host;

    public function __construct($host)
    {
        $this->host = $host;
    }

    public function generate($path)
    {
        return $this->host.$path;
    }
}

class Controller
{
    public function myAction(Request $request)
    {
        // Instead of
        $page = isset($_GET['page']) ? intval($_GET['page']) : 1;

        // Better (assuming you use the Symfony2 request)
        $page = $request->query->get('page', 1);
    }
}
Loading history...
433
{
434
    global $xoopsDB;
0 ignored issues
show
Compatibility Best Practice introduced by
Use of global functionality is not recommended; it makes your code harder to test, and less reusable.

Instead of relying on global state, we recommend one of these alternatives:

1. Pass all data via parameters

function myFunction($a, $b) {
    // Do something
}

2. Create a class that maintains your state

class MyClass {
    private $a;
    private $b;

    public function __construct($a, $b) {
        $this->a = $a;
        $this->b = $b;
    }

    public function myFunction() {
        // Do something
    }
}
Loading history...
435
    $cod_prova         = $_GET['cod_prova'];
436
    $fabrica_de_provas = new Xoopsassessment_provasHandler($xoopsDB);
437
    $prova             = $fabrica_de_provas->get($cod_prova);
438
439
    $fabrica_de_perguntas = new Xoopsassessment_perguntasHandler($xoopsDB);
440
    $fabrica_de_perguntas->renderFormCadastrar('cadastropergunta.php', $prova);
441
}
442
443
function cadastrarprova()
444
{
445
    global $xoopsDB;
0 ignored issues
show
Compatibility Best Practice introduced by
Use of global functionality is not recommended; it makes your code harder to test, and less reusable.

Instead of relying on global state, we recommend one of these alternatives:

1. Pass all data via parameters

function myFunction($a, $b) {
    // Do something
}

2. Create a class that maintains your state

class MyClass {
    private $a;
    private $b;

    public function __construct($a, $b) {
        $this->a = $a;
        $this->b = $b;
    }

    public function myFunction() {
        // Do something
    }
}
Loading history...
446
    $fabrica_de_provas = new Xoopsassessment_provasHandler($xoopsDB);
447
    $fabrica_de_provas->renderFormCadastrar('cadastroprova.php');
448
}
449
450
function editarprova()
0 ignored issues
show
Coding Style introduced by
editarprova uses the super-global variable $_GET which is generally not recommended.

Instead of super-globals, we recommend to explicitly inject the dependencies of your class. This makes your code less dependent on global state and it becomes generally more testable:

// Bad
class Router
{
    public function generate($path)
    {
        return $_SERVER['HOST'].$path;
    }
}

// Better
class Router
{
    private $host;

    public function __construct($host)
    {
        $this->host = $host;
    }

    public function generate($path)
    {
        return $this->host.$path;
    }
}

class Controller
{
    public function myAction(Request $request)
    {
        // Instead of
        $page = isset($_GET['page']) ? intval($_GET['page']) : 1;

        // Better (assuming you use the Symfony2 request)
        $page = $request->query->get('page', 1);
    }
}
Loading history...
451
{
452
    global $xoopsDB;
0 ignored issues
show
Compatibility Best Practice introduced by
Use of global functionality is not recommended; it makes your code harder to test, and less reusable.

Instead of relying on global state, we recommend one of these alternatives:

1. Pass all data via parameters

function myFunction($a, $b) {
    // Do something
}

2. Create a class that maintains your state

class MyClass {
    private $a;
    private $b;

    public function __construct($a, $b) {
        $this->a = $a;
        $this->b = $b;
    }

    public function myFunction() {
        // Do something
    }
}
Loading history...
453
    $cod_prova = $_GET['cod_prova'];
454
455
    $fabrica_de_provas = new Xoopsassessment_provasHandler($xoopsDB);
456
    $prova             = $fabrica_de_provas->get($cod_prova);
457
    $fabrica_de_provas->renderFormEditar('editarprova.php', $prova);
458
}
459
460
function editarpergunta()
0 ignored issues
show
Coding Style introduced by
editarpergunta uses the super-global variable $_GET which is generally not recommended.

Instead of super-globals, we recommend to explicitly inject the dependencies of your class. This makes your code less dependent on global state and it becomes generally more testable:

// Bad
class Router
{
    public function generate($path)
    {
        return $_SERVER['HOST'].$path;
    }
}

// Better
class Router
{
    private $host;

    public function __construct($host)
    {
        $this->host = $host;
    }

    public function generate($path)
    {
        return $this->host.$path;
    }
}

class Controller
{
    public function myAction(Request $request)
    {
        // Instead of
        $page = isset($_GET['page']) ? intval($_GET['page']) : 1;

        // Better (assuming you use the Symfony2 request)
        $page = $request->query->get('page', 1);
    }
}
Loading history...
461
{
462
    global $xoopsDB;
0 ignored issues
show
Compatibility Best Practice introduced by
Use of global functionality is not recommended; it makes your code harder to test, and less reusable.

Instead of relying on global state, we recommend one of these alternatives:

1. Pass all data via parameters

function myFunction($a, $b) {
    // Do something
}

2. Create a class that maintains your state

class MyClass {
    private $a;
    private $b;

    public function __construct($a, $b) {
        $this->a = $a;
        $this->b = $b;
    }

    public function myFunction() {
        // Do something
    }
}
Loading history...
463
    $cod_pergunta = $_GET['cod_pergunta'];
464
    //    loadModuleAdminMenu(1,"migalhas3");
0 ignored issues
show
Unused Code Comprehensibility introduced by
75% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
465
    $mainAdmin = new ModuleAdmin();
466
    echo $mainAdmin->addNavigation('main.php?op=editar_pergunta');
467
    $criteria = new Criteria('cod_pergunta', $cod_pergunta);
468
    $criteria->setSort('cod_resposta');
469
    $criteria->setOrder('ASC');
470
    $fabrica_de_respostas = new Xoopsassessment_respostasHandler($xoopsDB);
471
    $respostas            = $fabrica_de_respostas->getObjects($criteria);
472
    $fabrica_de_perguntas = new Xoopsassessment_perguntasHandler($xoopsDB);
473
    $pergunta             = $fabrica_de_perguntas->get($cod_pergunta);
474
    $fabrica_de_perguntas->renderFormEditar('editarpergunta.php', $pergunta, $respostas);
475
}
476
477
function listarDocumentos()
0 ignored issues
show
Coding Style introduced by
listarDocumentos uses the super-global variable $_GET which is generally not recommended.

Instead of super-globals, we recommend to explicitly inject the dependencies of your class. This makes your code less dependent on global state and it becomes generally more testable:

// Bad
class Router
{
    public function generate($path)
    {
        return $_SERVER['HOST'].$path;
    }
}

// Better
class Router
{
    private $host;

    public function __construct($host)
    {
        $this->host = $host;
    }

    public function generate($path)
    {
        return $this->host.$path;
    }
}

class Controller
{
    public function myAction(Request $request)
    {
        // Instead of
        $page = isset($_GET['page']) ? intval($_GET['page']) : 1;

        // Better (assuming you use the Symfony2 request)
        $page = $request->query->get('page', 1);
    }
}
Loading history...
Coding Style introduced by
listarDocumentos uses the super-global variable $GLOBALS which is generally not recommended.

Instead of super-globals, we recommend to explicitly inject the dependencies of your class. This makes your code less dependent on global state and it becomes generally more testable:

// Bad
class Router
{
    public function generate($path)
    {
        return $_SERVER['HOST'].$path;
    }
}

// Better
class Router
{
    private $host;

    public function __construct($host)
    {
        $this->host = $host;
    }

    public function generate($path)
    {
        return $this->host.$path;
    }
}

class Controller
{
    public function myAction(Request $request)
    {
        // Instead of
        $page = isset($_GET['page']) ? intval($_GET['page']) : 1;

        // Better (assuming you use the Symfony2 request)
        $page = $request->query->get('page', 1);
    }
}
Loading history...
478
{
479
    /**
480
     * Listar variáveis globais
481
     */
482
    global $xoopsDB, $start, $startdoc, $xoopsModuleConfig, $pathIcon16;
0 ignored issues
show
Compatibility Best Practice introduced by
Use of global functionality is not recommended; it makes your code harder to test, and less reusable.

Instead of relying on global state, we recommend one of these alternatives:

1. Pass all data via parameters

function myFunction($a, $b) {
    // Do something
}

2. Create a class that maintains your state

class MyClass {
    private $a;
    private $b;

    public function __construct($a, $b) {
        $this->a = $a;
        $this->b = $b;
    }

    public function myFunction() {
        // Do something
    }
}
Loading history...
483
484
    /**
485
     * Buscando os dados passados via GET
486
     */
487
    $cod_prova = isset($_GET['cod_prova']) ? $_GET['cod_prova'] : '';
488
489
    /**
490
     * Montando os criterios para buscar o total de documentos para montar a barra de navegacao
491
     */
492
    $criteria = new Criteria('cod_prova', $cod_prova);
493
    $criteria->setLimit('');
494
    $criteria->setStart(0);
495
    $fabrica_de_documentos = new Xoopsassessment_documentosHandler($xoopsDB);
496
    $total_items           = $fabrica_de_documentos->getCount($criteria);
497
    if ($total_items == 0) {
498
        echo _AM_ASSESSMENT_SEMDOCUMENTO;
499
    } else {
500
        /**
501
         * Montando os criterios para buscar somente os documentos desta página
502
         */
503
        $criteria->setLimit($xoopsModuleConfig['qtditens']);
504
        $criteria->setStart($startdoc);
505
506
        $vetor_documentos = $fabrica_de_documentos->getObjects($criteria);
507
508
        $barra_navegacao = new XoopsPageNav($total_items, $xoopsModuleConfig['qtditens'], $startdoc, 'startdoc', 'op=' . $_GET['op'] . '&' . 'cod_prova=' . $cod_prova);
509
510
        echo "<table class='outer' width='100%'><tr><th colspan='3'>" . _AM_ASSESSMENT_LISTADOC . '</th></tr>';
511
        foreach ($vetor_documentos as $documento) {
512
            $x = "<tr><td class='odd'>" . $documento->getVar('titulo', 's') . "</td><td class='odd' width='50'>";
513
514
            $x .= '<a href="main.php?op=editar_documento&amp;cod_documento=' . $documento->getVar('cod_documento', 's');
515
            $x .= '"><img src="' . $pathIcon16 . '/edit.png" alt="' . _AM_ASSESSMENT_EDITARDOC . '" title="' . _AM_ASSESSMENT_EDITARDOC . '"></a><br /></td>';
516
            //$x.= '<td class="odd" width="50"><a href="main.php?op=resultados_prova&amp;cod_documento='.$documento->getVar("cod_documento", "s").'"><img src="../assets/images/detalhe.gif" alt="Ver Resultados" style="border-color:#E6E6E6"></a></td>';
0 ignored issues
show
Unused Code Comprehensibility introduced by
62% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
517
            $x .= '<td class="odd" width="50"><form action="excluirdocumento.php" method="post">'
518
                  . $GLOBALS['xoopsSecurity']->getTokenHTML()
519
                  . '<input type="image" src="'
520
                  . $pathIcon16
521
                  . '/delete.png" alt="'
522
                  . _AM_ASSESSMENT_EXCLUIRDOC
523
                  . '"  title="'
524
                  . _AM_ASSESSMENT_EXCLUIRDOC
525
                  . '"/><input type="hidden" value="'
526
                  . $documento->getVar('cod_documento', 's')
527
                  . '" name="cod_documento" id="cod_documento"><input type="hidden" value="'
528
                  . $documento->getVar('cod_prova', 's')
529
                  . '" name="cod_prova" id="cod_prova"></form></td></tr>';
530
            echo $x;
531
        }
532
        echo '</table>';
533
        echo $barra_navegacao->renderImageNav(2);
534
    }
535
}
536
537
function cadastrarDocumento()
0 ignored issues
show
Coding Style introduced by
cadastrarDocumento uses the super-global variable $_GET which is generally not recommended.

Instead of super-globals, we recommend to explicitly inject the dependencies of your class. This makes your code less dependent on global state and it becomes generally more testable:

// Bad
class Router
{
    public function generate($path)
    {
        return $_SERVER['HOST'].$path;
    }
}

// Better
class Router
{
    private $host;

    public function __construct($host)
    {
        $this->host = $host;
    }

    public function generate($path)
    {
        return $this->host.$path;
    }
}

class Controller
{
    public function myAction(Request $request)
    {
        // Instead of
        $page = isset($_GET['page']) ? intval($_GET['page']) : 1;

        // Better (assuming you use the Symfony2 request)
        $page = $request->query->get('page', 1);
    }
}
Loading history...
538
{
539
    /**
540
     * Buscando os dados passados via GET
541
     */
542
    global $xoopsDB;
0 ignored issues
show
Compatibility Best Practice introduced by
Use of global functionality is not recommended; it makes your code harder to test, and less reusable.

Instead of relying on global state, we recommend one of these alternatives:

1. Pass all data via parameters

function myFunction($a, $b) {
    // Do something
}

2. Create a class that maintains your state

class MyClass {
    private $a;
    private $b;

    public function __construct($a, $b) {
        $this->a = $a;
        $this->b = $b;
    }

    public function myFunction() {
        // Do something
    }
}
Loading history...
543
    $cod_prova = isset($_GET['cod_prova']) ? $_GET['cod_prova'] : '';
544
545
    if ($cod_prova == '') {
546
        echo _AM_ASSESSMENT_INSTRUCOESNOVODOC;
547
    } else {
548
        $fabrica_de_documentos = new Xoopsassessment_documentosHandler($xoopsDB);
549
        $fabrica_de_documentos->renderFormCadastrar('cadastrardocumento.php', $cod_prova);
550
    }
551
}
552
553
function editarDocumento()
0 ignored issues
show
Coding Style introduced by
editarDocumento uses the super-global variable $_GET which is generally not recommended.

Instead of super-globals, we recommend to explicitly inject the dependencies of your class. This makes your code less dependent on global state and it becomes generally more testable:

// Bad
class Router
{
    public function generate($path)
    {
        return $_SERVER['HOST'].$path;
    }
}

// Better
class Router
{
    private $host;

    public function __construct($host)
    {
        $this->host = $host;
    }

    public function generate($path)
    {
        return $this->host.$path;
    }
}

class Controller
{
    public function myAction(Request $request)
    {
        // Instead of
        $page = isset($_GET['page']) ? intval($_GET['page']) : 1;

        // Better (assuming you use the Symfony2 request)
        $page = $request->query->get('page', 1);
    }
}
Loading history...
554
{
555
    global $xoopsDB;
0 ignored issues
show
Compatibility Best Practice introduced by
Use of global functionality is not recommended; it makes your code harder to test, and less reusable.

Instead of relying on global state, we recommend one of these alternatives:

1. Pass all data via parameters

function myFunction($a, $b) {
    // Do something
}

2. Create a class that maintains your state

class MyClass {
    private $a;
    private $b;

    public function __construct($a, $b) {
        $this->a = $a;
        $this->b = $b;
    }

    public function myFunction() {
        // Do something
    }
}
Loading history...
556
    $cod_documento = $_GET['cod_documento'];
557
558
    $fabrica_de_documentos = new Xoopsassessment_documentosHandler($xoopsDB);
559
    $fabrica_de_documentos->renderFormEditar('editar_documento.php', $cod_documento);
560
}
561
562
function seloqualidade()
563
{
564
    echo '<img align="right" src="../assets/images/mlogo.png" id="marcello_brandao">';
565
}
566
567
switch ($op) {
568
569
    case 'manter_documentos':
570
        //            loadModuleAdminMenu(3,"-> "._AM_ASSESSMENT_DOCUMENTO);
0 ignored issues
show
Unused Code Comprehensibility introduced by
60% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
571
        $mainAdmin = new ModuleAdmin();
572
        echo $mainAdmin->addNavigation('main.php?op=manter_documentos');
573
        listarDocumentos();
574
        cadastrarDocumento();
575
        seloqualidade();
576
        break;
577
578 View Code Duplication
    case 'manter_provas':
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
579
        //            loadModuleAdminMenu(1,"-> "._AM_ASSESSMENT_PROVA);
0 ignored issues
show
Unused Code Comprehensibility introduced by
60% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
580
        $mainAdmin = new ModuleAdmin();
581
        echo $mainAdmin->addNavigation('main.php?op=manter_provas');
582
583
        //        $mainAdmin = new ModuleAdmin();
0 ignored issues
show
Unused Code Comprehensibility introduced by
46% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
584
        //        echo $mainAdmin->addNavigation('main.php?op=manter_provas');
0 ignored issues
show
Unused Code Comprehensibility introduced by
70% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
585
        //        $mainAdmin->addItemButton(_AM_ASSESSMENT_CADASTRAR . " " . _AM_ASSESSMENT_PERGUNTA, '#cadastrar_pergunta', 'add');
0 ignored issues
show
Unused Code Comprehensibility introduced by
46% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
586
        //        $mainAdmin->addItemButton(_AM_ASSESSMENT_CADASTRAR . " " . _AM_ASSESSMENT_DOCUMENTO, '#cadastrar_documento', 'add');
0 ignored issues
show
Unused Code Comprehensibility introduced by
46% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
587
        //    $mainAdmin->addItemButton(_MI_ASSESSMENT_ADMENU1, "{$currentFile}?op==manter_provas", 'list');
0 ignored issues
show
Unused Code Comprehensibility introduced by
65% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
588
        //        echo $mainAdmin->renderButton('left');
0 ignored issues
show
Unused Code Comprehensibility introduced by
70% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
589
590
        listarprovas();
591
        cadastrarprova();
592
        seloqualidade();
593
        break;
594
595
    case 'manter_resultados':
596
        //            loadModuleAdminMenu(2,"-> "._AM_ASSESSMENT_RESULTADO);
0 ignored issues
show
Unused Code Comprehensibility introduced by
60% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
597
        $mainAdmin = new ModuleAdmin();
598
        echo $mainAdmin->addNavigation('main.php?op=manter_resultados');
599
        listarResultados();
600
        seloqualidade();
601
        break;
602
603
    case 'resultados_prova':
604
        //          loadModuleAdminMenu(2,"-> "._AM_ASSESSMENT_RESULTPROVA);
0 ignored issues
show
Unused Code Comprehensibility introduced by
60% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
605
        $mainAdmin = new ModuleAdmin();
606
        echo $mainAdmin->addNavigation('main.php?op=manter_prova');
607
        listarResultados();
608
        seloqualidade();
609
        break;
610
611
    case 'ver_detalhe_pergunta':
612
        //            loadModuleAdminMenu(2,_AM_ASSESSMENT_RESPALUNO);
0 ignored issues
show
Unused Code Comprehensibility introduced by
63% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
613
        $mainAdmin = new ModuleAdmin();
614
        echo $mainAdmin->addNavigation('main.php?op=ver_detalhe_pergunta');
615
        verDetalhePergunta($_GET['cod_pergunta'], $_GET['cod_resposta']);
616
        seloqualidade();
617
        break;
618
619
    case 'editar_prova':
620
        //            loadModuleAdminMenu(1,"-> "._AM_ASSESSMENT_PROVA." - "._AM_ASSESSMENT_EDITAR);
0 ignored issues
show
Unused Code Comprehensibility introduced by
50% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
621
        $mainAdmin = new ModuleAdmin();
622
        echo $mainAdmin->addNavigation('main.php?op=manter_provas');
623
        $mainAdmin->addItemButton(_AM_ASSESSMENT_CADASTRAR . ' ' . _AM_ASSESSMENT_PERGUNTA, '#cadastrar_pergunta', 'add');
624
        $mainAdmin->addItemButton(_AM_ASSESSMENT_CADASTRAR . ' ' . _AM_ASSESSMENT_DOCUMENTO, '#cadastrar_documento', 'add');
625
        $mainAdmin->addItemButton(_MI_ASSESSMENT_ADMENU1, "{$currentFile}?op==manter_provas", 'list');
626
627
        echo $mainAdmin->renderButton('left');
628
629
        //        echo "<a href=#cadastrar_pergunta>" . _AM_ASSESSMENT_CADASTRAR . " " . _AM_ASSESSMENT_PERGUNTA . "</a> | <a href=#cadastrar_documento>" . _AM_ASSESSMENT_CADASTRAR
630
        //            . " " . _AM_ASSESSMENT_DOCUMENTO . "</a>";
631
        editarprova();
632
        echo "<table class='outer' width='100%'><tr><td valign=top width='50%'>";
633
        listarperguntas();
634
        echo "</td><td valign=top width='50%'>";
635
        listarDocumentos();
636
        echo "</td></tr><tr><td colspan='2'>";
637
        echo '<br /><br /><a name="cadastrar_pergunta">';
638
        cadastrarpergunta();
639
        echo "</td></tr><tr><td colspan='2'>";
640
        echo '<br /><br /><a name="cadastrar_documento">';
641
        cadastrarDocumento();
642
        echo '</td></tr></table>';
643
        seloqualidade();
644
        break;
645
646
    case 'editar_resultado':
647
        //            loadModuleAdminMenu(2,"-> "._AM_ASSESSMENT_PROVA." "._AM_ASSESSMENT_EDITAR);
0 ignored issues
show
Unused Code Comprehensibility introduced by
50% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
648
        $mainAdmin = new ModuleAdmin();
649
        echo $mainAdmin->addNavigation('main.php');
650
        editarResultado();
651
        seloqualidade();
652
        break;
653
654
    case 'editar_documento':
655
        //            loadModuleAdminMenu(3,"-> "._AM_ASSESSMENT_DOCUMENTO." "._AM_ASSESSMENT_EDITAR);
0 ignored issues
show
Unused Code Comprehensibility introduced by
50% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
656
        $mainAdmin = new ModuleAdmin();
657
        echo $mainAdmin->addNavigation('main.php');
658
        editarDocumento();
659
        seloqualidade();
660
        break;
661
662
    case 'editar_pergunta':
663
        $mainAdmin = new ModuleAdmin();
664
        echo $mainAdmin->addNavigation('main.php');
665
        editarpergunta();
666
        seloqualidade();
667
        break;
668
669
    case 'default':
0 ignored issues
show
Coding Style introduced by
The case body in a switch statement must start on the line following the statement.

According to the PSR-2, the body of a case statement must start on the line immediately following the case statement.

switch ($expr) {
case "A":
    doSomething(); //right
    break;
case "B":

    doSomethingElse(); //wrong
    break;

}

To learn more about the PSR-2 coding standard, please refer to the PHP-Fig.

Loading history...
670
671 View Code Duplication
    default:
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
672
        //        loadModuleAdminMenu(1,"-> "._AM_ASSESSMENT_PROVA);
0 ignored issues
show
Unused Code Comprehensibility introduced by
60% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
673
        $mainAdmin = new ModuleAdmin();
674
        echo $mainAdmin->addNavigation('main.php');
675
        listarprovas();
676
        cadastrarprova();
677
        seloqualidade();
678
        break;
679
}
680
681
//    }
682
//}
683
684
//fechamento das tags de if lá de cimão verificação se os arquivos do phppp existem
685
include_once __DIR__ . '/admin_footer.php';
686