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
b05271c9
Commit
b05271c9
authored
May 31, 2012
by
Bridger Maxwell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added a feature flag, END_COURSE_ENABLED to enable the certificate request and exit survey.
parent
82a7f969
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
32 additions
and
20 deletions
+32
-20
djangoapps/certificates/views.py
+2
-1
djangoapps/courseware/views.py
+15
-13
djangoapps/student/views.py
+1
-1
settings.py
+3
-0
templates/profile.html
+6
-2
urls.py
+5
-3
No files found.
djangoapps/certificates/views.py
View file @
b05271c9
...
@@ -2,6 +2,7 @@ import json
...
@@ -2,6 +2,7 @@ import json
import
logging
import
logging
import
uuid
import
uuid
from
django.conf
import
settings
from
django.contrib.auth.decorators
import
login_required
from
django.contrib.auth.decorators
import
login_required
from
django.http
import
Http404
,
HttpResponse
from
django.http
import
Http404
,
HttpResponse
from
mitxmako.shortcuts
import
render_to_response
from
mitxmako.shortcuts
import
render_to_response
...
@@ -16,7 +17,7 @@ log = logging.getLogger("mitx.certificates")
...
@@ -16,7 +17,7 @@ log = logging.getLogger("mitx.certificates")
@login_required
@login_required
def
certificate_request
(
request
):
def
certificate_request
(
request
):
''' Attempt to send a certificate. '''
''' Attempt to send a certificate. '''
if
request
.
method
!=
"POST"
:
if
request
.
method
!=
"POST"
or
not
settings
.
END_COURSE_ENABLED
:
raise
Http404
raise
Http404
verification_checked
=
request
.
POST
.
get
(
'cert_request_verify'
,
'false'
)
verification_checked
=
request
.
POST
.
get
(
'cert_request_verify'
,
'false'
)
...
...
djangoapps/courseware/views.py
View file @
b05271c9
...
@@ -74,6 +74,19 @@ def profile(request, student_id = None):
...
@@ -74,6 +74,19 @@ def profile(request, student_id = None):
grade_sheet
=
grades
.
grade_sheet
(
student
)
grade_sheet
=
grades
.
grade_sheet
(
student
)
context
=
{
'name'
:
user_info
.
name
,
'username'
:
student
.
username
,
'location'
:
user_info
.
location
,
'language'
:
user_info
.
language
,
'email'
:
student
.
email
,
'format_url_params'
:
content_parser
.
format_url_params
,
'csrf'
:
csrf
(
request
)[
'csrf_token'
],
'grade_cutoffs'
:
course_settings
.
GRADE_CUTOFFS
,
'grade_sheet'
:
grade_sheet
,
}
if
settings
.
END_COURSE_ENABLED
:
took_survey
=
student_took_survey
(
user_info
)
took_survey
=
student_took_survey
(
user_info
)
generated_certificate
=
None
generated_certificate
=
None
...
@@ -88,20 +101,9 @@ def profile(request, student_id = None):
...
@@ -88,20 +101,9 @@ def profile(request, student_id = None):
#They haven't submited the request form
#They haven't submited the request form
certificate_requested
=
False
certificate_requested
=
False
context
.
update
({
'certificate_requested'
:
certificate_requested
,
context
=
{
'name'
:
user_info
.
name
,
'username'
:
student
.
username
,
'location'
:
user_info
.
location
,
'language'
:
user_info
.
language
,
'email'
:
student
.
email
,
'format_url_params'
:
content_parser
.
format_url_params
,
'csrf'
:
csrf
(
request
)[
'csrf_token'
],
'grade_cutoffs'
:
course_settings
.
GRADE_CUTOFFS
,
'grade_sheet'
:
grade_sheet
,
'certificate_requested'
:
certificate_requested
,
'certificate_download_url'
:
certificate_download_url
,
'certificate_download_url'
:
certificate_download_url
,
'took_survey'
:
took_survey
,
'took_survey'
:
took_survey
})
}
return
render_to_response
(
'profile.html'
,
context
)
return
render_to_response
(
'profile.html'
,
context
)
...
...
djangoapps/student/views.py
View file @
b05271c9
...
@@ -461,7 +461,7 @@ def accept_name_change(request):
...
@@ -461,7 +461,7 @@ def accept_name_change(request):
@login_required
@login_required
def
record_exit_survey
(
request
):
def
record_exit_survey
(
request
):
if
request
.
method
!=
"POST"
:
if
request
.
method
!=
"POST"
or
not
settings
.
END_COURSE_ENABLED
:
raise
Http404
raise
Http404
default_responses
=
{
default_responses
=
{
...
...
settings.py
View file @
b05271c9
...
@@ -5,6 +5,9 @@ import tempfile
...
@@ -5,6 +5,9 @@ import tempfile
import
djcelery
import
djcelery
# Enables certificate requests and the exit survey
END_COURSE_ENABLED
=
False
# from settings2.askbotsettings import LIVESETTINGS_OPTIONS
# from settings2.askbotsettings import LIVESETTINGS_OPTIONS
DEFAULT_GROUPS
=
[]
DEFAULT_GROUPS
=
[]
...
...
templates/profile.html
View file @
b05271c9
...
@@ -5,6 +5,7 @@
...
@@ -5,6 +5,7 @@
<
%!
<
%!
from
django
.
core
.
urlresolvers
import
reverse
from
django
.
core
.
urlresolvers
import
reverse
from
django
.
conf
import
settings
%
>
%
>
<
%
block
name=
"headextra"
>
<
%
block
name=
"headextra"
>
...
@@ -121,7 +122,7 @@ $(function() {
...
@@ -121,7 +122,7 @@ $(function() {
return
false
;
return
false
;
});
});
%
if
settings
.
END_COURSE_ENABLED
:
/*
/*
There is a fieldset, #survey_fieldset, which contains an exit survey. This exist survey can be taken by iteself,
There is a fieldset, #survey_fieldset, which contains an exit survey. This exist survey can be taken by iteself,
or as part of the certificate request. If they haven't taken the survey yet, it moves to the open modal dialogue.
or as part of the certificate request. If they haven't taken the survey yet, it moves to the open modal dialogue.
...
@@ -190,7 +191,7 @@ $(function() {
...
@@ -190,7 +191,7 @@ $(function() {
// "new_email":new_email});
// "new_email":new_email});
return
false
;
return
false
;
});
});
%
endif
});
});
</script>
</script>
...
@@ -207,6 +208,7 @@ $(function() {
...
@@ -207,6 +208,7 @@ $(function() {
<h1>
Course Progress
</h1>
<h1>
Course Progress
</h1>
</header>
</header>
%if settings.END_COURSE_ENABLED:
<div
id=
"grade"
>
<div
id=
"grade"
>
%if grade_sheet['grade']:
%if grade_sheet['grade']:
<p>
Final Grade:
<strong>
${grade_sheet['grade']}
</strong></p>
<p>
Final Grade:
<strong>
${grade_sheet['grade']}
</strong></p>
...
@@ -229,6 +231,8 @@ $(function() {
...
@@ -229,6 +231,8 @@ $(function() {
</div>
</div>
%endif
%endif
%endif
<div
id=
"grade-detail-graph"
></div>
<div
id=
"grade-detail-graph"
></div>
<ol
class=
"chapters"
>
<ol
class=
"chapters"
>
...
...
urls.py
View file @
b05271c9
...
@@ -15,7 +15,6 @@ urlpatterns = ('',
...
@@ -15,7 +15,6 @@ urlpatterns = ('',
url
(
r'^accept_name_change$'
,
'student.views.accept_name_change'
),
url
(
r'^accept_name_change$'
,
'student.views.accept_name_change'
),
url
(
r'^reject_name_change$'
,
'student.views.reject_name_change'
),
url
(
r'^reject_name_change$'
,
'student.views.reject_name_change'
),
url
(
r'^pending_name_changes$'
,
'student.views.pending_name_changes'
),
url
(
r'^pending_name_changes$'
,
'student.views.pending_name_changes'
),
url
(
r'^certificate_request$'
,
'certificates.views.certificate_request'
),
url
(
r'^gradebook$'
,
'courseware.views.gradebook'
),
url
(
r'^gradebook$'
,
'courseware.views.gradebook'
),
url
(
r'^event$'
,
'track.views.user_track'
),
url
(
r'^event$'
,
'track.views.user_track'
),
url
(
r'^t/(?P<template>[^/]*)$'
,
'static_template_view.views.index'
),
url
(
r'^t/(?P<template>[^/]*)$'
,
'static_template_view.views.index'
),
...
@@ -40,8 +39,11 @@ urlpatterns = ('',
...
@@ -40,8 +39,11 @@ urlpatterns = ('',
url
(
r'^send_feedback$'
,
'util.views.send_feedback'
),
url
(
r'^send_feedback$'
,
'util.views.send_feedback'
),
)
)
if
True
:
# settings.END_COURSE_ENABLED:
if
settings
.
END_COURSE_ENABLED
:
urlpatterns
+=
(
url
(
r'^record_exit_survey$'
,
'student.views.record_exit_survey'
),)
urlpatterns
+=
(
url
(
r'^certificate_request$'
,
'certificates.views.certificate_request'
),
url
(
r'^record_exit_survey$'
,
'student.views.record_exit_survey'
),
)
if
settings
.
PERFSTATS
:
if
settings
.
PERFSTATS
:
urlpatterns
=
urlpatterns
+
(
url
(
r'^reprofile$'
,
'perfstats.views.end_profile'
),)
urlpatterns
=
urlpatterns
+
(
url
(
r'^reprofile$'
,
'perfstats.views.end_profile'
),)
...
...
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