Skip to main content

test by gkwithmath

TEST 1



Question x of y

function Quiz(questions) { this.score = 0; this.questions = questions; this.questionIndex = 0; } Quiz.prototype.getQuestionIndex = function() { return this.questions[this.questionIndex]; } Quiz.prototype.guess = function(answer) { if(this.getQuestionIndex().isCorrectAnswer(answer)) { this.score++; } this.questionIndex++; } Quiz.prototype.isEnded = function() { return this.questionIndex === this.questions.length; } function Question(text, choices, answer) { this.text = text; this.choices = choices; this.answer = answer; } Question.prototype.isCorrectAnswer = function(choice) { return this.answer === choice; } function populate() { if(quiz.isEnded()) { showScores(); } else { // show question var element = document.getElementById("question"); element.innerHTML = quiz.getQuestionIndex().text; // show options var choices = quiz.getQuestionIndex().choices; for(var i = 0; i < choices.length; i++) { var element = document.getElementById("choice" + i); element.innerHTML = choices[i]; guess("bt" + i, choices[i]); } showProgress(); } }; function guess(id, guess) { var button = document.getElementById(id); button.onclick = function() { quiz.guess(guess); populate(); } }; function showProgress() { var currentQuestionNumber = quiz.questionIndex + 1; var element = document.getElementById("progress"); element.innerHTML = "Question " + currentQuestionNumber + " of " + quiz.questions.length; }; function showScores() { var gameOverHTML = "

Result

"; gameOverHTML += "

Your scores: " + quiz.score + "

"; var element = document.getElementById("quiz"); element.innerHTML = gameOverHTML; }; // create questions var questions = [ new Question("What is the Capital of India?", ["New Delhi", "Mumbai","Jaipur", "Kolkata"], "New Delhi"), new Question("National Animal of India?", ["Elephant", "Bengal Tiger","Lion", "Cow"], "Bengal Tiger"), new Question("National River of India?", ["Yamuna", "Ganga","Brahmputra", "Sindhu"], "Ganga"), new Question("तू कौन है ?", ["पागल ", "गधा","मेंचल", "दिमाग"], "दिमाग"), ]; var quiz = new Quiz(questions); populate();

Comments

Popular posts from this blog

ENGLISH VOCAB 7

1. Bourgeois - Relating to middle class socity. . 2. GLIB - Speaking in a smooth, easy way that is not sincere use- Politicians need to do more than provide glib answers to difficult questions. 3. RUMINATE - To think carefully and deeply about something Synonym - cogitate, meditate, ponder, wrestle, perpend. uses - The question got us ruminating on the real value of wealth. करेंट अफेयर्स यहाँ क्लिक करें  4. DEMEANOR - A person's appearance and behavior synonym - actions, adress, conduct, bearing, comportment uses - The director of the opera company has haughty demeanor that can be irritating. 5. Gestalt - The general quality or character of someting. uses - The gestalt of human consciousness. More vocabulary click here  6.ELEEMOSYNARY - of supported by charity synonym -altruist, beneficient, charitable antonym - selfish, self centered, selfish uses - used his vast fortune for establishing and funding a host of eleemosynary institution

करंट अफेयर्स 09/01/2017

करंट अफेयर्स 09/01/2017 1. चुनाव चिह्न (आरक्षण और आवंटन) आदेश, 1968 राजनीतिक दलों को प्रतीकों का आवंटन करने के लिए चुनाव आयोग को अधिकार देता है। इस अधिनियम के पैरा 15 के तहत दो या दो से अधिक प्रतिद्वंदी समूह द्वारा चुनाव प्रतीक पर दावा जताने की स्थिति में चुनाव आयोग को मुद्दों पर फैसला सुनाने का अधिकार प्रदान करता है। वर्तमान परिपेक्ष्य में उत्तर प्रदेश के समाजवादी पार्टी के चुनाव प्रतीक “साइकिल” के केस पर भी चुनाव चिह्न (आरक्षण और आवंटन) आदेश, 1968 चुनाव आयोग को फैसला सुनाने का अधिकार प्रदान करता है। 2. 5 जनवरी 2017 को केंद्र सरकार को नीति आयोग द्वारा देश में एक नई परिवहन प्रणाली Hyperloop स्थापित करने का प्रस्ताव भेजा गया। यह प्रस्ताव केंद्र सरकार द्वारा प्रस्तावित स्मार्ट सिटी परियोजना के तहत 100 प्रमुख शहरों में नई परिवहन प्रणाली हेतु भेजा गया है। Hyperloop एक नई परिवहन प्रणाली है जिसमें दो शहरों को वैक्यूम ट्यूब में चलने वाली ट्रेन समान माध्यम से जोड़ा जाएगा। Hyperloop की अनुमानित गति 1,000 किलोमीटर/घंटा है। 3. एच 1 बी वीजा, गैर प्रवासी कुशल कार्मिकों को संयुक्त राज्य अमेर...

English vocab 4

1. ACCLIMATIZE - ac(according)+ climate Meaning- to adjust in a climate or situation synonym -adapt, adjust, condition, fit uses - The mountain climbers spent a few days acclimatizing themselves to the high altitude. 2. NEMESIS - An opponent or enemy that is very difficult to defeat. synonym - avenger, castigator, vigilante, scourge antonym - benefit, boon, windfall, falicity uses- HE will be playing his old nemesis for the championship. 3. Cognizance - Knowledge or awareness of something synonym - notice, attention, awareness, heed antonym - unfamiliarity uses- They seem to have no cognizance of the crime. 4 .Tarnish - to become dull or not shiny:  a thin layar on the surface of metal which makes the metal look dull synonym - stain, blemish, mar, vitiate uses - some foods will tarnish silver. 5. Squalid -  very dirty and unpleasant synonym -dirty, sordid uses - The family lived in squalid conditions. click here to  करंट अफेयर्स 09/01/2017 ...