Backend code for the 'make large course' tool.
More...
|
| __construct ( $shortname, $size, $fixeddataset=false, $filesizelimit=false, $progress=true, $fullname=null, $summary=null, $summaryformat=FORMAT_HTML) |
| Constructs object ready to create course. More...
|
|
| make () |
| Runs the entire 'make' process. More...
|
|
|
int const | DEFAULT_SIZE = 3 |
| Default size index.
|
|
int const | MAX_SIZE = 5 |
| Highest (largest) size index.
|
|
int const | MIN_SIZE = 0 |
| Lowest (smallest) size index.
|
|
|
| dot ($number, $total) |
| Outputs dots. More...
|
|
| end_log () |
| Ends a log string that was started using log function with $leaveopen.
|
|
| log ($langstring, $a=null, $leaveopen=false) |
| Displays information as part of progress. More...
|
|
|
int bool | $filesizelimit |
| Maximum number of bytes for file.
|
|
bool | $fixeddataset |
| True if we want a fixed dataset or false to generate random data.
|
|
testing_data_generator | $generator |
| Data generator.
|
|
int | $lastdot |
| Epoch time at which last dot was displayed.
|
|
int | $lastpercentage |
| Epoch time at which last percentage was displayed.
|
|
bool | $progress |
| True if displaying progress.
|
|
int | $size |
| Size code (index in the above arrays)
|
|
int | $starttime |
| Epoch time at which current step (current set of dots) started.
|
|
Backend code for the 'make large course' tool.
- Copyright
- 2013 The Open University
- License
- http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
◆ __construct()
tool_generator_course_backend::__construct |
( |
|
$shortname, |
|
|
|
$size, |
|
|
|
$fixeddataset = false , |
|
|
|
$filesizelimit = false , |
|
|
|
$progress = true , |
|
|
|
$fullname = null , |
|
|
|
$summary = null , |
|
|
|
$summaryformat = FORMAT_HTML |
|
) |
| |
Constructs object ready to create course.
- Parameters
-
string | $shortname | Course shortname |
int | $size | Size as numeric index |
bool | $fixeddataset | To use fixed or random data |
int | bool | $filesizelimit | The max number of bytes for a generated file |
bool | $progress | True if progress information should be displayed |
◆ check_shortname_available()
static tool_generator_course_backend::check_shortname_available |
( |
|
$shortname | ) |
|
|
static |
Checks that a shortname is available (unused).
- Parameters
-
string | $shortname | Proposed course shortname |
- Return values
-
string | An error message if the name is unavailable or '' if OK |
◆ dot()
tool_generator_backend::dot |
( |
|
$number, |
|
|
|
$total |
|
) |
| |
|
protectedinherited |
Outputs dots.
There is up to one dot per second. Once a minute, it displays a percentage.
- Parameters
-
int | $number | Number of completed items |
int | $total | Total number of items to complete |
◆ get_size_choices()
static tool_generator_course_backend::get_size_choices |
( |
| ) |
|
|
static |
Gets a list of size choices supported by this backend.
- Return values
-
array | List of size (int) => text description for display |
◆ get_users_per_size()
static tool_generator_course_backend::get_users_per_size |
( |
| ) |
|
|
static |
Returns the relation between users and course sizes.
- Return values
-
◆ log()
tool_generator_backend::log |
( |
|
$langstring, |
|
|
|
$a = null , |
|
|
|
$leaveopen = false |
|
) |
| |
|
protectedinherited |
Displays information as part of progress.
- Parameters
-
string | $langstring | Part of langstring (after progress_) |
mixed | $a | Optional lang string parameters |
bool | $leaveopen | If true, doesn't close LI tag (ready for dots) |
◆ make()
tool_generator_course_backend::make |
( |
| ) |
|
Runs the entire 'make' process.
- Return values
-
◆ size_for_name()
static tool_generator_backend::size_for_name |
( |
|
$sizename | ) |
|
|
staticinherited |
Converts a size name into the numeric constant.
- Parameters
-
string | $sizename | Size name e.g. 'L' |
- Return values
-
- Exceptions
-
The documentation for this class was generated from the following file: