Minor - flint fixes; format code

pull/2757/head^2
Julio Montoya 7 years ago
parent 8b75c84f97
commit a5c5e41a61
  1. 2
      main/exercise/exercise_show.php
  2. 4
      main/inc/lib/auth.lib.php
  3. 24
      main/inc/lib/statistics.lib.php

@ -809,7 +809,7 @@ foreach ($questionList as $questionId) {
$formMark->addSelect('marks', get_lang('AssignMarks'), $options); $formMark->addSelect('marks', get_lang('AssignMarks'), $options);
$formMark->display();*/ $formMark->display();*/
echo '<form name="marksform_'.$questionId.'" method="post" action="">'; echo '<form name="marksform_'.$questionId.'" method="post" action="">';
echo get_lang("AssignMarks"); echo get_lang('AssignMarks');
echo "&nbsp;<select name='marks' id='select_marks_".$questionId."' class='selectpicker exercise_mark_select'>"; echo "&nbsp;<select name='marks' id='select_marks_".$questionId."' class='selectpicker exercise_mark_select'>";
$model = ExerciseLib::getCourseScoreModel(); $model = ExerciseLib::getCourseScoreModel();
if (empty($model)) { if (empty($model)) {

@ -35,7 +35,7 @@ class Auth
// Secondly we select the courses that are in a category (user_course_cat<>0) and // Secondly we select the courses that are in a category (user_course_cat<>0) and
// sort these according to the sort of the category // sort these according to the sort of the category
$user_id = intval($user_id); $user_id = (int) $user_id;
$sql = "SELECT $sql = "SELECT
course.code k, course.code k,
course.visual_code vc, course.visual_code vc,
@ -51,7 +51,7 @@ class Auth
FROM $TABLECOURS course, $TABLECOURSUSER course_rel_user FROM $TABLECOURS course, $TABLECOURSUSER course_rel_user
WHERE WHERE
course.id = course_rel_user.c_id AND course.id = course_rel_user.c_id AND
course_rel_user.relation_type<>".COURSE_RELATION_TYPE_RRHH." AND course_rel_user.relation_type <> ".COURSE_RELATION_TYPE_RRHH." AND
course_rel_user.user_id = '".$user_id."' course_rel_user.user_id = '".$user_id."'
$avoidCoursesCondition $avoidCoursesCondition
ORDER BY course_rel_user.sort ASC"; ORDER BY course_rel_user.sort ASC";

@ -629,7 +629,7 @@ class Statistics
/** /**
* get the number of recent logins. * get the number of recent logins.
* *
* @param bool $distinct Whether to only give distinct users stats, or *all* logins * @param bool $distinct Whether to only give distinct users stats, or *all* logins
* @param int $sessionDuration * @param int $sessionDuration
* @param bool $completeMissingDays Whether to fill the daily gaps (if any) when getting a list of logins * @param bool $completeMissingDays Whether to fill the daily gaps (if any) when getting a list of logins
* *
@ -766,6 +766,7 @@ class Statistics
while ($obj = Database::fetch_object($res)) { while ($obj = Database::fetch_object($res)) {
$result[$obj->course_language] = $obj->number_of_courses; $result[$obj->course_language] = $obj->number_of_courses;
} }
return $result; return $result;
} }
@ -1075,13 +1076,16 @@ class Statistics
false false
); );
} }
/** /**
* Returns an array with indexes as the 'yyyy-mm-dd' format of each date * Returns an array with indexes as the 'yyyy-mm-dd' format of each date
* within the provided range (including limits). Dates are assumed to be * within the provided range (including limits). Dates are assumed to be
* given in UTC * given in UTC.
* @param string $startDate Start date, in Y-m-d or Y-m-d h:i:s format *
* @param string $endDate End date, in Y-m-d or Y-m-d h:i:s format * @param string $startDate Start date, in Y-m-d or Y-m-d h:i:s format
* @param string $endDate End date, in Y-m-d or Y-m-d h:i:s format
* @param bool $removeYear Whether to remove the year in the results (for easier reading) * @param bool $removeYear Whether to remove the year in the results (for easier reading)
*
* @return array|bool False on error in the params, array of [date1 => 0, date2 => 0, ...] otherwise * @return array|bool False on error in the params, array of [date1 => 0, date2 => 0, ...] otherwise
*/ */
public static function buildDatesArray($startDate, $endDate, $removeYear = false) public static function buildDatesArray($startDate, $endDate, $removeYear = false)
@ -1110,17 +1114,20 @@ class Statistics
} }
$list[$datetime] = 0; $list[$datetime] = 0;
} }
return $list; return $list;
} }
/** /**
* Prepare the JS code to load a chart * Prepare the JS code to load a chart.
* @param string $url URL for AJAX data generator *
* @param string $type bar, line, pie, etc * @param string $url URL for AJAX data generator
* @param string $type bar, line, pie, etc
* @param string $options Additional options to the chart (see chart-specific library) * @param string $options Additional options to the chart (see chart-specific library)
* @param string A JS code for loading the chart together with a call to AJAX data generator * @param string A JS code for loading the chart together with a call to AJAX data generator
*/ */
public static function getJSChartTemplate($url, $type = 'pie', $options = '', $elementId = 'canvas') public static function getJSChartTemplate($url, $type = 'pie', $options = '', $elementId = 'canvas')
{ {
$chartCode = ' $chartCode = '
<script> <script>
$(document).ready(function() { $(document).ready(function() {
@ -1139,6 +1146,7 @@ class Statistics
}); });
}); });
</script>'; </script>';
return $chartCode; return $chartCode;
} }
} }

Loading…
Cancel
Save