Fixed incorrect vocabulary_count, wasn't accounting for the doubling of kanji items.

This commit is contained in:
neviyn 2016-01-25 21:45:09 +00:00
parent f743358355
commit fb0f6d7ccd

View File

@ -141,7 +141,7 @@ def get_items_with_level_restriction(level_range, item_state, item_types):
'answer_type': 'kana'},
{'item_type': 'vocabulary', 'question': item['character'],
'answer': item['meaning'], 'answer_type': 'eng'}])
vocabulary_count = int((len(items) - (radical_count + kanji_count)) / 2)
vocabulary_count = int((len(items) - (radical_count + (kanji_count * 2))) / 2)
if not items:
return flask.jsonify(error="No items within these filter parameters")
else: