Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
edx-platform-release
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hsin-Yu Chien
edx-platform-release
Commits
c51d121f
Commit
c51d121f
authored
6 years ago
by
rabiaiftikhar
Browse files
Options
Downloads
Patches
Plain Diff
EDUCATOR-2774 add new condition for cert eligible column in grade report
parent
1f490a66
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lms/djangoapps/certificates/models.py
+5
-4
5 additions, 4 deletions
lms/djangoapps/certificates/models.py
lms/djangoapps/certificates/tests/tests.py
+3
-1
3 additions, 1 deletion
lms/djangoapps/certificates/tests/tests.py
with
8 additions
and
5 deletions
lms/djangoapps/certificates/models.py
+
5
−
4
View file @
c51d121f
...
...
@@ -570,12 +570,13 @@ def certificate_info_for_user(user, course_id, grade, user_is_whitelisted, user_
"""
certificate_is_delivered
=
'
N
'
certificate_type
=
'
N/A
'
eligible_for_certificate
=
'
Y
'
if
(
user_is_whitelisted
or
grade
is
not
None
)
and
user
.
profile
.
allow_certificate
\
else
'
N
'
status
=
certificate_status
(
user_certificate
)
can_have_certificate
=
CourseOverview
.
get_from_id
(
course_id
).
may_certify
()
certificate_generated
=
status
[
'
status
'
]
==
CertificateStatuses
.
downloadable
can_have_certificate
=
CourseOverview
.
get_from_id
(
course_id
).
may_certify
()
eligible_for_certificate
=
'
Y
'
if
(
user_is_whitelisted
or
grade
is
not
None
or
certificate_generated
)
\
and
user
.
profile
.
allow_certificate
else
'
N
'
if
certificate_generated
and
can_have_certificate
:
certificate_is_delivered
=
'
Y
'
certificate_type
=
status
[
'
mode
'
]
...
...
This diff is collapsed.
Click to expand it.
lms/djangoapps/certificates/tests/tests.py
+
3
−
1
View file @
c51d121f
...
...
@@ -90,7 +90,9 @@ class CertificatesModelTest(ModuleStoreTestCase, MilestonesTestCaseMixin):
{
'
allow_certificate
'
:
True
,
'
whitelisted
'
:
True
,
'
grade
'
:
None
,
'
output
'
:
[
'
Y
'
,
'
Y
'
,
'
honor
'
]},
{
'
allow_certificate
'
:
True
,
'
whitelisted
'
:
False
,
'
grade
'
:
0.9
,
'
output
'
:
[
'
Y
'
,
'
Y
'
,
'
honor
'
]},
{
'
allow_certificate
'
:
False
,
'
whitelisted
'
:
True
,
'
grade
'
:
0.8
,
'
output
'
:
[
'
N
'
,
'
Y
'
,
'
honor
'
]},
{
'
allow_certificate
'
:
False
,
'
whitelisted
'
:
None
,
'
grade
'
:
0.8
,
'
output
'
:
[
'
N
'
,
'
Y
'
,
'
honor
'
]}
{
'
allow_certificate
'
:
False
,
'
whitelisted
'
:
None
,
'
grade
'
:
0.8
,
'
output
'
:
[
'
N
'
,
'
Y
'
,
'
honor
'
]},
{
'
allow_certificate
'
:
True
,
'
whitelisted
'
:
None
,
'
grade
'
:
None
,
'
output
'
:
[
'
Y
'
,
'
Y
'
,
'
honor
'
]},
{
'
allow_certificate
'
:
False
,
'
whitelisted
'
:
True
,
'
grade
'
:
None
,
'
output
'
:
[
'
N
'
,
'
Y
'
,
'
honor
'
]}
)
def
test_certificate_info_for_user_when_grade_changes
(
self
,
allow_certificate
,
whitelisted
,
grade
,
output
):
"""
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment