CareKit
CareKit copied to clipboard
Preserve the Completion Button States in Surveys
I created the surveys with your suggested way using the following classes.
- class SurveyViewController: OCKInstructionsTaskViewController, ORKTaskViewControllerDelegate
- class SurveyViewSynchronizer: OCKInstructionsTaskViewSynchronizer
Everything is working fine with the default behavior.
- I've set up surveys of multiple steps.
- I changed the button text to "Start Survey" button and I hit the "Start Survey" button, it changes the button state immediately to "Completed" and then it opens the survey steps.
- On the survey steps, I clicked the Cancel button which dismissed the ViewController as expected.
But I want to make the following changes:
- Don't change the Text to "Completed" immediately and don't change Button's state/background color.
- If the Survey didn't complete and finished with .Discarded reason, I want to preserve the Button state to default.
- How can I disable this Completion button for a specific time? For example, if a survey is successfully submitted and then I want to restrict the patient to re-take the survey till mid-night of that day.
Can you show me what the code in your SurveyViewSynchronizer looks like?