• Hey there,

    I have embedded a Gravity Form in a Lesson so the student must submit certain details before they can proceed to the next lesson.

    The issue I am facing however, is how to ensure they have submitted the form before letting them proceed to the next lesson.

    I can’t use [Namaste-Mark] in the page, as that could allow them to mark it complete prematurely.
    Nor can I put [namaste-mark] in the actual form because the form itself is inserted with a shortcode.

    Without [Namaste-Mark] in the page, the lesson is marked as complete once the page has been viewed.
    This allows them to go back to the Lessons overview and click on the next one, skipping the form.

    Can you recommend the best way to do this?
    I have Namaste PRO so happy to email if needed.

    Thanks!

    Justin

    https://wordpress.org/plugins/namaste-lms/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Bob

    (@prasunsen)

    You can require admin approval so when the form is submitted you manually approve the lesson as completed.
    If this is not feasible you’ll need some custom code to mark the lesson as completed when the form is submitted.

    Thread Starter jhickling

    (@jhickling)

    I can use a PHP shortcode in the form confirmation that will allow me to execute a function.

    I notice on your developer page that you have:
    do_action(‘namaste_completed_lesson’, $student_id, $lesson_id)

    Will this code mark the lesson as complete?
    If so, do I need to change anything in the variables? Or are these automatically pulled from the current user/lesson they are viewing?

    Thanks,

    Justin.

    Plugin Author Bob

    (@prasunsen)

    Maybe my documentation sucks again, but the do_action that you see is what WE call when lesson is compelted. I.e. you can’t call this action yourself – it allows you to catch the action and do something with the information that student X completed lesson Y.

    In order to mark the lesson as completed you need to directly call:

    NamasteLMSLessonModel :: complete($lesson_id, $student_id)

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Namaste Lesson Gravity Form’ is closed to new replies.