German Version: Here
NOTE: In the current version, this plugin is only designed to work with the KIB3 Moodle Courses.
- Install the backend
- Clone this repository.
- Move the downloaded code into the following path relative to your Moodle server code top level directory:
./blocks/chatbot
. I.e., the folder./blocks/chatbot/
should contain the version information:version.php
- Open your Moodle administration page in your web browser, this should trigger the plugin installation.
NOTE: for full assistant functionallity, we recommend also installing this plugin which allows searching through PDF content in the course using the assistant.
- Go to the administration settings, then navigate to
Plugins
. - Click
Chatbot Plugin
in the sectionBlocks
. This should open the settings page (see screenshot below).
- Set
Server name
to the IP address or URL of the server hosting the Chatbot Backend Server. - If you are not running the Moodle Assistant as part of the docker setup, then set
Event Server Name
to the same value asServer name
. Otherwise, ignore this setting - the default should work for the docker setup. - Only if you changed the default port of the
Chatbot Backend Server
in the python code, update theServer port
setting accordingly. Otherwise, leave at default value. - Leave
Chat Container
at the default value (if you run into problems with your theme later, you might want to change this setting). - Enable the Moodle Assistant for all Courses that you want it to appear in.
- Navigate to the administration settings, then navigate to
Server
. - In the section
Web services
, clickoverview
. - Ensure that
Enable Web Services
status isYes
. - Ensure that
Enable protocols
status includesrest
. - Click
Create a specific user
with the following attributes:Username
:kib3_webservice
, choose a password,First name
:KIB3 Webservice
,Last name
:KIB3 Webservice
, choose an email address and create the user.
- Navigate to the administration settings, then navigate to
Users
and in the sectionPermissions
, clickDefine roles
. - Click
Add a new role
. - Select archetype:
MANAGER
and continue. - Set
Short name
tokib3webservice
andCustom full name
toKIB3 Webservice
. Give a description. - Scroll down to the permissions, and allow
moodle/webservice:createtoken
andwebservice/rest:use
- Assign this role to the newly created user
kib3_webservice
. - Navigate back to the webservices overview page.
- Click
Select a service
. UnderneathCustom services
, clickAdd
. - Change
Name
andShort Name
tokib3_webservices
. Make sure to tickEnabled
andAuthorised users only
and save. - Navigate back to the webservices overview page, then click
Add functions
. - Under the section
Custom services
, click theFunctions
link in the row forkib3_webservices
. - Click
Add functions
, and add all functions starting withblock_chatbot_
,block_booksearch_
,mod_icecreamgame_
(only if you installed the Icecreamgame Plugin ) and finally the 2 functionsmod_glossary_get_entries_by_search
andmod_glossary_get_glossaries_by_courses
. - Navigate back to the webservices overview page, then click
Create a token for a user
. - Select the
KIB3 Webservice
user and thekib3_webservices
Service
, then save changes.
- Go to the frontpage of your Moodle site.
- Turn editing on
- Click "+ Add a block"
- Select
Chatbot
- Once the block has been added, click the settings icon, and then
Configure
. - Look for setting
Where this block appears
, chooseAny Page
. Don't worry, the assistant will only show up in courses selected in configuration step 7.
- Navigate to the KIB3 course in your moodle using your webbrowser.
- Make sure you are a student in the course.
- If the backend is running and everything is configured correctly, the chatbot window should show in the bottom right corner of the screen:
- If nothing shows up, check both the javascript console and the output of the chatbot backend server.