Minor - format code.

1.10.x
Julio Montoya 10 years ago
parent fa1203ae6b
commit 35313bc560
  1. 7
      main/exercice/exercise.class.php
  2. 8
      main/exercice/exercise_report.php
  3. 2
      main/inc/lib/api.lib.php
  4. 2
      main/inc/lib/exercise.lib.php

@ -1608,6 +1608,7 @@ class Exercise
// if we want to delete attempts before date $cleanResultBeforeDate // if we want to delete attempts before date $cleanResultBeforeDate
// $cleanResultBeforeDate must be a valid UTC-0 date yyyy-mm-dd // $cleanResultBeforeDate must be a valid UTC-0 date yyyy-mm-dd
if (!empty($cleanResultBeforeDate)) { if (!empty($cleanResultBeforeDate)) {
$cleanResultBeforeDate = Database::escape_string($cleanResultBeforeDate); $cleanResultBeforeDate = Database::escape_string($cleanResultBeforeDate);
if (api_is_valid_date($cleanResultBeforeDate)) { if (api_is_valid_date($cleanResultBeforeDate)) {
@ -1633,7 +1634,8 @@ class Exercise
$i = 0; $i = 0;
if (is_array($exe_list) && count($exe_list) > 0) { if (is_array($exe_list) && count($exe_list) > 0) {
foreach ($exe_list as $item) { foreach ($exe_list as $item) {
$sql = "DELETE FROM $table_track_e_attempt WHERE exe_id = '".$item['exe_id']."'"; $sql = "DELETE FROM $table_track_e_attempt
WHERE exe_id = '".$item['exe_id']."'";
Database::query($sql); Database::query($sql);
$i++; $i++;
} }
@ -1901,6 +1903,9 @@ class Exercise
/** /**
* So the time control will work * So the time control will work
*
* @param string $time_left
* @return string
*/ */
public function show_time_control_js($time_left) public function show_time_control_js($time_left)
{ {

@ -1,5 +1,6 @@
<?php <?php
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
/** /**
* Exercise list: This script shows the list of exercises for administrators and students. * Exercise list: This script shows the list of exercises for administrators and students.
* @package chamilo.exercise * @package chamilo.exercise
@ -9,7 +10,7 @@
* @todo fix excel export * @todo fix excel export
* *
*/ */
// including the global library
require_once '../inc/global.inc.php'; require_once '../inc/global.inc.php';
// Setting the tabs // Setting the tabs
@ -318,7 +319,10 @@ if (($is_allowedToEdit || $is_tutor || api_is_coach()) && isset($_GET['delete_be
if ($check) { if ($check) {
$objExerciseTmp = new Exercise(); $objExerciseTmp = new Exercise();
if ($objExerciseTmp->read($exercise_id)) { if ($objExerciseTmp->read($exercise_id)) {
$count = $objExerciseTmp->clean_results(true, $_GET['delete_before_date'].' 23:59:59'); $count = $objExerciseTmp->clean_results(
true,
$_GET['delete_before_date'].' 23:59:59'
);
Display::display_confirmation_message(sprintf(get_lang('XResultsCleaned'), $count)); Display::display_confirmation_message(sprintf(get_lang('XResultsCleaned'), $count));
} }
} }

@ -1847,7 +1847,7 @@ function api_format_course_array($course_data)
$_course['department_name'] = $course_data['department_name']; $_course['department_name'] = $course_data['department_name'];
$_course['department_url'] = $course_data['department_url']; $_course['department_url'] = $course_data['department_url'];
//Course password // Course password
$_course['registration_code'] = !empty($course_data['registration_code']) ? sha1($course_data['registration_code']) : null; $_course['registration_code'] = !empty($course_data['registration_code']) ? sha1($course_data['registration_code']) : null;
$_course['disk_quota'] = $course_data['disk_quota']; $_course['disk_quota'] = $course_data['disk_quota'];
$_course['course_public_url'] = api_get_path(WEB_COURSE_PATH).$course_data['directory'].'/index.php'; $_course['course_public_url'] = api_get_path(WEB_COURSE_PATH).$course_data['directory'].'/index.php';

@ -2446,7 +2446,7 @@ HTML;
// only end is set // only end is set
$time_conditions .= " (start_time = '0000-00-00 00:00:00' AND end_time <> '0000-00-00 00:00:00' AND end_time > '$now') OR "; $time_conditions .= " (start_time = '0000-00-00 00:00:00' AND end_time <> '0000-00-00 00:00:00' AND end_time > '$now') OR ";
// nothing is set // nothing is set
$time_conditions .= " (start_time = '0000-00-00 00:00:00' AND end_time = '0000-00-00 00:00:00')) "; $time_conditions .= " (start_time = '0000-00-00 00:00:00' AND end_time = '0000-00-00 00:00:00')) ";
} }
$needle_where = !empty($search) ? " AND title LIKE '?' " : ''; $needle_where = !empty($search) ? " AND title LIKE '?' " : '';

Loading…
Cancel
Save