Snippet Script effecting quiz page
-
Last year I was provided support for an operation modification with the view quiz button.
I use a external auditor for exams, and I password protect the lesson page.
this was to prevent the student from entering the quiz/exam before the auditor come online with them. The auditor types in the password then the lesson page would show with the view quiz button.Since the last two updates not including todays recent update, the script, continues to operate, however, the when I enter the password, I see the lesson page and the view quiz button, however, once i enter the quiz page, it is blank, I can see the quiz title but none of the questions appear, it is just blank. I have 52 questions. None of them appear.
Here was the script I was given before:
??
function remove_quiz_button() {
if ( post_password_required() ) {
remove_action( ‘sensei_single_lesson_content_inside_after’, [ ‘Sensei_Lesson’, ‘footer_quiz_call_to_action’ ] );
remove_action( ‘sensei_single_lesson_content_inside_before’, array( ‘Sensei_Lesson’, ‘user_lesson_quiz_status_message’ ), 20 );
}
if ( ‘quiz’ === get_post_type() ) {
add_filter(
‘sensei_can_user_view_lesson’,
function( $can_user_view_lesson, $lesson_id, $user_id ) {
if ( post_password_required( get_post( $lesson_id ) ) ) {
return false;
} else {
return $can_user_view_lesson;
}
},
10,
3
);
}
}
add_action( ‘template_redirect’, ‘remove_quiz_button’);`Is there a modification that needs to be addressed to that the quizz questions can be seen.
Page is behind membership gateway so it wont be easy to provide a link, but can provide screen shot.
Thank you for your assistance!
SK
- The topic ‘Snippet Script effecting quiz page’ is closed to new replies.