Skip to content

Commit

Permalink
MDL-30975 Docs Documenting Logs API
Browse files Browse the repository at this point in the history
  • Loading branch information
ankitagarwal committed Feb 13, 2012
1 parent 5fc420e commit fcf6490
Showing 1 changed file with 19 additions and 23 deletions.
42 changes: 19 additions & 23 deletions lib/datalib.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?php

// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
Expand Down Expand Up @@ -1649,14 +1648,14 @@ function coursemodule_visible_for_user($cm, $userid=0) {
* than web server hits, and provide a way to easily reconstruct what
* any particular student has been doing.
*
* @global object
* @global object
* @global object
* @global object $DB
* @global object $CFG
* @global object $USER
* @uses SITEID
* @uses DEBUG_DEVELOPER
* @uses DEBUG_ALL
* @param int $courseid The course id
* @param string $module The module name - e.g. forum, journal, resource, course, user etc
* @param string $module The module name e.g. forum, journal, resource, course, user etc
* @param string $action 'view', 'update', 'add' or 'delete', possibly followed by another word to clarify.
* @param string $url The file and parameters used to see the results of the action
* @param string $info Additional description information
Expand Down Expand Up @@ -1746,12 +1745,12 @@ function add_to_log($courseid, $module, $action, $url='', $info='', $cm=0, $user
/**
* Store user last access times - called when use enters a course or site
*
* @global object
* @global object
* @global object
* @global object $USER
* @global object $CFG
* @global object $DB
* @uses LASTACCESS_UPDATE_SECS
* @uses SITEID
* @param int $courseid, empty means site
* @param int $courseid empty courseid means site
* @return void
*/
function user_accesstime_log($courseid=0) {
Expand Down Expand Up @@ -1816,16 +1815,14 @@ function user_accesstime_log($courseid=0) {
/**
* Select all log records based on SQL criteria
*
* @todo Finish documenting this function
*
* @global object
* @global object $DB
* @param string $select SQL select criteria
* @param array $params named sql type params
* @param string $order SQL order by clause to sort the records returned
* @param string $limitfrom ?
* @param int $limitnum ?
* @param string $limitfrom return a subset of records, starting at this point (optional, required if $limitnum is set)
* @param int $limitnum return a subset comprising this many records (optional, required if $limitfrom is set)
* @param int $totalcount Passed in by reference.
* @return object
* @return moodle_recordset instance
*/
function get_logs($select, array $params=null, $order='l.time DESC', $limitfrom='', $limitnum='', &$totalcount) {
global $DB;
Expand Down Expand Up @@ -1860,13 +1857,12 @@ function get_logs($select, array $params=null, $order='l.time DESC', $limitfrom=
/**
* Select all log records for a given course and user
*
* @todo Finish documenting this function
*
* @global object
* @global object $DB
* @uses DAYSECS
* @param int $userid The id of the user as found in the 'user' table.
* @param int $courseid The id of the course as found in the 'course' table.
* @param string $coursestart ?
* @param string $coursestart unix timestamp representing course start date and time.
* @return moodle_recordset instance
*/
function get_logs_usercourse($userid, $courseid, $coursestart) {
global $DB;
Expand All @@ -1891,12 +1887,12 @@ function get_logs_usercourse($userid, $courseid, $coursestart) {
/**
* Select all log records for a given course, user, and day
*
* @global object
* @global object $DB
* @uses HOURSECS
* @param int $userid The id of the user as found in the 'user' table.
* @param int $courseid The id of the course as found in the 'course' table.
* @param string $daystart ?
* @return object
* @param string $daystart unix timestamp of the start of the day for which the logs needs to be retrived
* @return moodle_recordset instance
*/
function get_logs_userday($userid, $courseid, $daystart) {
global $DB;
Expand Down Expand Up @@ -1925,7 +1921,7 @@ function get_logs_userday($userid, $courseid, $daystart) {
* number of accounts. For non-admins, only the attempts on the given user
* are shown.
*
* @global object
* @global object $DB
* @uses CONTEXT_SYSTEM
* @param string $mode Either 'admin' or 'everybody'
* @param string $username The username we are searching for
Expand Down

0 comments on commit fcf6490

Please sign in to comment.