Minor - format code.

1.10.x
Julio Montoya 11 years ago
parent 3824a0ed5b
commit 67ee519ab9
  1. 3
      main/admin/filler.php
  2. 40
      main/inc/lib/api.lib.php
  3. 23
      tests/datafiller/data_courses.php
  4. 10
      tests/datafiller/fill_courses.php

@ -1,5 +1,6 @@
<?php <?php
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
/** /**
* Index of the admin tools * Index of the admin tools
* *
@ -70,4 +71,4 @@ if (count($output)>0) {
</div> </div>
<?php <?php
/* FOOTER */ /* FOOTER */
Display::display_footer(); Display::display_footer();

@ -456,29 +456,29 @@ define('EXERCISE_MAX_NAME_SIZE', 80);
// Question types // Question types
// @todo move into a class // @todo move into a class
define('UNIQUE_ANSWER', 1); define('UNIQUE_ANSWER', 1);
define('MULTIPLE_ANSWER', 2); define('MULTIPLE_ANSWER', 2);
define('FILL_IN_BLANKS', 3); define('FILL_IN_BLANKS', 3);
define('MATCHING', 4); define('MATCHING', 4);
define('FREE_ANSWER', 5); define('FREE_ANSWER', 5);
define('HOT_SPOT', 6); define('HOT_SPOT', 6);
define('HOT_SPOT_ORDER', 7); define('HOT_SPOT_ORDER', 7);
define('HOT_SPOT_DELINEATION', 8); define('HOT_SPOT_DELINEATION', 8);
define('MULTIPLE_ANSWER_COMBINATION', 9); define('MULTIPLE_ANSWER_COMBINATION', 9);
define('UNIQUE_ANSWER_NO_OPTION', 10); define('UNIQUE_ANSWER_NO_OPTION', 10);
define('MULTIPLE_ANSWER_TRUE_FALSE', 11); define('MULTIPLE_ANSWER_TRUE_FALSE', 11);
define('MULTIPLE_ANSWER_COMBINATION_TRUE_FALSE', 12); define('MULTIPLE_ANSWER_COMBINATION_TRUE_FALSE', 12);
define('ORAL_EXPRESSION', 13); define('ORAL_EXPRESSION', 13);
define('GLOBAL_MULTIPLE_ANSWER', 14); define('GLOBAL_MULTIPLE_ANSWER', 14);
define('MEDIA_QUESTION', 15); define('MEDIA_QUESTION', 15);
define('CALCULATED_ANSWER', 16); define('CALCULATED_ANSWER', 16);
define('UNIQUE_ANSWER_IMAGE', 17); define('UNIQUE_ANSWER_IMAGE', 17);
//Some alias used in the QTI exports //Some alias used in the QTI exports
define('MCUA', 1); define('MCUA', 1);
define('TF', 1); define('TF', 1);
define('MCMA', 2); define('MCMA', 2);
define('FIB', 3); define('FIB', 3);
// Skills // Skills
define ('SKILL_TYPE_REQUIREMENT', 'required'); define ('SKILL_TYPE_REQUIREMENT', 'required');

@ -1,22 +1,21 @@
<?php //$id$ <?php
/* For licensing terms, see /license.txt */
/** /**
* This script contains the data to fill (or empty) the database with using * This script contains the data to fill (or empty) the database with using
* the fillers in this directory. * the fillers in this directory.
* @author Yannick Warnier <yannick.warnier@dokeos.com> * @author Yannick Warnier <yannick.warnier@dokeos.com>
* *
*/ */
/**
* Initialisation section
*/
$courses = array(); $courses = array();
$courses[] = array( $courses[] = array(
'code' => 'ENGLISH101', 'code' => 'ENGLISH101',
'title' => 'English for beginners', 'title' => 'English for beginners',
'description' => 'English course', 'description' => 'English course',
'category_code' => 'PROJ', 'category_code' => 'PROJ',
'course_language' => 'english', 'course_language' => 'english',
'user_id' => 1, 'user_id' => 1,
'expiration_date' => '2020-09-01 00:00:00', 'expiration_date' => '2020-09-01 00:00:00',
'exemplary_content' => true, 'exemplary_content' => true,
); );

@ -1,18 +1,19 @@
<?php <?php
/* For licensing terms, see /license.txt */
/** /**
* This script contains a data filling procedure for users * This script contains a data filling procedure for users
* @author Yannick Warnier <yannick.warnier@beeznest.com> * @author Yannick Warnier <yannick.warnier@beeznest.com>
* *
*/ */
/**
* Initialisation section
*/
/** /**
* Loads the data and injects it into the Chamilo database, using the Chamilo * Loads the data and injects it into the Chamilo database, using the Chamilo
* internal functions. * internal functions.
* @return array List of user IDs for the users that have just been inserted * @return array List of user IDs for the users that have just been inserted
*/ */
function fill_courses() { function fill_courses()
{
$eol = PHP_EOL; $eol = PHP_EOL;
$courses = array(); //declare only to avoid parsing notice $courses = array(); //declare only to avoid parsing notice
require_once 'data_courses.php'; //fill the $users array require_once 'data_courses.php'; //fill the $users array
@ -25,5 +26,6 @@ function fill_courses() {
$output[$i]['line-info'] = ($res = CourseManager::create_course($course)? $res: get_lang('NotInserted')); $output[$i]['line-info'] = ($res = CourseManager::create_course($course)? $res: get_lang('NotInserted'));
$i++; $i++;
} }
return $output; return $output;
} }

Loading…
Cancel
Save