PHP Class judge_base, moodle-local_onlinejudge

Afficher le fichier Open project: hit-moodle/moodle-local_onlinejudge

Protected Properties

Свойство Type Description
$language language id without judge id
$task object of the task

Méthodes publiques

Méthode Description
__construct ( $task )
get_compiler_info ( string $language ) : compiler Return the infomation of the compiler of specified language
get_languages ( ) Return an array of programming languages supported by this judge
is_available ( ) : true Whether the judge is avaliable
judge ( ) : updated Judge the current task
parse_options ( $options, &$task ) : throw Put options into task

Méthodes protégées

Méthode Description
convert_to_utf8 ( $string ) If string is not encoded in UTF-8, convert it into utf-8 charset
create_temp_files ( ) : array Save files of current task to a temp directory
diff ( ) Compare the stdout of program and the output of testcase

Method Details

__construct() public méthode

public __construct ( $task )

convert_to_utf8() protected méthode

If string is not encoded in UTF-8, convert it into utf-8 charset
protected convert_to_utf8 ( $string )

create_temp_files() protected méthode

Save files of current task to a temp directory
protected create_temp_files ( ) : array
Résultat array of the full path of saved files

diff() protected méthode

Compare the stdout of program and the output of testcase
protected diff ( )

get_compiler_info() static public méthode

Return the infomation of the compiler of specified language
static public get_compiler_info ( string $language ) : compiler
$language string ID of the language
Résultat compiler information or null

get_languages() static public méthode

The array key must be the language's ID, such as c_sandbox, python_ideone. The array value must be a human-readable name of the language, such as 'C (local)', 'Python (ideone.com)'
static public get_languages ( )

is_available() static public méthode

Whether the judge is avaliable
static public is_available ( ) : true
Résultat true for yes, false for no

judge() public méthode

Judge the current task
public judge ( ) : updated
Résultat updated task or false

parse_options() static public méthode

Put options into task
static public parse_options ( $options, &$task ) : throw
Résultat throw exceptions on error

Property Details

$language protected_oe property

language id without judge id
protected $language

$task protected_oe property

object of the task
protected $task