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
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
38 additions
and
26 deletions
+38
-26
djangoapps/certificates/views.py
+2
-1
djangoapps/courseware/views.py
+20
-18
djangoapps/student/views.py
+1
-1
settings.py
+3
-0
templates/profile.html
+7
-3
urls.py
+5
-3
No files found.
djangoapps/certificates/views.py
View file @
b05271c9
...
...
@@ -2,6 +2,7 @@ import json
import
logging
import
uuid
from
django.conf
import
settings
from
django.contrib.auth.decorators
import
login_required
from
django.http
import
Http404
,
HttpResponse
from
mitxmako.shortcuts
import
render_to_response
...
...
@@ -16,7 +17,7 @@ log = logging.getLogger("mitx.certificates")
@login_required
def
certificate_request
(
request
):
''' Attempt to send a certificate. '''
if
request
.
method
!=
"POST"
:
if
request
.
method
!=
"POST"
or
not
settings
.
END_COURSE_ENABLED
:
raise
Http404
verification_checked
=
request
.
POST
.
get
(
'cert_request_verify'
,
'false'
)
...
...
djangoapps/courseware/views.py
View file @
b05271c9
...
...
@@ -74,21 +74,6 @@ def profile(request, student_id = None):
grade_sheet
=
grades
.
grade_sheet
(
student
)
took_survey
=
student_took_survey
(
user_info
)
generated_certificate
=
None
certificate_download_url
=
None
certificate_requested
=
False
if
grade_sheet
[
'grade'
]:
try
:
generated_certificate
=
GeneratedCertificate
.
objects
.
get
(
user
=
student
)
certificate_requested
=
True
certificate_download_url
=
generated_certificate
.
download_url
except
GeneratedCertificate
.
DoesNotExist
:
#They haven't submited the request form
certificate_requested
=
False
context
=
{
'name'
:
user_info
.
name
,
'username'
:
student
.
username
,
'location'
:
user_info
.
location
,
...
...
@@ -98,10 +83,27 @@ def profile(request, student_id = None):
'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
,
'took_survey'
:
took_survey
,
}
if
settings
.
END_COURSE_ENABLED
:
took_survey
=
student_took_survey
(
user_info
)
generated_certificate
=
None
certificate_download_url
=
None
certificate_requested
=
False
if
grade_sheet
[
'grade'
]:
try
:
generated_certificate
=
GeneratedCertificate
.
objects
.
get
(
user
=
student
)
certificate_requested
=
True
certificate_download_url
=
generated_certificate
.
download_url
except
GeneratedCertificate
.
DoesNotExist
:
#They haven't submited the request form
certificate_requested
=
False
context
.
update
({
'certificate_requested'
:
certificate_requested
,
'certificate_download_url'
:
certificate_download_url
,
'took_survey'
:
took_survey
})
return
render_to_response
(
'profile.html'
,
context
)
...
...
djangoapps/student/views.py
View file @
b05271c9
...
...
@@ -461,7 +461,7 @@ def accept_name_change(request):
@login_required
def
record_exit_survey
(
request
):
if
request
.
method
!=
"POST"
:
if
request
.
method
!=
"POST"
or
not
settings
.
END_COURSE_ENABLED
:
raise
Http404
default_responses
=
{
...
...
settings.py
View file @
b05271c9
...
...
@@ -5,6 +5,9 @@ import tempfile
import
djcelery
# Enables certificate requests and the exit survey
END_COURSE_ENABLED
=
False
# from settings2.askbotsettings import LIVESETTINGS_OPTIONS
DEFAULT_GROUPS
=
[]
...
...
templates/profile.html
View file @
b05271c9
...
...
@@ -5,6 +5,7 @@
<
%!
from
django
.
core
.
urlresolvers
import
reverse
from
django
.
conf
import
settings
%
>
<
%
block
name=
"headextra"
>
...
...
@@ -121,7 +122,7 @@ $(function() {
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,
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() {
// "new_email":new_email});
return
false
;
});
%
endif
});
</script>
...
...
@@ -206,7 +207,8 @@ $(function() {
<header>
<h1>
Course Progress
</h1>
</header>
%if settings.END_COURSE_ENABLED:
<div
id=
"grade"
>
%if grade_sheet['grade']:
<p>
Final Grade:
<strong>
${grade_sheet['grade']}
</strong></p>
...
...
@@ -228,6 +230,8 @@ $(function() {
Take the
<a
class=
"survey_link"
rel=
"leanModal"
href=
"#survey"
>
survey
</a>
.
</div>
%endif
%endif
<div
id=
"grade-detail-graph"
></div>
...
...
urls.py
View file @
b05271c9
...
...
@@ -15,7 +15,6 @@ urlpatterns = ('',
url
(
r'^accept_name_change$'
,
'student.views.accept_name_change'
),
url
(
r'^reject_name_change$'
,
'student.views.reject_name_change'
),
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'^event$'
,
'track.views.user_track'
),
url
(
r'^t/(?P<template>[^/]*)$'
,
'static_template_view.views.index'
),
...
...
@@ -40,8 +39,11 @@ urlpatterns = ('',
url
(
r'^send_feedback$'
,
'util.views.send_feedback'
),
)
if
True
:
# settings.END_COURSE_ENABLED:
urlpatterns
+=
(
url
(
r'^record_exit_survey$'
,
'student.views.record_exit_survey'
),)
if
settings
.
END_COURSE_ENABLED
:
urlpatterns
+=
(
url
(
r'^certificate_request$'
,
'certificates.views.certificate_request'
),
url
(
r'^record_exit_survey$'
,
'student.views.record_exit_survey'
),
)
if
settings
.
PERFSTATS
:
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