• Resolved Andrew

    (@andrew1111)


    We would like to get user quiz scores programmatically (i.e. API call), what is the best way? I see there is stm_lms_get_user_course_quizzes()

    Thank you,

    Andrew

Viewing 5 replies - 1 through 5 (of 5 total)
  • Hello,

    Thank you for contacting us

    I have forwarded your message to the dev team and they would like to know about which user you want to get scores. Like all users in the database or separate/unique/individual users?

    Let me know and I will try to give the prompt answer,

    Thanks,

    Jacob, Support Team

    Thread Starter Andrew

    (@andrew1111)

    Hi Jacob,

    Thanks for your help. We need quiz scores for a specific user and course. When the user completes a course, we gather their quiz score for that specific course.

    Thank you,

    Andrew

    Hi @andrew1111,

    Sorry for the delay. I contacted with developers and was told following guides:

    1. stm_lms_lesson_passed – runs when Lesson Completed, but Course may be still not finished here:
      do_action( ‘stm_lms_lesson_passed’, $user_id, $lesson_id, $course_id )
    2. stm_lms_progress_updated – runs when Lesson Completed, $progress value will be 100, when Course finished:
      do_action( ‘stm_lms_progress_updated’, $course_id, $user_id, $progress );

    stm_lms_lesson_passed action:
    $lesson_id = $quiz_id

    stm_lms_get_user_quizzes( $user_id, $quiz_id )

    Let us know if there will be any further questions. We are always there to help you.

    Best Regards

    Thread Starter Andrew

    (@andrew1111)

    Thank you. Going forward we will depend on these Masterstudy APIs:

    stm_lms_get_user_course_quizzes()

    stm_lms_progress_updated

    Also, I noticed in my testing that if a quiz is shared between courses, once the quiz has been taken in one course, the quiz result is shown in all courses that include it in the curriculm. I’m not sure if this is the expected behavior?

    For example, in the demo content there is “Middle Quiz” that’s shared among the various demo courses. When “Middle Quiz” is completed in one course, the other courses that include it, show it as completed as well. They show it completed even though no record exists in table wp_stm_lms_user_quizzes for the course/quiz.

    Thanks,

    Andrew

    Yes, you are right. Because quiz in shared courses is a single post. For different courses, separate posts should be used, if you do not want such behavior of quizzes.

    In case you want to use the same questions in quizzes of different courses, then we recommend to create the questions separately from MS LMS > Questions, then import them to your existing quiz using Questions Library. Here is the manual for that: https://docs.stylemixthemes.com/masterstudy-lms/lms-course-features/questions

    Let us know if there will be any further questions.

    Best Regards

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Get user quiz scores’ is closed to new replies.