Fileref:login/sl teacher courses linker.php
From SLIS Second Life Wiki
This Linker Script allows another script to retrieve a list of Moodle courses for which the specified user has at least teacher status. (Note: Moodle administrators have teacher status for all courses). Optionally, the results returned can be restricted to a specific course category.
Contents |
Dependencies
Sloodle files:
Parameters
The following HTTP parameters are required:
- sloodlepwd = the site's Prim Password
- sloodleuuid = UUID of the user's avatar (note: optional if 'sloodleavname' is provided)
- sloodleavname = name of the user's avatar (note: optional if 'sloodleuuid' is provided)
The following parameter is optional:
- sloodlecategoryid = ID of the course category to limit results to
Response
If the query is successful, the status code in the response will be 1, and each data line will contain information about a course, in format: "<id>|<shortname>|<fullname>".
Note: if the user does not have teacher status on any courses in the specified category (or on the whole site if no category is specified), then the response can still have status code 1, but there will be no data lines. When interacting with this script, ensure to check the number of data lines in the response before attempting to process them.
Algorithm
- Construct a SloodleLSLHandler object
- Process request data
- Authenticate request
- Login user identified in request
- Fetch list of courses, restricted to specific category if necessary
- For each course listed:
- If the user is an admin, or a teacher on that course, output the course data
- Render response
- Terminate script
| This page is part of the Sloodle documentation | |||
|---|---|---|---|
| SloodleDocs Home | User Documentation | Administrator Documentation | Developer Documentation | Sloodle Wiki Home | |||
