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

Visibilty of items #234

Open
Remi-Gau opened this issue Jun 21, 2021 · 5 comments
Open

Visibilty of items #234

Remi-Gau opened this issue Jun 21, 2021 · 5 comments

Comments

@Remi-Gau
Copy link
Contributor

Not sure if I am in the wrong and misunderstood how the visibility is supposed to work but I am getting some really strange behavior of the app on this test activity.

Some items appear even when they are not supposed to.

https://github.com/Remi-Gau/eCobidas/blob/dev/python/tests/data/activities/visibility/visibility_schema.jsonld

Am I missing something?

@Remi-Gau
Copy link
Contributor Author

Remi-Gau commented Dec 1, 2021

Tried to figure out what is going on with this problem.

The way the app deals with visibility for a given item seems to complete break down if another item has an OR operator (||) on its visibility field.

I have update the example activity above to show this: see here is how it plays in the app

@Remi-Gau
Copy link
Contributor Author

Remi-Gau commented Dec 1, 2021

Screenshot from 2021-12-01 19-42-23

For example this item should not appear when that response is selected.

@Remi-Gau
Copy link
Contributor Author

Remi-Gau commented Dec 1, 2021

Changing || to && makes the other items behave as expected.

https://github.com/Remi-Gau/eCobidas/blob/visi_fix/python/tests/data/activities/visibility/visibility_schema.jsonld

See it in how this "fixed" activity plays HERE

Screenshot from 2021-12-01 19-45-36

@Remi-Gau
Copy link
Contributor Author

Remi-Gau commented Dec 1, 2021

Could this be because the evaluateString that are involved in dealing with the visibility are RegEx based and that the || are not escaped in the RegEx?

@Remi-Gau
Copy link
Contributor Author

Remi-Gau commented Dec 1, 2021

The behavior of the app seems that if one item has one "wrongly' formatted "visbility" it will then show all the items. Which I guess is one way to "throw an exception", though something preferable would be to default the visibility to true only for the item with the problematic visibility and to though an error in the console.

Encountered a similar behavior when a typo in a the visibility of an item (conductive medium == 4 instead of conductive_medium == 4) made all the items of the activity visible: so the problem seems to go beyond Regex and || but seems to be happening when encountering "non valid" Javascript in isVis

Wonder if there could be some kind of check for this when validating the JSONLD files.

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

No branches or pull requests

1 participant