LibreTexts / ckeditor-binder-plugin

A CKeditor plugin that makes adding binder enabled pre tags easy.
GNU General Public License v3.0
4 stars 2 forks source link

Showing output only not working as expected #161

Open moorepants opened 3 years ago

moorepants commented 3 years ago

Hi Jason and all,

We created a script in Python to allow successive approximations of equilibrium constants by varying extents of reactions and wish to run it on a LibreText page where students do not see the code, but have fields to input values like reaction coef, molar concentrations and their guesstimate of extent of reactions.

When we use the "insert with output only" we do not get the buttons to run the program.

Cheers and thanks, Bob

moorepants commented 3 years ago

Thanks for the prompt reply Jason,

I am cc'ing Elena, my student working on it, and she just made a copy on this test page, https://chem.libretexts.org/Courses/University_of_Arkansas_Little_Rock/01403L%3A0General_Chemistry_Lab_(Fall_2021)/2%3A_Graphing/4%3A_Test

Cheers, Bob

sandertyu commented 3 years ago

This behavior is determined in src/dialogConfig.js and seems to be determined by the no-code and noCode variables. I expect that this is actually intended behavior for ckeditor-binder-plugin, but front-end users are expecting something different. The script being used will prompt you with multiple input boxes and then do a calculation and display the result.

We'll have to look more into the code. I think the Output Only option only really works properly with widgets, and it might require a somewhat major extension to get it to work with this script as well.

moorepants commented 3 years ago

A simple way to hide the code is to write the code in a script file and import it, so only one or two lines of code are needed to create the output.

sandertyu commented 3 years ago

I tried replacing the input boxes with FloatText widgets but there isn't an immediately easy and intuitive way to integrate them.

It looks like the widgets display as static outputs when using the "Output Only" option anyways, so it wouldn't be useful. This option doesn't actually connect the cell to a kernel I believe, so there is currently no way to get interactive output with the "Output Only" option.