update
This commit is contained in:
@@ -94,12 +94,12 @@ class FlowchartStatisticsAPI(APIView):
|
|||||||
criteria_counts = Counter()
|
criteria_counts = Counter()
|
||||||
criteria_max = {}
|
criteria_max = {}
|
||||||
|
|
||||||
suggestions_texts = []
|
feedback_texts = []
|
||||||
|
|
||||||
for row in submissions.values_list(
|
for row in submissions.values_list(
|
||||||
"ai_criteria_details", "ai_suggestions"
|
"ai_criteria_details", "ai_feedback"
|
||||||
).iterator():
|
).iterator():
|
||||||
details, suggestions = row
|
details, feedback = row
|
||||||
if details and isinstance(details, dict):
|
if details and isinstance(details, dict):
|
||||||
for key, val in details.items():
|
for key, val in details.items():
|
||||||
if isinstance(val, dict) and "score" in val:
|
if isinstance(val, dict) and "score" in val:
|
||||||
@@ -107,8 +107,8 @@ class FlowchartStatisticsAPI(APIView):
|
|||||||
criteria_counts[key] += 1
|
criteria_counts[key] += 1
|
||||||
if key not in criteria_max:
|
if key not in criteria_max:
|
||||||
criteria_max[key] = val.get("max", 100)
|
criteria_max[key] = val.get("max", 100)
|
||||||
if suggestions:
|
if feedback:
|
||||||
suggestions_texts.append(suggestions)
|
feedback_texts.append(feedback)
|
||||||
|
|
||||||
criteria_averages = {}
|
criteria_averages = {}
|
||||||
for key in criteria_totals:
|
for key in criteria_totals:
|
||||||
@@ -131,8 +131,8 @@ class FlowchartStatisticsAPI(APIView):
|
|||||||
real_name = get_real_name(uname, class_name)
|
real_name = get_real_name(uname, class_name)
|
||||||
unaccepted.append({"username": uname, "real_name": real_name})
|
unaccepted.append({"username": uname, "real_name": real_name})
|
||||||
|
|
||||||
# 5. Word cloud from suggestions
|
# 5. Word cloud from feedback
|
||||||
word_freq = self._build_word_frequencies(suggestions_texts)
|
word_freq = self._build_word_frequencies(feedback_texts)
|
||||||
|
|
||||||
return self.success({
|
return self.success({
|
||||||
"total_count": total_count,
|
"total_count": total_count,
|
||||||
|
|||||||
Reference in New Issue
Block a user