update(feat): Multi-Language Support

chore(coding-style): Fix Indentation
This commit is contained in:
nearbyplayer
2017-09-21 12:23:36 -04:00
parent 072ef503b2
commit 4c7e767a1d
11 changed files with 633 additions and 386 deletions
+71
View File
@@ -0,0 +1,71 @@
var tableauQuestion = [
{ question : "If you're going 65 mph, and you're approaching a residential area you must:",
propositionA : "You accelerate",
propositionB : "You keep your speed, if you do not pass other vehicles",
propositionC : "You slow down",
propositionD : "You keep your speed",
reponse : "C"},
{ question : "If you're turning right at a traffic light, but see a pedestrian crossing what do you do:",
propositionA : "You pass the pedestrian",
propositionB : "You check that there is no other vehicles around",
propositionC : "You wait until the pedestrian has crossed",
propositionD : "You shoot the pedestrian and continue to drive",
reponse : "C"},
{ question : "Without any prior indication, the speed in a residential area is: __ mph",
propositionA : "30",
propositionB : "35",
propositionC : "40",
propositionD : "45",
reponse : "A"},
{ question : "Before every lane change you must:",
propositionA : "Check your mirrors",
propositionB : "Check your blind spots",
propositionC : "Signal your intentions",
propositionD : "All of the above",
reponse : "D"},
{ question : "What blood alcohol level is classified as driving while intoxicated?",
propositionA : "0.05%",
propositionB : "0.18%",
propositionC : "0.08%",
propositionD : "0.06%",
reponse : "C"},
{ question : "When can you continue to drive at a traffic light?",
propositionA : "When it is green",
propositionB : "When there is nobody in the intersection",
propositionC : "You are in a school zone",
propositionD : "When it is green and / or red and you're turning right",
reponse : "D"},
{ question : "A pedestrian has a do not cross signal, what do you do?",
propositionA : "You let them pass",
propositionB : "You observe before continuing",
propositionC : "You wave to tell them to cross",
propositionD : "You continue because your traffic light is green",
reponse : "D"},
{ question : "What is allowed when passing another vehicle",
propositionA : "You follow it closely to pass it faster",
propositionB : "You pass it without leaving the roadway",
propositionC : "You drive on the opposite side of the road to pass",
propositionD : "You exceed the speed limit to pass them",
reponse : "C"},
{ question : "You are driving on a highway which indicates a maximum speed of 70 mph. Most traffic drives at 75 mph, so you should not drive faster than:",
propositionA : "50 mph",
propositionB : "25 mph",
propositionC : "30 mph",
propositionD : "70 mph",
reponse : "D"},
{ question : "When you are overtaken by another vehicle it is important NOT to:",
propositionA : "Slow Down",
propositionB : "Check your mirrors",
propositionC : "Watch other drivers",
propositionD : "Increase your speed",
reponse : "D"},
]
+1 -1
View File
@@ -52,7 +52,7 @@ function closeAll() {
function openQuestionnaire() {
$(".questionnaire-container").css("display", "block");
var randomQuestion = getRandomQuestion();
$("#questionNumero").html("Question : " + questionNumber);
$("#questionNumero").html("Question: " + questionNumber);
$("#question").html(tableauQuestion[randomQuestion].question);
$(".answerA").html(tableauQuestion[randomQuestion].propositionA);
$(".answerB").html(tableauQuestion[randomQuestion].propositionB);
+98
View File
@@ -0,0 +1,98 @@
<head>
<link href="https://fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet">
<link rel="stylesheet" href="styles.css" type="text/css">
</head>
<body>
<div class="full-screen">
<div class="question-container">
<!-- header -->
<div class="header">
<h1>Driving School</h1>
</div>
<!-- home -->
<div class="body home">
<div class="content">
<!-- ICI BREVE PRESENTATION -->
<center><img src="dmv.png" class="logo"><br><p class="bold-text">Welcome to Driving School</center>
<br><center>All citizens of Los Santos must pass their exam before they can drive.<br>Take your time, answer with common sense, and do not answer randomly.<br><br>
Theory Test<br>
- The Theory Test costs $200, this is not refunded if you fail the test.<br>
- Don't be afraid, the driving school accepts credit, but be careful not to get into debt.<br>
- If you fail your test the first time, you can't retake it immediately, you'll have to take it at a later date.<br><br>
Driving Test<br>
- The Driving Test costs $500, just like the theory test, this payment will not be refunded if you fail.<br>
- Make sure you stay alert whilst driving, and avoid accidents!</p></center>
</div>
<div class="buttonspot">
<a href="#" class="button btnQuestion">Start</a>
</div>
<div class ="barre-progression" >
<h2>Progress</h2>
<progress class="progression" value="0" max="10" >
</div>
</div>
<!-- Question-->
<div class="body questionnaire-container">
<div class="content">
<h2 id="questionNumero"></h2>
<p id="question"></p>
<form class="form" id="question-form">
<div>
<input type="radio" name="question" id="answerA" value="A">
<label class="answerA"></label>
</div>
<div>
<input type="radio" name="question" id="answerB" value="B">
<label class="answerB"></label>
</div>
<div>
<input type="radio" name="question" id="answerC" value="C">
<label class="answerC"></label>
</div>
<div>
<input type="radio" name="question" id="answerD" value="D">
<label class="answerD"></label>
</div>
<button type="submit" id="submit" class="submit">Next question</button>
</form>
</div>
<div class ="barre-progression">
<h2>Progress</h2>
<progress class="progression" value="0" max="10" >
</div>
</div>
<!-- Résults -->
<div class="body resultGood">
<div class="content">
<center><p class="bold-text">Good work!</p><br><br>You did well during the examination.<br><br>You can close this window, and go take your road test(s).</center>
</div>
<div class="buttonspot">
<a href="#" class="button btnClose">Close</a>
</div>
<div class ="barre-progression" >
<h2>Progress</h2>
<progress class="progression" value="10" max="10" >
</div>
</div>
<div class="body resultBad">
<div class="content">
<center><p class="bold-text">You failed</p><br><br>You weren't ready for this test, try again later...<br><br></center>
</div>
<div class="buttonspot">
<a href="#" class="button btnKick">Close</a>
</div>
<div class ="barre-progression" >
<h2>Progress</h2>
<progress class="progression" value="10" max="10" >
</div>
</div>
</div>
</div>
<script src="nui://game/ui/jquery.js" type="text/javascript"></script>
<script src="questions.js" type="text/javascript"></script>
<script src="scripts.js" type="text/javascript"></script>
<script src="debounce.min.js" type="text/javascript"></script>
</body>