Posts

Showing posts from September, 2021

can't find data record error in moodle

1. Create a file called fixup.php with these contents: <?php require_once('config.php'); require_once($CFG-> dirroot . '/course/lib.php'); require_login(); require_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM)); move_courses(array(1,2,3,4,5,6,7,8,9,10), 1); // the numbers from 1 to 10 are courses ids then ',1' is the category where you will be moving all your courses. echo 'Done!'; 2. put it in your top level of your moodle application folder - where the config.php file is. 3. Go to your moodle instance plus /fixup.php in the url. https://moodle.org/mod/forum/discuss.php?d=399516

Change user to admininstrator

To make a user an administrator on a moodle instance, you need to find their UserID and add it to the moodle config table in the database. Step 1. Get the User ID:  select username,id from mdl_user where username="john"; This will print out something like the following: +----------+----+ | username | id | +----------+----+ | john     |  4 | +----------+----+ Step 2. Find out who is/are already administrator/s: select * from mdl_config where name="siteadmins"; This will print out something like this: +----+------------+--------------------------------------------------+ | id | name       | value                                            | +----+------------+--------------------------------------------------+ | 23 | siteadmins | 2,289,3497,10187,4164,10165,10175,210,10181,4184 | +----+------------+--------------------------------------------------+ This means that user ID numbers < 2,289,3497,10187,4164,10165,10175,210,10181,4184 > are admins Step 3. Add your u