François Gautrais 7 лет назад
Родитель
Сommit
e126bff60e

BIN
app/src/main/assets/bib.jpg


+ 1 - 0
app/src/main/assets/bib.res

@@ -0,0 +1 @@
+{"type" : "Image"}

BIN
app/src/main/assets/creche.jpg


+ 1 - 0
app/src/main/assets/creche.res

@@ -0,0 +1 @@
+{"type" : "Image"}

BIN
app/src/main/assets/fin.mp3


+ 6 - 0
app/src/main/assets/fin.res

@@ -0,0 +1,6 @@
+{
+	"comment" : "Nous avons réussi !",
+	"title" : "On a gagné",
+	"type" : "Audio",
+	"display" : true
+}

+ 287 - 235
app/src/main/assets/game_medium

@@ -8,314 +8,366 @@
 	"event_end" : { "method" : "armBomb" }
 },
 {
-	"name" : "QrCode",
+	"name" : "Bibliotheuqe_intro",
 	"challenges" :
 		[
 			{
-				"type" : "QRCodeGeoTreasure",
-				"name" : "A trouver 0",
-				"bad_message" : "Essaye encore",
+				"type" : "QRCodeTreasure",
+				"name" : "BibQr",
+				"bad_message" : "C'est pas le bon !",
 				"qr_value" : "1",
 				"resource" : "bib",
 				"indices" : [
-					{
-						"type" : "geo",
-						"penality": 1
-					},
 					{
 						"type" : "text",
-						"text" : "Entre le 0 et le 2",
-						"penality": 5
+						"text" : "On y emprunte des livres",
+						"penality": 1
 					},
 					{
 						"type" : "text",
-						"text" : "sqrt(x) = x",
-						 "penality": 4
+						"penality": 1,
+						"text" : "b I bliothèque" 
 					}
-				],
-				"area" : {
-					"coordinates": [
-							[
-							  0.1493293046951294,
-							  45.62988696308149
-							],
-							[
-							  0.14950096607208252,
-							  45.62975941918258
-							],
-							[
-							  0.1496753096580505,
-							  45.629898216940994
-							],
-							[
-							  0.14950096607208252,
-							  45.63003888999412
-							],
-							[
-							  0.14934271574020386,
-							  45.63002951180155
-							],
-							[
-							  0.1493293046951294,
-							  45.62988696308149
-							]
-						  ],
-					"name" : "a",
-					"point" :
-						{
-							"angle" : 180.0,
-							"coordinates" :
-							[
-							  0.14950096607208252,
-							  45.629875709219725
-							],
-							"field" : 90.0,
-							"radius" : 100.0,
-							"useAngle" : false
-						}
-				}
+				]
 			}
 		],
-	"resources" : [],
+	"resources" : ["intro_fin"],
 	"charIndex" : 0
 },
 {
-	"name" : "QrCode",
+	"name" : "MPG",
+	"charIndex" : 1,
 	"challenges" :
 		[
 			{
+				"type" : "QRCodeTreasure",
+				"name" : "MPG_Qr",
+				"bad_message" : "C'est pas le bon !",
+				"qr_value" : "2",
+				"resource" : "mpg",
+				"indices" : [
+					{
+						"type" : "text",
+						"text" : "C'est un très bon endroit pour grandir",
+						"penality": 1
+					},
+					{
+						"type" : "text",
+						"penality": 1,
+						"text" : "Les maternelles, primaires et collégiens y sont très très très heureux (inscriptions au 05 45.... " 
+					}
+				]
+			},
+			{
+                    "type" : "QCM",
+                    "name" : "a1",
+                    "question" : "La première réponse",
+                    "answer" : ["Louis Aragon"],
+                    "choices" : [
+									"Oui !",
+									"Jean-Vincent Placé", 
+									"Zinedine Zidane", 
+									"Patrick Timsit", 
+									"Louis Aragon", 
+									"La réponse D",
+									"Non !",
+									"Kylian M'Bappé",
+									"Des jeux"
+								],
+                    "bad_message" : "T'es nul !",
+					"resource" : "question",
+					 "penality": 1,
+                     "mandatory" : false
+                 },
+                 {
+                    "type" : "QCM",
+                    "name" : "a2",
+                    "question" : "La deuxieme réponse",
+                    "answer" : ["Des jeux"],
+                    "choices" : [
+									"Oui !",
+									"Des jeux", 
+									"Rond", 
+									"Des livres", 
+									"Des DVD",
+									"Non !",
+									"Kylian M'Bappé",
+									"Marc Levy"
+								],
+                    "bad_message" : "T'es nul !",
+					"resource" : "question",
+					 "penality": 1,
+                     "mandatory" : false
+                 },
+                 {
+                    "type" : "QCM",
+                    "name" : "a3",
+                    "question" : "La troisème réponse",
+                    "answer" : ["Rond", "Carré"],
+                    "choices" : [
+									"Oui !",
+									"Des jeux", 
+									"Rond", 
+									"Carré", 
+									"Losange",
+									"VTT",
+									"Dodécagonal",
+									"Hexagone"
+								],
+                    "bad_message" : "T'es nul !",
+					"resource" : "question",
+					 "penality": 1,
+                     "mandatory" : false
+                 },
+                 {
                     "type" : "QCM",
-                    "name" : "Joconde",
-                    "question" : "Qui a peint la Joconde ?",
-                    "answer" : "Léonard De Vinci",
-                    "choices" : ["Léonard De Vinci", "Jean Ferrat", "Patrick Timsit", "BHL"],
-                    "good_message" : "Bien joué !",
+                    "name" : "a4",
+                    "question" : "La quatrième réponse",
+                    "answer" : ["D"],
+                    "choices" : [
+									"Oui !",
+									"Des jeux", 
+									"Rond", 
+									"Carré", 
+									"Losange",
+									"VTT",
+									"D",
+									"Hexagone",
+									"W"
+								],
                     "bad_message" : "T'es nul !",
 					"resource" : "question",
-                     "indices" : [
-                         {
-                             "type" : "text",
-                             "text" : "Un italien",
-                                "penality": 5
-                         },
-                         {
-                             "type" : "text",
-                             "text" : "Un vieu !",
-                                 "penality": 5
-                         }
-                     ],
-					 "penality": 3,
-                     "charIndex" : 1
+					 "penality": 1,
+                     "mandatory" : false
                  },
                  {
-                     "type" : "QCM",
-                    "name" : "OS",
-                    "question" : "Windows 7 et 10 sont des systèmes d'explploitation, parmi ces proposition lequel en est un ?",
-                    "answer" : "Linux",
-                    "choices" : ["Apple", "Linux", "Microsoft Word", "Mozilla La réponse D"],
-                    "good_message" : "Bien joué !",
+                    "type" : "QCM",
+                    "name" : "a5",
+                    "question" : "La cinquième réponse",
+                    "answer" : ["w", "vv"],
+                    "choices" : [
+									"Oui !",
+									"Des jeux", 
+									"Bob Marley", 
+									"Carré", 
+									"42",
+									"VTT",
+									"D",
+									"Hexagone",
+									"W"
+								],
                     "bad_message" : "T'es nul !",
 					"resource" : "question",
-                     "indices" : [
-                         {
-                             "type" : "text",
-                             "text" : "Il a été inventé par Linus Torvalds",
-                                "penality": 4
-                         },
-                         {
-                             "type" : "text",
-                             "text" : "Il est de la famille des UNIX",
-                                 "penality": 5
-                         }
-                     ],
-					 "penality": 3,
-                     "charIndex" : 2
+					 "penality": 1,
+                     "mandatory" : false
                  },
                  {
-                     "type" : "QCM",
-                    "name" : "RA",
-                    "question" : "Qu'est ce que la réalité augmentée ?",
-                    "answer" : "Une technologie qui permet d'ajouter virtuellement des éléments à la réalité",
-                    "choices" : ["Une technologie qui permet d'ajouter virtuellement des éléments à la réalité",
-								"Des jeux vidéos sur PC ou consoles qui sont très réalistes",
-								"Une technique de médium",
-								"Une Fake News"],
-                    "good_message" : "Bien joué !",
+                    "type" : "QCM",
+                    "name" : "a6",
+                    "question" : "La sixième réponse",
+                    "answer" : "Des DVD",
+                    "choices" : [
+									"Oui !",
+									"Des DVD", 
+									"Bob Marley", 
+									"Carré", 
+									"42",
+									"VTT",
+									"D",
+									"Hexagone",
+									"W"
+								],
                     "bad_message" : "T'es nul !",
 					"resource" : "question",
-                     "indices" : [
-                         {
-                             "type" : "text",
-                             "text" : "Pokemon GO est une application en réalité augmentée",
-                                "penality": 1
-                         }
-                     ],
-					 "penality": 3,
-                     "charIndex" : 3
+					 "penality": 1,
+                     "mandatory" : false
                  },
                  {
-                     "type" : "QCM",
-                    "name" : "Question conne",
-                    "question" : "Combien fait 10 / (10-10) ?",
-                    "answer" : "C'est impossible",
-                    "choices" : ["10",
-								"1",
-								"C'est impossible",
-								"0"],
-                    "good_message" : "Bien joué !",
+                    "type" : "QCM",
+                    "name" : "a7",
+                    "question" : "La septième réponse",
+                    "answer" : "Ma Campagne",
+                    "choices" : [
+									"Le Blosne RPZ 35 BZH !!!!",
+									"C'est quoi la question ?", 
+									"Bob Marley", 
+									"Zinedine Zidane", 
+									"42",
+									"Ma Campagne",
+									"D",
+									"Meurs, pourriture communiste !",
+									"W"
+								],
                     "bad_message" : "T'es nul !",
 					"resource" : "question",
-                     "indices" : [
-                         {
-                             "type" : "text",
-                             "text" : "Ce calcul peut provoquer des erreurs sur les ordinateurs",
-                                "penality": 1
-                         }
-                     ],
-					 "penality": 3,
-                     "charIndex" : 4
+					 "penality": 1,
+                     "mandatory" : false
+                 },
+                 {
+                    "type" : "QCM",
+                    "name" : "a8",
+                    "question" : "La septième réponse",
+                    "answer" : "L France",
+                    "choices" : [
+									"Le Blosne RPZ 35 BZH !!!!",
+									"C'est quoi la question ?", 
+									"Bob Marley", 
+									"Zinedine Zidane", 
+									"42",
+									"Ma Campagne",
+									"D",
+									"La France",
+									"W"
+								],
+                    "bad_message" : "T'es nul !",
+					"resource" : "question",
+					 "penality": 1,
+                     "mandatory" : false
                  }
 		]
 },
 {
-	"name" : "QrCode",
+	"name" : "Ludothèque",
 	"challenges" :
 		[
 			{
-				"type" : "QRCodeGeoTreasure",
-				"name" : "A trouver 1",
-				"bad_message" : "Essaye encore",
-				"qr_value" : "1",
-				"resource" : "mjc",
+				"type" : "QRCodeTreasure",
+				"name" : "Jardin ludothèque",
+				"bad_message" : "C'est pas le bon !",
+				"qr_value" : "3",
+				"resource" : "ludo",
 				"indices" : [
 					{
-						"type" : "geo",
+						"type" : "text",
+						"text" : "Je vais emprunter un Uno ou Jungle Speed",
 						"penality": 1
 					},
 					{
 						"type" : "text",
-						"text" : "Entre le 0 et le 2",
-						"penality": 1
+						"text" : "Ne pas sonner SVP !",
+						 "penality": 1
+					}
+				]
+			},
+			{
+				"type": "Question",
+				"name" : "QuestionLudo",
+				"bad_message" : "Non !",
+				"good_message" : "Brillant !",
+				"answer" : "97",
+				"indices" : [
+					{
+						"type" : "text",
+						"penality" : 1,
+						"text": "Question de point de vu..."
 					},
 					{
 						"type" : "text",
-						"text" : "sqrt(x) = x",
-						 "penality": 5
+						"penality" : 1,
+						"text": "Sans dessus dessous"
 					}
 				],
-				"area" : {
-					"coordinates": [
-						[
-						  0.1493293046951294,
-						  45.62988696308149
-						],
-						[
-						  0.14950096607208252,
-						  45.62975941918258
-						],
-						[
-						  0.1496753096580505,
-						  45.629898216940994
-						],
-						[
-						  0.14950096607208252,
-						  45.63003888999412
-						],
-						[
-						  0.14934271574020386,
-						  45.63002951180155
-						],
-						[
-						  0.1493293046951294,
-						  45.62988696308149
-						]
-					  ],
-					"name" : "a",
-					"point" :
-						{
-							"angle" : 180.0,
-							"coordinates" :
-							[
-								0.1493561267852783,
-								45.62970127407351
-							],
-							"field" : 90.0,
-							"radius" : 100.0,
-							"useAngle" : false
-						}
-				}
+				"penality" : 1
 			}
 		],
 	"resources" : ["milieu"],
 	"event_end" : { "method" : "setTimerTo", "args" : [15] },
-	"charIndex" : 5
+	"charIndex" : 2
 },
 {
-	"name" : "QrCode",
+	"name" : "JardinDhiver",
 	"challenges" :
 		[
 			{
-				"type" : "QRCodeGeoTreasure",
-				"name" : "A trouver 2",
-				"bad_message" : "Essaye encore",
-				"qr_value" : "1",
-				"resource" : "creche",
+				"type" : "Question",
+				"name" : "JardinHiverQuestion",
+				"bad_message" : "Non !",
+				"good_message" : "Bravo !",
+				"answer" : "ABBA",
 				"indices" : [
 					{
-						"type" : "geo",
-						"penality": 1
-					},
+						"type" : "text",
+						"penality" : 1,
+						"text": "Des lettres rouges ?"
+					}
+				],
+				"penality" : 1
+			}
+		],
+	"resources" : [],
+	"charIndex" : 3
+},
+{
+	"name" : "Accueil",
+	"challenges" :
+		[
+			{
+				"type" : "Question",
+				"name" : "accueilQuestion",
+				"bad_message" : "Non !",
+				"good_message" : "Bravo !",
+				"answer" : "Trop cuite",
+				"indices" : [
 					{
 						"type" : "text",
-						"text" : "Entre le 0 et le 2",
-						"penality": 1
+						"penality" : 1,
+						"text": "2 personnes, 2 accueils"
+					}
+				],
+				"penality" : 1
+			}
+		],
+	"resources" : [],
+	"charIndex" : 4
+},
+{
+	"name" : "Prospectus",
+	"challenges" :
+		[
+			{
+				"type" : "QRCodeTreasure",
+				"name" : "ProspectusQr",
+				"bad_message" : "Non !",
+				"qr_value" : "4",
+				"indices" : [
+					{
+						"type" : "text",
+						"penality" : 1,
+						"text": "1 entier vaut mieux que 2 moitiés"
 					},
 					{
 						"type" : "text",
-						"text" : "sqrt(x) = x",
-						 "penality": 5
+						"penality" : 1,
+						"text": "Rejoignez nous sur Facebook @MediathquesDeQuartierDAngouleme"
+					}
+				],
+				"penality" : 1
+			}
+		],
+	"resources" : [],
+	"charIndex" : 5
+},
+{
+	"name" : "Accueil",
+	"challenges" :
+		[
+			{
+				"type" : "Question",
+				"name" : "accueilQuestion",
+				"bad_message" : "Non !",
+				"good_message" : "Bravo !",
+				"answer" : "Trop cuite",
+				"indices" : [
+					{
+						"type" : "text",
+						"penality" : 1,
+						"text": "2 personnes, 2 accueils"
 					}
 				],
-				"area" : {
-					"coordinates": [
-						[
-						  0.14973163604736328,
-						  45.62980068341694
-						],
-						[
-						  0.14937490224838257,
-						  45.62957185409808
-						],
-						[
-						  0.14950096607208252,
-						  45.6294705686915
-						],
-						[
-						  0.14989793300628662,
-						  45.62966376106791
-						],
-						[
-						  0.14973163604736328,
-						  45.62980068341694
-						]
-					  ],
-					"name" : "a",
-					"point" :
-						{
-							"angle" : 180.0,
-							"coordinates" :
-							[
-							  0.14959752559661865,
-							  45.62963937760083
-							],
-							"field" : 90.0,
-							"radius" : 100.0,
-							"useAngle" : false
-						}
-				}
+				"penality" : 1
 			}
 		],
-	"resources" : ["fin"],
+	"resources" : [],
 	"charIndex" : 6
 }	],
 	"credits" : 

+ 0 - 328
app/src/main/assets/game_medium2

@@ -1,328 +0,0 @@
-{
-    "password" : "12345678",
-    "max_time" : 30,
-	"stages" : [{
-	"name" : "Intro",
-	"challenges" : [],
-	"resources" : ["intro"],
-	"event_end" : { "method" : "armBomb" }
-},
-{
-	"name" : "QrCode",
-	"challenges" :
-		[
-			{
-				"type" : "QRCodeGeoTreasure",
-				"name" : "A trouver 0",
-				"bad_message" : "Essaye encore",
-				"qr_value" : "1",
-				"resource" : "bib",
-				"indices" : [
-					{
-						"type" : "geo",
-						"penality": 1
-					},
-					{
-						"type" : "text",
-						"text" : "Entre le 0 et le 2",
-						"penality": 5
-					},
-					{
-						"type" : "text",
-						"text" : "sqrt(x) = x",
-						 "penality": 4
-					}
-				],
-				"area" : {
-					"coordinates": [
-							[
-							  0.1493293046951294,
-							  45.62988696308149
-							],
-							[
-							  0.14950096607208252,
-							  45.62975941918258
-							],
-							[
-							  0.1496753096580505,
-							  45.629898216940994
-							],
-							[
-							  0.14950096607208252,
-							  45.63003888999412
-							],
-							[
-							  0.14934271574020386,
-							  45.63002951180155
-							],
-							[
-							  0.1493293046951294,
-							  45.62988696308149
-							]
-						  ],
-					"name" : "a",
-					"point" :
-						{
-							"angle" : 180.0,
-							"coordinates" :
-							[
-							  0.14950096607208252,
-							  45.629875709219725
-							],
-							"field" : 90.0,
-							"radius" : 100.0,
-							"useAngle" : false
-						}
-				}
-			}
-		],
-	"resources" : [],
-	"charIndex" : 0
-},
-{
-	"name" : "QrCode",
-	"challenges" :
-		[
-			{
-                    "type" : "QCM",
-                    "name" : "Joconde",
-                    "question" : "Qui a peint la Joconde ?",
-                    "answer" : "Léonard De Vinci",
-                    "choices" : ["Léonard De Vinci", "Jean Ferrat", "Patrick Timsit", "BHL"],
-                    "good_message" : "Bien joué !",
-                    "bad_message" : "T'es nul !",
-					"resource" : "question",
-                     "indices" : [
-                         {
-                             "type" : "text",
-                             "text" : "Un italien",
-                                "penality": 5
-                         },
-                         {
-                             "type" : "text",
-                             "text" : "Un vieu !",
-                                 "penality": 5
-                         }
-                     ],
-					 "penality": 3,
-                     "charIndex" : 1
-                 },
-                 {
-                     "type" : "QCM",
-                    "name" : "OS",
-                    "question" : "Windows 7 et 10 sont des systèmes d'explploitation, parmi ces proposition lequel en est un ?",
-                    "answer" : "Linux",
-                    "choices" : ["Apple", "Linux", "Microsoft Word", "Mozilla La réponse D"],
-                    "good_message" : "Bien joué !",
-                    "bad_message" : "T'es nul !",
-					"resource" : "question",
-                     "indices" : [
-                         {
-                             "type" : "text",
-                             "text" : "Il a été inventé par Linus Torvalds",
-                                "penality": 4
-                         },
-                         {
-                             "type" : "text",
-                             "text" : "Il est de la famille des UNIX",
-                                 "penality": 5
-                         }
-                     ],
-					 "penality": 3,
-                     "charIndex" : 2
-                 },
-                 {
-                     "type" : "QCM",
-                    "name" : "RA",
-                    "question" : "Qu'est ce que la réalité augmentée ?",
-                    "answer" : "Une technologie qui permet d'ajouter virtuellement des éléments à la réalité",
-                    "choices" : ["Une technologie qui permet d'ajouter virtuellement des éléments à la réalité", 
-								"Des jeux vidéos sur PC ou consoles qui sont très réalistes", 
-								"Une technique de médium", 
-								"Une Fake News"],
-                    "good_message" : "Bien joué !",
-                    "bad_message" : "T'es nul !",
-					"resource" : "question",
-                     "indices" : [
-                         {
-                             "type" : "text",
-                             "text" : "Pokemon GO est une application en réalité augmentée",
-                                "penality": 1
-                         }
-                     ],
-					 "penality": 3,
-                     "charIndex" : 3
-                 },
-                 {
-                     "type" : "QCM",
-                    "name" : "Question conne",
-                    "question" : "Combien fait 10 / (10-10) ?",
-                    "answer" : "C'est impossible",
-                    "choices" : ["10", 
-								"1", 
-								"C'est impossible", 
-								"0"],
-                    "good_message" : "Bien joué !",
-                    "bad_message" : "T'es nul !",
-					"resource" : "question",
-                     "indices" : [
-                         {
-                             "type" : "text",
-                             "text" : "Ce calcul peut provoquer des erreurs sur les ordinateurs",
-                                "penality": 1
-                         }
-                     ],
-					 "penality": 3,
-                     "charIndex" : 4
-                 }
-		]
-},
-{
-	"name" : "QrCode",
-	"challenges" :
-		[
-			{
-				"type" : "QRCodeGeoTreasure",
-				"name" : "A trouver 1",
-				"bad_message" : "Essaye encore",
-				"qr_value" : "1",
-				"resource" : "mjc",
-				"indices" : [
-					{
-						"type" : "geo",
-						"penality": 1
-					},
-					{
-						"type" : "text",
-						"text" : "Entre le 0 et le 2",
-						"penality": 1
-					},
-					{
-						"type" : "text",
-						"text" : "sqrt(x) = x",
-						 "penality": 5
-					}
-				],
-				"area" : {
-					"coordinates": [
-						[
-						  0.1493293046951294,
-						  45.62988696308149
-						],
-						[
-						  0.14950096607208252,
-						  45.62975941918258
-						],
-						[
-						  0.1496753096580505,
-						  45.629898216940994
-						],
-						[
-						  0.14950096607208252,
-						  45.63003888999412
-						],
-						[
-						  0.14934271574020386,
-						  45.63002951180155
-						],
-						[
-						  0.1493293046951294,
-						  45.62988696308149
-						]
-					  ],
-					"name" : "a",
-					"point" :
-						{
-							"angle" : 180.0,
-							"coordinates" :
-							[
-								0.1493561267852783,
-								45.62970127407351
-							],
-							"field" : 90.0,
-							"radius" : 100.0,
-							"useAngle" : false
-						}
-				}
-			}
-		],
-	"resources" : ["milieu"],
-	"event_end" : { "method" : "setTimerTo", "args" : [15] },
-	"charIndex" : 5
-},
-{
-	"name" : "QrCode",
-	"challenges" :
-		[
-			{
-				"type" : "QRCodeGeoTreasure",
-				"name" : "A trouver 2",
-				"bad_message" : "Essaye encore",
-				"qr_value" : "1",
-				"resource" : "creche",
-				"indices" : [
-					{
-						"type" : "geo",
-						"penality": 1
-					},
-					{
-						"type" : "text",
-						"text" : "Entre le 0 et le 2",
-						"penality": 1
-					},
-					{
-						"type" : "text",
-						"text" : "sqrt(x) = x",
-						 "penality": 5
-					}
-				],
-				"area" : {
-					"coordinates": [
-						[
-						  0.14973163604736328,
-						  45.62980068341694
-						],
-						[
-						  0.14937490224838257,
-						  45.62957185409808
-						],
-						[
-						  0.14950096607208252,
-						  45.6294705686915
-						],
-						[
-						  0.14989793300628662,
-						  45.62966376106791
-						],
-						[
-						  0.14973163604736328,
-						  45.62980068341694
-						]
-					  ],
-					"name" : "a",
-					"point" :
-						{
-							"angle" : 180.0,
-							"coordinates" :
-							[
-							  0.14959752559661865,
-							  45.62963937760083
-							],
-							"field" : 90.0,
-							"radius" : 100.0,
-							"useAngle" : false
-						}
-				}
-			}
-		],
-	"resources" : ["fin"],
-	"charIndex" : 6
-}	],
-	"credits" : 
-	{
-		"text" : "Par Fran\u00e7ois Gautrais !",
-		"useHtml" : true
-	},
-	"map" : "/home/ptitcois/Documents/Angouleme/DemoRA/ressources/carte.png",
-	"name" : "game_medium"
-}

BIN
app/src/main/assets/intro.mp3


+ 6 - 0
app/src/main/assets/intro.res

@@ -0,0 +1,6 @@
+{
+	"comment" : "Nous avons reçu un étrange message...",
+	"title" : "Un étrange message",
+	"type" : "Audio",
+	"display" : true
+}

BIN
app/src/main/assets/milieu.mp3


+ 6 - 0
app/src/main/assets/milieu.res

@@ -0,0 +1,6 @@
+{
+	"comment" : "Nous avons reçu un  nouveau message !",
+	"title" : "Un nouveau message",
+	"type" : "Audio",
+	"display" : true
+}

BIN
app/src/main/assets/mjc.jpg


+ 1 - 0
app/src/main/assets/mjc.res

@@ -0,0 +1 @@
+{"type" : "Image"}

BIN
app/src/main/assets/question.png


+ 1 - 0
app/src/main/assets/question.res

@@ -0,0 +1 @@
+{"type" : "Image"}

+ 4 - 0
app/src/main/java/app/mar/activities/HostActivity.java

@@ -188,6 +188,10 @@ public class HostActivity extends Activity implements ChallengeDriver{
             if(mCurrentFragment.check())
             {
                 challengeValidate(mCurrentFragment.getChallenge(),  mGame, this);
+            }else if(!mCurrentFragment.getChallenge().isMandatory())
+            {
+                mGame.getBomb().addTime(-mCurrentFragment.getChallenge().getPenality());
+                challengeValidate(mCurrentFragment.getChallenge(),  mGame, this);
             }
         }
     }

+ 2 - 2
app/src/main/java/app/mar/game/Bomb.java

@@ -76,9 +76,9 @@ public class Bomb implements Serializable{
     }
 
 
-    public void addTime(int minutes)
+    public void addTime(float minutes)
     {
-        mDeadLine+=minutes*60*1000;
+        mDeadLine+=minutes*60.0*1000;
     }
 
     public String getTimeBeforeBoom()

+ 18 - 12
app/src/main/java/app/mar/game/challenges/Challenge.java

@@ -25,8 +25,6 @@ public abstract class Challenge implements Serializable{
     protected String mType=CHALLENGE_NULL;
     protected String mName="null";
 
-    protected char mCharPassword;
-    protected int  mCharPasswordIndex;
     protected Class  mStartWith = null;
     protected ArrayList<Indice> mIndices = new ArrayList<Indice>();
     protected int mLastIndiceDiscoveredIndex = 0;
@@ -36,6 +34,8 @@ public abstract class Challenge implements Serializable{
     protected ArrayList<Event> mEndEvent = new ArrayList<Event>();
 
     protected String mResource;
+    protected boolean mIsMandatory=true;
+    protected float mPenality=0;
 
     public Challenge(Game g, JSONObject root, Class start, Activity act)
     {
@@ -92,16 +92,6 @@ public abstract class Challenge implements Serializable{
         } catch (JSONException e) {
         }
 
-        try {
-            String s = root.getString("password_char");
-            if(s.length()==0) throw new JSONException("password_char is an empty string");
-            mCharPassword = s.charAt(0);
-            mCharPasswordIndex = root.getInt("password_index");
-        } catch (JSONException e) {
-            mCharPassword=0;
-            mCharPasswordIndex=-1;
-        }
-
         try {
             JSONArray arr = root.getJSONArray("indices");
             for(int i=0; i<arr.length(); i++)
@@ -114,6 +104,15 @@ public abstract class Challenge implements Serializable{
             mCharIndex = root.getInt("charIndex");
         } catch (JSONException e) {
         }
+
+        try {
+            mIsMandatory = root.getBoolean("mandatory");
+        } catch(JSONException e){}
+
+        try {
+            mPenality = root.getInt("penality");
+        } catch(JSONException e){}
+
     }
 
 
@@ -133,6 +132,13 @@ public abstract class Challenge implements Serializable{
 
     public int getCharIndex() {return mCharIndex; }
 
+    public boolean isMandatory() {
+        return mIsMandatory;
+    }
+
+    public float getPenality() {
+        return mPenality;
+    }
 
     public static Class getChallengeClass(String classe)
     {

+ 3 - 3
app/src/main/java/app/mar/game/challenges/Indice.java

@@ -6,13 +6,13 @@ import org.json.JSONObject;
 import java.io.Serializable;
 
 public abstract class Indice implements Serializable {
-    protected  int mPenality=-1;
+    protected  float mPenality=-1;
     protected  boolean mIsDiscovered=false;
 
     public Indice(JSONObject root)
     {
         try {
-            mPenality = root.getInt("penality");
+            mPenality = (float) root.getDouble("penality");
         } catch (JSONException e) {
         }
     }
@@ -34,7 +34,7 @@ public abstract class Indice implements Serializable {
     public boolean isDiscovered() { return mIsDiscovered; }
     public void     discover() { mIsDiscovered=true; }
 
-    public int getPenality() {
+    public float getPenality() {
         return mPenality;
     }
 }

+ 10 - 0
app/src/main/java/app/mar/game/challenges/QRCodeTreasure.java

@@ -13,6 +13,9 @@ public class QRCodeTreasure extends Treasure {
 
     protected String mQRValue;
     protected String mBadQRMessage;
+    protected String mComment;
+
+
     public static final int REQUEST_CODE=2003;
 
     public int getResultCode() { return REQUEST_CODE; }
@@ -27,6 +30,13 @@ public class QRCodeTreasure extends Treasure {
         } catch (JSONException e) {
             e.printStackTrace();
         }
+
+        try {
+            mComment = root.getString("comment");
+        }catch(JSONException e)
+        {
+            mComment="Retrouvez un QR Code proche de cet endroit";
+        }
     }
 
 

+ 37 - 8
app/src/main/java/app/mar/game/challenges/Question.java

@@ -2,18 +2,22 @@ package app.mar.game.challenges;
 
 import android.app.Activity;
 
+import org.json.JSONArray;
 import org.json.JSONException;
 import org.json.JSONObject;
 
+import java.util.ArrayList;
+
 import app.mar.activities.QuestionFragment;
 import app.mar.game.Game;
+import app.mar.utils.Levenshtein;
 
 public class Question extends Challenge {
 
     protected String mQuestion;
-    protected String mAnswer;
-    protected String mGoodMessage;
-    protected String mBadMessage;
+    protected ArrayList<String> mAnswer = new ArrayList<String>();
+    protected String mGoodMessage="";
+    protected String mBadMessage="";
     public static final int REQUEST_CODE=2004;
 
 
@@ -23,22 +27,47 @@ public class Question extends Challenge {
     public Question(Game g,JSONObject root, Activity a) {
         super(g, root, QuestionFragment.class, a);
 
+
         try {
             mQuestion = root.getString("question");
-            mAnswer = root.getString("answer");
-            mGoodMessage = root.getString("good_message");
-            mBadMessage = root.getString("bad_message");
         } catch (JSONException e) {
             e.printStackTrace();
         }
+
+        try {
+            mAnswer.clear();
+            String s = root.getString("answer");
+            mAnswer.add(s);
+        }catch(JSONException e)
+        {
+            try{
+                JSONArray js = root.getJSONArray("answer");
+                for(int i=0; i<js.length(); i++)
+                    mAnswer.add(js.getString(i));
+            }catch(JSONException ee) {
+                ee.printStackTrace();
+            }
+        }
+
+
+        try {mGoodMessage = root.getString("good_message"); } catch (JSONException e) {}
+        try {mBadMessage = root.getString("bad_message"); } catch (JSONException e) {}
     }
 
 
 
+    public boolean checkAnswer(String a, int i)
+    {
+        int length = mAnswer.get(i).length();
+        int n = length/3;
+        return Levenshtein.test(mAnswer.get(i), a);
+    }
 
     public boolean checkAnswer(String answer)
     {
-        return answer.toLowerCase().compareTo(mAnswer.toLowerCase())==0;
+        for(int i=0; i< mAnswer.size(); i++)
+            if(checkAnswer(answer, i)) return true;
+        return false;
     }
 
 
@@ -46,7 +75,7 @@ public class Question extends Challenge {
         return mQuestion;
     }
 
-    public String getAnswer() {
+    public ArrayList<String> getAnswer() {
         return mAnswer;
     }
 

+ 79 - 0
app/src/main/java/app/mar/utils/Levenshtein.java

@@ -0,0 +1,79 @@
+//*******************************************************************
+// Welcome to CompileJava!
+// If you experience any issues, please contact us ('More Info')  -->
+// Also, sorry that the "Paste" feature no longer works! GitHub broke
+// this (so we'll switch to a new provider): https://blog.github.com\
+// /2018-02-18-deprecation-notice-removing-anonymous-gist-creation/
+//*******************************************************************
+
+package app.mar.utils;
+
+import java.lang.Math; // headers MUST be above the first class
+import java.text.Normalizer;
+import java.util.ArrayList;
+
+
+// one class needs to have a main() method
+public class Levenshtein
+{
+  
+  	public static String normalize(String input)
+    {
+      	String normalized = Normalizer.normalize(input, Normalizer.Form.NFD);
+		String accentRemoved = normalized.replaceAll("\\p{InCombiningDiacriticalMarks}+", "");
+      	
+      return accentRemoved.toLowerCase();
+      
+    }
+                                                
+    private static int minimum(int a, int b, int c) {                            
+        return Math.min(Math.min(a, b), c);                                      
+    }                                                                            
+                                                                                 
+    private static int computeLevenshteinDistance(CharSequence lhs, CharSequence rhs) {      
+      	System.out.println(lhs+" "+rhs);
+        int[][] distance = new int[lhs.length() + 1][rhs.length() + 1];        
+                                                                                 
+        for (int i = 0; i <= lhs.length(); i++)                                 
+            distance[i][0] = i;                                                  
+        for (int j = 1; j <= rhs.length(); j++)                                 
+            distance[0][j] = j;                                                  
+                                                                                 
+        for (int i = 1; i <= lhs.length(); i++)                                 
+            for (int j = 1; j <= rhs.length(); j++)                             
+                distance[i][j] = minimum(                                        
+                        distance[i - 1][j] + 1,                                  
+                        distance[i][j - 1] + 1,                                  
+                        distance[i - 1][j - 1] + ((lhs.charAt(i - 1) == rhs.charAt(j - 1)) ? 0 : 1));
+                                                                                 
+        return distance[lhs.length()][rhs.length()];                           
+    }                                                                            
+
+  public static int compute(String ref, String test)
+  {
+    return computeLevenshteinDistance(normalize(ref), normalize(test));
+  }
+
+  public static boolean test(String ref, String test)
+  {
+    int s = (ref.length()/3);
+    if(s==0) s++;
+    return compute(ref, test)<s;
+  }
+  
+  public static boolean test(String ref, ArrayList<String> tests)
+  {
+    for(int i=0; i<tests.size(); i++)
+      if(test(ref, tests.get(i))) return true;
+     return false;
+  }
+  
+  public static boolean test(String ref, String[] tests)
+  {
+    for(int i=0; i<tests.length; i++)
+      if(test(ref, tests[i])) return true;
+     return false;
+  }
+ 
+}
+

+ 1 - 1
app/src/main/res/values/dimens.xml

@@ -5,5 +5,5 @@
     <dimen name="fab_margin">16dp</dimen>
     <dimen name="title_height">70dp</dimen>
     <dimen name="title_text_size">30dp</dimen>
-    <dimen name="bomb_key_size">70</dimen>
+    <dimen name="bomb_key_size">70dp</dimen>
 </resources>