Merge pull request #14771 from edx/neem/grade-only-for-engaged

Grade only engaged learners
This commit is contained in:
Eric Fischer
2017-04-11 14:04:06 -04:00
committed by GitHub
41 changed files with 958 additions and 692 deletions

View File

@@ -115,7 +115,7 @@ class CourseEndingTest(TestCase):
)
cert_status = {'status': 'generating', 'grade': '67', 'mode': 'honor'}
with patch('lms.djangoapps.grades.new.course_grade.CourseGradeFactory.get_persisted') as patch_persisted_grade:
with patch('lms.djangoapps.grades.new.course_grade_factory.CourseGradeFactory.read') as patch_persisted_grade:
patch_persisted_grade.return_value = Mock(percent=100)
self.assertEqual(
_cert_info(user, course, cert_status, course_mode),

View File

@@ -68,7 +68,7 @@ from certificates.api import ( # pylint: disable=import-error
get_certificate_url,
has_html_certificates_enabled,
)
from lms.djangoapps.grades.new.course_grade import CourseGradeFactory
from lms.djangoapps.grades.new.course_grade_factory import CourseGradeFactory
from xmodule.modulestore.django import modulestore
from opaque_keys import InvalidKeyError
@@ -423,7 +423,7 @@ def _cert_info(user, course_overview, cert_status, course_mode): # pylint: disa
)
if status in {'generating', 'ready', 'notpassing', 'restricted', 'auditing', 'unverified'}:
persisted_grade = CourseGradeFactory().get_persisted(user, course_overview)
persisted_grade = CourseGradeFactory().read(user, course=course_overview)
if persisted_grade is not None:
status_dict['grade'] = unicode(persisted_grade.percent)
elif 'grade' in cert_status:

View File

@@ -14,7 +14,7 @@ class ProgressPage(CoursePage):
def is_browser_on_page(self):
is_present = (
self.q(css='.course-info').present and
self.q(css='#grade-detail-graph').present
self.q(css='.grade-detail-graph').present
)
return is_present
@@ -115,7 +115,7 @@ class ProgressPage(CoursePage):
Return the CSS index of the chapter with `title`.
Returns `None` if it cannot find such a chapter.
"""
chapter_css = '.chapters section .hd'
chapter_css = '.chapters>section h3'
chapter_titles = self.q(css=chapter_css).map(lambda el: el.text.lower().strip()).results
try: