Sloodle Distributor Module
From SLIS Second Life Wiki
Sloodle Versions: 0.3 (?)
The Sloodle Distributor Module and Sloodle Vending Machine replace the Moodle Distribution Interface and the Sloodle Object Distributor functionality from previous versions of Sloodle. They allow you to distribute items in Second Life via an interface in Moodle. It is a sub-type of the Sloodle activity module in Moodle, so you will need to add an instance of it to your course in order to use it.
An important change is that you can have as many Distributor modules as you like in a course/site, whereas previous versions of Sloodle only allowed a single distributor.
Contents |
[edit] Quick Start Guide
[edit] A. Setting up Moodle
Before you can use a Distributor, you must allow Sloodle to access your course. To do that, ensure that there is a Sloodle Controller Module in your course, and that it is visible and enabled. (The course itself should also be visible). Next, you need to add a Distributor module instance to your course, as follows:
- Activate edit mode (if it is not already active)
- Click a box which says "Add an activity..."
- Look down the list for "Sloodle Modules", and click "Distributor" underneath it
- (you will be taken to a module editing page)
- Enter a name for your Distributor
- Enter a description for your Distributor
- Click one of the "Save" buttons at the bottom
If you view your course page again, you will see a Distributor instance, entitled "Sloodle Distributor: " followed by the name you specified.
[edit] B. Setting up in Second Life
You now need to create a Sloodle Vending Machine object in Second Life, which will be linked to your Distributor in Moodle. You can rez it from a Sloodle Set, or rez it manually if you have one in your inventory. Authorize the Vending Machine if necessary, and visit its web-configuration page. Select the Distributor instance you just created, and save the configuration. In Second Life, download the configuration, and the Vending Machine will attempt to connect to the Distributor in Moodle.
[edit] C. Adding Objects
The Vending Machine and Distributor need to have objects to distribute. Right-click the Vending Machine, click Edit, and select the "Contents" tab. You will see several Sloodle scripts there, which you must not alter. There may also be a "Test Object", which you are free to delete. Click and drag items from your inventory into that Contents tab to store them (note that they may not appear immediately, as Second Life's inventory system can be quite slow sometimes!). You can add anything except scripts, but you must make sure it has the copy permission enabled, otherwise it will be removed from the Vending Machine as soon as somebody takes on.
You can now close the "Edit" window. By default, the Vending Machine should notify Moodle every hour if it has new items to distribute. However, you can manually make an updated by touching the Vending Machine, clicking the "cmd" button, and selecting "Reconnect". Warning: do not click "Reset", because that will force you to re-authorise and reconfigure the Vending Machine.
[edit] D. Distributing Objects
Go back to your Moodle course, and click on the Distributor module. If you are a teacher or administrator, then you will see 3 sections on the page, entitled "Send to me", "Send to another avatar", and "Send to custom UUID". Students will normally only see the first section.
If a Moodle user (such as a student) has their avatar registered with the Moodle site, they can select an object from the menu, and click the send button to have the Vending Machine automatically send them an object. Teachers and administrators can use the other two sections to send objects to any avatar registered with the site, or they can paste any avatar's UUID into the box and have the Vending Machine send objects to them.
(You can also allow avatars to select objects directly from the Vending Machine, without the need for a Distributor module in Moodle).
- Note: you can only send one object to one avatar at a time. In the future, the ability may be added to distribute multiple objects and/or to multiple avatars.
[edit] Frequently Asked Questions
Q: How many Distributor modules and Vending Machines can I have?
A: As many as you like. You can add multiple modules to each course in Moodle, and you can have as many Vending Machines as you like.
Q: Can I use the Vending Machine without the Distributor module, or vice versa?
A: Yes and no. You can use a Vending Machine 'standalone', in which case it is not connected to a Distributor module in Moodle (the only way to access it is to touch the Vending Machine in-world to request objects). However, you cannot use a Distributor module without a Vending Machine, because without, there is nothing in-world to store and distribute the objects.
Q: How many items can the Distributor handle?
A: There is no definite number, but it is inherently limited by the available memory of the Sloodle Vending Machine script to process object names. (Thus, if the object names are shorter, then it should be able to handle a larger number of them).
Q: What types of items can the Distributor handle?
A: In theory, any items can be handled, although scripts are ignored by the Sloodle Vending Machine.
Q: Are there any limits on the names of objects?
A: Any unicode characters should work, including single and double quotation marks. However, this is an area prone to bugs, so if you find a problem, then please report it! :-)
Q: Why can I not have separate Distributor/Selector objects in-world anymore?
A: When those objects were first developed, only a single Distributor could be connected to a site, and thus the Selector was created to allow multiple access points. However, since the number of Distributors (or Vending Machines) is no longer limited, it is simpler to combine all functionality together.
Q: Why can't I just use SL groups to distribute items?
A: You certainly can, and for many purposes, that is much easier. However, it is sometimes useful to be able to distribute an item to yourself or somebody else without having to login to Second Life.
Q: Do I need XMLRPC?
A: Currently, yes. The distribution requests from Moodle into Second Life are send via XMLRPC, as it is fast. However, it is not supported by all servers, and not entirely reliable in Second Life, so email or HTTP 'polling' may be introduced as optional alternatives in future versions of Sloodle.
[edit] See Also
[edit] Developer Information
[edit] Communications
Updates from Second Life to Moodle are sent via HTTP parameters, using the LSL "llHTTPRequest()" function. When connected to Moodle, the Sloodle Vending Machine will open an XMLRPC channel (the key of which is stored in the Moodle database), and subsquent distribution requests are transmitted via that XMLRPC channel.
[edit] API Classes
The Sloodle PHP API contains a class (called SloodleModuleDistributor) to encapsulate much of the Distributore module functionality. If you are using a SloodleSession, then you can access it in the following way:
$sloodle = new SloodleSession();
$sloodle->load_module('distributor', true);
$sloodle->module->...;
[edit] Files
There is a dedicated folder in the Sloodle module for distributor functionality: "sloodle/mod/distributor-1.0".
[edit] Moodle Interface
- The form for adding/editing a Distributor is found in the "mod_form.php" file in the root of the Sloodle module folder.
- The functionality for the main Distributor page is in "view/view_distributor.php", which is included by the "view.php" script.
- The list of sub-types for the Sloodle module (in the "Add an activity..." menus) is defined by the "sloodle_get_types()" function in "lib.php"
[edit] Database
Each Distributor module is a sub-type of the Sloodle module, so it will have an entry in the "sloodle" table, although additional information will be stored in the "sloodle_distributor" table. Each item available in a Distributor will occupy one record of the "sloodle_distributor_entry" table.
| This page is part of the Sloodle documentation | |||
|---|---|---|---|
| SloodleDocs Home | User Documentation | Administrator Documentation | Developer Documentation | Sloodle Wiki Home | |||
