From cf57affd358b0d2dd278ca97a65ed4739d046559 Mon Sep 17 00:00:00 2001 From: ankitjavalkar Date: Thu, 24 Sep 2020 14:14:57 +0530 Subject: Add katex CDN --- yaksh/static/yaksh/js/lesson.js | 2 +- yaksh/templates/base.html | 9 +++++++++ yaksh/templates/yaksh/add_module.html | 3 +-- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/yaksh/static/yaksh/js/lesson.js b/yaksh/static/yaksh/js/lesson.js index 6eaf6c6..5ebb9bc 100644 --- a/yaksh/static/yaksh/js/lesson.js +++ b/yaksh/static/yaksh/js/lesson.js @@ -35,7 +35,7 @@ $(document).ready(function(){ function preview_text(data) { $("#description_body").empty(); $("#description_body").html(data); - MathJax.Hub.Queue(["Typeset",MathJax.Hub]); + // MathJax.Hub.Queue(["Typeset",MathJax.Hub]); } $("#embed").click(function() { diff --git a/yaksh/templates/base.html b/yaksh/templates/base.html index c70c265..10f9661 100644 --- a/yaksh/templates/base.html +++ b/yaksh/templates/base.html @@ -20,6 +20,8 @@ + + {% block meta %} @@ -37,6 +39,13 @@ + + + + + + - + {% endblock %} {% block css %} -- cgit From 3e41537f022dd151ff7081d0a3441926d6e02756 Mon Sep 17 00:00:00 2001 From: ankitjavalkar Date: Thu, 24 Sep 2020 14:16:15 +0530 Subject: Remove comments --- yaksh/static/yaksh/js/lesson.js | 1 - yaksh/templates/yaksh/add_module.html | 1 - 2 files changed, 2 deletions(-) diff --git a/yaksh/static/yaksh/js/lesson.js b/yaksh/static/yaksh/js/lesson.js index 5ebb9bc..f582778 100644 --- a/yaksh/static/yaksh/js/lesson.js +++ b/yaksh/static/yaksh/js/lesson.js @@ -35,7 +35,6 @@ $(document).ready(function(){ function preview_text(data) { $("#description_body").empty(); $("#description_body").html(data); - // MathJax.Hub.Queue(["Typeset",MathJax.Hub]); } $("#embed").click(function() { diff --git a/yaksh/templates/yaksh/add_module.html b/yaksh/templates/yaksh/add_module.html index fe423a6..94f9402 100644 --- a/yaksh/templates/yaksh/add_module.html +++ b/yaksh/templates/yaksh/add_module.html @@ -11,7 +11,6 @@ - {% endblock %} {% block css %} -- cgit From be55d8d11098ce7fa2b9cfc3e2e7bb0d5bc8efc2 Mon Sep 17 00:00:00 2001 From: ankitjavalkar Date: Mon, 28 Sep 2020 11:08:02 +0530 Subject: Display file names of uploaded files in question files --- yaksh/templates/yaksh/question.html | 9 +++++++++ yaksh/views.py | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/yaksh/templates/yaksh/question.html b/yaksh/templates/yaksh/question.html index 3f7e67e..2dbfeed 100644 --- a/yaksh/templates/yaksh/question.html +++ b/yaksh/templates/yaksh/question.html @@ -276,6 +276,15 @@ question_type = "{{ question.type }}"; {% if question.type == "upload" %}

Upload assignment file for the said question

+ {% if assignment_files %} +

+ {% endif %} {% endif %} diff --git a/yaksh/views.py b/yaksh/views.py index 41f367d..859ce3b 100644 --- a/yaksh/views.py +++ b/yaksh/views.py @@ -668,6 +668,7 @@ def show_question(request, question, paper, error_message=None, quiz = paper.question_paper.quiz quiz_type = 'Exam' can_skip = False + assignment_files = [] if previous_question: delay_time = paper.time_left_on_question(previous_question) else: @@ -709,6 +710,13 @@ def show_question(request, question, paper, error_message=None, test_cases = question.get_ordered_test_cases(paper) else: test_cases = question.get_test_cases() + if question.type == 'upload': + assignment_files = AssignmentUpload.objects.filter( + assignmentQuestion_id=question.id, + course_id=course_id, + user=request.user, + question_paper_id=paper.question_paper_id + ) files = FileUpload.objects.filter(question_id=question.id, hide=False) course = Course.objects.get(id=course_id) module = course.learning_module.get(id=module_id) @@ -728,6 +736,7 @@ def show_question(request, question, paper, error_message=None, 'delay_time': delay_time, 'quiz_type': quiz_type, 'all_modules': all_modules, + 'assignment_files': assignment_files, } answers = paper.get_previous_answers(question) if answers: -- cgit From ba736ced194434e77909a178463e4cb41d6ee367 Mon Sep 17 00:00:00 2001 From: ankitjavalkar Date: Mon, 28 Sep 2020 18:11:08 +0530 Subject: Re calculate and save total marks of paper --- yaksh/models.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/yaksh/models.py b/yaksh/models.py index dc08307..1b76eed 100644 --- a/yaksh/models.py +++ b/yaksh/models.py @@ -1769,6 +1769,8 @@ class QuestionPaper(models.Model): for question in questions: marks += question.points for question_set in self.random_questions.all(): + question_set.marks = question_set.questions.first().points + question_set.save() marks += question_set.marks * question_set.num_questions self.total_marks = marks self.save() -- cgit From 668f3ab5b74977df1793393d596f489d15e2e830 Mon Sep 17 00:00:00 2001 From: ankitjavalkar Date: Tue, 29 Sep 2020 16:45:04 +0530 Subject: Fix tests --- yaksh/test_models.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yaksh/test_models.py b/yaksh/test_models.py index 7ef1ca7..11ab6cd 100644 --- a/yaksh/test_models.py +++ b/yaksh/test_models.py @@ -994,7 +994,7 @@ class QuestionPaperTestCases(unittest.TestCase): # create two QuestionSet for random questions # QuestionSet 1 self.question_set_1 = QuestionSet.objects.create( - marks=2, num_questions=2 + marks=1, num_questions=2 ) # add pool of questions for random sampling @@ -1007,7 +1007,7 @@ class QuestionPaperTestCases(unittest.TestCase): # QuestionSet 2 self.question_set_2 = QuestionSet.objects.create( - marks=3, num_questions=3 + marks=1, num_questions=3 ) # add pool of questions @@ -1074,7 +1074,7 @@ class QuestionPaperTestCases(unittest.TestCase): """ Test update_total_marks() method of Question Paper""" self.assertEqual(self.question_paper.total_marks, 0) self.question_paper.update_total_marks() - self.assertEqual(self.question_paper.total_marks, 15) + self.assertEqual(self.question_paper.total_marks, 7.0) def test_get_random_questions(self): """ Test get_random_questions() method of Question Paper""" -- cgit From c199eaa11b3fd2620551853d9857f0e3fcf13d53 Mon Sep 17 00:00:00 2001 From: ankitjavalkar Date: Tue, 29 Sep 2020 17:49:38 +0530 Subject: Release related changes --- CHANGELOG.txt | 7 +++++++ online_test/__init__.py | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index d94534b..9124125 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,3 +1,10 @@ +=== 0.25.0 (14-09-2020) === + +* Fix bug to show missing marks in grade user +* Recalculate and save total marks of paper after saving or changing +* Remove MathJax references and replace Katex CDN +* Add feature to allow to extend time even if the paper is completed + === 0.24.0 (09-09-2020) === * Fix rendering of the quiz list diff --git a/online_test/__init__.py b/online_test/__init__.py index 101b525..b9e8f77 100644 --- a/online_test/__init__.py +++ b/online_test/__init__.py @@ -4,4 +4,4 @@ from online_test.celery_settings import app as celery_app __all__ = ('celery_app',) -__version__ = '0.24.0' +__version__ = '0.25.0' -- cgit From f45e194246391926e3546efd73eb519a167f0fdd Mon Sep 17 00:00:00 2001 From: adityacp Date: Tue, 29 Sep 2020 21:51:36 +0530 Subject: Show assignment upload file in view answerpaper --- yaksh/views.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/yaksh/views.py b/yaksh/views.py index 859ce3b..907facb 100644 --- a/yaksh/views.py +++ b/yaksh/views.py @@ -1929,8 +1929,8 @@ def grade_user(request, quiz_id=None, user_id=None, attempt_number=None, course.is_teacher(current_user): raise Http404('This course does not belong to you') has_quiz_assignments = AssignmentUpload.objects.filter( - question_paper_id__in=questionpaper_id - ).exists() + course_id=course_id, question_paper_id__in=questionpaper_id + ).exists() context = { "users": user_details, "quiz_id": quiz_id, @@ -1949,9 +1949,9 @@ def grade_user(request, quiz_id=None, user_id=None, attempt_number=None, except IndexError: raise Http404('No attempts for paper') has_user_assignments = AssignmentUpload.objects.filter( - question_paper_id__in=questionpaper_id, - user_id=user_id - ).exists() + course_id=course_id, question_paper_id__in=questionpaper_id, + user_id=user_id + ).exists() user = User.objects.get(id=user_id) data = AnswerPaper.objects.get_user_data( user, questionpaper_id, course_id, attempt_number @@ -2212,12 +2212,12 @@ def view_answerpaper(request, questionpaper_id, course_id): if quiz.view_answerpaper and user in course.students.all(): data = AnswerPaper.objects.get_user_data(user, questionpaper_id, course_id) - has_user_assignment = AssignmentUpload.objects.filter( + has_user_assignments = AssignmentUpload.objects.filter( user=user, course_id=course.id, question_paper_id=questionpaper_id ).exists() context = {'data': data, 'quiz': quiz, 'course_id': course.id, - "has_user_assignment": has_user_assignment} + "has_user_assignments": has_user_assignments} return my_render_to_response( request, 'yaksh/view_answerpaper.html', context ) -- cgit