Commit 9a691935 by Bridger Maxwell

Changed certificate request form wording. Removed email address field.

parent 32f9f631
......@@ -20,16 +20,22 @@ def certificate_request(request):
if request.method != "POST" or not settings.END_COURSE_ENABLED:
raise Http404
verification_checked = request.POST.get('cert_request_verify', 'false')
destination_email = request.POST.get('cert_request_email', '')
honor_code_verify = request.POST.get('cert_request_honor_code_verify', 'false')
name_verify = request.POST.get('cert_request_name_verify', 'false')
id_verify = request.POST.get('cert_request_id_verify', 'false')
error = ''
if verification_checked != 'true':
error += 'You must verify that you have followed the honor code to receive a certificate. '
try:
validate_email(destination_email)
except ValidationError:
error += 'Please provide a valid email address to send the certificate. '
if honor_code_verify != 'true':
error += 'Please verify that you have followed the honor code to receive a certificate. '
if name_verify != 'true':
error += 'Please verify that your name is correct to receive a certificate. '
if id_verify != 'true':
error += 'Please certify that you understand the unique ID on the certificate. '
grade = None
if len(error) == 0:
student_gradesheet = grades.grade_sheet(request.user)
......@@ -40,18 +46,17 @@ def certificate_request(request):
error += 'You have not earned a grade in this course. '
if len(error) == 0:
generate_certificate(request.user, grade, destination_email)
generate_certificate(request.user, grade)
# TODO: Send the certificate email
return HttpResponse(json.dumps({'success':True,
'value': 'A certificate is being generated and will be sent. ' }))
return HttpResponse(json.dumps({'success':True}))
else:
return HttpResponse(json.dumps({'success':False,
'error': error }))
# This method should only be called if the user has a grade and has requested a certificate
def generate_certificate(user, grade, destination_email):
def generate_certificate(user, grade):
# Make sure to see the comments in models.GeneratedCertificate to read about the valid
# states for a GeneratedCertificate object
generated_certificate = None
......
......@@ -142,8 +142,10 @@ $(function() {
});
$("#cert_request_form").submit(function(){
var values = {'cert_request_verify' : $("#cert_request_verify").is(':checked'),
'cert_request_email': $("#cert_request_email").val() };
var values = {'cert_request_honor_code_verify' : $("#cert_request_honor_code_verify").is(':checked'),
'cert_request_name_verify' : $("#cert_request_name_verify").is(':checked'),
'cert_request_id_verify' : $("#cert_request_id_verify").is(':checked'),
};
postJSON('/certificate_request', values, function(data) {
if (data.success) {
......@@ -155,7 +157,7 @@ $(function() {
$("#survey_form").submit();
}
$("#cert_request").html("<h1>Certificate Request Received</h1><p>A certificate will be sent to the specified email in a short time.</p>");
$("#cert_request").html("<h1>Certificate Request Received</h1><p>Thank you! A certificate is being generated. You will be notified when it is ready to download.</p>");
$(".cert_request_link").text("Certificate is being generated...");
} else {
$("#cert_request_error").html(data.error);
......@@ -405,28 +407,31 @@ $(function() {
%if grade_sheet['grade']:
<div id="cert_request" class="leanModal_box">
<h1>Request a 6.002x Certificate</h1>
<p>You can request a certificate which verifies that you passed this course. When the certificate has been generated, it will be emailed. Later, the certificate can be downloaded from your Profile page.</p>
<p>The certificate will indicate that <strong>${name}</strong> has successfully completed the Fall 2012 offering of <strong>Circuits and Electronics 6.002x</strong>. Please ensure that this is correct.</p>
<p>You can request a certificate which verifies that you passed this course. When the certificate has been generated, you will receive an email notification that it can be downloaded from your Profile page.</p>
<p>The certificate will indicate that <strong>${name}</strong> has successfully completed the Fall 2012 offering of <strong>Circuits and Electronics 6.002x</strong>. Please ensure that this information is correct.</p>
<form id="cert_request_form">
<fieldset>
<div id="cert_request_error"> </div>
<ul>
<li class="verify">
<input type="checkbox" id="cert_request_verify"/>
<label> I certify that I have not violated the Honor Code for this course. The name shown above is correct. </label>
<input type="checkbox" id="cert_request_honor_code_verify"/>
<label> I certify that I have not violated the Honor Code for this course. </label>
</li>
<li>
<label> Please enter the email address to send the certificate to: </label>
<input id="cert_request_email" type="email" value="${email}" />
<li class="verify">
<input type="checkbox" id="cert_request_name_verify"/>
<label> The name shown above is correct. </label>
</li>
<li class="verify">
<input type="checkbox" id="cert_request_id_verify"/>
<label> I understand that my certificate contains my name a unique ID which will be visible on the certificate. I will give this ID only to those who I wish to visit the verification page on www.edXOnline.org to confirm that I passed Circuits and Electronics 6.002x. </label>
</li>
</ul>
</fieldset>
<div id="cert_request_survey_holder"> </div>
<input type="submit" id="" value="Send Certificate" />
<input type="submit" id="" value="Generate Certificate" />
</form>
</div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment