Hey guys, I'm super new to moodle development so please go easy on me!
I'll start with some context, I have a block that displays a form that contains a 'leaderboard' of students enrolled on the course, but it only displays 10 students currently. I have added a button at the bottom of this html table that I want the user to be able to click and be taken to a form to view the full leaderboard.
The problem is, I don't know how to do this, and have no experience using JavaScript. I tried to use things like this:
$url = new moodle_url('/blocks/simple_rank/edit_form.php', array('id' => $courseid));
echo $OUTPUT->single_button($url, 'test', 'get');
However, this didn't work, as the button didn't show up on the form but instead behind the header of the local moodle page and when clicked it did not get taken to the form that I wanted it to.
Apologies for the presumably stupid question, but any help and (simple) explanation would be greatly appreciated!
Thanks,
Sean.