Fileref:sl classroom/sl profile linker.php

From SLIS Second Life Wiki

Jump to: navigation, search

Image:folder.gif (parent)

This Linker Script gives external access to the profile management tools for classroom layouts. (See the Sloodle Set for more information).

The script operates in one of several modes, depending on what is specified in the 'sloodlecmd' parameter.


Contents

[edit] Dependencies

Sloodle files:


[edit] Parameters

The following parameters are required:

  • sloodlepwd = Prim Password for authenticating the request
  • sloodleuuid = UUID of the user making the request (optional if 'sloodleavname' is specified)
  • sloodleavname = avatar name of the user making the request (optional if 'sloodleuuid' is specified)
  • sloodlecourseid = the ID of the course which the profile is in
  • sloodlecmd = the operation (or command) to be carried out. (This can be 'newprofile', 'saveentries', 'listentries', or 'listprofiles')


If 'sloodlecmd' is set to 'newprofile', 'saveentries' or 'listentries' then the following parameter is also required:

  • sloodleprofilename = the name of the profile beinghandled


If 'sloodlecmd' is set to 'saveentries' then the following parameter is required as well:

  • sloodleentries = the entries to be added to the profile, in pipe-delimited form (e.g. "Sloodle+Set+0.704|<1,2,3>||Sloodle+WebIntercom|<0,3.2,1>")


[edit] Response

The response depends on the mode, as specified in the 'sloodlecmd' parameter.

[edit] newprofile

If successful, the status code will be 1, and the ID number and profile name will be give on the first data line, like this:

23|My Prfile

[edit] saveentries

Status code will be 1, but with no data.

[edit] listentries

If successful, the status code will be 1, with each line representing a single entry. The entry will contain the entry ID, the name of the object, and the position; e.g.:

6|Sloodle WebIntercom|<1.4,0.9,2.6> 7|Sloodle Registration Booth|<2.1,3.0,3.5> 11|Sloodle MetaGloss|<0.0,1.2,2.6>

[edit] listprofiles

If successful in fetching a list of profiles, the status code will be 1, and each line will contain a profile ID number, and the name of the profile; e.g.:

2|topic1 15|demo 26|assessment


[edit] Error Responses

There are some profile-specific error codes, as follows:

  • -901 = unknown profile error
  • -902 = profile does not exist
  • -903 = profile already exists (i.e. cannot be created again)
  • -904 = unknown profile command (parameter 'sloodlecmd')

In some cases, -103 may also be returned if no profile or entry data was found. Also, -331 will be returned if the user does not have admin or teacher status on the course.


[edit] Algorithm

  1. Create SloodleLSLHandler object
  2. Process basic request data
  3. Authenticate request
  4. Login user
  5. Ensure user is an admin, or a teacher on the current course (terminate if not)
  6. Obtain additional parameters
  7. Is script in 'newprofile' mode? If yes then:
    1. Fetch classroom profile
    2. If profile didn't exist already then:
      1. Construct database object
      2. Add profile to database (terminate on failure)
    3. If profile already existed then:
      1. Output error message
  8. Is script in 'listprofiles' mode? If yes then:
    1. Get a list of profiles in the course
    2. Output profiles
  9. Is script in 'listentries' mode? If yes then:
    1. Get named profile (terminate on failure)
    2. Get all entries in profile
    3. Output each entry
  10. Is script in 'saveentries' mode? If yes then:
    1. If there are no entries to save then terminate with error message
    2. Get named profile (terminate on failure)
    3. Get old entries
    4. Construct array of database entry object for new entries
    5. Save new profile entries to database
    6. Output success or failure message
  11. Is script mode unrecognised? Then output error message
  12. Render response
  13. Terminate script
This page is part of the Sloodle documentation
SloodleDocs Home | User Documentation | Administrator Documentation | Developer Documentation | Sloodle Wiki Home
Personal tools