Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 0.239.0 #5351

Merged
merged 8 commits into from
Sep 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 0 additions & 41 deletions .github/PULL_REQUEST_TEMPLATE/pull_request_template.md

This file was deleted.

34 changes: 0 additions & 34 deletions .github/pull_request_template.md

This file was deleted.

11 changes: 11 additions & 0 deletions RELEASE.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
Release Notes
=============

Version 0.239.0
---------------

- Revert "Use poetry for python dependency management (#5345)" (#5350)
- Use poetry for python dependency management (#5345)
- Remove President's quote (#5346)
- Delete PR Template
- Delete PR Template
- Delete PR Template
- Update the Program record to display grades properly (#5341)

Version 0.238.0 (Released May 01, 2023)
---------------

Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.238.0
0.239.0
11 changes: 9 additions & 2 deletions certificates/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,12 +259,19 @@ def get_context_data(self, **kwargs):
for course in courses:
best_grade = mmtrack.get_best_final_grade_for_course(course)
combined_grade = CombinedFinalGrade.objects.filter(user=user, course=course).first()
letter_grade = convert_to_letter(combined_grade.grade) if combined_grade else ""
earned = get_certificate_url(mmtrack, course)
if best_grade and best_grade.is_already_combined:
combined_grade = best_grade
letter_grade = convert_to_letter(best_grade.grade_percent)
earned = best_grade.passed

context['courses'].append({
"title": course.title,
"edx_course_key": best_grade.course_run.edx_course_key if best_grade else "",
"attempts": mmtrack.get_course_proctorate_exam_results(course).count(),
"letter_grade": convert_to_letter(combined_grade.grade) if combined_grade else "",
"status": "Earned" if get_certificate_url(mmtrack, course) else "Not Earned",
"letter_grade": letter_grade,
"status": "Earned" if earned else "Not Earned",
"date_earned": combined_grade.created_on if combined_grade else "",
"overall_grade": mmtrack.get_overall_final_grade_for_course(course),
"elective_tag": "elective" if (getattr(course, "electivecourse", None) is not None) else "core"
Expand Down
5 changes: 0 additions & 5 deletions cms/templates/cms/home_page.html
Original file line number Diff line number Diff line change
Expand Up @@ -219,11 +219,6 @@ <h3>Join Us at Our Free Online Events</h3>
</section>
{% include "faqs.html" %}
<section class="quote-section">
<div class="row quote">
<img class="person" src="{% static 'images/reif1.png' %}" alt="">
<blockquote class="quote-text">“We will find people who never thought they would be able to apply to MIT. And they will discover that they are much stronger in the global competition than they think.”</blockquote>
<p class="quote-author">Rafael Reif, MIT President </p>
</div>
<div class="row quote">
<img class="person" src="{% static 'images/grimson.png' %}" alt="">
<blockquote class="quote-text">“MicroMasters Programs offer unprecedented access points to advanced degrees, as well as to accelerated professional growth in some of the world's most in-demand fields. Through these programs, learners worldwide can gain the experience of a masters-level course of study, but also the confidence of thriving in an MIT-caliber education.”</blockquote>
Expand Down
11 changes: 4 additions & 7 deletions dashboard/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@
from decimal import Decimal
from math import floor

import datetime

import pytz
from django.db import transaction
from django.db.models import Q, Count
from django.urls import reverse
Expand All @@ -16,7 +13,7 @@
from dashboard.api_edx_cache import CachedEdxUserData
from dashboard.models import ProgramEnrollment
from ecommerce.models import Order, Line
from grades.constants import FinalGradeStatus
from grades.constants import FinalGradeStatus, NEW_COMBINED_FINAL_GRADES_DATE
from grades.models import (
FinalGrade,
ProctoredExamGrade,
Expand Down Expand Up @@ -389,7 +386,7 @@ def has_passed_course(self, course):
return FinalGrade.objects.filter(
user=self.user,
course_run__course_id=course.id,
course_run__start_date__gt=datetime.datetime(2022, 9, 1, tzinfo=pytz.UTC),
course_run__start_date__gt=NEW_COMBINED_FINAL_GRADES_DATE,
).passed().exists()
else:
return self.final_grade_qset.filter(course_run__course_id=course.id).passed().exists()
Expand Down Expand Up @@ -453,7 +450,7 @@ def get_overall_final_grade_for_course(self, course):
best_grade = self.get_best_final_grade_for_course(course)
if best_grade is None:
return ""
if not course.has_exam:
if not course.has_exam or best_grade.is_already_combined:
return str(round(best_grade.grade_percent))

combined_grade = CombinedFinalGrade.objects.filter(user=self.user, course=course)
Expand Down Expand Up @@ -567,7 +564,7 @@ def get_number_of_passed_courses(self, course_ids):
course_ids_passing_grade = FinalGrade.objects.filter(
user=self.user,
course_run__course_id__in=course_ids,
course_run__start_date__gt=datetime.datetime(2022, 9, 1, tzinfo=pytz.UTC),
course_run__start_date__gt=NEW_COMBINED_FINAL_GRADES_DATE,
).passed().values_list('course_run__course__id', flat=True).distinct()
num_certs = MicromastersCourseCertificate.objects.filter(
user=self.user,
Expand Down
17 changes: 14 additions & 3 deletions dashboard/utils_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
from ecommerce.models import Order
from exams.factories import ExamProfileFactory, ExamAuthorizationFactory, ExamRunFactory
from exams.models import ExamProfile, ExamAuthorization
from grades.constants import NEW_COMBINED_FINAL_GRADES_DATE
from grades.factories import FinalGradeFactory, ProctoredExamGradeFactory
from grades.models import FinalGrade, MicromastersProgramCertificate, CombinedFinalGrade, \
MicromastersProgramCommendation, CourseRunGradingStatus
Expand Down Expand Up @@ -863,7 +864,8 @@ def test_get_best_final_grade_for_course(self):
FinalGradeFactory.create(user=self.user, course_run=course_run, grade=grade, passed=True)
assert mmtrack.get_best_final_grade_for_course(finaid_course).grade == 0.8

def test_get_overall_final_grade_for_course(self):
@ddt.data(True, False)
def test_get_overall_final_grade_for_course(self, before_exam_merge):
"""
Test for get_overall_final_grade_for_course to return CombinedFinalGrade for course
"""
Expand All @@ -877,8 +879,17 @@ def test_get_overall_final_grade_for_course(self):
FinalGradeFactory.create(user=self.user, course_run=self.crun_fa, passed=True, grade=0.8)
assert mmtrack.get_overall_final_grade_for_course(finaid_course) == "80"
ExamRunFactory.create(course=finaid_course)
CombinedFinalGrade.objects.create(user=self.user, course=finaid_course, grade="74")
assert mmtrack.get_overall_final_grade_for_course(finaid_course) == "74"
if before_exam_merge:
# if the course run end date is before Fall 2022
self.crun_fa.start_date = NEW_COMBINED_FINAL_GRADES_DATE - timedelta(days=1)
self.crun_fa.save()
CombinedFinalGrade.objects.create(user=self.user, course=finaid_course, grade="74")
assert mmtrack.get_overall_final_grade_for_course(finaid_course) == "74"
else:
self.crun_fa.start_date = NEW_COMBINED_FINAL_GRADES_DATE + timedelta(days=1)
self.crun_fa.save()
CombinedFinalGrade.objects.create(user=self.user, course=finaid_course, grade="80")
assert mmtrack.get_overall_final_grade_for_course(finaid_course) == "80"

def test_get_best_proctored_exam_grade(self):
"""
Expand Down
4 changes: 4 additions & 0 deletions grades/constants.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
"""
Constants for the grades app
"""
import datetime
import pytz

COURSE_GRADE_WEIGHT = 0.4
EXAM_GRADE_WEIGHT = 0.6

NEW_COMBINED_FINAL_GRADES_DATE = datetime.datetime(2022, 9, 1, tzinfo=pytz.UTC)


class FinalGradeStatus:
"""
Expand Down
9 changes: 8 additions & 1 deletion grades/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
)
from exams.models import ExamRun
from exams.constants import EXAM_GRADE_PASS, EXAM_GRADE_FAIL
from grades.constants import FinalGradeStatus
from grades.constants import FinalGradeStatus, NEW_COMBINED_FINAL_GRADES_DATE
from micromasters.models import (
AuditableModel,
AuditModel,
Expand Down Expand Up @@ -102,6 +102,13 @@ def grade_percent(self):
"""Returns the grade field value as a number out of 100 (or None if the value is None)"""
return self.grade * 100 if self.grade is not None else None

@property
def is_already_combined(self):
"""
Returns true if this grade is for a course run that started after Sept 1st, 2022
"""
return self.course_run.start_date > NEW_COMBINED_FINAL_GRADES_DATE

@classmethod
def get_frozen_users(cls, course_run):
"""
Expand Down
20 changes: 0 additions & 20 deletions pull_request_template.md

This file was deleted.

Loading