Skip to content

Commit

Permalink
Made score update on goodbye page.
Browse files Browse the repository at this point in the history
  • Loading branch information
Wylan committed May 10, 2012
1 parent b465599 commit 95faacb
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions js/script.js
Expand Up @@ -238,6 +238,17 @@ $("*").live("pageshow", function (event) {
remainingQuiz();
});

$("#goodbyePage").live("pageshow", function (event) {
// just in case they never played the quiz 0 it out if it doesnt exist
if (localStorage.getItem("score") == null) {
localStorage.setItem("score", 0);
};
var score = localStorage.getItem("score");

var scoreString = score + "/40";
$(".totalscore").text(scoreString);
});

// called when the index page is shown.
$(".navbar_index").live("pageshow", function (event) {
// the button at the top of the index page
Expand Down

0 comments on commit 95faacb

Please sign in to comment.