def view_student_survey(user, survey_name, course=None, redirect_url=None, is_required=False, skip_redirect_url=None):
 redirect_url = (redirect_url if redirect_url else reverse('dashboard'))
 dashboard_redirect_url = reverse('dashboard')
 skip_redirect_url = (skip_redirect_url if skip_redirect_url else dashboard_redirect_url)
 survey = SurveyForm.get(survey_name, throw_if_not_found=False)
 if (not survey):
  return HttpResponseRedirect(redirect_url)
 existing_answers = survey.get_answers(user=user).get(user.id, {})
 platform_name = configuration_helpers.get_value('platform_name', settings.PLATFORM_NAME)
 context = {'existing_data_json': json.dumps(existing_answers), 'postback_url': reverse('submit_answers', args=[survey_name]), 'redirect_url': redirect_url, 'skip_redirect_url': skip_redirect_url, 'dashboard_redirect_url': dashboard_redirect_url, 'survey_form': survey.form, 'is_required': is_required, 'mail_to_link': configuration_helpers.get_value('email_from_address', settings.CONTACT_EMAIL), 'platform_name': platform_name, 'course': course}
 return render_to_response('survey/survey.html', context)

def view_student_survey ( user , survey_name , course = None , redirect_url = None , is_required = False , skip_redirect_url = None ) : redirect_url = ( redirect_url if redirect_url else reverse ( 'dashboard' ) ) dashboard_redirect_url = reverse ( 'dashboard' ) skip_redirect_url = ( skip_redirect_url if skip_redirect_url else dashboard_redirect_url ) survey = SurveyForm . get ( survey_name , throw_if_not_found = False ) if ( not survey ) : return HttpResponseRedirect ( redirect_url ) existing_answers = survey . get_answers ( user = user ) . get ( user . id , { } ) platform_name = configuration_helpers . get_value ( 'platform_name' , settings . PLATFORM_NAME ) context = { 'existing_data_json' : json . dumps ( existing_answers ) , 'postback_url' : reverse ( 'submit_answers' , args = [ survey_name ] ) , 'redirect_url' : redirect_url , 'skip_redirect_url' : skip_redirect_url , 'dashboard_redirect_url' : dashboard_redirect_url , 'survey_form' : survey . form , 'is_required' : is_required , 'mail_to_link' : configuration_helpers . get_value ( 'email_from_address' , settings . CONTACT_EMAIL ) , 'platform_name' : platform_name , 'course' : course } return render_to_response ( 'survey/survey.html' , context )
shared utility method to render a survey form note: this method is shared between the survey and courseware djangoapps .