Commit 1696a643 by Bridger Maxwell

Small modifications to certificates and survey.

parent b77b721e
......@@ -28,10 +28,6 @@ def certificate_request(request):
name_verify = request.POST.get('cert_request_name_verify', 'false')
id_verify = request.POST.get('cert_request_id_verify', 'false')
error = ''
survey_response = record_exit_survey(request, internal_request=True)
if not survey_response['success']:
error += survey_response['error']
if honor_code_verify != 'true':
error += 'Please verify that you have followed the honor code to receive a certificate. '
......@@ -42,6 +38,10 @@ def certificate_request(request):
if id_verify != 'true':
error += 'Please certify that you understand the unique ID on the certificate. '
if len(error) == 0:
survey_response = record_exit_survey(request, internal_request=True)
if not survey_response['success']:
error += survey_response['error']
grade = None
if len(error) == 0:
......
......@@ -469,7 +469,6 @@ def record_exit_survey(request, internal_request = False):
if request.method == "POST":
# If internal_request = True, this is a survey that was submitted with another form
# We will record it and return the results as a dictionary, instead of a json HttpResponse
def returnResults(return_data):
if internal_request:
return return_data
......@@ -493,6 +492,12 @@ def record_exit_survey(request, internal_request = False):
return returnResults({'success':True})
else:
log.debug("response values: " + str( response.values() ))
if internal_request and all( value == None or value == [''] for value in response.values() ):
# If all values are empty, then the student didn't answer any questions.
# In the case of this being an internal request, we don't mark the survey as taken
return returnResults({'success':True})
meta['6002x_exit_response'] = response
up.set_meta(meta)
up.save()
......
......@@ -157,9 +157,7 @@ $(function() {
%endif
%if not took_survey:
<div class="survey_offer">
<a class="survey_link" href="/exit_survey">Take the survey</a>
</div>
%endif
</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