Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: selection of question #644

Open
sjanssen2 opened this issue Mar 18, 2017 · 2 comments
Open

bug: selection of question #644

sjanssen2 opened this issue Mar 18, 2017 · 2 comments

Comments

@sjanssen2
Copy link
Contributor

Is this a bug in amgut/lib/data_access/survey.py def fetch_survey()?
We might need to restrict the returned questions to the correct group they belong to:

  •        sql = """SELECT survey_question_id, {1}.display_index,
                           survey_response_type
                           survey_response_type
                    FROM {0}
                    FROM {0}
                    JOIN {1} USING (response, survey_question_id)
                    JOIN {1} USING (response, survey_question_id)
                    JOIN {2} USING (survey_question_id)
                    JOIN {2} USING (survey_question_id)
                    LEFT JOIN {3} USING (survey_question_id)
                    LEFT JOIN {3} USING (survey_question_id)
    
  •                 WHERE survey_id = %s AND retired = FALSE""".format(
    
  •                 JOIN ag.group_questions USING (survey_question_id)
    
  •                 WHERE survey_group = {4}
    
  •                 AND survey_id = %s
    
  •                 AND retired = FALSE""".format(
               self._survey_answers_table,
               self._survey_answers_table,
               self._survey_question_response_table,
               self._survey_question_response_table,
               self._survey_question_response_type_table,
               self._survey_question_response_type_table,
    
  •            self._questions_table)
    
  •            self._questions_table,
    
  •            str(-1*self.id))
    
@sjanssen2
Copy link
Contributor Author

I think I found a bug in amgut/lib/data_access/survey.py function fetch_survey():
I added the restriction that only those answers should be enumerated, that belong to the correct "survey_group". Tests are passing, but since our coverage is low I'd like you to ask to run some manual inspections.

@wasade
Copy link
Member

wasade commented Mar 20, 2017

I'm not sure I totally understand, can you elaborate a little more please?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants