Christmas Candle Bridge Bulbs

A Festive related post

The problem with most Christmas candle bridges (& some other light sets) is that they are one complete circuit.. Meaning if one bulb is dead the whole thing will not light.. I found this out when decorating our home this weekend. Check out this picture to see how to work out how many of your bulbs need replacing.

Grab a 9v battery, place the end of the bulb on the + (plus) and the side of the bulb touching the (minus) and check that it lights. This trick will only light up bulbs which need less than about 4.5 watts to light.

Please do not throw away the whole item, thinking that it is broken !

If you are thinking of using this same method to check higher powered bulbs on a higher power battery DO NOT do it, it could be very shocking โšกโšกโšก for you.

Wishing you a very Happy and Safe Christmas

Moodle OAuth 2 services > Microsoft OneDrive

Setting up OAuth 2 services within Moodle can be quite painful.

Hopefully the below information which is ‘not’ documented by Moodle will help you with that.

The issue I was seeing was when I clicked on ‘Connect to a system account’, it threw this error “The system account was not connected for offline access

To fix this the answer lies within the endpoints on Moodle, the authorization_endpoint & token_endpoint needed the specific endpoints from the Azure App Registration

Within Azure these are here

Rather than the default ones which look like this, in the case for me /common/ was not working

If your issue is a different one and you are after support for your Moodle, why not reach out to us to host and or just support your instance.

Contact us here info@cosector.com

Moodle Scheduled Task & MySQL Going Away

Have you ever had the following error in one of your Moodle scheduled tasks ??

What this means is that and the size of the file it is trying to write is bigger than the variable currently allows, MySQL has tried to do as you’ve asked and couldn’t at which point it has packed its bags and gone home..

You might see it if you ever run a full Sync users with Azure AD on a large Moodle site.

The task will then just restart and fail the next time as well and keep looping causing your sync and Moodle site get more and more out of date with your Azure AD.

How to fix.. its pretty simple really, you just need to get MySQL’s connection to be able to write larger sized data files packages.

The default for max_allowed_packets on your Moodle’s MySQL database is likely to be 16mb

show global variables like '%max_allow%';

You want to change this to 256mb’s

You do this with the following line on your MySQL command line

set global max_allowed_packet = 268435456;

What is 268435456 ??

268435456 / 1024 / 1024 = 256 as in 256mbs, just like that 16777216 / 1024 / 1024 = 16 as in 16mbs.

This ‘should’ be enough to be able to write the data in the sync back to your database without the databases connection closing and it going off home..

๐Ÿ˜€

Moodle Office365 & redirect issues?

Having issue with your Moodle, specifically no longer being able to get to the manual login page when using either of these URL’s

https://yourMoodle/?noredirect=1

or

https://yourMoodle/login/index.php?noredirect=1

Do check that this is switched on

https://yourMoodle/admin/search.php?query=forceredirect

If you have lost access to your frontend in is in mdl_config_plugins

Check whether you Office365 plugins page is all verified, click the button, if yours is not in a state with green ticks as the below screenshot.

https://yourMoodle/admin/settings.php?section=local_o365

Reason this is needed is taken from the manual below – Why this might Undo at any stage in the future is currently unknown, if you figure this out, let us know in the comments.

Verify Setup

  1. This tool verifies that Azure has been correctly set up. Click the “Update” button to check setup.
  2. If the tool reports any missing permissions, return to Azure and ensure that all required permissions have been added to your configured application for Moodle.

Moodle Course Delete From the Command Line(CLI)

Have you a lot of courses to delete within Moodle & tried doing it via the frontend ?

Quickly you will learn that this is a complete nightmare and may work & most probably wont!

So how do you go about deleting from the CLI on the server?

Create your .csv file, use Excel or other application

You only require a shortname and delete column

You can get the shortname like this from the database with this bit of SQL

Select shortname, '1' As 'delete' from mdl_course
Where shortname like '%1314%';

Export the output of this as a CSV and there is no need for Excel ๐Ÿ˜‰

Now its time to jump on the server & head to

/var/www/moodle/docroot/admin/tool/uploaduser/cli

Create yourself a Screen session with something like

screen -S "RR #12345 1314 Course delete for XYZ"

And run something like this .. check your directory paths, don’t just trust me !

sudo -u www-data php uploaduser.php --mode=update --updatemode=dataonly --file=/var/www/moodle/tmp/All-1314-CoursesFrom-mdl_course.csv --delimiter=comma --allowdeletes |tee /var/www/moodle/tmp/deletecourses-1314_log.txt

Press CTRL + A + D to exit the screen session and come back in a few days, either by checking the log file you piped it out to or the Session itself to see if it has finished.

To note www-data is the group which your Moodle is running its commands as

Turnitin Error on Submission in Moodle

Turnitin’s plugins are the gift that keeps giving…

This bug still has not been addressed and it was showing on one of our customers sites after they moved to Moodle 4.1.4 and the latest version of Turnitin tool 3.9+ (2023032701)

The error shows after a user makes a submission via a ‘Turnitin Assignment 2’ submission activity point.

The above shows Turnitin trying to display a Digital receipt and cannot, this is because these settings have been wiped out during the upgrade.. sometimes this happens and most times not!

Head to this location on your site and check the following are enabled for Email or Web /admin/message.php

This will then allow the Digital receipt to come through to the frontend on submission

If you use Turnitin via the core Moodle Assignment activity this does not occur, better still why not reach out to CoSector and ask to see our fully featured Electronic Management of Assessment platform plugin for Moodle (Coursework).

Hope that helps.

Stuck button on Dualit Mixer HMR2

Today our Dualit HMR2 Mixer which we’ve owned for some 12 years stopped working as the whisks eject button got trapped in the way off the on/off power slider…

If I didn’t fix it then I wouldn’t get any more cake.. I like cake, so this is how I fixed it.

A fixya page exists showing how to open the mixer, but its pictures are missing… So I thought I’d post mine on here.

Start by plugging the plug into the actual mixer where the whisks go and turn the plug about a 1/10th of a rotation clockwise. This allows you to take the front off.

Unscrew screw 1 which allows you to pull the base where the cord is stored down about an inch, this reveals screws 2 & 3 behind the fan.. unscrew these as well.

Now carefully prise the bottom of the handle up, there’s 3 hidden clips (2 at the middle sides and 1 at the end) which will probably snap, I had to superglue 2 back on!

This should allow you access to the power slider and the stuck ejection button. Ours had failed as the actual button has two tiny pegs on it which had snapped off.. after attempting to superglue these on… And pushing it back in, these snapped again but held in place – luckily!

Reverse the above, make sure the power. Slider matches the position of the power switch and clip it back together.. redo up the screws.

I then glued on a thin piece of plastic on the button and down towards where the power slider sits to counteract the broken pegs at the top end of the button, which keeps it perfectly in place

Make cake and be happy ๐Ÿ˜

Notepad++ Wrap numbers for ease of use in a SQL query

In my new role I seems to have lines and lines of numbers from scheduled tasks logs and the like, which I then have to action quickly back into SQL queries. So I thought I write down how I do that.. for two reason.

  1. You might stumble across it
  2. I may forget how to do it ๐Ÿ˜

Launch Notepad ++

Press CTRL + H to bring up Replace

Find what:

^(.+)$

Replace with:

โ€˜\1โ€™,

Select Regular expression

Replace All

This coverts the above list of numbers into the following format

This way you can now wrap that in brackets and query it.

Time for a change

Goodbye Manchester Metropolitan University, Hello CoSector / University of London

I’ve started a new job there as a Customer Success Consultant.

Amongst other things we host and manage Moodle installations mainly for the schools / colleges and university’s in the Higher Education sector.

We are currently walking our customers through the changes the move to Moodle 4.1 brings and helping them get the best from their Virtual Learning Environment.

Want to move to a professionally hosted platform, contact us.

Moodle 4 Boost, Hide Block Titles

Good Morning, just thought I’d write a quick post about the blocks within the Boost theme in Moodle 4.

I’ve noticed that every block has the block’s name as a title. In our instance of Moodle 4 we do not want them as it duplicates what the content already displays.

So this is the CSS you need to pop into Boost / Advanced Settings /admin/settings.php?section=themesettingboost#theme_boost_advanced in the box ‘Raw SCSS theme_boost | scss’

/* Hide My Office365 block title */
.block_microsoft  .card-title {
    display: none!important;
}

/* Hide My Overview block title */
.block_myoverview .card-title {
    display: none!important;
}

In our case this does the following, the two blocks goes from this

To this

Hope that helps someone out there. I’m documenting this so I do not forget it when we go live to Moodle 4.1 in June 2023