<commit_before># Composer quiz package to be used in session

A simple composer quiz package that allows the creation of questions, alternatives and choice of answers in a very easy way.

## Install
```bash
composer require soufraz/quiz-in-session dev-master
```


## Usage

Creating quiz
```
        $data = [
            'title' => 'The first quiz of all'
        ];
        
        $quiz = new Quiz();
        $quiz->create($data);
```

Adding questions to created quiz
```
        $data = [
            [
                'id' => 10,
                'title' => 'How many continents are there on earth?'
            ],
            [
                'id' => 20,
                'title' => 'When was php released?'
            ],
            [
                'id' => 30,
                'title' => '<NAME> really stolen a <NAME> idea?'
            ]
        ];
        
        $quiz = new Quiz();
        $quiz->addQuestions($data);
```

Adding alternatives to created questions
```
        // Mocking a question
        $data = [
            'question_id' => 10,
            'alternatives' => [
                'five',
                'six',
                'seven',
            ]
        ];
        
        $quiz = new Quiz();
        $quiz->addAlternativesToQuestion($data['question_id'], $data);
```

LET'S PLAY!

Getting quiz
```
    $quiz = new Quiz();
    $your_quiz = $quiz->get();
```

Requesting next question and alternatives
```
    $quiz = new Quiz();
    $question = $quiz->nextQuestion();
```

Saving answer
```

```

Getting all data to save where you want
```

```<commit_msg>[task] Removing $quiz instance of all examples<commit_after># Composer quiz package to be used in session

A simple composer quiz package that allows the creation of questions, alternatives and choice of answers in a very easy way.

## Install
```bash
composer require soufraz/quiz-in-session dev-master
```


## Usage

Creating quiz
```
        $data = [
            'title' => 'The first quiz of all'
        ];
        
        $quiz = new Quiz();
        $quiz->create($data);
```

Hey: All of the following examples we will assume that **$quiz** is already defined.

Adding questions to created quiz
```
        $data = [
            [
                'id' => 10,
                'title' => 'How many continents are there on earth?'
            ],
            [
                'id' => 20,
                'title' => 'When was php released?'
            ],
            [
                'id' => 30,
                'title' => '<NAME> really stolen a Steve Jobs idea?'
            ]
        ];
        
        $quiz->addQuestions($data);
```

Adding alternatives to created questions
```
        // Mocking a question
        $data = [
            'question_id' => 10,
            'alternatives' => [
                'five',
                'six',
                'seven',
            ]
        ];
        
        $quiz->addAlternativesToQuestion($data['question_id'], $data);
```

LET'S PLAY!

Getting quiz
```
    $your_quiz = $quiz->get();
```

Requesting next question and alternatives
```
    $question = $quiz->nextQuestion();
```

Saving answer
```

```

Getting all data to save where you want
```

```
{'fraction_non_alphanumeric': 0.13507625272331156, 'fraction_numerical': 0.004979769685652039, 'mean_word_length': 1.6172638436482085, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 34, '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': '4112806', 'n_tokens_mistral': 994, 'n_tokens_neox': 887, 'n_words': 279}