The LearnDash Reset Button module enables 2 things: a course progress reset button and a course progress reset function (for developers). The button can be displayed with this shortcode or block:
Block Name: Reset Button
In that example, “x” is the ID for the course, which you can look up by editing your course as an admin and looking at the “post=x” value in the URL. The “x” there is the course ID.
- This shortcode or block can be added to any post type, including course post types. When placed on a course page, you do not need to pass in the course ID attribute.
- When added (and the module turned on), the button will be shown on a page only if the user viewing the button has some progress recorded for the course. The button will not be displayed if the user hasn’t started the course.
- If you want to show the button on a course page and only want to show it when users have completed the course, consider wrapping it in the course_complete shortcode included in LearnDash. See https://support.learndash.com/articles/course_complete/ for more information.
Resetting Tin Canny Data
When using the reset button with Tin Canny LearnDash Reporting, the following parameter is supported:
If the reset_tincanny parameter is set to “yes”, clicking the reset button will also delete all Tin Canny results records for that user in the target course. Note: Due to technical constraints, Tin Canny bookmark (resume) data will not be deleted.
For even more control over the button, you can click the settings button in the Toolkit Module page to edit the button text and append the name of the course to the button. The latter is helpful if you make multiple buttons available on a single page so users can distinguish them.
Now, for developers that want to use the new course reset function included in this module in other ways, here’s what you need to know to set this up (please note that this is for developer use only):
//Replace with the user ID and course ID combination to be reset $user_id = 10; $course_id = 100; $reset = new \uncanny_pro_toolkit\LearnDashReset(); $reset->reset_course_progress($user_id, $course_id);