From 51039188a191a46afd4e3c499e2a035e3bc1ceba Mon Sep 17 00:00:00 2001
From: adityacp
Date: Thu, 11 Feb 2021 14:15:41 +0530
Subject: Fix monitor to get all the attempts properly
---
yaksh/models.py | 7 +++++--
yaksh/templates/yaksh/micromanaged.html | 2 +-
yaksh/templates/yaksh/monitor.html | 16 ++++++++++++++++
yaksh/urls.py | 2 ++
yaksh/views.py | 12 ++++++------
5 files changed, 30 insertions(+), 9 deletions(-)
(limited to 'yaksh')
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:
diff --git a/yaksh/templates/yaksh/micromanaged.html b/yaksh/templates/yaksh/micromanaged.html
index 5d7e58c..5339d71 100644
--- a/yaksh/templates/yaksh/micromanaged.html
+++ b/yaksh/templates/yaksh/micromanaged.html
@@ -12,7 +12,7 @@
Start Special Attempt
{% else %}
- Exhausted
+ Exhausted
{% endif %}
{% endif %}
diff --git a/yaksh/templates/yaksh/monitor.html b/yaksh/templates/yaksh/monitor.html
index 9b10b58..c7755e7 100644
--- a/yaksh/templates/yaksh/monitor.html
+++ b/yaksh/templates/yaksh/monitor.html
@@ -124,6 +124,22 @@ $(document).ready(function()
+