It shouldn't need JS to work. Your button has to be defined in the 'content' of the block so you need to append output from the single_button() function to the list e.g. $content = $mystudentlist . $OUTPUT->single_button(.....) ;
General developer forum
How do I handle a button being clicked?
This discussion has been locked so you can no longer reply to it.