Note: You are currently viewing documentation for Moodle 2.2. Up-to-date documentation for the latest stable version is available here: Portfolio API.

Development:Portfolio API: Difference between revisions

From MoodleDocs
No edit summary
No edit summary
Line 4: Line 4:
# The admin can specify default portfolio for all users, and/or allow the user to pick one as well.
# The admin can specify default portfolio for all users, and/or allow the user to pick one as well.
# Small function like portfolio_add_button() can be called from throughout Moodle to add a small button labelled "Add to portfolio".  Can be next to forum posts, assignments, quiz attempts etc.
# Small function like portfolio_add_button() can be called from throughout Moodle to add a small button labelled "Add to portfolio".  Can be next to forum posts, assignments, quiz attempts etc.
# Button links to central script portfolio/add.php with parameters to call back a lib.php function in the calling Moodle module, such as portfolio_add_item().
# Button links to central script portfolio/add.php with parameters to call back a lib.php function in the calling Moodle module, such as assignment_add_portfolio().
# This function takes the arguments and uses it to create a file (native format or a constructed html) plus metadata like user name etc, which it returns.
# This function takes the arguments and uses it to create a file (native format or a constructed html) plus metadata like user name etc, which it returns.
# If there are multiple portfolios or instances configured, then portfolio/add.php shows the thing along with "you are currently sending this to a portfolio, select one or more from the following" ... otherwise if there is only one, then skip this step.
# If there are multiple portfolios or instances configured, then portfolio/add.php shows the thing along with "you are currently sending this to a portfolio, select one or more from the following" ... otherwise if there is only one, then skip this step.

Revision as of 22:32, 6 May 2007

Here is how it will work:

  1. The admin can set up portfolio plugins over Moodlenet or any other mehcanism as being trusted portfolios for this Moodle.
  2. The admin can specify default portfolio for all users, and/or allow the user to pick one as well.
  3. Small function like portfolio_add_button() can be called from throughout Moodle to add a small button labelled "Add to portfolio". Can be next to forum posts, assignments, quiz attempts etc.
  4. Button links to central script portfolio/add.php with parameters to call back a lib.php function in the calling Moodle module, such as assignment_add_portfolio().
  5. This function takes the arguments and uses it to create a file (native format or a constructed html) plus metadata like user name etc, which it returns.
  6. If there are multiple portfolios or instances configured, then portfolio/add.php shows the thing along with "you are currently sending this to a portfolio, select one or more from the following" ... otherwise if there is only one, then skip this step.
  7. portfolio/add.php then takes care of passing this data to the currently active portfolio plugin(s) (All in the directories /portfolio/type/xxx).
  8. The plugin takes care of copying this data to the external system, and showing any screens that might be necessary, like more metadata etc, or perhaps just a simple message saying "your file has been added to your portfolio" with two buttons, one to return to where you were, and one to go further into the portfolio and start messing with it.

Easy!