Interactive Binary Long Addition

This is the culmination of a number of experiments with getting bitwise computations to work. This experiment allows students to try a problem twice, and then reset the input values.

The code to get the reset to interact with the 'try X number of times" feature was trickier than anticipated. It still has a few bugs, but works reasonably well.

Take a look at the public version: Long Binary Addition Practice

Steve Frezza

1 Like

Hi Steve, this looks great!

I think the only thing I noticed playing with it is that tab order here feels very unnatural, since you want to start on the right end and work your way left. This makes keyboard navigation/accessibility challenging. I would have layed it out exactly as you have, so I’m curious to see what the community suggests on making it easier to navigate/interact with.

It looks good to me. We don’t have a way to change the tab order among the inputs. If we did, presumably, it’d be better for the order to traverse the table by columns.

I’m wondering about the practice of using the resample action to resample the random parameters. The more I think about, the more I worry that it is an antipattern. If we are really just talking about randomizing parameter values and giving students new attempts (as opposed to exploring the behavior of random numbers), then we should encourage use of the <select*> tags rather than the <sample*> tags. The select tags create different variants of the problem, which can then be assigned to students. When creating the assignment, one can allow students an unlimited number of attempts (which are attempts of the whole problem, which are a separate concept from the attempts on an individual answer). Then students will get a “New attempt” button that will give them a new variant.

This new attempt button is not yet available for Doenet embedded in PreTeXt, so the current solution might be the only way to do it for now. But, the hope is we can make it easier for you by just taking care of that logic and not forcing you to create call action buttons to get the desired behavior.

I’m not confident that this explanation is at the right level. Let me know if some points need more clarification.