[svn r14819] Added parameter to get_db_progress() to allow for a non-altered result

skala
Yannick Warnier 17 years ago
parent 4346f5be43
commit 3f6fa53899
  1. 11
      main/newscorm/learnpath.class.php

@ -1831,9 +1831,11 @@ class learnpath {
* @param integer Learnpath ID
* @param integer User ID
* @param string Mode of display ('%','abs' or 'both')
* @param string Course database name (optional, defaults to '')
* @param boolean Whether to return null if no record was found (true), or 0 (false) (optional, defaults to false)
* @return integer Current progress value as found in the database
*/
function get_db_progress($lp_id,$user_id,$mode='%', $course_db='')
function get_db_progress($lp_id,$user_id,$mode='%', $course_db='', $sincere=false)
{
//if($this->debug>0){error_log('New LP - In learnpath::get_db_progress()',0);}
$table = Database::get_course_table('lp_view', $course_db);
@ -1846,6 +1848,13 @@ class learnpath {
$progress = $row['progress'];
$view_id = $row['id'];
}
else
{
if($sincere)
{
return null;
}
}
if(!$progress)
{
$progress = '0';

Loading…
Cancel
Save