idx
int64
0
60.3k
question
stringlengths
92
4.62k
target
stringlengths
7
635
33,500
public static function cleanup_instances ( ) { global $ DB ; self :: init_levels ( ) ; $ sqls = array ( ) ; foreach ( self :: $ alllevels as $ level => $ classname ) { $ sqls [ ] = $ classname :: get_cleanup_sql ( ) ; } $ sql = implode ( " UNION " , $ sqls ) ; $ transaction = $ DB -> start_delegated_transaction ( ) ; $...
Remove stale contexts that belonged to deleted instances . Ideally all code should cleanup contexts properly unfortunately accidents happen ...
33,501
public static function create_instances ( $ contextlevel = null , $ buildpaths = true ) { self :: init_levels ( ) ; foreach ( self :: $ alllevels as $ level => $ classname ) { if ( $ contextlevel and $ level > $ contextlevel ) { continue ; } $ classname :: create_level_instances ( ) ; if ( $ buildpaths ) { $ classname ...
Create all context instances at the given level and above .
33,502
public static function build_all_paths ( $ force = false ) { self :: init_levels ( ) ; foreach ( self :: $ alllevels as $ classname ) { $ classname :: build_paths ( $ force ) ; } accesslib_clear_all_caches ( true ) ; }
Rebuild paths and depths in all context levels .
33,503
public static function preload_contexts_by_id ( array $ contextids ) { global $ DB ; $ tofetch = [ ] ; foreach ( $ contextids as $ contextid ) { if ( ! self :: cache_get_by_id ( $ contextid ) ) { $ tofetch [ ] = $ contextid ; } } if ( count ( $ tofetch ) > 1 ) { list ( $ insql , $ inparams ) = $ DB -> get_in_or_equal (...
Preload a set of contexts using their contextid .
33,504
public static function preload_course ( $ courseid ) { if ( isset ( context :: $ cache_preloaded [ $ courseid ] ) ) { return ; } $ coursecontext = context_course :: instance ( $ courseid ) ; $ coursecontext -> get_child_contexts ( ) ; context :: $ cache_preloaded [ $ courseid ] = true ; }
Preload all contexts instances from course .
33,505
public static function delete_instance ( $ contextlevel , $ instanceid ) { global $ DB ; if ( $ record = $ DB -> get_record ( 'context' , array ( 'contextlevel' => $ contextlevel , 'instanceid' => $ instanceid ) ) ) { $ context = context :: create_instance_from_record ( $ record ) ; $ context -> delete ( ) ; } else { }...
Delete context instance
33,506
public static function instance ( $ instanceid = 0 , $ strictness = MUST_EXIST , $ cache = true ) { global $ DB ; if ( $ instanceid != 0 ) { debugging ( 'context_system::instance(): invalid $id parameter detected, should be 0' ) ; } if ( defined ( 'SYSCONTEXTID' ) and $ cache ) { if ( ! isset ( context :: $ systemconte...
Returns system context instance .
33,507
public function get_child_contexts ( ) { global $ DB ; debugging ( 'Fetching of system context child courses is strongly discouraged on production servers (it may eat all available memory)!' ) ; $ sql = "SELECT c.* FROM {context} c WHERE contextlevel > " . CONTEXT_SYSTEM ; $ records = $...
Returns all site contexts except the system context DO NOT call on production servers!!
33,508
protected static function build_paths ( $ force ) { global $ DB ; $ record = $ DB -> get_record ( 'context' , array ( 'contextlevel' => CONTEXT_SYSTEM ) , '*' , MUST_EXIST ) ; if ( $ record -> instanceid != 0 ) { debugging ( 'Invalid system context detected' ) ; } if ( defined ( 'SYSCONTEXTID' ) and $ record -> id != S...
Rebuild context paths and depths at system context level .
33,509
public static function instance ( $ userid , $ strictness = MUST_EXIST ) { global $ DB ; if ( $ context = context :: cache_get ( CONTEXT_USER , $ userid ) ) { return $ context ; } if ( ! $ record = $ DB -> get_record ( 'context' , array ( 'contextlevel' => CONTEXT_USER , 'instanceid' => $ userid ) ) ) { if ( $ user = $...
Returns user context instance .
33,510
protected static function build_paths ( $ force ) { global $ DB ; $ path = $ DB -> sql_concat ( '?' , 'id' ) ; $ pathstart = '/' . SYSCONTEXTID . '/' ; $ params = array ( $ pathstart ) ; if ( $ force ) { $ where = "depth <> 2 OR path IS NULL OR path <> ({$path})" ; $ params [ ] = $ pathstart ; } else { $ where = "depth...
Rebuild context paths and depths at user context level .
33,511
public static function instance ( $ categoryid , $ strictness = MUST_EXIST ) { global $ DB ; if ( $ context = context :: cache_get ( CONTEXT_COURSECAT , $ categoryid ) ) { return $ context ; } if ( ! $ record = $ DB -> get_record ( 'context' , array ( 'contextlevel' => CONTEXT_COURSECAT , 'instanceid' => $ categoryid )...
Returns course category context instance .
33,512
public function get_child_contexts ( ) { global $ DB ; if ( empty ( $ this -> _path ) or empty ( $ this -> _depth ) ) { debugging ( 'Can not find child contexts of context ' . $ this -> _id . ' try rebuilding of context paths' ) ; return array ( ) ; } $ sql = "SELECT ctx.* FROM {context} ctx ...
Returns immediate child contexts of category and all subcategories children of subcategories and courses are not returned .
33,513
protected static function create_level_instances ( ) { global $ DB ; $ sql = "SELECT " . CONTEXT_COURSECAT . ", cc.id FROM {course_categories} cc WHERE NOT EXISTS (SELECT 'x' FROM {context} cx WHERE cc.id = cx.instan...
Create missing context instances at course category context level
33,514
protected static function build_paths ( $ force ) { global $ DB ; if ( $ force or $ DB -> record_exists_select ( 'context' , "contextlevel = " . CONTEXT_COURSECAT . " AND (depth = 0 OR path IS NULL)" ) ) { if ( $ force ) { $ ctxemptyclause = $ emptyclause = '' ; } else { $ ctxemptyclause = "AND (ctx.path IS NULL OR ctx...
Rebuild context paths and depths at course category context level .
33,515
public static function instance ( $ courseid , $ strictness = MUST_EXIST ) { global $ DB ; if ( $ context = context :: cache_get ( CONTEXT_COURSE , $ courseid ) ) { return $ context ; } if ( ! $ record = $ DB -> get_record ( 'context' , array ( 'contextlevel' => CONTEXT_COURSE , 'instanceid' => $ courseid ) ) ) { if ( ...
Returns course context instance .
33,516
public static function instance ( $ cmid , $ strictness = MUST_EXIST ) { global $ DB ; if ( $ context = context :: cache_get ( CONTEXT_MODULE , $ cmid ) ) { return $ context ; } if ( ! $ record = $ DB -> get_record ( 'context' , array ( 'contextlevel' => CONTEXT_MODULE , 'instanceid' => $ cmid ) ) ) { if ( $ cm = $ DB ...
Returns module context instance .
33,517
public static function instance ( $ blockinstanceid , $ strictness = MUST_EXIST ) { global $ DB ; if ( $ context = context :: cache_get ( CONTEXT_BLOCK , $ blockinstanceid ) ) { return $ context ; } if ( ! $ record = $ DB -> get_record ( 'context' , array ( 'contextlevel' => CONTEXT_BLOCK , 'instanceid' => $ blockinsta...
Returns block context instance .
33,518
protected static function build_paths ( $ force ) { global $ DB ; if ( $ force or $ DB -> record_exists_select ( 'context' , "contextlevel = " . CONTEXT_BLOCK . " AND (depth = 0 OR path IS NULL)" ) ) { if ( $ force ) { $ ctxemptyclause = '' ; } else { $ ctxemptyclause = "AND (ctx.path IS NULL OR ctx.depth = 0)" ; } $ s...
Rebuild context paths and depths at block context level .
33,519
protected function openReader ( $ filePath ) { $ this -> zip = new \ ZipArchive ( ) ; if ( $ this -> zip -> open ( $ filePath ) === true ) { $ this -> sharedStringsHelper = new SharedStringsHelper ( $ filePath , $ this -> getOptions ( ) -> getTempFolder ( ) ) ; if ( $ this -> sharedStringsHelper -> hasSharedStrings ( )...
Opens the file at the given file path to make it ready to be read . It also parses the sharedStrings . xml file to get all the shared strings available in memory and fetches all the available sheets .
33,520
public function get_indexes ( $ table ) { $ indexes = array ( ) ; $ sql = 'PRAGMA index_list(' . $ this -> prefix . $ table . ')' ; if ( $ this -> debug ) { $ this -> debug_query ( $ sql ) ; } $ rsindexes = $ this -> pdb -> query ( $ sql ) ; foreach ( $ rsindexes as $ index ) { $ unique = ( boolean ) $ index [ 'unique'...
Return table indexes - everything lowercased
33,521
protected function get_limit_clauses ( $ sql , $ limitfrom = 0 , $ limitnum = 0 ) { if ( $ limitnum ) { $ sql .= ' LIMIT ' . $ limitnum ; if ( $ limitfrom ) { $ sql .= ' OFFSET ' . $ limitfrom ; } } return $ sql ; }
Returns the sql statement with clauses to append used to limit a recordset range .
33,522
public function sql_bitxor ( $ int1 , $ int2 ) { return '( ~' . $ this -> sql_bitand ( $ int1 , $ int2 ) . ' & ' . $ this -> sql_bitor ( $ int1 , $ int2 ) . ')' ; }
Returns the SQL text to be used in order to perform one bitwise XOR operation between 2 integers .
33,523
protected function split ( $ string , $ config , $ context ) { $ pattern = '/(?:(?<=\s)|\A)' . '((?:--|-?[A-Za-z_])[A-Za-z_\-0-9]*)' . '(?:(?=\s)|\z)/' ; preg_match_all ( $ pattern , $ string , $ matches ) ; return $ matches [ 1 ] ; }
Splits a space separated list of tokens into its constituent parts .
33,524
protected function get_column_type ( $ columnname ) { if ( ! class_exists ( $ columnname ) ) { if ( class_exists ( 'core_question\\bank\\' . $ columnname ) ) { $ columnname = 'core_question\\bank\\' . $ columnname ; } else { throw new \ coding_exception ( "No such class exists: $columnname" ) ; } } if ( empty ( $ this ...
Get a column object from its name .
33,525
protected function init_columns ( $ wanted , $ heading = '' ) { $ this -> visiblecolumns = array ( ) ; $ this -> extrarows = array ( ) ; foreach ( $ wanted as $ column ) { if ( $ column -> is_extra_row ( ) ) { $ this -> extrarows [ get_class ( $ column ) ] = $ column ; } else { $ this -> visiblecolumns [ get_class ( $ ...
Initializing table columns
33,526
public function new_sort_url ( $ sort , $ newsortreverse ) { if ( $ newsortreverse ) { $ order = - 1 ; } else { $ order = 1 ; } $ newsort = array_reverse ( $ this -> sort ) ; if ( isset ( $ newsort [ $ sort ] ) ) { unset ( $ newsort [ $ sort ] ) ; } $ newsort [ $ sort ] = $ order ; $ newsort = array_reverse ( $ newsort...
Get a URL to redisplay the page with a new sort for the question bank .
33,527
protected function build_query ( ) { global $ DB ; $ joins = array ( ) ; $ fields = array ( 'q.hidden' , 'q.category' ) ; foreach ( $ this -> requiredcolumns as $ column ) { $ extrajoins = $ column -> get_extra_joins ( ) ; foreach ( $ extrajoins as $ prefix => $ join ) { if ( isset ( $ joins [ $ prefix ] ) && $ joins [...
Create the SQL query to retrieve the indicated questions based on \ core_question \ bank \ search \ condition filters .
33,528
public function preview_question_url ( $ questiondata ) { return question_preview_url ( $ questiondata -> id , null , null , null , null , $ this -> get_most_specific_context ( ) ) ; }
Get the URL to preview a question .
33,529
public function display ( $ tabname , $ page , $ perpage , $ cat , $ recurse , $ showhidden , $ showquestiontext , $ tagids = [ ] ) { global $ PAGE , $ CFG ; if ( $ this -> process_actions_needing_ui ( ) ) { return ; } $ editcontexts = $ this -> contexts -> having_one_edit_tab_cap ( $ tabname ) ; list ( $ categoryid , ...
Shows the question bank editing interface .
33,530
protected function print_category_info ( $ category ) { $ formatoptions = new \ stdClass ( ) ; $ formatoptions -> noclean = true ; $ formatoptions -> overflowdiv = true ; echo '<div class="boxaligncenter">' ; echo format_text ( $ category -> info , $ category -> infoformat , $ formatoptions , $ this -> course -> id ) ;...
prints category information
33,531
protected function display_category_form ( $ contexts , $ pageurl , $ current ) { global $ OUTPUT ; debugging ( 'display_category_form() is deprecated, please use ' . '\core_question\bank\search\condition instead.' , DEBUG_DEVELOPER ) ; echo '<div class="choosecategory">' ; $ catmenu = question_category_options ( $ con...
Prints a form to choose categories
33,532
protected function display_category_form_checkbox ( $ name , $ value , $ label ) { debugging ( 'display_category_form_checkbox() is deprecated, ' . 'please use \core_question\bank\search\condition instead.' , DEBUG_DEVELOPER ) ; echo '<div><input type="hidden" id="' . $ name . '_off" name="' . $ name . '" value="0" />'...
Print a single option checkbox .
33,533
protected function display_options_form ( $ showquestiontext , $ scriptpath = '/question/edit.php' , $ showtextoption = true ) { global $ PAGE ; echo \ html_writer :: start_tag ( 'form' , array ( 'method' => 'get' , 'action' => new \ moodle_url ( $ scriptpath ) , 'id' => 'displayoptions' ) ) ; echo \ html_writer :: sta...
Display the form with options for which questions are displayed and how they are displayed .
33,534
protected function display_advanced_search_form ( ) { print_collapsible_region_start ( '' , 'advancedsearch' , get_string ( 'advancedsearchoptions' , 'question' ) , 'question_bank_advanced_search' ) ; foreach ( $ this -> searchconditions as $ searchcondition ) { echo $ searchcondition -> display_options_adv ( $ this ) ...
Print the advanced UI elements for the form to select which questions . Hidden by default .
33,535
protected static function export_subwiki ( $ user , context $ context , $ subwiki , $ wikimode ) { if ( empty ( $ subwiki ) ) { return ; } $ subwikiid = key ( $ subwiki ) ; $ pages = $ subwiki [ $ subwikiid ] [ 'pages' ] ; unset ( $ subwiki [ $ subwikiid ] [ 'pages' ] ) ; writer :: with_context ( $ context ) -> export_...
Add one subwiki to the export
33,536
protected static function get_page_comments ( $ user , \ context $ context , $ pageid , $ onlyforthisuser = true ) { global $ USER , $ DB ; $ params = [ 'contextid' => $ context -> id , 'commentarea' => 'wiki_page' , 'itemid' => $ pageid ] ; $ sql = "SELECT c.id, c.content, c.format, c.timecreated, c.userid ...
Retrieves page comments
33,537
protected static function export_used_files ( $ context , $ subwikiid , $ alltexts ) { if ( ! self :: text_has_files ( $ alltexts ) ) { return ; } $ fs = get_file_storage ( ) ; $ files = $ fs -> get_area_files ( $ context -> id , 'mod_wiki' , 'attachments' , $ subwikiid , 'filepath, filename' , false ) ; if ( empty ( $...
Analyze which files are used in the texts and export
33,538
protected function get_permission_strings ( ) { static $ strpermissions ; if ( ! $ strpermissions ) { $ strpermissions = array ( CAP_INHERIT => new lang_string ( 'inherit' , 'role' ) , CAP_ALLOW => new lang_string ( 'allow' , 'role' ) , CAP_PREVENT => new lang_string ( 'prevent' , 'role' ) , CAP_PROHIBIT => new lang_st...
Returns an array of permission strings .
33,539
public function capability_comparison_table ( array $ capabilities , $ contextid , array $ roles ) { $ strpermissions = $ this -> get_permission_strings ( ) ; $ permissionclasses = $ this -> get_permission_classes ( ) ; if ( $ contextid === context_system :: instance ( ) -> id ) { $ strpermissions [ CAP_INHERIT ] = new...
Produces a table to visually compare roles and capabilities .
33,540
public function getNamespace ( $ mbox , $ personal = false ) { $ mbox = strval ( $ mbox ) ; if ( $ ns = $ this [ $ mbox ] ) { return $ ns ; } foreach ( $ this -> _ns as $ val ) { $ mbox = $ mbox . $ val -> delimiter ; if ( strlen ( $ val -> name ) && ( strpos ( $ mbox , $ val -> name ) === 0 ) ) { return $ val ; } } re...
Get namespace info for a full mailbox path .
33,541
public static function get_blocks_from_path ( $ path ) { global $ DB ; $ blocks = array ( ) ; static $ availableblocks = array ( ) ; if ( empty ( $ availableblocks ) ) { $ availableblocks = array_keys ( core_component :: get_plugin_list ( 'block' ) ) ; } $ path = $ path . '/blocks' ; if ( ! is_dir ( $ path ) ) { return...
Load all the blocks information needed for a given path within moodle2 backup
33,542
public static function get_backup_information_from_mbz ( $ filepath , file_progress $ progress = null ) { global $ CFG ; if ( ! is_readable ( $ filepath ) ) { throw new backup_helper_exception ( 'missing_moodle_backup_file' , $ filepath ) ; } $ tmpname = 'info_from_mbz_' . time ( ) . '_' . random_string ( 4 ) ; $ tmpdi...
Load and format all the needed information from a backup file .
33,543
public static function backup_is_samesite ( $ info ) { global $ CFG ; $ hashedsiteid = md5 ( get_site_identifier ( ) ) ; if ( isset ( $ info -> original_site_identifier_hash ) && ! empty ( $ info -> original_site_identifier_hash ) ) { return $ info -> original_site_identifier_hash == $ hashedsiteid ; } else { return $ ...
Given the information fetched from moodle_backup . xml file decide if we are restoring in the same site the backup was generated or no . Behavior of various parts of restore are dependent of this .
33,544
public static function detect_backup_format ( $ tempdir ) { global $ CFG ; require_once ( $ CFG -> dirroot . '/backup/util/helper/convert_helper.class.php' ) ; if ( convert_helper :: detect_moodle2_format ( $ tempdir ) ) { return backup :: FORMAT_MOODLE ; } $ converters = convert_helper :: available_converters ( ) ; fo...
Detects the format of the given unpacked backup directory
33,545
public function definition ( ) { $ mform = $ this -> _form ; $ instance = $ this -> _customdata ; $ options = array ( ) ; $ options [ 'lock' ] = get_string ( 'locksubmissions' , 'assign' ) ; $ options [ 'unlock' ] = get_string ( 'unlocksubmissions' , 'assign' ) ; $ options [ 'downloadselected' ] = get_string ( 'downloa...
Define this form - called by the parent constructor .
33,546
public static function create ( int $ id , \ stdClass $ record = null , handler $ handler = null ) : category_controller { global $ DB ; if ( $ id && $ record ) { debugging ( 'Too many parameters, either id need to be specified or a record, but not both.' , DEBUG_DEVELOPER ) ; } if ( $ id ) { if ( ! $ record = $ DB -> ...
Creates an instance of category_controller
33,547
public function get_handler ( ) : handler { if ( $ this -> handler === null ) { $ this -> handler = handler :: get_handler ( $ this -> get ( 'component' ) , $ this -> get ( 'area' ) , $ this -> get ( 'itemid' ) ) ; } return $ this -> handler ; }
Gets a handler if not known retrieve it
33,548
public function set_handler ( handler $ handler ) { if ( $ this -> get ( 'component' ) !== $ handler -> get_component ( ) ) { throw new \ coding_exception ( 'Component of the handler does not match the one from the record' ) ; } if ( $ this -> get ( 'area' ) !== $ handler -> get_area ( ) ) { throw new \ coding_exceptio...
Allows to set handler so we don t need to retrieve it later
33,549
public static function get_resources_by_courses ( $ courseids = array ( ) ) { $ warnings = array ( ) ; $ returnedresources = array ( ) ; $ params = array ( 'courseids' => $ courseids , ) ; $ params = self :: validate_parameters ( self :: get_resources_by_courses_parameters ( ) , $ params ) ; $ mycourses = array ( ) ; i...
Returns a list of files in a provided list of courses . If no list is provided all files that the user can view will be returned .
33,550
public static function create ( $ config ) { if ( ! ( $ config instanceof HTMLPurifier_Config ) ) { $ lexer = $ config ; trigger_error ( "Passing a prototype to HTMLPurifier_Lexer::create() is deprecated, please instead use %Core.LexerImpl" , E_USER_WARNING ) ; } else { $ lexer = $ config ...
Retrieves or sets the default Lexer as a Prototype Factory .
33,551
public static function create ( $ writerType ) { $ writer = null ; switch ( $ writerType ) { case Type :: CSV : $ writer = new CSV \ Writer ( ) ; break ; case Type :: XLSX : $ writer = new XLSX \ Writer ( ) ; break ; case Type :: ODS : $ writer = new ODS \ Writer ( ) ; break ; default : throw new UnsupportedTypeExcepti...
This creates an instance of the appropriate writer given the type of the file to be read
33,552
public static function create_competency_framework ( $ competencyframework ) { global $ PAGE ; $ params = self :: validate_parameters ( self :: create_competency_framework_parameters ( ) , array ( 'competencyframework' => $ competencyframework ) ) ; $ params = $ params [ 'competencyframework' ] ; $ context = self :: ge...
Create a new competency framework
33,553
public static function read_competency_framework ( $ id ) { global $ PAGE ; $ params = self :: validate_parameters ( self :: read_competency_framework_parameters ( ) , array ( 'id' => $ id , ) ) ; $ framework = api :: read_framework ( $ params [ 'id' ] ) ; self :: validate_context ( $ framework -> get_context ( ) ) ; $...
Read a competency framework by id .
33,554
public static function competency_viewed ( $ id ) { $ params = self :: validate_parameters ( self :: competency_viewed_parameters ( ) , array ( 'id' => $ id ) ) ; return api :: competency_viewed ( $ params [ 'id' ] ) ; }
Log event competency viewed .
33,555
public static function duplicate_competency_framework ( $ id ) { global $ PAGE ; $ params = self :: validate_parameters ( self :: duplicate_competency_framework_parameters ( ) , array ( 'id' => $ id , ) ) ; $ framework = api :: read_framework ( $ params [ 'id' ] ) ; self :: validate_context ( $ framework -> get_context...
Duplicate a competency framework
33,556
public static function delete_competency_framework ( $ id ) { $ params = self :: validate_parameters ( self :: delete_competency_framework_parameters ( ) , array ( 'id' => $ id , ) ) ; $ framework = api :: read_framework ( $ params [ 'id' ] ) ; self :: validate_context ( $ framework -> get_context ( ) ) ; return api ::...
Delete a competency framework
33,557
public static function update_competency_framework ( $ competencyframework ) { $ params = self :: validate_parameters ( self :: update_competency_framework_parameters ( ) , array ( 'competencyframework' => $ competencyframework ) ) ; $ params = $ params [ 'competencyframework' ] ; $ framework = api :: read_framework ( ...
Update an existing competency framework
33,558
public static function count_competency_frameworks ( $ context , $ includes ) { $ params = self :: validate_parameters ( self :: count_competency_frameworks_parameters ( ) , array ( 'context' => $ context , 'includes' => $ includes ) ) ; $ context = self :: get_context_from_params ( $ params [ 'context' ] ) ; self :: v...
Count the existing competency frameworks
33,559
public static function competency_framework_viewed ( $ id ) { $ params = self :: validate_parameters ( self :: competency_framework_viewed_parameters ( ) , array ( 'id' => $ id ) ) ; return api :: competency_framework_viewed ( $ params [ 'id' ] ) ; }
Log event competency framework viewed .
33,560
public static function create_competency ( $ competency ) { global $ PAGE ; $ params = self :: validate_parameters ( self :: create_competency_parameters ( ) , array ( 'competency' => $ competency ) ) ; $ params = $ params [ 'competency' ] ; $ framework = api :: read_framework ( $ params [ 'competencyframeworkid' ] ) ;...
Create a new competency
33,561
public static function read_competency ( $ id ) { global $ PAGE ; $ params = self :: validate_parameters ( self :: read_competency_parameters ( ) , array ( 'id' => $ id , ) ) ; $ competency = api :: read_competency ( $ params [ 'id' ] ) ; $ context = $ competency -> get_context ( ) ; self :: validate_context ( $ contex...
Read a competency by id .
33,562
public static function delete_competency ( $ id ) { $ params = self :: validate_parameters ( self :: delete_competency_parameters ( ) , array ( 'id' => $ id , ) ) ; $ competency = api :: read_competency ( $ params [ 'id' ] ) ; $ context = $ competency -> get_context ( ) ; self :: validate_context ( $ context ) ; return...
Delete a competency
33,563
public static function update_competency ( $ competency ) { $ params = self :: validate_parameters ( self :: update_competency_parameters ( ) , array ( 'competency' => $ competency ) ) ; $ params = $ params [ 'competency' ] ; $ competency = api :: read_competency ( $ params [ 'id' ] ) ; self :: validate_context ( $ com...
Update an existing competency
33,564
public static function list_competencies ( $ filters , $ sort , $ order , $ skip , $ limit ) { global $ PAGE ; $ params = self :: validate_parameters ( self :: list_competencies_parameters ( ) , array ( 'filters' => $ filters , 'sort' => $ sort , 'order' => $ order , 'skip' => $ skip , 'limit' => $ limit ) ) ; if ( $ p...
List the existing competency .
33,565
public static function count_competencies ( $ filters ) { $ params = self :: validate_parameters ( self :: count_competencies_parameters ( ) , array ( 'filters' => $ filters ) ) ; $ safefilters = array ( ) ; $ validcolumns = array ( 'id' , 'shortname' , 'description' , 'sortorder' , 'idnumber' , 'parentid' , 'competenc...
Count the existing competency frameworks .
33,566
public static function set_parent_competency ( $ competencyid , $ parentid ) { $ params = self :: validate_parameters ( self :: set_parent_competency_parameters ( ) , array ( 'competencyid' => $ competencyid , 'parentid' => $ parentid ) ) ; $ competency = api :: read_competency ( $ params [ 'competencyid' ] ) ; self ::...
Move the competency to a new parent .
33,567
public static function reorder_course_competency ( $ courseid , $ competencyidfrom , $ competencyidto ) { $ params = self :: validate_parameters ( self :: reorder_course_competency_parameters ( ) , array ( 'courseid' => $ courseid , 'competencyidfrom' => $ competencyidfrom , 'competencyidto' => $ competencyidto , ) ) ;...
Change the order of course competencies .
33,568
public static function reorder_template_competency ( $ templateid , $ competencyidfrom , $ competencyidto ) { $ params = self :: validate_parameters ( self :: reorder_template_competency_parameters ( ) , array ( 'templateid' => $ templateid , 'competencyidfrom' => $ competencyidfrom , 'competencyidto' => $ competencyid...
Change the order of template competencies .
33,569
public static function create_template ( $ template ) { global $ PAGE ; $ params = self :: validate_parameters ( self :: create_template_parameters ( ) , array ( 'template' => $ template ) ) ; $ params = $ params [ 'template' ] ; $ context = self :: get_context_from_params ( $ params ) ; self :: validate_context ( $ co...
Create a new learning plan template
33,570
public static function read_template ( $ id ) { global $ PAGE ; $ params = self :: validate_parameters ( self :: read_template_parameters ( ) , array ( 'id' => $ id ) ) ; $ template = api :: read_template ( $ params [ 'id' ] ) ; self :: validate_context ( $ template -> get_context ( ) ) ; $ output = $ PAGE -> get_rende...
Read a learning plan template by id .
33,571
public static function delete_template ( $ id , $ deleteplans = true ) { $ params = self :: validate_parameters ( self :: delete_template_parameters ( ) , array ( 'id' => $ id , 'deleteplans' => $ deleteplans , ) ) ; $ template = api :: read_template ( $ params [ 'id' ] ) ; self :: validate_context ( $ template -> get_...
Delete a learning plan template
33,572
public static function update_template ( $ template ) { $ params = self :: validate_parameters ( self :: update_template_parameters ( ) , array ( 'template' => $ template ) ) ; $ params = $ params [ 'template' ] ; $ template = api :: read_template ( $ params [ 'id' ] ) ; self :: validate_context ( $ template -> get_con...
Update an existing learning plan template
33,573
public static function list_templates ( $ sort , $ order , $ skip , $ limit , $ context , $ includes , $ onlyvisible ) { global $ PAGE ; $ params = self :: validate_parameters ( self :: list_templates_parameters ( ) , array ( 'sort' => $ sort , 'order' => $ order , 'skip' => $ skip , 'limit' => $ limit , 'context' => $...
List the existing learning plan templates
33,574
public static function count_templates ( $ context , $ includes ) { $ params = self :: validate_parameters ( self :: count_templates_parameters ( ) , array ( 'context' => $ context , 'includes' => $ includes ) ) ; $ context = self :: get_context_from_params ( $ params [ 'context' ] ) ; self :: validate_context ( $ cont...
Count the existing learning plan templates
33,575
public static function add_competency_to_plan ( $ planid , $ competencyid ) { $ params = self :: validate_parameters ( self :: add_competency_to_plan_parameters ( ) , array ( 'planid' => $ planid , 'competencyid' => $ competencyid , ) ) ; $ plan = api :: read_plan ( $ params [ 'planid' ] ) ; self :: validate_context ( ...
add competency to a learning plan .
33,576
public static function remove_competency_from_plan ( $ planid , $ competencyid ) { $ params = self :: validate_parameters ( self :: remove_competency_from_plan_parameters ( ) , array ( 'planid' => $ planid , 'competencyid' => $ competencyid , ) ) ; $ plan = api :: read_plan ( $ params [ 'planid' ] ) ; self :: validate_...
Remove a competency from plan .
33,577
public static function reorder_plan_competency ( $ planid , $ competencyidfrom , $ competencyidto ) { $ params = self :: validate_parameters ( self :: reorder_plan_competency_parameters ( ) , array ( 'planid' => $ planid , 'competencyidfrom' => $ competencyidfrom , 'competencyidto' => $ competencyidto , ) ) ; $ plan = ...
Change the order of plan competencies .
33,578
public static function user_competency_cancel_review_request ( $ userid , $ competencyid ) { $ params = self :: validate_parameters ( self :: user_competency_cancel_review_request_parameters ( ) , array ( 'userid' => $ userid , 'competencyid' => $ competencyid ) ) ; $ context = context_user :: instance ( $ params [ 'us...
External function user_competency_cancel_review_request .
33,579
public static function user_competency_request_review ( $ userid , $ competencyid ) { $ params = self :: validate_parameters ( self :: user_competency_request_review_parameters ( ) , array ( 'userid' => $ userid , 'competencyid' => $ competencyid , ) ) ; $ context = context_user :: instance ( $ params [ 'userid' ] ) ; ...
External function user_competency_request_review .
33,580
public static function user_competency_start_review ( $ userid , $ competencyid ) { $ params = self :: validate_parameters ( self :: user_competency_start_review_parameters ( ) , array ( 'userid' => $ userid , 'competencyid' => $ competencyid ) ) ; $ context = context_user :: instance ( $ params [ 'userid' ] ) ; self :...
External function user_competency_start_review .
33,581
public static function user_competency_stop_review ( $ userid , $ competencyid ) { $ params = self :: validate_parameters ( self :: user_competency_stop_review_parameters ( ) , array ( 'userid' => $ userid , 'competencyid' => $ competencyid ) ) ; $ context = context_user :: instance ( $ params [ 'userid' ] ) ; self :: ...
External function user_competency_stop_review .
33,582
public static function create_plan ( $ plan ) { global $ PAGE ; $ params = self :: validate_parameters ( self :: create_plan_parameters ( ) , array ( 'plan' => $ plan ) ) ; $ params = $ params [ 'plan' ] ; $ context = context_user :: instance ( $ params [ 'userid' ] ) ; self :: validate_context ( $ context ) ; $ output...
Create a new learning plan .
33,583
public static function update_plan ( $ plan ) { global $ PAGE ; $ params = self :: validate_parameters ( self :: update_plan_parameters ( ) , array ( 'plan' => $ plan ) ) ; $ params = $ params [ 'plan' ] ; $ plan = api :: read_plan ( $ params [ 'id' ] ) ; self :: validate_context ( $ plan -> get_context ( ) ) ; $ outpu...
Updates a new learning plan .
33,584
public static function complete_plan ( $ planid ) { $ params = self :: validate_parameters ( self :: complete_plan_parameters ( ) , array ( 'planid' => $ planid ) ) ; return api :: complete_plan ( $ params [ 'planid' ] ) ; }
Complete Learning plan .
33,585
public static function reopen_plan ( $ planid ) { $ params = self :: validate_parameters ( self :: reopen_plan_parameters ( ) , array ( 'planid' => $ planid ) ) ; return api :: reopen_plan ( $ params [ 'planid' ] ) ; }
Reopen Learning plan .
33,586
public static function read_plan ( $ id ) { global $ PAGE ; $ params = self :: validate_parameters ( self :: read_plan_parameters ( ) , array ( 'id' => $ id , ) ) ; $ plan = api :: read_plan ( $ params [ 'id' ] ) ; self :: validate_context ( $ plan -> get_context ( ) ) ; $ output = $ PAGE -> get_renderer ( 'core' ) ; $...
Read a plan by id .
33,587
public static function delete_plan ( $ id ) { $ params = self :: validate_parameters ( self :: delete_plan_parameters ( ) , array ( 'id' => $ id , ) ) ; $ plan = api :: read_plan ( $ params [ 'id' ] ) ; self :: validate_context ( $ plan -> get_context ( ) ) ; return external_api :: clean_returnvalue ( self :: delete_pl...
Delete a plan .
33,588
public static function plan_cancel_review_request ( $ id ) { $ params = self :: validate_parameters ( self :: plan_cancel_review_request_parameters ( ) , array ( 'id' => $ id ) ) ; $ plan = api :: read_plan ( $ id ) ; self :: validate_context ( $ plan -> get_context ( ) ) ; return api :: plan_cancel_review_request ( $ ...
External function plan_cancel_review_request .
33,589
public static function plan_request_review ( $ id ) { $ params = self :: validate_parameters ( self :: plan_request_review_parameters ( ) , array ( 'id' => $ id ) ) ; $ plan = api :: read_plan ( $ id ) ; self :: validate_context ( $ plan -> get_context ( ) ) ; return api :: plan_request_review ( $ plan ) ; }
External function plan_request_review .
33,590
public static function plan_start_review ( $ id ) { $ params = self :: validate_parameters ( self :: plan_start_review_parameters ( ) , array ( 'id' => $ id ) ) ; $ plan = api :: read_plan ( $ id ) ; self :: validate_context ( $ plan -> get_context ( ) ) ; return api :: plan_start_review ( $ plan ) ; }
External function plan_start_review .
33,591
public static function plan_stop_review ( $ id ) { $ params = self :: validate_parameters ( self :: plan_stop_review_parameters ( ) , array ( 'id' => $ id ) ) ; $ plan = api :: read_plan ( $ id ) ; self :: validate_context ( $ plan -> get_context ( ) ) ; return api :: plan_stop_review ( $ plan ) ; }
External function plan_stop_review .
33,592
public static function approve_plan ( $ id ) { $ params = self :: validate_parameters ( self :: approve_plan_parameters ( ) , array ( 'id' => $ id , ) ) ; $ plan = api :: read_plan ( $ id ) ; self :: validate_context ( $ plan -> get_context ( ) ) ; return api :: approve_plan ( $ plan ) ; }
External function approve_plan .
33,593
public static function unapprove_plan ( $ id ) { $ params = self :: validate_parameters ( self :: unapprove_plan_parameters ( ) , array ( 'id' => $ id , ) ) ; $ plan = api :: read_plan ( $ id ) ; self :: validate_context ( $ plan -> get_context ( ) ) ; return api :: unapprove_plan ( $ plan ) ; }
External function unapprove_plan .
33,594
public static function list_plan_competencies ( $ id ) { global $ PAGE ; $ params = self :: validate_parameters ( self :: list_plan_competencies_parameters ( ) , array ( 'id' => $ id ) ) ; $ id = $ params [ 'id' ] ; $ plan = api :: read_plan ( $ id ) ; $ usercontext = $ plan -> get_context ( ) ; self :: validate_contex...
List plan competencies .
33,595
public static function list_plan_competencies_returns ( ) { $ uc = user_competency_exporter :: get_read_structure ( ) ; $ ucp = user_competency_plan_exporter :: get_read_structure ( ) ; $ uc -> required = VALUE_OPTIONAL ; $ ucp -> required = VALUE_OPTIONAL ; return new external_multiple_structure ( new external_single_...
External function return structure .
33,596
public static function list_user_plans ( $ userid ) { global $ PAGE ; $ params = self :: validate_parameters ( self :: list_user_plans_parameters ( ) , array ( 'userid' => $ userid ) ) ; $ context = context_user :: instance ( $ params [ 'userid' ] ) ; self :: validate_context ( $ context ) ; $ output = $ PAGE -> get_re...
External function list_user_plans .
33,597
public static function request_review_of_user_evidence_linked_competencies ( $ id ) { $ params = self :: validate_parameters ( self :: request_review_of_user_evidence_linked_competencies_parameters ( ) , array ( 'id' => $ id ) ) ; $ userevidence = api :: read_user_evidence ( $ id ) ; self :: validate_context ( $ userev...
Send user evidence competencies to review .
33,598
public static function get_scale_values ( $ scaleid ) { global $ DB ; $ params = self :: validate_parameters ( self :: get_scale_values_parameters ( ) , array ( 'scaleid' => $ scaleid , ) ) ; $ context = context_system :: instance ( ) ; self :: validate_context ( $ context ) ; $ scale = grade_scale :: fetch ( array ( '...
Get the values associated with a scale .
33,599
public static function add_related_competency ( $ competencyid , $ relatedcompetencyid ) { $ params = self :: validate_parameters ( self :: add_related_competency_parameters ( ) , array ( 'competencyid' => $ competencyid , 'relatedcompetencyid' => $ relatedcompetencyid ) ) ; $ competency = api :: read_competency ( $ pa...
Adds a related competency .