Added stats for how many potential review items there are.
This commit is contained in:
parent
a8e4e3e334
commit
634454edb6
@ -5,7 +5,14 @@ refreshQuestion = () ->
|
||||
dataType: 'json',
|
||||
success: (e) ->
|
||||
sessionStorage.setItem('user_items', JSON.stringify(e['item_list']))
|
||||
sessionStorage.setItem('radical_count', e['radical_count'])
|
||||
sessionStorage.setItem('kanji_count', e['kanji_count'])
|
||||
sessionStorage.setItem('vocabulary_count', e['vocabulary_count'])
|
||||
refreshQuestion()
|
||||
if($('#radical-num').text() == '')
|
||||
$('#radical-num').text(sessionStorage.getItem('radical_count'));
|
||||
$('#kanji-num').text(sessionStorage.getItem('kanji_count'));
|
||||
$('#vocab-num').text(sessionStorage.getItem('vocabulary_count'));
|
||||
if(sessionStorage.getItem('user_items'))
|
||||
items = JSON.parse(sessionStorage.getItem('user_items'))
|
||||
selection = items[Math.floor(Math.random() * items.length)]
|
||||
|
@ -8,6 +8,14 @@
|
||||
</a>
|
||||
</div>
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
<li class="dropdown">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown"><span class="glyphicon glyphicon-option-horizontal"></span></a>
|
||||
<ul class="dropdown-menu" aria-labelledby="dLabel">
|
||||
<li><span id="radical-num"></span> Radicals</li>
|
||||
<li><span id="kanji-num"></span> Kanji</li>
|
||||
<li><span id="vocab-num"></span> Vocabulary</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
<button id="api-refresh" type="submit" class="btn btn-default navbar-btn" aria-label="Refresh API">
|
||||
<span class="glyphicon glyphicon-refresh" aria-hidden="true"></span>
|
||||
@ -45,5 +53,5 @@
|
||||
</div>
|
||||
</div>
|
||||
<script src="{{ url_for('static', filename='wanakana.min.js')}}"></script>
|
||||
<script defer src="{{ url_for('static', filename='quiz_item.js')}}"></script>
|
||||
<script defer src="{{ url_for('static', filename='quiz_item.js')}}"></script>
|
||||
{% endblock %}
|
Loading…
Reference in New Issue
Block a user