Skip to content

Commit

Permalink
Merge branch 'NES-1013' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
Cassiano R. N. dos Santos committed Mar 11, 2020
2 parents 0eaef5f + 0a97458 commit 3c9cf16
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -335,8 +335,8 @@ <h4><span class="glyphicon glyphicon-tag"></span> {{ group_of_questions.name }}<

{# If already in the edit response page, there is no need to redirect #}
if (window.location.href.indexOf('edit') == -1) {
{# Wait 3 seconds before redirecting, so that the user can read the message. #}
window.setTimeout(redirect, 3000);
{# Wait 10 seconds before redirecting, so that the user can read the message. #}
window.setTimeout(redirect, 10000);
}
}
});
Expand Down
13 changes: 3 additions & 10 deletions patientregistrationsystem/qdc/survey/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -799,20 +799,16 @@ def get_questionnaire_responses(language_code, lime_survey_id, token_id, request
answer = ''
no_response_flag = False

# type 'X' means "Text display"
if not question['type'] == 'X':
# type "1" means "Array dual scale"
if question['type'] == '1':
answer_list = []
if question['question_id'] + "[1]" in responses_list[0]:
index = responses_list[0].index(question['question_id'] + "[1]")
answer_options = question['answer_options']
answer = question['question_id'] + "[1]: "
if responses_list[1][index] in answer_options:
answer_option = answer_options[responses_list[1][index]]
answer += answer_option['answer']
answer = answer_option['answer']
else:
# Sem resposta
answer += _('No answer')
no_response_flag = True

Expand All @@ -821,13 +817,11 @@ def get_questionnaire_responses(language_code, lime_survey_id, token_id, request
if question['question_id'] + "[2]" in responses_list[0]:
index = responses_list[0].index(question['question_id'] + "[2]")
answer_options = question['answer_options']
answer = question['question_id'] + "[2]: "
if responses_list[1][index] in answer_options:
answer_option = answer_options[responses_list[1][index]]
answer += answer_option['answer']
answer = answer_option['answer']
else:
# no answer
answer += _('No answer')
answer = _('No answer')
no_response_flag = True

answer_list.append(answer)
Expand All @@ -840,7 +834,6 @@ def get_questionnaire_responses(language_code, lime_survey_id, token_id, request
index = responses_list[0].index(question['question_id'])
answer_options = question['answer_options']
if isinstance(answer_options, dict):
# type "M" means "Multiple choice"
if question['type'] == 'M':
answer = responses_list[1][index]
if question['other']:
Expand Down

0 comments on commit 3c9cf16

Please sign in to comment.