I am trying to calculate a learning plan, based on following user inputs:
Deadline
Repetitions
Then I would calculate dates for repetitions in the order, that the time till next repetition the Double of the previous is, for example 2, 4, 8, 16 day delays.
As output I would like to return a learning Schedule.
Here’s my Matlab code for this operation(there are bit more inputs):
deadline = 28;%days till deadline
x =0;%first review delay
r = 4;%number of reviews
c = 2; %review multiplyier
sum_buffer = 0;
for i = 1:r
sum_buffer = sum_buffer + c^(i-1);
end
x = deadline/sum_buffer;
reviews = 1:r;
for z = 1:r
reviews(z) = round(x*c^(z-1));
fprintf('reviev %d: %d\n', z, reviews(z));
end
Just do it in the browser using Toolbox plug-ins (Run Javascript action and JS to Bubble element to return the value(s) back to Bubble). This is fairly straightforward once you’ve done it or seen how its done.
(Unfortunately, I haven’t seen the “canonical” tutorial post on using these elements in this way… I’m sure somebody’s got a slick video about this or something.)
I know, this sounds noob, but can you help me with data communication between Javascript code and my bubble databank. For example, how do I store return values?
The HTML I’m using is a map, and I’m trying to trigger a workflow from a click on an item in the map. What would I need to use to trigger the “run javascript” step from the HTML element?
I am trying to run a calculation in a repeating group using two different dynamic data sets.
In the repeating group is a list of phones. The first dynamic data set is that each phone has a numerical score (out of 100) for how good 6 different features (e.g. a score of 48 out of 100 for battery life).
The second dynamic data set is the user’s preferences for the importance of the different features (e.g. a score of 85 out of 100 for the importance of a good battery). These would have already been set when they sign up.
When the user views the repeating group, I want a weighted calculation (using the user’s preferences and products features scores) for each product to show which product best suits their requirements.
I think it would be best that this calculation is calculated in the browser.
Would it be possible to run this using the toolbox plugin, or is their another way to do this?
Thanks a lot, I have downloaded the tool but do not see how it’s possible with the options it’s giving me. Please could you expand on how to use the tool in this way or point me in the direction of any documentation that could explain it?
For anyone who wants a little more commentary and description about how you use Run JavaScript with JavaScript to Bubble, here’s a follow-on that covers the same ground: