From abfb2571287ea5baa9db0ca55263f4db7b5f4ded Mon Sep 17 00:00:00 2001 From: krishna-ts Date: Thu, 11 Jul 2024 20:59:04 +0530 Subject: [PATCH] Added logs --- common/djangoapps/student/helpers.py | 2 +- .../course_home_api/assessments/serializers.py | 17 +++++------------ lms/templates/user_assessment_tracker_link.html | 2 +- 3 files changed, 7 insertions(+), 14 deletions(-) diff --git a/common/djangoapps/student/helpers.py b/common/djangoapps/student/helpers.py index be152269037c..26310c7220f8 100644 --- a/common/djangoapps/student/helpers.py +++ b/common/djangoapps/student/helpers.py @@ -63,7 +63,7 @@ from openedx.core.djangoapps.enrollments.data import get_course_enrollments from opaque_keys.edx.keys import CourseKey -from lms.djangoapps.course_home_api.assessments.serializers import AssessmentsSerializer, CustomGradesSerializer +from lms.djangoapps.course_home_api.assessments.serializers import AssessmentsSerializer from lms.djangoapps.course_home_api.utils import get_course_or_403 from lms.djangoapps.courseware.access import has_access from lms.djangoapps.courseware.masquerade import setup_masquerade diff --git a/lms/djangoapps/course_home_api/assessments/serializers.py b/lms/djangoapps/course_home_api/assessments/serializers.py index 63d9cb19d705..f7ee31d70bc1 100644 --- a/lms/djangoapps/course_home_api/assessments/serializers.py +++ b/lms/djangoapps/course_home_api/assessments/serializers.py @@ -4,12 +4,15 @@ """ import pytz +import logging from datetime import datetime from rest_framework import serializers from lms.djangoapps.courseware.date_summary import VerificationDeadlineDate from lms.djangoapps.course_home_api.serializers import ReadOnlySerializer +log = logging.getLogger("edx.student") + class SubsectionScoresSerializer(ReadOnlySerializer): """ Serializer for subsections in section_scores @@ -65,18 +68,6 @@ class SectionScoresSerializer(ReadOnlySerializer): Serializer for sections in section_scores """ subsections = SubsectionScoresSerializer(source='sections', many=True) - - -class CustomGradesSerializer(): - section_scores = SectionScoresSerializer(many=True) - - def to_representation(self, instance): - representation = super().to_representation(instance) - merged_subsections = [] - for section in representation['section_scores']: - merged_subsections.extend(section['subsections']) - return {'subsections': merged_subsections} - class AssessmentsSerializerDatesSummary(serializers.Serializer): """ @@ -127,6 +118,7 @@ def to_representation(self, instance): for section in representation['section_scores']: merged_subsections.extend(section['subsections']) + log.info(merged_subsections) # Add course name to each date_block start_date = "" for date_block in representation['date_blocks']: @@ -141,6 +133,7 @@ def to_representation(self, instance): def check_grade(self, merged_subsections, first_component_block_id): if merged_subsections and first_component_block_id: for each_one in merged_subsections: + log.info(each_one["has_graded_assignment"]) if each_one["block_key"]==first_component_block_id: return "Graded" if each_one["has_graded_assignment"] else "Under Review" return "-" diff --git a/lms/templates/user_assessment_tracker_link.html b/lms/templates/user_assessment_tracker_link.html index 136c63d9825e..321eb2b651fe 100644 --- a/lms/templates/user_assessment_tracker_link.html +++ b/lms/templates/user_assessment_tracker_link.html @@ -97,7 +97,7 @@

Assessment Tracker

- {{ item.start_date }} {{ item.date }} - {{ item.assignment_type }} + - {{ item.is_graded }} {% endfor %}