'Return success json answer for client.'

def get_state(self):

    if self.submitted:
        total_count = sum(self.all_words.itervalues())
        return json.dumps({'status': 'success', 'submitted': True, 'display_student_percents': pretty_bool(self.display_student_percents), 'student_words': {word: self.all_words[word] for word in self.student_words}, 'total_count': total_count, 'top_words': self.prepare_words(self.top_words, total_count)})
    else:
        return json.dumps({'status': 'success', 'submitted': False, 'display_student_percents': False, 'student_words': {}, 'total_count': 0, 'top_words': {}})
