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
dd46eb47
Commit
dd46eb47
authored
Sep 30, 2013
by
Diana Huang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add barebones reverification flow.
parent
b9c00ae3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
114 additions
and
0 deletions
+114
-0
lms/djangoapps/verify_student/urls.py
+11
-0
lms/djangoapps/verify_student/views.py
+63
-0
lms/static/js/verify_student/photocapture.js
+22
-0
lms/templates/verify_student/photo_reverification.html
+0
-0
lms/templates/verify_student/reverification_confirmation.html
+18
-0
No files found.
lms/djangoapps/verify_student/urls.py
View file @
dd46eb47
...
@@ -35,4 +35,15 @@ urlpatterns = patterns(
...
@@ -35,4 +35,15 @@ urlpatterns = patterns(
name
=
"verify_student_results_callback"
,
name
=
"verify_student_results_callback"
,
),
),
url
(
r'^reverify$'
,
views
.
ReverifyView
.
as_view
(),
name
=
"verify_student_reverify"
),
url
(
r'^reverification_confirmation$'
,
views
.
reverification_submission_confirmation
,
name
=
"verify_student_reverification_confirmation"
),
)
)
lms/djangoapps/verify_student/views.py
View file @
dd46eb47
...
@@ -267,3 +267,66 @@ def show_requirements(request, course_id):
...
@@ -267,3 +267,66 @@ def show_requirements(request, course_id):
"upgrade"
:
upgrade
,
"upgrade"
:
upgrade
,
}
}
return
render_to_response
(
"verify_student/show_requirements.html"
,
context
)
return
render_to_response
(
"verify_student/show_requirements.html"
,
context
)
class
ReverifyView
(
View
):
"""
The main reverification view. Under similar constraints as the main verification view.
Has to perform these functions:
- take new face photo
- take new id photo
- submit photos to photo verification service
Does not need to be attached to a particular course.
Does not need to worry about pricing
"""
@method_decorator
(
login_required
)
def
get
(
self
,
request
):
"""
display this view
"""
context
=
{
"user_full_name"
:
request
.
user
.
profile
.
name
,
"error"
:
False
,
}
return
render_to_response
(
"verify_student/photo_reverification.html"
,
context
)
@method_decorator
(
login_required
)
def
post
(
self
,
request
):
"""
submits the reverification to SoftwareSecure
"""
try
:
attempt
=
SoftwareSecurePhotoVerification
(
user
=
request
.
user
)
b64_face_image
=
request
.
POST
[
'face_image'
]
.
split
(
","
)[
1
]
b64_photo_id_image
=
request
.
POST
[
'photo_id_image'
]
.
split
(
","
)[
1
]
attempt
.
upload_face_image
(
b64_face_image
.
decode
(
'base64'
))
attempt
.
upload_photo_id_image
(
b64_photo_id_image
.
decode
(
'base64'
))
attempt
.
mark_ready
()
# save this attempt
attempt
.
save
()
# then submit it across
attempt
.
submit
()
return
HttpResponseRedirect
(
reverse
(
'verify_student_reverification_confirmation'
))
except
Exception
:
log
.
exception
(
"Could not submit verification attempt for user {}"
.
format
(
request
.
user
.
id
)
)
context
=
{
"user_full_name"
:
request
.
user
.
profile
.
name
,
"error"
:
True
,
}
return
render_to_response
(
"verify_student/photo_reverification.html"
,
context
)
@login_required
def
reverification_submission_confirmation
(
_request
):
"""
Shows the user a confirmation page if the submission to SoftwareSecure was successful
"""
return
render_to_response
(
"verify_student/reverification_confirmation.html"
)
lms/static/js/verify_student/photocapture.js
View file @
dd46eb47
...
@@ -18,6 +18,23 @@ function initVideoCapture() {
...
@@ -18,6 +18,23 @@ function initVideoCapture() {
return
!
(
navigator
.
getUserMedia
==
undefined
);
return
!
(
navigator
.
getUserMedia
==
undefined
);
}
}
var
submitReverificationPhotos
=
function
()
{
// add photos to the form
$
(
'<input>'
).
attr
({
type
:
'hidden'
,
name
:
'face_image'
,
value
:
$
(
"#face_image"
)[
0
].
src
,
}).
appendTo
(
"#reverify_form"
);
$
(
'<input>'
).
attr
({
type
:
'hidden'
,
name
:
'photo_id_image'
,
value
:
$
(
"#photo_id_image"
)[
0
].
src
,
}).
appendTo
(
"#reverify_form"
);
$
(
"#reverify_form"
).
submit
();
}
var
submitToPaymentProcessing
=
function
()
{
var
submitToPaymentProcessing
=
function
()
{
var
contribution_input
=
$
(
"input[name='contribution']:checked"
)
var
contribution_input
=
$
(
"input[name='contribution']:checked"
)
var
contribution
=
0
;
var
contribution
=
0
;
...
@@ -255,10 +272,15 @@ $(document).ready(function() {
...
@@ -255,10 +272,15 @@ $(document).ready(function() {
submitToPaymentProcessing
();
submitToPaymentProcessing
();
});
});
$
(
"#reverify_button"
).
click
(
function
()
{
submitReverificationPhotos
();
});
// prevent browsers from keeping this button checked
// prevent browsers from keeping this button checked
$
(
"#confirm_pics_good"
).
prop
(
"checked"
,
false
)
$
(
"#confirm_pics_good"
).
prop
(
"checked"
,
false
)
$
(
"#confirm_pics_good"
).
change
(
function
()
{
$
(
"#confirm_pics_good"
).
change
(
function
()
{
$
(
"#pay_button"
).
toggleClass
(
'disabled'
);
$
(
"#pay_button"
).
toggleClass
(
'disabled'
);
$
(
"#reverify_button"
).
toggleClass
(
'disabled'
);
});
});
...
...
lms/templates/verify_student/photo_reverification.html
0 → 100644
View file @
dd46eb47
This diff is collapsed.
Click to expand it.
lms/templates/verify_student/reverification_confirmation.html
0 → 100644
View file @
dd46eb47
<
%!
from
django
.
utils
.
translation
import
ugettext
as
_
%
>
<
%!
from
django
.
core
.
urlresolvers
import
reverse
%
>
<
%
inherit
file=
"../main.html"
/>
<
%
namespace
name=
'static'
file=
'/static_content.html'
/>
<
%
block
name=
"bodyclass"
>
register verification-process step-photos
</
%
block>
<
%
block
name=
"title"
><title>
${_("Verification Submission Confirmation")}
</title></
%
block>
<
%
block
name=
"js_extra"
>
<script
src=
"${static.url('js/vendor/responsive-carousel/responsive-carousel.js')}"
></script>
<script
src=
"${static.url('js/vendor/responsive-carousel/responsive-carousel.keybd.js')}"
></script>
</
%
block>
<
%
block
name=
"content"
>
<p>
Successfully reverified!
</p>
<p><a
href=
"${reverse('dashboard')}"
>
Return to Dashboard
</a></p>
</
%
block>
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