Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
6fe06382
Commit
6fe06382
authored
Mar 10, 2016
by
aamir-khan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove the certificate generation button from progress page for audit student
parent
76b8e2e8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
3 deletions
+28
-3
lms/djangoapps/courseware/tests/test_views.py
+23
-2
lms/djangoapps/courseware/views.py
+5
-1
No files found.
lms/djangoapps/courseware/tests/test_views.py
View file @
6fe06382
...
...
@@ -857,7 +857,7 @@ class ProgressPageTests(ModuleStoreTestCase):
)
self
.
course
=
modulestore
()
.
get_course
(
course
.
id
)
CourseEnrollmentFactory
(
user
=
self
.
user
,
course_id
=
self
.
course
.
id
)
CourseEnrollmentFactory
(
user
=
self
.
user
,
course_id
=
self
.
course
.
id
,
mode
=
CourseMode
.
HONOR
)
self
.
chapter
=
ItemFactory
.
create
(
category
=
'chapter'
,
parent_location
=
self
.
course
.
location
)
self
.
section
=
ItemFactory
.
create
(
category
=
'sequential'
,
parent_location
=
self
.
chapter
.
location
)
...
...
@@ -1044,7 +1044,7 @@ class ProgressPageTests(ModuleStoreTestCase):
self
.
assertContains
(
resp
,
u"Download Your Certificate"
)
@ddt.data
(
*
itertools
.
product
(((
4
0
,
4
,
True
),
(
40
,
4
,
False
)),
(
True
,
False
))
*
itertools
.
product
(((
4
1
,
4
,
True
),
(
41
,
4
,
False
)),
(
True
,
False
))
)
@ddt.unpack
def
test_query_counts
(
self
,
(
sql_calls
,
mongo_calls
,
self_paced
),
self_paced_enabled
):
...
...
@@ -1055,6 +1055,27 @@ class ProgressPageTests(ModuleStoreTestCase):
resp
=
views
.
progress
(
self
.
request
,
course_id
=
unicode
(
self
.
course
.
id
))
self
.
assertEqual
(
resp
.
status_code
,
200
)
@patch
(
'courseware.grades.grade'
,
Mock
(
return_value
=
{
'grade'
:
'Pass'
,
'percent'
:
0.75
,
'section_breakdown'
:
[],
'grade_breakdown'
:
[]
}))
@ddt.data
(
(
CourseMode
.
AUDIT
,
False
),
(
CourseMode
.
HONOR
,
True
),
(
CourseMode
.
VERIFIED
,
True
),
(
CourseMode
.
PROFESSIONAL
,
True
),
(
CourseMode
.
NO_ID_PROFESSIONAL_MODE
,
True
),
(
CourseMode
.
CREDIT_MODE
,
True
),
)
@ddt.unpack
def
test_show_certificate_request_button
(
self
,
course_mode
,
show_button
):
"""Verify that the Request Certificate is not displayed in audit mode."""
CertificateGenerationConfiguration
(
enabled
=
True
)
.
save
()
certs_api
.
set_cert_generation_enabled
(
self
.
course
.
id
,
True
)
CourseEnrollment
.
enroll
(
self
.
user
,
self
.
course
.
id
,
mode
=
course_mode
)
resp
=
views
.
progress
(
self
.
request
,
course_id
=
unicode
(
self
.
course
.
id
))
self
.
assertEqual
(
show_button
,
'Request Certificate'
in
resp
.
content
)
@attr
(
'shard_1'
)
class
VerifyCourseKeyDecoratorTests
(
TestCase
):
...
...
lms/djangoapps/courseware/views.py
View file @
6fe06382
...
...
@@ -1043,7 +1043,11 @@ def _progress(request, course_key, student_id):
raise
Http404
# checking certificate generation configuration
show_generate_cert_btn
=
certs_api
.
cert_generation_enabled
(
course_key
)
enrollment_mode
,
is_active
=
CourseEnrollment
.
enrollment_mode_for_user
(
student
,
course_key
)
show_generate_cert_btn
=
(
is_active
and
CourseMode
.
is_eligible_for_certificate
(
enrollment_mode
)
and
certs_api
.
cert_generation_enabled
(
course_key
)
)
context
=
{
'course'
:
course
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment