I’m trying to build hotspot-style questions for my medical education app. The idea is simple: a corrector defines a valid clickable area on an image, and later the student clicks on the image. If the student’s click falls within the predefined area, the answer is considered correct.
I’ve tried a few plugins, but I haven’t found a reliable way to implement this yet, and I’m currently stuck.
Does anyone have suggestions or experience with building this kind of feature?
One way to implement this in Bubble is to treat the hotspot as coordinates, not as a special element in the image.
On the broker screen, you display the image within a group, give it an ID, and use the Toolbox (JavaScript to Bubble) plugin to capture the point at which the person clicked. With each click you receive the coordinates relative to the image (for example, normalized from 0 to 1) and save this in the database, in a data type linked to the question. If you want a rectangle, for example, the corrector clicks twice: first to the top left, then to the bottom right, and you record x1, y1, x2, y2.
On the student’s screen, you show the same image, capture the student’s click with the same schema (JavaScript to Bubble), and get normalized click_x and click_y. In the workflow, you only compare: if the click is between x1 and x2 and between y1 and y2, you mark it as correct; otherwise, incorrect.
The advantage of this path is that you do not depend on a specific hotspot plugin and yet
Thank you for the help ! Another question : using this method, how could I display the “correct area” on the image for student when it comes to correction ?