generated from Code-Institute-Org/gitpod-full-template
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #42 from alissatroiano/alissa-homepage
Alissa Landing Page
- Loading branch information
Showing
9 changed files
with
202 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
// We will use the index of the questions array to get the current question | ||
Quiz.prototype.getQuestionIndex = function() { | ||
return this.questionIndex; | ||
} | ||
|
||
// Quiz Ended/Over script | ||
Quiz.prototype.isEnded = function() { | ||
} | ||
|
||
// This function is called when the user clicks on the start button | ||
function Question(text, choices, answer) { | ||
this.text = text; | ||
this.choices = choices; | ||
this.answer = answer; | ||
} | ||
|
||
// Store the user's choice here | ||
Question.prototype.userChoice = function(choice) { | ||
return choice === this.answer; | ||
}; | ||
|
||
|
||
// A function for the user's chouce | ||
function answer(id, choice) { | ||
// Find the ID's in the HTML | ||
var button = document.getElementById(id); | ||
} | ||
|
||
// show progress | ||
function showProgress() { | ||
const currentQuestionNumber = quiz.questionIndex + 1; | ||
const element = document.getElementById('progress'); | ||
element.innerHTML = `Question ${currentQuestionNumber} of ${quiz.questions.length}`; | ||
} | ||
|
||
// Create an array of questions here | ||
var questions = [ | ||
{ | ||
question: "What type of car do you want?", | ||
answers: { | ||
a: "Compact", | ||
b: "Mid-Size", | ||
c: "SUV" | ||
}, | ||
userAnswer: "" | ||
}, | ||
{ | ||
question: "What is your annual mileage?", | ||
answers: { | ||
a: "Less than 10,000", | ||
b: "10,000 - 20,000", | ||
c: "More than 20,000" | ||
}, | ||
userAnswer: "" | ||
}, | ||
{ | ||
question: "What is your budget?", | ||
answers: { | ||
a: "Less than $30,000", | ||
b: "$30,000 - $50,000", | ||
c: "$More than $50,000" | ||
}, | ||
userAnswer: "" | ||
} | ||
]; | ||
|
||
|
||
// Used the questions defined about to create the quiz | ||
function Quiz(questions) { | ||
this.score = 0; | ||
this.questions = 0; | ||
this.questionIndex = 0; | ||
} | ||
|
||
var quiz = new Quiz(questions); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.