Projects in HTML5 – Chapter 41 – Optimizing Our Code

preview_player
Показать описание
Here we are with Chapter 41, where you will optimizing our code in HTML.

Follow Eduonix on other social networks:
Рекомендации по теме
Комментарии
Автор

thankyou so much for this! was building a quiz app and this tuts were my bread and butter. keep up the good work!

harunthuo
Автор

Your Project is excelent and also explanation theoraticaly. please help me to develop pasals question

dcrajapaksha
Автор

Hello sir, how to add previous button to this and also updates the score according to it?

sportsmalayalam
Автор

he doesn't hide the questions anymore now i get all the same time

jofreydegraaff
Автор

Hey, can I please get some help? when I comment out process my page will go to the next questions but if I let it be as it should it doesn't move from question 1. Basically, I am unable to tell how much question a person gets right or wrong. Please help thank you, I have looked everywhere

LestsTalkBIBLE
Автор

If I want to add an image / gif together with the "Good Job" text when you get X ammount of rights, then how do I do that??

Rawzix
Автор

I have problem with sessionStorage, I can't see it in resources, and probably because of that it doesn't work properly, do you maybe know why? Tnx.

miroslavskeledzija
Автор

How can i add more questions. When i try it the score already shows at question six instead off the last question.
can you help me?

daankentrop
Автор

Do you have an idea for a function that would take you back to a previous question, like a "back button", would appreciate the help :)

oscartarrosaiii
Автор

Could i please have a download for the finished product i messed up on chapter 41.

mr.froffles
Автор

hello sir ! how the choices to be randomized ? thankz..

arnoldgonzales
Автор

My Points does not want to add does anyone have the same problem?

cometstar
Автор

heei, i have a problem, any answer I pick it'll show me 0 out of ...

here's the code:

var score = 0; // set score =0
var total = 5; //nr tot intrebari
var point = 2;//nr puncte pe raspuns corect
var highest = total * point;

//initializer

function init () {
//set correct answers
sessionStorage.setItem('a1', 'b');
sessionStorage.setItem('a2', 'd');
sessionStorage.setItem('a3', 'c');
sessionStorage.setItem('a4', 'a');
sessionStorage.setItem('a5', 'b');
}


$(document).ready(function(){
$('.questionForm').hide();

$('#q1').show();

$('.questionForm #submit').click(function(){
//get data attributes
current =
next =
//hide all questions
$('.questionForm').hide();
//show next question
$('#q'+ next+'').fadeIn(300);
process(''+current+'');
return false;

});

/* $('#q1 #submit').click(function(){
$('.questionForm').hide();
process('q1');
$('#q2').fadeIn(300);
return false;
});

$('#q2 #submit').click(function(){
$('.questionForm').hide();
process('q2');
$('#q3').fadeIn(300);
return false;
});

$('#q3 #submit').click(function(){
$('.questionForm').hide();
process('q3');
$('#q4').fadeIn(300);
return false;
});

$('#q4 #submit').click(function(){
$('.questionForm').hide();
process('q4');
$('#q5').fadeIn(300);
return false;
});

$('#q5 #submit').click(function(){
$('.questionForm').hide();
process('q5');
$('#rezults').fadeIn(300);
return false;
}); */
});

//process the answer

function process(n){
//get imput value
var submitted=
if
score= score + point;
}

if( n == total){
$('#results').html('<h3>Your final score is: '+score+' out of '+ highest+'</h3><a href="wdd.html">Take Quiz Again</a>')
}
return false;
}


//add event listener

window.addEventListener('load', init, false);

mackenzehollister
visit shbcf.ru