-
Notifications
You must be signed in to change notification settings - Fork 0
/
quiz.php
51 lines (36 loc) · 1009 Bytes
/
quiz.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<?php
/**
* Created by PhpStorm.
* User: Karl
* Date: 2/20/2015
* Time: 3:28 PM
*/
require_once __DIR__ . '/vendor/autoload.php';
use Bootcamp\Demo\Quiz\Option;
use Bootcamp\Demo\Quiz\Question;
use Bootcamp\Demo\Quiz\Quiz;
$options1 = [];
$options1[] = new Option(443);
$options1[] = new Option(80, true);
$options1[] = new Option(22);
$options1[] = new Option(3306);
$questions[1] = new Question('What is http port?');
foreach ($options1 as $option) {
$questions[1]->addOption($option);
}
$options2 = [];
$options2[] = new Option('atbilde 1');
$options2[] = new Option('pareiza atbilde', true);
$options2[] = new Option('atbilde 3', true);
$options2[] = new Option('atbilde 4');
$questions[2] = new Question('Tas ir jautaajums?');
foreach ($options2 as $option) {
$questions[2]->addOption($option);
}
$quiz = new Quiz('PHP Quiz');
foreach ($questions as $question) {
$quiz->addQuestion($question);
}
var_dump($questions[1]->multiAnswer());
//echo '<pre>';
//var_export($quiz);