vmware-tanzu-labs / educates-training-platform

A platform for hosting interactive workshop environments in Kubernetes, or on top of a local container runtime.
https://docs.educates.dev
Apache License 2.0
63 stars 15 forks source link

Ability to block progress unless examiner actions passed #390

Open GrahamDumpleton opened 1 month ago

GrahamDumpleton commented 1 month ago

Is your feature request related to a problem? Please describe.

When using examiner actions there is no way to block someone to skip to next page anyway.

Describe the solution you'd like

Want to be able to block moving forward in workshop unless selected examiner actions have successfully passed. The next page buttons should be disabled, as well as entries for subsequent pages in the TOC.

A hack solution is to use a shortcode which injects following Javascript.

<script>
    document.addEventListener("DOMContentLoaded", function() {
        $("#header-next-page").prop("disabled", true)
        $("#next-page").prop("disabled", true)
        intervalId = setInterval(() => {
            if ($('[data-action-name="examiner:execute-test"]').not('[data-action-result="success"]').length == 0) {
                $("#header-next-page").prop("disabled", false)
                $("#next-page").prop("disabled", false)
                clearInterval(intervalId);
            }
        }, 1000);
    })
</script>

Note that needs to perhaps know when have successfully completed a page so that if go back again not forced to perform those actions again and not blocked from moving forward again.

Describe alternatives you've considered

No response

Additional information

No response