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

Conflict of ID between blocs in workspace and toolbox #28

Open
cyrilledebongnie opened this issue Jul 25, 2022 · 3 comments
Open

Conflict of ID between blocs in workspace and toolbox #28

cyrilledebongnie opened this issue Jul 25, 2022 · 3 comments

Comments

@cyrilledebongnie
Copy link

When creating a variable with the same name present both in the workspace and the toolbox, a bug will appear when you try to solve the task.
The blocs (getter - setter - variable) from the toolbox cannot be dragged onto the workspace, as there is a conflict of ID.

Error message : Uncaught Error: Variable "test" is already in use and its id is "Gb:rfS?s2I9-yzU+:m4C" which conflicts with the passed in id, "wm||];n1QbzdRrI@1wT|".

However you can resume using those blocs from the toolbox if you first manually change the getter/setter/var to any variable then again to your variable, it seems to reset the ID of the variable in the toolbox to the ID of the variable in the workspace.

A quickfix is to use the online factory from google ( https://blockly-demo.appspot.com/static/demos/blockfactory/index.html ) and after setting up your workspace from it, export the XML. Using this XML on the INGInious platform seems to do the trick.
It's worth noticing that doing so, since it uses hardcoded ID's, prevents any other modification from the graphical interface.

A suggestion to fix this would be to change the path of the factory files currently in use, to the more recent ones present on the INGInious github.

Kind regards

@ogoletti
Copy link

You mean when creating a variable with the workspace editor of a blockly task on inginious.

Also, if I remember what you told me, for the proposed quickfix to work, you need to create the workspace first and the toolbox is generated by the facotry or something like that?

For the fix, my understanding is the actual factory used in inginious' task editor use old blockly js (here:https://github.com/UCL-INGI/INGInious-problems-blockly/blob/c8e30a5013260d2f649cdcf73d1b5573c8bd3004/inginious-problems-blockly/templates/editbox_blockly_templates.html#L101) the js files are 4 years old and have been copied here https://github.com/UCL-INGI/INGInious-problems-blockly/tree/master/inginious-problems-blockly/static/blocklyfactory but we should use the ones in the blockly submodule (in demos/blockfactory). Not sure whether thoses files were modified though.

@cyrilledebongnie
Copy link
Author

cyrilledebongnie commented Jul 26, 2022

You mean when creating a variable with the workspace editor of a blockly task on inginious.

Yes I forgot to specify that indeed.

Also, if I remember what you told me, for the proposed quickfix to work, you need to create the workspace first and the toolbox is generated by the facotry or something like that?

Yes, the workspace factory proposes that you store the generated blocs of the workspace into categories in the toolbox, if you do not accept the toolbox is not created along (also the google factory glitches a bit)

For the fix, my understanding is the actual factory used in inginious' task editor use old blockly js (here:

https://github.com/UCL-INGI/INGInious-problems-blockly/blob/c8e30a5013260d2f649cdcf73d1b5573c8bd3004/inginious-problems-blockly/templates/editbox_blockly_templates.html#L101

) the js files are 4 years old and have been copied here https://github.com/UCL-INGI/INGInious-problems-blockly/tree/master/inginious-problems-blockly/static/blocklyfactory but we should use the ones in the blockly submodule (in demos/blockfactory). Not sure whether thoses files were modified though.

Thanks for the clarification, my message was unclear here as well

@anthonygego
Copy link
Member

For the fix, my understanding is the actual factory used in inginious' task editor use old blockly js (here:

https://github.com/UCL-INGI/INGInious-problems-blockly/blob/c8e30a5013260d2f649cdcf73d1b5573c8bd3004/inginious-problems-blockly/templates/editbox_blockly_templates.html#L101

) the js files are 4 years old and have been copied here https://github.com/UCL-INGI/INGInious-problems-blockly/tree/master/inginious-problems-blockly/static/blocklyfactory but we should use the ones in the blockly submodule (in demos/blockfactory). Not sure whether thoses files were modified though.

There is high chance they were not modified, even if I remember having imported them from the old repo without any further check. This made me realize there is no copyright mention in those files (happily the license at least is OK). That would be worth updating them.

@Drumor I see the blocky submodule has been updated 2 years ago but files copy never updated in the /static folder... there were also changes in the local wrapper js at the same time (see 3495a6b), this is a bit confusing...

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

3 participants