Skip to content

Instantly share code, notes, and snippets.

@bryantee
Last active August 29, 2015 14:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bryantee/9b96c00157cb1786fcf3 to your computer and use it in GitHub Desktop.
Save bryantee/9b96c00157cb1786fcf3 to your computer and use it in GitHub Desktop.
$(document).ready(function() {
var DEBUG_MODE = true;
// Question class constructor
var Question = function (questionNumber, question, answer1, answer2, answer3, answer4, correctAnswer) {
this.questionNumber = questionNumber;
this.question = question;
this.answers = [answer1, answer2, answer3, answer4];
this.correctAnswer = correctAnswer;
if (DEBUG_MODE == true) {
console.log("Question number " + this.questionNumber + " instantiated.");
};
};
// Instantiated objects
var question1 = new Question(1, 'Example Question', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Correct Answer', 4);
var question2 = new Question(2, 'Example Question', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Correct Answer', 4);
var question3 = new Question(3, 'Example Question', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Correct Answer', 4);
var question4 = new Question(4, 'Example Question', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Correct Answer', 4);
var question5 = new Question(5, 'Example Question', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Correct Answer', 4);
var question6 = new Question(6, 'Example Question', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Correct Answer', 4);
}); // End Ready
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment