Skip to content

Commit

Permalink
Added logs
Browse files Browse the repository at this point in the history
  • Loading branch information
krishna-ts authored Jul 11, 2024
1 parent 2a987c2 commit abfb257
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 14 deletions.
2 changes: 1 addition & 1 deletion common/djangoapps/student/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
17 changes: 5 additions & 12 deletions lms/djangoapps/course_home_api/assessments/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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):
"""
Expand Down Expand Up @@ -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']:
Expand All @@ -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 "-"
Expand Down
2 changes: 1 addition & 1 deletion lms/templates/user_assessment_tracker_link.html
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ <h1>Assessment Tracker</h1>
<td>-</td>
<td>{{ item.start_date }}</td>
<td>{{ item.date }}</td>
<td>{{ item.assignment_type }}</td>
<td>-</td>
<td>{{ item.is_graded }}</td>
</tr>
{% endfor %}
Expand Down

0 comments on commit abfb257

Please sign in to comment.