CareKit icon indicating copy to clipboard operation
CareKit copied to clipboard

Preserve the Completion Button States in Surveys

Open majidsaleem105 opened this issue 5 years ago • 1 comments

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.

  1. I've set up surveys of multiple steps.
  2. 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.
  3. On the survey steps, I clicked the Cancel button which dismissed the ViewController as expected.

But I want to make the following changes:

  1. Don't change the Text to "Completed" immediately and don't change Button's state/background color.
  2. If the Survey didn't complete and finished with .Discarded reason, I want to preserve the Button state to default.
  3. 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.

majidsaleem105 avatar Jul 23 '20 15:07 majidsaleem105

Can you show me what the code in your SurveyViewSynchronizer looks like?

erik-apple avatar Aug 17 '20 23:08 erik-apple