From 0e3353d489fd54a2c84c712ae04e44a9f8d8cd90 Mon Sep 17 00:00:00 2001 From: prathamesh Date: Wed, 19 Dec 2018 13:46:40 +0530 Subject: Provide API version 1 for Yaksh - Serializers for Question, Quiz, QuestionPaper, AnswerPaper - Can create questions, quizzes, question and answer papers - Can check mcq, mcc and code questions - Tests for the API --- yaksh/models.py | 1 + 1 file changed, 1 insertion(+) (limited to 'yaksh') diff --git a/yaksh/models.py b/yaksh/models.py index 60b09c5..e3212fd 100644 --- a/yaksh/models.py +++ b/yaksh/models.py @@ -1509,6 +1509,7 @@ class QuestionPaper(models.Model): for question_set in self.random_questions.all(): marks += question_set.marks * question_set.num_questions self.total_marks = marks + self.save() def _get_questions_for_answerpaper(self): """ Returns fixed and random questions for the answer paper""" -- cgit From 7d75a279112bce3969d2d4a2b70d74dd67570e29 Mon Sep 17 00:00:00 2001 From: CruiseDevice Date: Mon, 30 Mar 2020 20:39:55 +0530 Subject: Show question test_cases, exclude unncessary fields from API --- yaksh/models.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'yaksh') diff --git a/yaksh/models.py b/yaksh/models.py index 949b87e..813453d 100644 --- a/yaksh/models.py +++ b/yaksh/models.py @@ -1426,6 +1426,19 @@ class Question(models.Model): tc_list.extend(test_case) return tc_list + def get_test_cases_as_dict(self, **kwargs): + tc_list = [] + for tc in self.testcase_set.values_list("type", flat=True).distinct(): + test_case_ctype = ContentType.objects.get(app_label="yaksh", + model=tc) + test_case = test_case_ctype.get_all_objects_for_this_type( + question=self, + **kwargs + ) + for tc in test_case: + tc_list.append(model_to_dict(tc)) + return tc_list + def get_test_case(self, **kwargs): for tc in self.testcase_set.all(): test_case_type = tc.type -- cgit From d94f28984782e2fd14f7730dff29a078cf6976c0 Mon Sep 17 00:00:00 2001 From: adityacp Date: Tue, 21 Apr 2020 17:31:26 +0530 Subject: Replace students list of names with a drop down --- yaksh/static/yaksh/css/custom.css | 7 +++++++ yaksh/templates/yaksh/grade_user.html | 24 +++++++++++++----------- 2 files changed, 20 insertions(+), 11 deletions(-) (limited to 'yaksh') diff --git a/yaksh/static/yaksh/css/custom.css b/yaksh/static/yaksh/css/custom.css index 63ee455..c3050d5 100644 --- a/yaksh/static/yaksh/css/custom.css +++ b/yaksh/static/yaksh/css/custom.css @@ -97,3 +97,10 @@ body, .dropdown-menu { min-height: 100vh; transition: all 0.3s; } + +@media (min-width: 1024px) { + + .students-list { + position: fixed !important; + } +} diff --git a/yaksh/templates/yaksh/grade_user.html b/yaksh/templates/yaksh/grade_user.html index 7206525..14666e1 100644 --- a/yaksh/templates/yaksh/grade_user.html +++ b/yaksh/templates/yaksh/grade_user.html @@ -87,16 +87,17 @@ $(document).ready(function()
{% if status == "grade" %} {% if users %} -
- +
+
+ +
{% else %}
@@ -110,7 +111,8 @@ $(document).ready(function() {% endif %} {% endif %} -
+
+
{% if has_quiz_assignments %}  Download All Assignments -- cgit From d5cdfe91335af6c79231d41453991af29a39e96e Mon Sep 17 00:00:00 2001 From: adityacp Date: Sat, 25 Apr 2020 10:57:51 +0530 Subject: Add a search bar to search users --- yaksh/templates/yaksh/grade_user.html | 36 ++++++++++++++++++++++++++++++++--- 1 file changed, 33 insertions(+), 3 deletions(-) (limited to 'yaksh') diff --git a/yaksh/templates/yaksh/grade_user.html b/yaksh/templates/yaksh/grade_user.html index 14666e1..f4c7d67 100644 --- a/yaksh/templates/yaksh/grade_user.html +++ b/yaksh/templates/yaksh/grade_user.html @@ -15,7 +15,24 @@ $(document).ready(function() { $("#marks_table").tablesorter({sortList: [[2,1]]}); }); +function searchNames() { + var input, filter, ul, li, a, i, txtValue; + input = document.getElementById('myInput'); + filter = input.value.toUpperCase(); + $("#myUL").toggle(); + ul = document.getElementById("myUL"); + li = ul.getElementsByTagName('li'); + for (i = 0; i < li.length; i++) { + a = li[i].getElementsByTagName("a")[0]; + txtValue = a.textContent || a.innerText; + if (txtValue.toUpperCase().indexOf(filter) > -1) { + li[i].style.display = ""; + } else { + li[i].style.display = "none"; + } + } +} {% endblock script %} @@ -92,8 +109,8 @@ $(document).ready(function() @@ -112,7 +129,6 @@ $(document).ready(function() {% endif %} {% endfor %} {% endif %} + {% if status == "grade" and users %} + + + {% endif %} {% if data %} +
Student Details -- cgit