diff --git a/static/quiz_item.coffee b/static/quiz_item.coffee index 78f1211..e340672 100644 --- a/static/quiz_item.coffee +++ b/static/quiz_item.coffee @@ -35,6 +35,7 @@ updateQuizItemStats = () -> $('#radical-num').text(sessionStorage.getItem('radical_count')); $('#kanji-num').text(sessionStorage.getItem('kanji_count')); $('#vocab-num').text(sessionStorage.getItem('vocabulary_count')); + $('#total-num').text(parseInt(sessionStorage.getItem('radical_count')) + parseInt(sessionStorage.getItem('kanji_count'))+ parseInt(sessionStorage.getItem('vocabulary_count'))) filterQuestions = () -> input_data = $('#filter-input').val() @@ -43,7 +44,7 @@ filterQuestions = () -> sessionStorage.removeItem('radical_count') sessionStorage.removeItem('kanji_count') sessionStorage.removeItem('vocabulary_count') - target_url = "/user_items/" + input_data + target_url = "/user_items?level_range=" + input_data $.ajax url: target_url, dataType: 'json', diff --git a/static/quiz_item.js b/static/quiz_item.js index c1fb596..00d8444 100644 --- a/static/quiz_item.js +++ b/static/quiz_item.js @@ -45,7 +45,8 @@ updateQuizItemStats = function() { $('#radical-num').text(sessionStorage.getItem('radical_count')); $('#kanji-num').text(sessionStorage.getItem('kanji_count')); - return $('#vocab-num').text(sessionStorage.getItem('vocabulary_count')); + $('#vocab-num').text(sessionStorage.getItem('vocabulary_count')); + return $('#total-num').text(parseInt(sessionStorage.getItem('radical_count')) + parseInt(sessionStorage.getItem('kanji_count')) + parseInt(sessionStorage.getItem('vocabulary_count'))); }; filterQuestions = function() { @@ -56,7 +57,7 @@ sessionStorage.removeItem('radical_count'); sessionStorage.removeItem('kanji_count'); sessionStorage.removeItem('vocabulary_count'); - target_url = "/user_items/" + input_data; + target_url = "/user_items?level_range=" + input_data; return $.ajax({ url: target_url, dataType: 'json', diff --git a/templates/quiz.html b/templates/quiz.html index 4dff007..7ef93fb 100644 --- a/templates/quiz.html +++ b/templates/quiz.html @@ -38,6 +38,7 @@