Brendan Abolivier 9 gadus atpakaļ
vecāks
revīzija
15d5d966f3

web/index.php → web/api/index.php Parādīt failu


web/model/class.categorie.php → web/api/model/class.categorie.php Parādīt failu

@@ -45,8 +45,13 @@ class Categorie {
45 45
 		$bdd = new Connector();
46 46
 		$arrayCat = $bdd->Select("*", "categorie");
47 47
 		$return = array();
48
+		$catIndex = -1;
49
+		$previousIndex = -1;
48 50
 		for($i = 0; $i < 2; $i++) {
49
-			$catIndex = rand(0, sizeof($arrayCat)-1);
51
+			do {
52
+				$previousIndex = $catIndex;
53
+				$catIndex = rand(0, sizeof($arrayCat)-1);
54
+			} while($catIndex == $previousIndex);
50 55
 			array_push($return, new Categorie($arrayCat[$catIndex]['nom_cat']));
51 56
 		}
52 57
 		return $return;

web/model/class.connector.php → web/api/model/class.connector.php Parādīt failu


web/model/class.question.php → web/api/model/class.question.php Parādīt failu


web/model/class.questset.php → web/api/model/class.questset.php Parādīt failu


web/model/class.score.php → web/api/model/class.score.php Parādīt failu


web/model/classes.php → web/api/model/classes.php Parādīt failu


web/tests.php → web/api/tests.php Parādīt failu


web/view/palmares.php → web/api/view/palmares.php Parādīt failu


web/view/questions.php → web/api/view/questions.php Parādīt failu