Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

The Moodle Bot Manager plugin adds custom functions for allowing the Moodle eLearning Chatbot app to interact with user and course data. For courses, it adds functions to the following activities: lessons, quizzes and, feedback. If the custom certificate plugin [link] it’s installed, further functions are added. Additionally two custom fields are added: Dialing prefix in the user’s profile to store the country dialing code, and Bot Mode in the course settings, to identify which courses the chatbot should present to the chatbot user.

What does it do?

Bot Manager Plugin creates 13 customized functions that are used by the Moodle eLearning Chatbot app.  These functions provide new ways to retrieve information by the Chatbot app, which presents users with a conversation style chatbot that allows them to create an user account, enroll on ‘chatbot’ compatible courses, and then run lesson content, quizzes, feedback and custom certificate(s), if the necessary plugin is available.

Features 

NEEDS TO BE UPDATED BASED ON GOOGLE DOC

https://docs.google.com/document/d/1MI_NygpXxjQ-qD-J8z-yYD7EE0nCiy1jruPMimAj1T0/edit

Add the following two custom properties:

  • Dialing Prefix field: This field captures the user's country dialing code.

  • Bot Mode field: This field identifies if a course has been configured as a chatbot course.

Adds the following functions:

  • local_botmanager_get_user: Allows retrieving user information from Moodle based on specific criteria such as user ID, mobile phone number, WhatsApp ID, or email. It returns user data that matches the provided criteria.

  • local_botmanager_create_user: Enables creating a new user in Moodle using information provided through an external API.

  • local_botmanager_update_user: Updates user information in Moodle based on provided parameters. It allows modification of various user attributes like first name, last name, email, password, gender, date of birth, and language. The function returns a status message indicating the success of the update and the user's ID.

  • local_botmanager_get_courses: Retrieves a list of courses for a specific user based on their user ID. Returned courses are filtered to include only those with a custom field named 'Bot Mode' set to 'yes'. It provides detailed information for each course, including course ID, course category ID, short name, full name, summary, format, user ID, course enrollment status, progress, raw grade, percentage grade, grade pass threshold, enrollment time, start time, and completion time.

  • local_botmanager_enrol_user: Enrolls a user in a specific course if the user is not already enrolled in that course. It returns the enrollment status as a response.

  • local_botmanager_get_activities: Retrieves information about activities within a specific course for a given user. It can obtain details about all activities or a specific activity within the course.

  • local_botmanager_get_quiz_attempts_summary: Retrieves a summary of a specific quiz attempt, providing details about the quiz, the attempt, the user, and the attempt's results.

  • local_botmanager_open_lesson: Used to retrieve information about opening a lesson, such as the ID of the starting page and the ID of the last seen page for a specific user in a lesson.

  • local_botmanager_view_lesson_page: Provides data about the content of a lesson page, including content type, position, and more. It supports tracking user progress within the lesson and is an essential component for presenting lesson content through the Moodle external API.

  • local_botmanager_get_lesson_attemps_summary: Retrieves a summary of user attempts within a lesson. It offers information about participation, including start and end times, duration, and completion status.

  • local_botmanager_get_feedback: Retrieves user feedback details for a specific feedback activity. It provides information about the activity's title, item ID, name, type, and completion status. This function efficiently extracts and delivers valuable feedback data through the Moodle external API.

  • local_botmanager_answer_question: Allows users to submit answers to questions in a feedback activity. It handles the processing of user responses, verifies correctness, and manages completion status.

  • local_botmanager_get_certificates: Retrieves information about certificates earned by a user in a specific course. It gathers data such as certificate title, description, user's full name, course short name, completion date, and element positions for display.