Hi
I want to add a button(submit) to the table. I’m unsure how to link the button to the table. I have scanned this site and searched extensively on YouTube. Came across excellent videos by Ryan De Le Garza.. but somehow what I envision is lost in translation with me. Somebody who can explain this to me as if I were a 5th grader would be greatly appreciated.
You can place an Action Button below a Table or above it, but not part of it. You can only combine the Action Button where it appears on it with Graph or Geometry components. See this activity.
@NTMDev That’s what I was thinking as well. @Poovandrie_Jansen Here is a mock up of a screen similar to the one that you have above. A couple things I want to point out:
I used the cellSuffix for feedback rather than another column to save space and to avoid an empty column.
I used some lists and list functions that you can find information on in this forum to save some time with repeated code. Keep in mind that list functionality is still in beta and may change in the future.
Feedback won’t appear on the table until the button in pressed. Buttons for the most part are pretty simple and one of their most useful features is just telling us how long it has been since they were pressed. It defaults to 10 seconds, but this can be changed by placing a number inside the parenthesis on the timeSincePress function called in the table. By defining the time using this and telling the cellSuffix not to appear until that number is greater than 0, the feedback doesn’t appear until the button is pressed. Time resets when the table is interacted with or the “Edit” button is pressed (still the same button, just in reset mode).
I kept the button pretty simple. The only thing I added as the resetLabel that makes the button show “Edit” after it is pressed. This also stops the timeSincePress timer.
Nice someone else also agrees!
I wonder how you would make the checking manual? Maybe like make an action button update a variable, say checkAnswerBoolean (default false) to TRUE, then we have a check: checkAnswerBoolean? Not sure if this would work.
Also (not sure if I’m on the same page as you) for:
Can’t you just do hidden: this.pressCount = 0 to see if the button was pressed to then show the feedback?
It really depends on if the you want the feedback to reset each time, or for it to persist. By using timeSincePress, the feedback will reset as things are edited as the time resets. However, pressCount won’t ever reset without some other trickery.
I find it a little cleaner on the eyes for the feedback to disappear whenever the table is edited so that isn’t updating in real time as the student makes changes.
I believe that just putting a cell in focus in the table should do it, but yes! It’ll reset back to 0, but pressCount will not. You can test it by setting a variable in the CL and then pulling it into a note to see it reset in real time.
Every time a table cell receives focus it should reset other components?
It breaks every button instantiated animation you’d care to run and isn’t at all semantic. User focus changes should not affect state change in other components.
It’s not in keeping with normal web based animation behaviors and a quick search here will reveal how much of a headache this has been over the years. It’s another thing that should be opt-in, but unfortunately it’s not even opt-out.
I think the intention would be so that if a student were to change a value in table that has an effect on the animation, then the animation would start over.
A lot of times we work around this by disabling edits to the table until the animation is completed, if needed/desired.
And if entering values in a table is not related to the animation running? Or if the animation itself is important to working with the table? You see the problem.
Notably, the Desmos Engineering Team agreed this is a bug and fixed it as far back as 2022(which I can verify through some pull requests I made for it with them), but it seems to have crept back into the codebase unfortunately.
Just search for “reset table focus” on this forum to see how much aggravation this has caused people over the years. It’s not good UX.
@Mike_Gleeson Out of curiosity, do you recall if it was fixed for the native table submit button, or any action button, or both? I guess I’m just wondering if it was only the table submit button that was fixed, which has since been deprecated, and we’re left with action buttons.
The fix was supposed to - and actually did for a short while - apply to all action buttons on the entire page. Table focus should not reset any of them. Just looking at the email now about it, and that was the fix implemented.
I even posted happily about it(last comment in that thread) when that bugfix was pushed through, but sadly I may have to retract that happy post as it reverted back at some point not too very long after that if memory serves.
Daniel and I are both CL Specialists with Amplify. While we can’t fix it directly as that takes work from the engineering team, we can attempt to push it up the chain about it being fixed again.