feat: add reset option to Randomized Content Block

This makes the reset button to refresh the contents of a Randomized
Content Block (RCB) without reloading the full page by fetching a new
set of problems in the "reset" response and replacing the DOM contents.

The reset button returns the student view as a string and the client
uses the HtmlUtils package to replace the contents and reinitializes the
XBlock.

This allows students to use the RCB as a flash card system.

Co-authored-by: tinumide <tinuade@opencraft.com>
This commit is contained in:
Arunmozhi
2021-09-01 13:47:39 +00:00
committed by Agrendalath
parent dae0de89dd
commit 2b39da69b9
5 changed files with 116 additions and 2 deletions

View File

@@ -635,6 +635,17 @@ html.video-fullscreen {
border-bottom: 1px solid #ddd;
margin-bottom: ($baseline*0.75);
padding: 0 0 15px;
.problem-reset-btn-wrapper {
position: relative;
.problem-reset-btn {
&:hover,
&:focus,
&:active {
color: $primary;
}
}
}
}
.vert > .xblock-student_view.is-hidden,