-
Notifications
You must be signed in to change notification settings - Fork 26
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
Write form path in Answers #489
Comments
/cc @sliverc |
/cc @winged |
@open-dynaMIX Maybe I am missing a recent change but could you outline a specific use case where this form path would help? |
Hey @sliverc 👋! In the context of #460: As questions can be used in multiple forms and answers are flat, it's difficult to filter the answers for the ones answering a question in a specific form. Right now we tavel the path to make sure we only fetch the right answers. This can be seen here. This works, but has a potential for performance issues and is hard to maintain. The filter expects a path (e.g. @winged was talking about another usecase in the JEXL-evaluation. I can't say anything about that, as I have never touched this. |
@open-dynaMIX So in a filter it doesn't make sense to define the path to a question but simply the question-slug will do and an answer. This should make things easier and this issue obsolete. Does this make sense or am I overlooking something? |
Just saw that there is a I do not have the full picture but those are just some thoughts to potentially think about. |
@sliverc If you have time, let's have a short call about it 😉 |
This is still true, and won't change either.
We have subdocuments; and a question may in fact be asked in multiple contexts across the document tree. For this reason it's important that we can define which instance of the question within tree was meant. Even if we would enforce question uniqueness across a whole form tree, we would still have the case of table questions, where it would break if we have multiple rows. For this reason I think we won't get around the hierarchical lookup, which is by any means already deeply ingrained by way of how the JEXL expressions work, for example: there, you can also navigate to "parent" documents and check values, which we need for example do determine question visibility. I'd prefer having the same kind of syntax available anywhere, and having the same meaning |
(I just sent out an invite for a telco about this for tomorrow, 13:00.) |
This is resolved with #505. |
The recursive nature of our Forms (in combination with FormQuestions) often has a negative impact on performance and developer sanity. One of many examples can be seen in this commit.
To simplify things, we want to write the form path to the Answers, i.e. the path from the case to the form the Answer actually belongs to.
This will be
null
, if there is no FormQuestion involved.This is a prerequisite for #460.
The text was updated successfully, but these errors were encountered: