Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 4.1.x will end 13 November 2023 (12 months).
  • Bug fixes for security issues in 4.1.x will end 10 November 2025 (36 months).
  • PHP version: minimum PHP 7.4.0 Note: minimum PHP version has increased since Moodle 4.0. PHP 8.0.x is supported too.

tool_generator site backend.

Copyright: 2013 David MonllaĆ³
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 212 lines (7 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

tool_generator_site_backend:: (5 methods):
  __construct()
  get_size_choices()
  make()
  run_create_course()
  get_last_testcourse_id()


Class: tool_generator_site_backend  - X-Ref

Backend code for the site generator.

__construct($size, $bypasscheck, $fixeddataset = false, $filesizelimit = false, $progress = true)   X-Ref
Constructs object ready to make the site.

param: int $size Size as numeric index
param: bool $bypasscheck If debugging level checking was skipped.
param: bool $fixeddataset To use fixed or random data
param: int|bool $filesizelimit The max number of bytes for a generated file
param: bool $progress True if progress information should be displayed
return: int Course id

get_size_choices()   X-Ref
Gets a list of size choices supported by this backend.

return: array List of size (int) => text description for display

make()   X-Ref
Runs the entire 'make' process.

return: int Course id

run_create_course($shortname, $coursesize)   X-Ref
Creates a course with the specified shortname, coursesize and the provided maketestsite options.

param: string $shortname The course shortname
param: int $coursesize One of the possible course sizes.
return: void

get_last_testcourse_id()   X-Ref
Obtains the last unique sufix (numeric) using the test course prefix.

return: int The last generated numeric value.