Exemplo n.º 1
0
 /**
  * Método que gera uma página que listas as questões salvas no banco de questões
  */
 public function bancoDeQuestoesListarAction()
 {
     $this->filtro->initGets(array("tipo_questao", "disciplina", "executar_acao", "questao"));
     try {
         if ($this->filtro->get("executar_acao") == Permissoes::EXCLUIR) {
             $msg = $this->excluirQuestao($this->filtro->get("questao"));
             $this->setData("msg", $msg);
         }
         $questao = new Questao();
         $sqlQuestao = new SqlQuestao();
         $this->loadPlugin("filtros");
         $this->setData("questoes", $sqlQuestao->listarTodos($this->filtro));
         $this->setData("tipos", $questao->getTiposAceitos());
         $this->printView();
     } catch (SqlException $exc) {
         echo Javascript::alert("Ocorreu um erro interno. Tente novamente mais tarde");
         die(Javascript::history_back());
     } catch (Exception $exc) {
         echo Javascript::alert($exc->getMessage());
         die(Javascript::history_back());
     }
 }