• Resolved StevenKarim1

    (@stevenkarim1)


    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

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Support Jay

    (@bluejay77)

    Hi @stevenkarim1,

    Since the last two updates not including todays recent update, the script, continues to operate,

    Could you specify what you mean by 2 updates ago? That is, which month are you referring to?

    Also, can you confirm if you’ve added some pre-requisites for the lessons->quiz you are trying to access?

    Thanks!

    Thread Starter StevenKarim1

    (@stevenkarim1)

    Hi Thank you for response.
    The last to updates I am referring to are 4.3.0 and 4.4.0

    On 4.4.0 version when I activate the snippet code to hide the view quiz button on the word protected page, this functions as expected.
    Once I put the password in, I see the lesson as expected and the view quiz button.
    Once I click on the view quiz button there is blank page. None of the questions are there. Once I deactive the snippet code, and refresh the questions all appear.

    I have not upgraded to 4.4.1 yet.
    PLease advise
    thank you
    SK

    Plugin Support Jay

    (@bluejay77)

    Hi @stevenkarim1,

    Thank you for providing the details. We’re looking into this issue and running some tests on our end. We’ll get back to you once we know more. Thanks!

    Thread Starter StevenKarim1

    (@stevenkarim1)

    HI Thank you for the update.
    Since my last post, I have updated to the latest version of LMS Sensie.
    The behaviour now is when the snippet is activated and the password protection is selected, you put the password, you see the lesson and the view quizz buttoon, onced clicked you cannot see the quizz questions.

    When the the selected page option is set back to public and the snippet code remains activated, the behaviour is that the page is obviously not password protected, the view quizz button as expected and onced clicked all the quizz questions are as expected.

    i hope this may narrow the beam a little…
    thank you
    SK

    Hi @stevenkarim1 ,

    > you see the lesson and the view quizz buttoon, onced clicked you cannot see the quizz questions.

    Can you let us know about your questions? Do you have any media attached? Are you using Learning Mode?

    The reason I ask is because while attempting to track down the snippet you originally posted, I came across this fairly recent forum post:

    https://www.ads-software.com/support/topic/lesson-media-not-showing-in-learning-mode-missing-gutenberg-block-for-media/

    which indicates that the sensei_single_lesson_content_inside_after action in your snippet may not be getting triggered properly.

    Best,

    Thread Starter StevenKarim1

    (@stevenkarim1)

    Hello
    thank you for your additional information and link.

    I am not using learning mode.

    I do have some images that are presented inline. This is an option in the question block. This is relevant to only 5 question, and the expected function and behaviour is as expected.

    My last post indicated that the relationship is between the snippet i have been using in earlier verions of sensi together with protected pages, that worked as expected.

    The snippet is to hide the view quiz button on the protected page.

    Since the last three version updates the expected behaviour is no longer working.
    I am not sure why when i trigger the protected page option and then enter course, lesson, enter pw and the click the view button quiz that the quiz does not show at all.

    Wehn I switch the page option to public, there is no pw page, there is no pw to enter, I go to the course page, click the lesson, click view quiz and see all the questions together with images.

    This behaviour is the same on the live site and a test student account

    If there anything else you need from me to asssit you please let me know.
    Thankyou for your help and attention.
    SK

    Plugin Support Jay

    (@bluejay77)

    Hi @stevenkarim1,

    Thank you for providing additional details. We are having a hard time reproducing the issue you’re describing.

    >The behaviour now is when the snippet is activated and the password protection is selected, you put the password, you see the lesson and the view quizz buttoon, onced clicked you cannot see the quizz questions.

    Would you try deactivating the snippet and password protect the lesson, and see what happens? Can you confirm that you can enter the password and view the quiz in this case?

    I would like to rule out any user permission-related issue unrelated to snippets.

    Let us know how that goes!

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Snippet Script effecting quiz page’ is closed to new replies.