|
@@ -8,16 +8,16 @@ class Questset {
|
8
|
8
|
|
9
|
9
|
function __construct($reponses) {
|
10
|
10
|
if(is_array($reponses)) {
|
11
|
|
- $this->intitules = array();
|
12
|
|
- $this->reponse1 = $reponse[0];
|
13
|
|
- $this->reponse2 = $reponse[1];
|
|
11
|
+ $this->questions = array();
|
|
12
|
+ $this->reponse1 = $reponses[0];
|
|
13
|
+ $this->reponse2 = $reponses[1];
|
14
|
14
|
try {
|
15
|
15
|
$bdd = new Connector();
|
16
|
16
|
|
17
|
17
|
$options = array(
|
18
|
18
|
"where" => array(
|
19
|
|
- array("reponse1", "=", $reponse1),
|
20
|
|
- array("reponse2", "=", $reponse2)
|
|
19
|
+ array("reponse1", "=", $this->reponse1),
|
|
20
|
+ array("reponse2", "=", $this->reponse2)
|
21
|
21
|
)
|
22
|
22
|
);
|
23
|
23
|
|
|
@@ -27,10 +27,11 @@ class Questset {
|
27
|
27
|
array_push($this->questions, new Question($question['intitule']));
|
28
|
28
|
}
|
29
|
29
|
|
30
|
|
- $this->categorie = $bdd->Select('*', 'reponses', $options)['nom_cat'];
|
|
30
|
+ $this->categorie = $bdd->Select('*', 'reponses', $options)[0]['nom_cat'];
|
31
|
31
|
} catch(Exception $e) {
|
32
|
32
|
throw $e;
|
33
|
33
|
}
|
|
34
|
+ echo "Initialized\n";
|
34
|
35
|
} else {
|
35
|
36
|
throw new Exception('Un tableau de réponses est attendu dans le constructeur.');
|
36
|
37
|
}
|