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

Heartbeat Study survey #182

Merged
merged 39 commits into from
Feb 22, 2025
Merged

Heartbeat Study survey #182

merged 39 commits into from
Feb 22, 2025

Conversation

eldcn
Copy link
Contributor

@eldcn eldcn commented Feb 17, 2025

Heartbeat study survey

♻️ Current situation & Problem

  • Implements the complete flow of a survey. Currently configured to use a fake flow with data from a json file and a fake firebase component that simulates login / email verification as the backend seem to send a terminal question. You can use these fields to configure the fake flow
object FakeConfigs {
    /**
     * If [true] simutales a fake flow with example questions from [R.raw.fake_data]
     */
    const val ENABLED = true

    /**
     * Indicates whether a dummy login / register flow should be used, otherwise survey starts immediately
     */
    const val SKIP_LOGIN = false

    /**
     * Max value in seconds that simulates async request durations to visualize loading states
     */
    const val MAX_DELAY_SECONDS = 2L

    /**
     * Whether dummy account should have the email already verified
     */
    const val EMAIL_VERIFIED = false

    /**
     * Set to true to ignore question validations and complete the flow
     */
    const val FORCE_ENABLE_CONTINUE = false
}

⚙️ Release Notes

Add a bullet point list summary of the feature and possible migration guides if this is a breaking change so this section can be added to the release notes.
Include code snippets that provide examples of the feature implemented or links to the documentation if it appends or changes the public interface.

📚 Documentation

Please ensure that you properly document any additions in conformance to Spezi Documentation Guide.
You can use this section to describe your solution, but we encourage contributors to document your reasoning and changes using in-line documentation.

✅ Testing

Please ensure that the PR meets the testing requirements set by CodeCov and that new functionality is appropriately tested.
This section describes important information about the tests and why some elements might not be testable.

📝 Code of Conduct & Contributing Guidelines

By submitting creating this pull request, you agree to follow our Code of Conduct and Contributing Guidelines:

@@ -0,0 +1,9 @@
package edu.stanford.bdh.heartbeat.app.fake

object FakeConfigs {
Copy link
Contributor Author

@eldcn eldcn Feb 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pauljohanneskraft you can simulate a fake flow via this object. If enabled it runs a survey from data of a json file that contains at least one question of the field types that we should implement

@eldcn eldcn marked this pull request as draft February 17, 2025 22:56
Copy link

codecov bot commented Feb 17, 2025

Codecov Report

Attention: Patch coverage is 0% with 19 lines in your changes missing coverage. Please review.

Project coverage is 33.10%. Comparing base (7d0f3d3) to head (0ca3d8d).
Report is 39 commits behind head on task/heartbeat-app.

Files with missing lines Patch % Lines
...stanford/spezi/core/design/component/FocusEvent.kt 0.00% 10 Missing ⚠️
...lin/edu/stanford/spezi/core/design/theme/Colors.kt 0.00% 6 Missing ⚠️
...rd/spezi/core/design/component/DatePickerDialog.kt 0.00% 2 Missing ⚠️
...nford/bdh/engagehf/health/components/TimePicker.kt 0.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@                   Coverage Diff                    @@
##             task/heartbeat-app     #182      +/-   ##
========================================================
- Coverage                 33.15%   33.10%   -0.04%     
  Complexity                  771      771              
========================================================
  Files                       277      278       +1     
  Lines                     11338    11355      +17     
  Branches                   1817     1818       +1     
========================================================
  Hits                       3758     3758              
- Misses                     7337     7354      +17     
  Partials                    243      243              
Flag Coverage Δ
unittests 33.10% <0.00%> (-0.04%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...nford/bdh/engagehf/health/components/TimePicker.kt 0.00% <0.00%> (ø)
...rd/spezi/core/design/component/DatePickerDialog.kt 0.00% <0.00%> (ø)
...lin/edu/stanford/spezi/core/design/theme/Colors.kt 0.00% <0.00%> (ø)
...stanford/spezi/core/design/component/FocusEvent.kt 0.00% <0.00%> (ø)

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7d0f3d3...0ca3d8d. Read the comment docs.

@PSchmiedmayer
Copy link
Member

Amazing for all the work here @eldcn! 🚀

pauljohanneskraft and others added 4 commits February 18, 2025 16:21
add missing required fields
send question metada info - retry count, render time and think time in millis
render optional title 2
addapt fake data json
improve logging
@eldcn eldcn merged commit 0ca3d8d into task/heartbeat-app Feb 22, 2025
5 of 11 checks passed
@eldcn eldcn deleted the task/heartbeat-app-api branch February 22, 2025 12:37
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

Successfully merging this pull request may close these issues.

3 participants