summaryrefslogtreecommitdiff
path: root/yaksh/models.py
diff options
context:
space:
mode:
authorPalaparthy Adityachandra2021-02-11 14:26:19 +0530
committerGitHub2021-02-11 14:26:19 +0530
commitb2bf7b9fef33d59cd1e55776a51577d66a252322 (patch)
tree0f95bec03075118e5310aba89c2b2ffe7d39b7c9 /yaksh/models.py
parent546458cd40d847015363f7c085d7f72733036498 (diff)
parent51039188a191a46afd4e3c499e2a035e3bc1ceba (diff)
downloadonline_test-b2bf7b9fef33d59cd1e55776a51577d66a252322.tar.gz
online_test-b2bf7b9fef33d59cd1e55776a51577d66a252322.tar.bz2
online_test-b2bf7b9fef33d59cd1e55776a51577d66a252322.zip
Merge pull request #818 from adityacp/hot_fix_3
Fix monitor to get all the attempts properly
Diffstat (limited to 'yaksh/models.py')
-rw-r--r--yaksh/models.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/yaksh/models.py b/yaksh/models.py
index 16800fe..11ddf8a 100644
--- a/yaksh/models.py
+++ b/yaksh/models.py
@@ -2037,8 +2037,11 @@ class AnswerPaperManager(models.Manager):
def _get_per_tc_data(answers, q_type):
tc = []
for answer in answers["answer"]:
- ans = literal_eval(answer) if answer else None
- tc.extend(ans) if q_type == "mcc" else tc.append(str(ans))
+ try:
+ ans = literal_eval(answer) if answer else None
+ tc.extend(ans) if q_type == "mcc" else tc.append(str(ans))
+ except Exception:
+ pass
return dict(Counter(tc))
df = pd.DataFrame(answers)
if not df.empty: