Exemplo n.º 1
0
 private function pdfQuestion(Mypdf $fpdf, $id_question, $count, $answered = false)
 {
     $question = new Question();
     $question_controller = new QuestionController($question);
     $decode = $question_controller->getCode($id_question);
     $type = $decode['type'];
     switch ($type) {
         case 'Выбор одного из списка':
             $one_choice = new OneChoice($id_question);
             $one_choice->pdf($fpdf, $count, $answered);
             break;
         case 'Выбор нескольких из списка':
             $multi_choice = new MultiChoice($id_question);
             $multi_choice->pdf($fpdf, $count, $answered);
             break;
         case 'Текстовый вопрос':
             $fill_gaps = new FillGaps($id_question);
             $fill_gaps->pdf($fpdf, $count, $answered);
             break;
         case 'Таблица соответствий':
             $accordance_table = new AccordanceTable($id_question);
             $accordance_table->pdf($fpdf, $count, $answered);
             break;
     }
 }
Exemplo n.º 2
0
 /** проверяет права доступа к рыбинским вопросам */
 public function rybaTest($id_question)
 {
     $question = new Question();
     $question_controller = new QuestionController($question);
     if ($question_controller->getCode($id_question)['section_code'] == 10) {
         if (Auth::user()['role'] == 'Рыбинец' || Auth::user()['role'] == 'Админ') {
             return true;
         } else {
             return false;
         }
     } else {
         return true;
     }
 }