Dragging Points on Integer Coordinates Only

Hi there!

I would like to how to code this so that students can only drag points to integer coordinates. Here is a pic: of screen 9, along with the link to the activity. I appreciate any help!

1 Like

wait … I’m fixing an error

2 Likes

I was going to say that it didn’t work

1 Like

Thank you soooo much for taking this on! :slight_smile:

1 Like

now:

2 Likes

Yes! Thank you so much! :slight_smile:

1 Like

For those unable to view this activity from the paid curriculum, using variables of sliders in the coordinates of your draggable point, and setting the Step to 1 will allow incremented dragging. Note that the activity had it set to 0.1. It is actually recommended to set a step for draggable points to improve accessibility for keyboard navigation.

Note that it is also possible to use the same slider as part of a calculation or function input within the point defintion. (Example). Calculations can sometimes break draggability, particularly if multiple variables are being used.

1 Like

Hello! Is there a way to set a parameter so that students can drag the point only to locations on the coordinate plane where the distance of (c) is divisible by the distance of (a)?

1 Like

You can. You’ll get some awkward jumping behavior of the third point as the distance a changes, but you can use both dynamic bounds for sliders as well as Steps. This is a fresh graph to demonstrate. Steps are often dependent on bounds, so there was a little work to do to ensure they were multiples of a from the second point (and can’t be dragged out of graph bounds).

1 Like

Can we not just do {mod(x, y) = 0:1,0} to see if the two numbers divide?

1 Like

Doing something like that fixes it as a variable and the slider will be removed. You have to only modify the bounds and step to maintain the slider.

1 Like

Oh really? I didn’t know that was the case. Ok.

1 Like