-
Notifications
You must be signed in to change notification settings - Fork 443
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
ORKTextChoice + ORKPredicateStepNavigationRule + CareKit + ResearchKit #681
Comments
Hello @InfuriatingYetti, I'd be happy to help. If I'm understanding correctly, it seems that you're attempting to:
If so, this is different than the expected flow for a navigable task. All navigation should be based on steps within the same ORKTask. So in your case the flow would look something like this I believe:
If you take a look the ORKCatalog app in the TaskListRow.swift file there is a good example of a predicate being implemented for the "private var eligibilityTask: ORKTask" variable. That should definitely help demystify things. If I misunderstood anything or if you simply have more questions please let me know. Hope this helps! |
Thank you so much for helping me out - it's a pleasure and thank you for the insight!! :) I checked out the TaskListRow.swift file in ResearchKit. From my understanding when using the ORKTask for approach (For example: TaskListRow.swift: steps += [questionStep3]), it will only show one question at a time, like in this example from the ResearchKit.org website (is that correct?): Is it possible to navigate with this kind of set up below: For example, if the user selects Thank you! |
You're correct that you would have to show one page at a time for your use case. Conditional questions within one step isn't something ResearchKit supports. That does sound useful however. |
This functionality would be very useful. |
@pthealthtech @Pariecemckinney-apple I was looking at the From
With the
I was thinking, maybe you could change the Going back to what @erik-apple did in the WWDC 21, here is an example using
I don't know if it would be possible to mod the instruction step like this to show an Thank you! |
I think I've got something going here! Here is a form that is navigable to a second form - in the same window! After selecting the answer response in the first form and clicking The problem I am having is while the code isn't giving me any errors, the code is not using logic to either skip the second question if I select Under
lol you all are great - thank you for the help so far!!! |
This is the best I could come up with using a step navigable form. I am having trouble though passing the Value to CareKit. I think it's almost there, but need a little guidance please! :) When I answer If on This is a mod from what @gavirawson-apple helped me with in the other tread and I tried adapting it to the navigable form. It's interesting to me because it seems that it is able to extract the answers from the form initially as I can get it to print (seen above), but it isn't able to process the data in this area:
Here's the full code:
Does anyone have any ideas?? Thank you! |
An idea I had was maybe I need to somehow have each question step extract the data along the way as opposed to trying to extract it all at the end. The thought being, does each question step act as as it's own survey form (conceptually)...I messed around with it for a little bit last night trying to extract the data at each step, but wasn't able to get it work quite right still - had a bit of errors I'll have to figure out. Theoretically, to get this to work would I need to extract each question's data along the way or is it possible to get it to extract all of the data at the end? |
Hey @InfuriatingYetti! I wanted to circle back and see if you have reached a working solution yet. If not, I'm more than happy to keep working through this. Just let me know! |
Hello @InfuriatingYetti, we still haven’t heard anything from you. Please let us know if you are are still stuck, otherwise we will close this issue soon. |
Good day @gavirawson-apple - hope you're doing well!
I tagged you because this question is an extension from the last question you helped me with (found here: [https://github.com//issues/680]), and anyone who may be able to help is more more than welcome! :)
I was reading about a feature called
ORKPredicateStepNavigationRule
and was trying to implement it in the previous code we were working on. I came up with the following code below...it sort of works in that it isn't throwing any codes and allows me to persist the data to CareKit Store and doesn't work because it isn't navigating to the second survey.Going back to the survey you helped me on, if the person were to select an answer greater than
value: 0
in theORKTextChoice(text: "None", value: 0 as NSNumber)
I am wanting to have it take them to another set of questions that is a part of another survey on another form, but only once the complete the first form.First question, is it possible to do this with the layout design seen in @erik-apple 's WWDC 21 + what we worked on previously? If so, I can keep trying...going in I was taking the Han Solo approach:
What happens is after I select an answer response and click Done it closes it like normal. I was thinking it either:
a) What I'm trying can't be done the way I'm trying to do it
b) The form is closing before it can run to the code to open the second survey, either in the current or new window
c) There is a step missing and I somehow need to have the first survey persist to CareKit and from CareKit somehow make it open the second survey.
d) ...
If seeing the code helps, this is what I've tried, again looking to have it both persist the answers from the first form to CareKit Store and also automatically go to another based on the answer response from the question once the first survey is complete:
`
I have also tried creating a second swift file, whereas it would open the second from second file automatically based on the answer response and once the first survey was submitted - did the same thing, it submits the first survey and doesn't open the second.
Do you think what I am trying to do is possible, or do I need a different approach?!
Thank you for your help!!
The text was updated successfully, but these errors were encountered: