<commit_before><?php

namespace Egzaminer\Question;

use Egzaminer\Admin\Dashboard as Controller;

class QuestionAdd extends Controller
{
    public function addAction($testId)
    {
        $this->testId = $testId;
        $this->data = [
            'question' => [
                'content' => '',
                'correct' => '',
            ],
            'answers' => [
                ['content' => '', 'id' => '1'],
                ['content' => '', 'id' => '2'],
                ['content' => '', 'id' => '3'],
                ['content' => '', 'id' => '4'],
            ],
        ];
        if (isset($_POST['submit'])) {
            $model = new QuestionAddModel();

            if ($id = $model->add($testId, $_POST)) {
                $_SESSION['valid'] = true;
                header('Location: '.$this->dir().'/admin/test/edit/'.$testId.'/question/edit/'.$id);
                exit;
            } else {
                $this->data['invalid'] = true;
            }
        }

        $this->render('admin-question', 'Dodawanie pytania');
    }
}<commit_msg>Fix display tests in navbar<commit_after><?php

namespace Egzaminer\Question;

use Egzaminer\Admin\Dashboard as Controller;

class QuestionAdd extends Controller
{
    public function addAction($testId)
    {
        $this->testId = $testId;
        $this->data['question'] = [
            'content' => '',
            'correct' => '',
        ];
        $this->data['answers'] = [
                ['content' => '', 'id' => '1'],
                ['content' => '', 'id' => '2'],
                ['content' => '', 'id' => '3'],
                ['content' => '', 'id' => '4'],
        ];

        if (isset($_POST['submit'])) {
            $model = new QuestionAddModel();

            if ($id = $model->add($testId, $_POST)) {
                $_SESSION['valid'] = true;
                header('Location: '.$this->dir().'/admin/test/edit/'.$testId.'/question/edit/'.$id);
                exit;
            } else {
                $this->data['invalid'] = true;
            }
        }

        $this->render('admin-question', 'Dodawanie pytania');
    }
}
{'fraction_non_alphanumeric': 0.19990592662276577, 'fraction_numerical': 0.0037629350893697085, 'mean_word_length': 1.553421368547419, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 38, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2618353', 'n_tokens_mistral': 634, 'n_tokens_neox': 613, 'n_words': 109}