Skip to content

Commit

Permalink
Fix research questions download (#1257)
Browse files Browse the repository at this point in the history
* add user variables to custom view

* fix Uuid from prev pr

* Consent form ansers csv expert and fixes

* small fix

* remove console.log

* add module completion date to data sent for custom view exercise service

* attempt to fix undefined user_answer

* rename db function to more descriptive

* Fix research form question download, db query distinct on both question AND user_id
  • Loading branch information
anadis504 authored Mar 28, 2024
1 parent 23dc057 commit 52cf3d3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions services/headless-lms/models/src/research_forms.rs
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ pub fn stream_course_research_form_user_answers(
sqlx::query_as!(
ExportedCourseResearchFormQustionAnswer,
r#"
SELECT DISTINCT ON (a.research_form_question_id)
SELECT DISTINCT ON (a.research_form_question_id, a.user_id)
q.course_id,
q.research_consent_form_id,
a.research_form_question_id,
Expand All @@ -211,7 +211,7 @@ pub fn stream_course_research_form_user_answers(
WHERE a.course_id = $1
AND a.deleted_at IS NULL
AND q.deleted_at IS NULL
ORDER BY a.research_form_question_id, a.updated_at DESC
ORDER BY a.user_id, a.research_form_question_id, a.updated_at DESC
"#,
course_id
)
Expand Down

0 comments on commit 52cf3d3

Please sign in to comment.