Commit b2730117 by Vasyl Nakvasiuk

add total_count to answer from server

parent 66615cab
......@@ -8,11 +8,9 @@ If student have answered - words he entered and cloud.
Stunent can change his answer.
"""
import cgi
import json
import logging
import re
from copy import deepcopy
from collections import OrderedDict
from lxml import etree
......@@ -56,7 +54,11 @@ class WordCloudModule(WordCloudFields, XModule):
if self.submitted:
return json.dumps({
'status': 'success',
'student_words': self.student_words,
'student_words': {
word:self.all_words[word] for
word in self.student_words
},
'total_count': sum(self.all_words.values())
'top_words': self.prepare_words(self.top_words)
})
else:
......@@ -134,9 +136,6 @@ class WordCloudModule(WordCloudFields, XModule):
self.all_words = temp_all_words
return self.get_state_json()
elif dispatch == 'get_state':
return self.get_state_json()
else:
return json.dumps({
'status': 'fail',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment