Picture of Jason Wilson
Hide assessment questions after completion
by Jason Wilson - Sunday, 14 February 2021, 11:56 PM

Hi guys, I was wondering if there might be a way to hide the assessment questions once it has been completed?

We have an issue where some of our regions tend to "share" their results with others so they can quickly pass assessments at the end of a course (generally by screen capturing the results).

I've set the following CSS, which works, but it is quite an abrupt change onscreen, as the CSS class changes:

.is-complete .is-assessment {
display: none;

This hides all the questions and only shows the result.

I'd like to animate the questions out if possible, so as not to be so abrupt, but "display: none" cannot be animated. I thought about using on-screen classes to use the built-in CSS animations, but am unsure how to call them when the assessment (or question) is complete.

Has anyone tried similar? I don't mind hiding either at a question level or assessment level.

I'm using the Author Tool, but don't mind hand coding into the template files if required.

Thanks for any input or ideas!

Picture of Simon Date
Re: Hide assessment questions after completion
by Simon Date - Monday, 15 February 2021, 9:36 AM

Hi Jason,

How about having a CSS animation that goes from height: 100% to height: 0 ?

You could solve your inita problem of preventing learners from sharing the questions/results why don't you use either question banking or randomisation to prevent learners from getting the same questions?


Picture of Jason Wilson
Re: Hide assessment questions after completion
by Jason Wilson - Monday, 15 February 2021, 8:17 PM

Thanks, Simon. I'll take another look but I don't think height is set initially, but there may be a workaround.

We actually do use randomisation and question banks, but unless I'm missing something all the questions are still displayed once the result is calculated (and displayed in a separate article below the questions article).

We only display the pass or fail icon, but it can still be enough to screenshot.

I was also having issues with where to place any custom jquery. I was calling it from theme.js (from a customised vanilla theme) as a test and could get a successful console message on the assessment page load, but it wouldn't seem to work once the assessment was started (after clicking a trickle button to show the first question).

I'll figure it out eventually but just wasn't sure if others had looked into this already.