Source for file learnpathlink.class.php
Documentation is available at learnpathlink.class.php
* Defines a gradebook LearnpathLink object.
* @author Yannick Warnier <yannick.warnier@dokeos.com>
* @package dokeos.gradebook
// FUNCTIONS IMPLEMENTING ABSTRACTLINK
* Generate an array of learnpaths that a teacher hasn't created a link for.
* @return array 2-dimensional array - every element contains 2 subelements (id, name)
die('Error in get_not_created_links() : course code not set');
. ' (SELECT ref_id FROM '. $tbl_grade_links
$cats[] = array ($data['id'], $data['name']);
* Generate an array of all learnpaths available.
* @return array 2-dimensional array - every element contains 2 subelements (id, name)
die('Error in get_not_created_links() : course code not set');
$cats[] = array ($data['id'], $data['name']);
* Has anyone used this learnpath yet ?
$sql = 'SELECT count(id) AS number FROM '. $tbl_stats
return ($number[0] != 0);
* Get the progress of this learnpath. Only the last attempt are taken into account.
* @param $stud_id student id (default: all students who have results - then the average is returned)
* @return array (score, max) if student is given
* array (sum of scores, number of scores) otherwise
* or null if no scores available
$sql = 'SELECT * FROM '. $tbl_stats
$sql .= ' AND user_id = '. $stud_id;
// order by id, that way the student's first attempt is accessed first
$sql .= ' ORDER BY view_count DESC';
return array ($data['progress'], 100);
// all students -> get average
$students= array(); // user list, needed to make sure we only
// take first attempts into account
$students[$data['user_id']] = $data['progress'];
$sum += ($data['progress'] / 100);
return array ($sum , $rescount);
* Get URL where to go to if the user clicks on the link.
$url .= '&action=view&lp_id='. $this->get_ref_id();
$url .= '&action=build&lp_id='. $this->get_ref_id();
* Get name to display: same as learnpath title
* Get description to display: same as learnpath description
return $data['description'];
* Check if this still links to a learnpath
return ($number[0] != 0);
* Lazy load function to get the database table of the learnpath
$database_name = $course_info['dbName'];
* Lazy load function to get the database contents of this learnpath
|