Skip to content

Commit

Permalink
Minor - flint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jmontoyaa committed Apr 14, 2020
1 parent b53068a commit 64a8670
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 29 deletions.
44 changes: 22 additions & 22 deletions main/exercise/exercise.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -3133,28 +3133,6 @@ public function save_stat_track_exercise_info(
return $id;
}

/**
* Get number of questions in exercise by user attempt.
*
* @return int
*/
private function countQuestionsInExercise()
{
$lpId = isset($_REQUEST['learnpath_id']) ? (int) $_REQUEST['learnpath_id'] : 0;
$lpItemId = isset($_REQUEST['learnpath_item_id']) ? (int) $_REQUEST['learnpath_item_id'] : 0;
$lpItemViewId = isset($_REQUEST['learnpath_item_view_id']) ? (int) $_REQUEST['learnpath_item_view_id'] : 0;

$trackInfo = $this->get_stat_track_exercise_info($lpId, $lpItemId, $lpItemViewId);

if (!empty($trackInfo)) {
$questionIds = explode(',', $trackInfo['data_tracking']);

return count($questionIds);
}

return $this->getQuestionCount();
}

/**
* @param int $question_id
* @param int $questionNum
Expand Down Expand Up @@ -9742,6 +9720,28 @@ public static function cleanSessionVariables()
Session::erase('hotspot_delineation_result');
}

/**
* Get number of questions in exercise by user attempt.
*
* @return int
*/
private function countQuestionsInExercise()
{
$lpId = isset($_REQUEST['learnpath_id']) ? (int) $_REQUEST['learnpath_id'] : 0;
$lpItemId = isset($_REQUEST['learnpath_item_id']) ? (int) $_REQUEST['learnpath_item_id'] : 0;
$lpItemViewId = isset($_REQUEST['learnpath_item_view_id']) ? (int) $_REQUEST['learnpath_item_view_id'] : 0;

$trackInfo = $this->get_stat_track_exercise_info($lpId, $lpItemId, $lpItemViewId);

if (!empty($trackInfo)) {
$questionIds = explode(',', $trackInfo['data_tracking']);

return count($questionIds);
}

return $this->getQuestionCount();
}

/**
* Gets the question list ordered by the question_order setting (drag and drop).
*
Expand Down
1 change: 0 additions & 1 deletion main/inc/global-min.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,6 @@
}
}


ini_set('log_errors', '1');

/**
Expand Down
1 change: 0 additions & 1 deletion main/inc/lib/api.lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -6482,7 +6482,6 @@ function api_request_uri()
* @return int access_url_id of the current Chamilo Installation
*
* @author Julio Montoya <gugli100@gmail.com>
*
*/
function api_get_current_access_url_id()
{
Expand Down
16 changes: 11 additions & 5 deletions main/inc/lib/statistics.lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,7 @@ public static function rescale($data, $max = 500)
* @param array $stats
* @param bool $showTotal
* @param bool $isFileSize
*
* @return string HTML table
*/
public static function printStats(
Expand Down Expand Up @@ -592,11 +593,14 @@ public static function printLoginStats($type)

/**
* Print the number of recent logins.
* @param bool $distinct whether to only give distinct users stats, or *all* logins
* @param int $sessionDuration Number of minutes a session must have lasted at a minimum to be taken into account
* @param array $periods List of number of days we want to query (default: [1, 7, 31] for last 1 day, last 7 days, last 31 days)
* @return string HTML table
*
* @param bool $distinct whether to only give distinct users stats, or *all* logins
* @param int $sessionDuration Number of minutes a session must have lasted at a minimum to be taken into account
* @param array $periods List of number of days we want to query (default: [1, 7, 31] for last 1 day, last 7 days, last 31 days)
*
* @throws Exception
*
* @return string HTML table
*/
public static function printRecentLoginStats($distinct = false, $sessionDuration = 0, $periods = [])
{
Expand Down Expand Up @@ -679,12 +683,14 @@ public static function printRecentLoginStats($distinct = false, $sessionDuration

/**
* Get the number of recent logins.
*
* @param bool $distinct Whether to only give distinct users stats, or *all* logins
* @param int $sessionDuration Number of minutes a session must have lasted at a minimum to be taken into account
* @param bool $completeMissingDays Whether to fill the daily gaps (if any) when getting a list of logins
*
* @return array
* @throws Exception
*
* @return array
*/
public static function getRecentLoginStats($distinct = false, $sessionDuration = 0, $completeMissingDays = true)
{
Expand Down

0 comments on commit 64a8670

Please sign in to comment.