Browse Source

Hey come back here you lil scums

Brendan Abolivier 9 years ago
parent
commit
a26f947ba8
2 changed files with 0 additions and 73 deletions
  1. 0
    10
      web/test.php
  2. 0
    63
      web/testapi.htm

+ 0
- 10
web/test.php View File

@@ -1,10 +0,0 @@
1
-<?php
2
-header("Content-Type:application/json");
3
-
4
-$array = array(
5
-  "numéro" => 2,
6
-  "lettre" => "a",
7
-  "string" => "qqfssdfq"
8
-);
9
-
10
-echo json_encode($array);

+ 0
- 63
web/testapi.htm View File

@@ -1,63 +0,0 @@
1
-<strong>Fails / Requ&ecirc;tes :</strong> <span id="fail">0</span>/<span id="tries">0</span><br />
2
-D&eacute;lai entre deux requ&ecirc;tes : <input type="text" id="ms" maxlength="4" style="width:40px" value="1" />ms <input type="submit" id="go" value="Go!" /><br />
3
-<p>Fail si :
4
-  <ul>
5
-    <li>Noms de cat&eacute;gories identiques</li>
6
-    <li>Une (au moins) cat&eacute;gorie vide</li>
7
-    <li>Pas assez de questions</li>
8
-    <li>Pas assez de th&egrave;mes</li>
9
-  </ul>
10
-</p>
11
-
12
-<script src="js/jquery-2.1.4.min.js"></script>
13
-<script>
14
-var tries = 0;
15
-var fail = 0;
16
-var goon = false;
17
-var delay = 1;
18
-
19
-function yolo() {
20
-  tries++;
21
-  $.ajax({
22
-    async: false,
23
-    url: './api/',
24
-    dataType: 'json',
25
-    success: function(json) {
26
-      var questions = 0;
27
-      var themes = json.cat1.themes.length + json.cat2.themes.length;
28
-      json.cat1.themes.forEach(function(theme) {
29
-        question += theme.questions.length;
30
-      });
31
-      json.cat2.themes.forEach(function(theme) {
32
-        question += theme.questions.length;
33
-      });
34
-      if(json.cat1.nom_cat === json.cat2.nom_cat || json.cat1.nom_cat === "" || json.cat2.nom_cat === ""
35
-          || questions < 2*2*3 || themes < 2*2) {
36
-        fail++;
37
-      }
38
-    }
39
-  })
40
-
41
-  $("#fail").html(fail);
42
-  $("#tries").html(tries);
43
-  if(goon) window.setTimeout(yolo, delay);
44
-}
45
-
46
-$("#go").on("click", function() {
47
-  if(!goon) $("#go").val("Stop!");
48
-  if(goon) $("#go").val("Go!");
49
-  delay = $("#ms").val()
50
-  goon = !goon;
51
-  yolo();
52
-});
53
-
54
-$(document).on("keypress", function(event) {
55
-  if(event.which === 32) {
56
-    if(!goon) $("#go").val("Stop!");
57
-    if(goon) $("#go").val("Go!");
58
-    delay = $("#ms").val()
59
-    goon = !goon;
60
-    yolo();
61
-  }
62
-});
63
-</script>