-->

Wednesday, August 30, 2023

bvgsdhdas

Right 0 Wrong 0
Quiz Result

Dear Apu

Total Questions:

Attempt:

Correct:

Wrong:

Percentage:

Tuesday, August 31, 2021

as

* { margin: 0px; padding: 0px; font: 16px 'Source Sans Pro', sans-serif; border: none; box-sizing: border-box; } html, body { background: #2E706C; text-align: center; width: 50%; height: 50%; margin: 5rem; bottom: 2rem; right: 2rem; } html { display: table; } body { display: table-cell; vertical-align: middle; } #quiz { margin: -44px 50px 0px; position: relative; width: calc(100% - 100px); } #quiz h1 { color: #FAFAFA; font-weight: 600; font-size: 36px; text-transform: uppercase; text-align: left; line-height: 44px; } #quiz button { float: left; margin: 8px 0px 0px 8px; padding: 4px 8px; background: #9ACFCC; color: #00403C; font-size: 14px; cursor: pointer; outline: none; } #quiz button:hover { background: #36a39c; color: #FFF; } #quiz button:disabled { opacity: 0.5; background: #9ACFCC; color: #00403C; cursor: default; } // Array of all the questions and choices to populate the questions. This might be saved in some JSON file or a database and we would have to read the data in. var all_questions = [{ question_string: "What color is the sky?", choices: { correct: "Blue", wrong: ["Pink", "Orange", "Green"] } }, { question_string: "Which of the following elements aren’t introduced in HTML5?", choices: { correct: "", wrong: ["
", "
", "
"] } }, { question_string: "How many wheels are there on a tricycle?", choices: { correct: "Three", wrong: ["One", "Two", "Four"] } }, { question_string: 'Who is the main character of Harry Potter?', choices: { correct: "Harry Potter", wrong: ["Hermione Granger", "Ron Weasley", "Voldemort"] } }]; // An object for a Quiz, which will contain Question objects. var Quiz = function(quiz_name) { // Private fields for an instance of a Quiz object. this.quiz_name = quiz_name; // This one will contain an array of Question objects in the order that the questions will be presented. this.questions = []; } // A function that you can enact on an instance of a quiz object. This function is called add_question() and takes in a Question object which it will add to the questions field. Quiz.prototype.add_question = function(question) { // Randomly choose where to add question var index_to_add_question = Math.floor(Math.random() * this.questions.length); this.questions.splice(index_to_add_question, 0, question); } // A function that you can enact on an instance of a quiz object. This function is called render() and takes in a variable called the container, which is the
that I will render the quiz in. Quiz.prototype.render = function(container) { // For when we're out of scope var self = this; // Hide the quiz results modal $('#quiz-results').hide(); // Write the name of the quiz $('#quiz-name').text(this.quiz_name); // Create a container for questions var question_container = $('
').attr('id', 'question').insertAfter('#quiz-name'); // Helper function for changing the question and updating the buttons function change_question() { self.questions[current_question_index].render(question_container); $('#prev-question-button').prop('disabled', current_question_index === 0); $('#next-question-button').prop('disabled', current_question_index === self.questions.length - 1); // Determine if all questions have been answered var all_questions_answered = true; for (var i = 0; i < self.questions.length; i++) { if (self.questions[i].user_choice_index === null) { all_questions_answered = false; break; } } $('#submit-button').prop('disabled', !all_questions_answered); } // Render the first question var current_question_index = 0; change_question(); // Add listener for the previous question button $('#prev-question-button').click(function() { if (current_question_index > 0) { current_question_index--; change_question(); } }); // Add listener for the next question button $('#next-question-button').click(function() { if (current_question_index < self.questions.length - 1) { current_question_index++; change_question(); } }); // Add listener for the submit answers button $('#submit-button').click(function() { // Determine how many questions the user got right var score = 0; for (var i = 0; i < self.questions.length; i++) { if (self.questions[i].user_choice_index === self.questions[i].correct_choice_index) { score++; } $('#quiz-retry-button').click(function(reset) { quiz.render(quiz_container); }); } // Display the score with the appropriate message var percentage = score / self.questions.length; console.log(percentage); var message; if (percentage === 1) { message = 'Great job!' } else if (percentage >= .75) { message = 'You did alright.' } else if (percentage >= .5) { message = 'Better luck next time.' } else { message = 'Maybe you should try a little harder.' } $('#quiz-results-message').text(message); $('#quiz-results-score').html('You got ' + score + '/' + self.questions.length + ' questions correct.'); $('#quiz-results').slideDown(); $('#submit-button').slideUp(); $('#next-question-button').slideUp(); $('#prev-question-button').slideUp(); $('#quiz-retry-button').sideDown(); }); // Add a listener on the questions container to listen for user select changes. This is for determining whether we can submit answers or not. question_container.bind('user-select-change', function() { var all_questions_answered = true; for (var i = 0; i < self.questions.length; i++) { if (self.questions[i].user_choice_index === null) { all_questions_answered = false; break; } } $('#submit-button').prop('disabled', !all_questions_answered); }); } // An object for a Question, which contains the question, the correct choice, and wrong choices. This block is the constructor. var Question = function(question_string, correct_choice, wrong_choices) { // Private fields for an instance of a Question object. this.question_string = question_string; this.choices = []; this.user_choice_index = null; // Index of the user's choice selection // Random assign the correct choice an index this.correct_choice_index = Math.floor(Math.random(0, wrong_choices.length + 1)); // Fill in this.choices with the choices var number_of_choices = wrong_choices.length + 1; for (var i = 0; i < number_of_choices; i++) { if (i === this.correct_choice_index) { this.choices[i] = correct_choice; } else { // Randomly pick a wrong choice to put in this index var wrong_choice_index = Math.floor(Math.random(0, wrong_choices.length)); this.choices[i] = wrong_choices[wrong_choice_index]; // Remove the wrong choice from the wrong choice array so that we don't pick it again wrong_choices.splice(wrong_choice_index, 1); } } } // A function that you can enact on an instance of a question object. This function is called render() and takes in a variable called the container, which is the
that I will render the question in. This question will "return" with the score when the question has been answered. Question.prototype.render = function(container) { // For when we're out of scope var self = this; // Fill out the question label var question_string_h2; if (container.children('h2').length === 0) { question_string_h2 = $('

').appendTo(container); } else { question_string_h2 = container.children('h2').first(); } question_string_h2.text(this.question_string); // Clear any radio buttons and create new ones if (container.children('input[type=radio]').length > 0) { container.children('input[type=radio]').each(function() { var radio_button_id = $(this).attr('id'); $(this).remove(); container.children('label[for=' + radio_button_id + ']').remove(); }); } for (var i = 0; i < this.choices.length; i++) { // Create the radio button var choice_radio_button = $('') .attr('id', 'choices-' + i) .attr('type', 'radio') .attr('name', 'choices') .attr('value', 'choices-' + i) .attr('checked', i === this.user_choice_index) .appendTo(container); // Create the label var choice_label = $('

Friday, February 7, 2020

How to get 100 marks tips by Tn Teachers Team

How to Upgrade to Windows 10 for Free Tips for Education

If you are still using Windows 7 on your PC, there is some important news for you. Microsoft is ending support for the OS on all computers and laptops. The action is taking place as the company is planning to focus more on Windows 10 going in the new decade. The support for Windows 7 will end on January 14, 2020. This means that the US tech giant will no longer be issuing patches or fixes for it, unless in very extreme circumstances. 
Microsoft's support web pages have revealed that Microsoft will discontinue its support so that they can focus on supporting newer technologies and creating better experiences. As a replacement, the tech giant recommended users to install Windows 10 sometime before January 2020. 
While Microsoft does not talk about providing a free upgrade to Windows 10, rather urges users to purchase the new version, users can still switch to Windows 10 for free. Of course, you need to have a legit licensed copy of Windows 7 running on your PC. Here’s how you can upgrade to Windows 10 for free: 
Step 1: Visit the Windows 10 download page. 
Step 2: On the page, click on ‘Download Tool now’ and download the Windows 10 Media Creation Tool. 
Step 3: Now, run the Media Creation Tool and accept the licence terms. 
Step 4: Next, select ‘Upgrade this PC now’ and click on ‘Next’. 
Step 5: Click on ‘Keep personal files and apps’ and then click ‘Continue’. 
Step 6: Once the Install option will be clicked, Windows 10 will begin to be installed. However, this will require some time. 
Step 7: Once the Windows 10 finishes installing, users need to connect to the internet and open Settings > Windows Update > Activation and the computer/laptop will be activated with a digital license.