Thursday, October 22, 2026

Moodle - Learner unable to move forward after completing an activity

One of our Moodle instances had an issue, as reported by the admin -  

This is an H5P page with a Video (not an interactive video), a Drag-and-drop (16 drops), an Image (reading material), and a single-choice set (5 questions), totalling 21 marks. The completion conditions are View, Receive a grade, and Receive a passing grade. 

While a few testers moved forward, this <particular user> could not. I tried a few times (using login as option), no luck. I even marked the activity completed thru the Activity Completion report. Yet, she is unable to go to the next activity. 
I unenrolled <particular user> from the course and enrolled, but the system remembers 
<particular user>

Every time I try to complete the activity, the system randomly shows the previous answers as incorrect. Even though I have provided correct answers to all the questions, some were displayed with options that I did not choose.

Conversation with Claude for my reference - https://claude.ai/chat/5e1f6865-4079-4118-ac93-5f23ef652602

Passing on that info (checks mentioned by Claude) did not help the situation. 

To understand the issue, I tried "log in as" that user, and went to the problematic section. 

There, I saw that the "Check your understanding" questions have only 1 correct answer out of 5, but probably the admin override has changed the grade to 5/5. This might have caused the inability to proceed further, since that activity is set to "receive a passing grade" and the passing grade is set to 100% but only 1/5 was actually correct. 

I changed the completion criteria to "receive a grade", "any grade" for that activity.

Then, when I 'log in as' that user, I got a pop-up saying grading has changed, "you have to retake that activity".

So I started completing that activity, completed it successfully.

There is a link there to "go back to course", as the workaround as mentioned in 

https://hnsws.blogspot.com/2026/07/h5p-page-in-moodle-does-not-show-next.html

Now, when I 'log in as' that user, the user can again retake that activity.

This seems to solve the problem.

So, if such an issue is faced with course completion with an activity, on making a small change in the course activity, the user will be prompted to retake the activity. (Claude also suggests --> "Open the activity and go to the Attempts report. Delete this learner's attempts. Moodle will then treat them as having no attempt." <-- I have not tested whether such a method works.)

If required, now the completion criterion can be changed back to 'receive a grade' and 'passing grade' instead of 'any grade'.

Monday, October 12, 2026

upgrading Moodle 4.5 on Ubuntu 24.04 to Moodle 5.3 on Ubuntu 26.04

Initial backup snapshot

https://allinonelms.com/blog/moodle-5-3

says we have one year time before moving from 4.5 to 5.3, so we can wait for Dec, Moodle 5.3.1, if plugins break. But we went ahead, and plugins broke. 

Our Ubuntu install also needed to be upgraded from 24.04 to 26.04, since MySQL 8.4 is required by Moodle 5.3.

The idea is to use sudo do-release-upgrade
(if no upgrade is available, it will tell us)
after taking a backup snapshot.

Duck.ai gave the detailed steps for 

  1. create a snapshot of the original OS disk,
  2. generate a new managed disk from that snapshot,
  3. then deploy a new virtual machine using the new managed disk. 
I did only 1. and 2., did not need to do 3. It just took a few seconds to create snapshot and generate a new managed disk from the snapshot, for our 45 GB OS disk. Just to be safe, I stopped the services, then stopped the VM, then took the snapshot.

sudo service apache2 stop
sudo service postgresql stop
sudo service mysql stop


Gemini, on prompting, listed the disadvantages of upgrading vs creating a new VM from scratch, like the need to choose old vs new config files, the need to have downtime, etc. (private link to conversation is here for my reference, https://aistudio.google.com/prompts/1X_RhD-CQTQS1DdVHShfBhK67VxMp6uYk )

Since the CMS PHP code would also be migrated to PHP 8.5 with this upgrade, tested for breaks using Antigravity - just fed in the code, and asked for what to patch. Only the deprecated FILTER_SANITIZE_STRING in login-action.php and a suggested composer update for dependencies

sudo -u www-data composer update --no-dev --optimize-autoloader

(If done with sudo, would need 
sudo chown -R www-data:www-data /var/www/html/vendor
sudo chown www-data:www-data /var/www/html/composer.lock
)

To have a temporary 'Site under Maintenance' message, a cloudflare redirect to a page hosted on github pages, Rules > Overview > Redirect rules - struggled a bit to find the location of the redirect rules page, private link to conversation is at https://aistudio.google.com/prompts/1iFwSbjXsmI1TsYEIIlQcxvDM0VfolK2I 


Errors during the do-release-upgrade

While doing the do-release-upgrade after saving the snapshot, these were the problems observed.

rclone warning - not from ubuntu repos.
will need to reinstall, maybe.

login.defs - chose to upgrade

Postgres said,
Success. Please check that the upgraded cluster works. If it does,
you can remove the old cluster with
    pg_dropcluster 16 main

certbot not upgraded, dependency problems.

Package apache2 is not configured yet. Will defer actions by package libapache2-mod-php8.5.
Processing triggers for dbus (1.16.2-2ubuntu4) ...
Errors were encountered while processing:
 apache2
 python3-certbot-apache
needrestart is being skipped since dpkg has failed
packages have been installed but needrestart is suspended

etc.

dpkg: error processing package python3-certbot-apache (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 apache2
 python3-certbot-apache

Upgrade complete

The upgrade has completed but there were errors during the upgrade
process.

To continue please press [ENTER]
=== Command detached from window (Sun Oct 11 04:49:30 2026) ===

Gemini, in this conversation, https://aistudio.google.com/prompts/1ySB2bg3r8w23ODeVyiyw-hyOXi-u8gmI said that we can safely reboot, the issue is with apache (and since apache is required for certbot, that fails too). Apache would be loading the old PHP versions, we have to disable PHP 8.3 and enable PHP 8.5. But

sudo a2dismod php8.3
ERROR: /etc/apache2/mods-enabled/php8.3.load is not a symbolic link, not deleting
ERROR: /etc/apache2/mods-enabled/php8.3.conf is not a symbolic link, not deleting
Module php8.3 disabled.

So somewhere the mods-enabled got turned into real files. Had to find all real files (and not links) with

sudo find /etc/apache2/*-enabled/ -type f

and delete all of them. 

sudo bash -c '
# Fix conf-enabled
for file in /etc/apache2/conf-enabled/*; do
    if [ -f "$file" ] && [ ! -L "$file" ]; then
        name=$(basename "$file")
        if [ -f "/etc/apache2/conf-available/$name" ]; then
            rm -f "$file"
        else
            mv "$file" "/etc/apache2/conf-available/$name"
        fi
        ln -s "../conf-available/$name" "$file"
    fi
done

# Fix mods-enabled
for file in /etc/apache2/mods-enabled/*; do
    if [ -f "$file" ] && [ ! -L "$file" ]; then
        name=$(basename "$file")
        if [ -f "/etc/apache2/mods-available/$name" ]; then
            rm -f "$file"
        else
            mv "$file" "/etc/apache2/mods-available/$name"
        fi
        ln -s "../mods-available/$name" "$file"
    fi
done
'

Now 
sudo apache2ctl configtest
was OK, and restarting apache followed by dpkg 

sudo systemctl restart apache2
sudo dpkg --configure -a

fixed certbot also. Then, since postgres 18 was running fine,

sudo pg_dropcluster 16 main

sudo apt purge "postgresql-16*"
sudo apt autoremove


Clear browser host cache for testing, git upgrade

Flush DNS and test - Edge browser on Linux, method suggested by ChatGPT 

https://chatgpt.com/c/6acb1b41-4d04-83e8-a31f-f6958c4a2bbb
has many more testing and dns tips.

edge://net-internals/#dns
and choose Clear host cache.
and choose Flush socket pools.

Then the actual Moodle upgrade using git,
https://chatgpt.com/c/6acb1c57-0e94-83e8-aa2a-31ae3e8f9ef0
git branch -r
to list the remote branches, and then, following 
or

git branch --track MOODLE_503_STABLE origin/MOODLE_503_STABLE
git checkout  MOODLE_503_STABLE

sudo chown -R azureuser:www-data .
sudo chmod -R 775 .

sudo -u www-data /usr/bin/php admin/cli/upgrade.php 

At this point, after the upgrade completed, we needed to install all the PHP modules needed by Moodle 5.3.


Post-install fixes

Took the help of chatgpt to generate the commands needed to install all the required PHP modules,
sudo apt update

sudo apt install \
  php8.5-cli \
  php8.5-common \
  php8.5-curl \
  php8.5-gd \
  php8.5-intl \
  php8.5-mbstring \
  php8.5-mysql \
  php8.5-xml \
  php8.5-zip

/usr/bin/php --ini # to find the ini file path
Loaded Configuration File: /etc/php/8.5/cli/php.ini


Edit both the cli as well as the apache php.ini files to bump
max_input_vars = 5000

upload_max_filesize = 100M
post_max_size = 110M
memory_limit = 256M
max_execution_time = 300
max_input_time = 300


Needed to change the sites' document root in the sites-available of apache to append /public to the existing DocumentRoot value. Copied the "missing from disk" plugins to the public directory by asking chatgpt to write the commands as below,

cd /var/www/theMoodlegit

for plugin in \
    mod/quiz/accessrule/proctoring \
    admin/tool/tcpdffonts \
    availability/condition/othercompleted \
    availability/condition/stash \
    course/format/onetopic \
    course/format/remuiformat \
    course/format/tiles
do
    destination="public/$plugin"

    if [ -d "$plugin" ] && [ ! -e "$destination" ]; then
        sudo mv "$plugin" "$destination"
        echo "Moved $plugin"
    else
        echo "SKIPPED $plugin — check source and destination"
    fi
done

Had to install composer and run it, since Moodle 5.1 onwards use composer for dependencies. Without doing this, some plugins were complaining of Mustache errors, file not found etc. https://claude.ai/chat/427274e2-d874-4b60-b744-2989d51b6b72

sudo apt install composer

cd /var/www/theMoodlegit
composer install --no-dev --classmap-authoritative # (for each instance.)

Router not configured message still shows up, we need to follow the guide to set it up, would be mandatory for future versions of Moodle.

Lots of warnings like

PHP Deprecated:  Function xml_parser_free() is deprecated since 8.5, as it has no effect since PHP 8.0 in /var/www/theMoodlegit/public/lib/classes/xml_parser.php on line 190

ChatGPT recommends ignoring it till the Moodle team removes it, since Moodle 5.3 officially does not support PHP 8.5.

The installation and fixes so far took from 9 am to 2 pm with an hour's lunch break. The next day, the following were also fixed.

Theme edits and unsupported plugins 

Fix for duplicate logo appearing, by adding these lines to the Raw SCSS of Moove theme,

/* Dark mode is disabled, so hide the duplicate dark logo */
nav.navbar .navbar-brand img.logo.dark { display: none !important; }

Site Administration > Appearance > Themes > (gear icon of Moove theme) > Advanced tab > Raw SCSS textbox

(This duplication was a side-effect of us removing the Connectime branding logo advertisement of the Moove theme in SCSS.) 

Later, users found problems with courses using formattype onetopic (which has not been updated to support Moodle 5.3) - https://claude.ai/chat/5c5a6dd0-e0b9-4bfb-a41f-4b8062fabef6 - changed to topics instead in the database to fix,
UPDATE mdl_course SET format = 'topics' WHERE format = 'onetopic';
(after first trying it for a single course and testing.)

Similar fix for some other courses which were using formattype tiles - in that case, only the edit mode was affected, so the teacher admins could themselves change the course formattype to Multitopic (which is topics in the db) in the Course Settings in the UI.


Saturday, October 10, 2026

rhino runtime error for asset search

One of our Google Apps scripts failed with "Execution failed. The Rhino runtime is deprecated and no longer supported."

According to Gemini - 

You must first migrate the script to Google’s modern V8 JavaScript engine.
 ...

Step 1: Enable the V8 Runtime

Before you deploy, you have to tell Google Apps Script to use the new engine.

1.  Open your Google Apps Script project.
2.  Click on the Project Settings (the gear icon ⚙️) on the left sidebar.
3.  Under the "General settings" section, look for "Enable Chrome V8 runtime for
    Apps Script" and check the box. (Note: Alternatively, if you use the
    appsscript.json manifest file, you can manually add "runtimeVersion": "V8"
    to the file).

Step 2: Fix Incompatible Code (If necessary)

Because Rhino was an ancient version of JavaScript, it allowed some non-standard
syntax that the modern V8 engine does not support. When you switch to V8, you
may need to make minor updates to your code:

  - for each loops: Rhino allowed for each (var item in list). In V8, you must
    change this to modern JavaScript: for (var item of list).
  - __iterator__: If your code relied on custom iterators using __iterator__,
    you will need to replace them with ECMAScript iterators.
  - Run your script in the editor to ensure it executes without syntax errors.
    V8 supports modern JS features (like let, const, and arrow functions), so
    your code will likely run faster once fixed.

Step 3: Create a New Deployment

Once you have enabled V8 and tested the code, then you must re-deploy the
script.
S fixed it.

Thursday, October 08, 2026

interesting results with 60 Moodle users logged in

One of our Ubuntu servers hosting Moodle instances had been bumped from D2asv5 (8 GB RAM) to D32asv5 (128 GB RAM) anticipating 100+ users for a training event. Interestingly, even with 60+ users logged on simultaneously, RAM usage did not cross 8 GB. So, tried using D4asv5 (16 GB RAM) for this standalone server, and then tried even not bumping it up from D2asv5. But with D2 (2 cpu cores), the CPU was continuously pegged at 100%, with load average going up to 15. Probably better to bump up to D4. Logging was via https://github.com/hn-88/log-memory-cpu-usage as mentioned in the previous post, and emails being sent to me similar to this - https://hnsws.blogspot.com/2021/02/scripts-to-alert-admin-when-hard-disk.html

(for my reference, conversation with Gemini to find the number of logged in users - and what they were doing - is at https://aistudio.google.com/prompts/1rp43v9LvY7d-b6pk82fgF0dDVQPWmJh8 )

Suggested database queries were - 

SELECT COUNT(DISTINCT l.userid) AS unique_users_active
FROM mdl_logstore_standard_log l
WHERE l.timecreated BETWEEN [START_UNIX_TIMESTAMP] AND [END_UNIX_TIMESTAMP]; 

to find the number of logged in users, and to see what they were doing, 

SELECT 
    u.username, 
    u.firstname, 
    u.lastname, 
    FROM_UNIXTIME(l.timecreated) AS time_of_action,
    l.eventname, 
    l.component, 
    l.target
FROM mdl_logstore_standard_log l
JOIN mdl_user u ON u.id = l.userid
WHERE l.timecreated BETWEEN [START_UNIX_TIMESTAMP] AND [END_UNIX_TIMESTAMP]
ORDER BY l.timecreated ASC;

Edit: Digging deeper, the limited RAM use is probably due to the MaxRequestWorkers setting in Apache settings as per https://docs.moodle.org/503/en/Performance_recommendations#Apache_Performance

Wednesday, October 07, 2026

query to find number of concurrent users - and what they are doing - in Moodle

(for my reference, conversation with Gemini is at https://aistudio.google.com/prompts/1rp43v9LvY7d-b6pk82fgF0dDVQPWmJh8 )

Query to run on the database to find the number of concurrent users - 

SELECT COUNT(DISTINCT l.userid) AS unique_users_active
FROM mdl_logstore_standard_log l
WHERE l.timecreated BETWEEN [START_UNIX_TIMESTAMP] AND [END_UNIX_TIMESTAMP]; 

and similarly, to know what they were doing,

SELECT 
    u.username, 
    u.firstname, 
    u.lastname, 
    FROM_UNIXTIME(l.timecreated) AS time_of_action,
    l.eventname, 
    l.component, 
    l.target
FROM mdl_logstore_standard_log l
JOIN mdl_user u ON u.id = l.userid
WHERE l.timecreated BETWEEN 1791281400 AND 1791285000
ORDER BY l.timecreated ASC;

convert UTC to IST in Google Sheets

 Running this simple memory and cpu logger on one of our servers, the timezone on that machine is UTC, to view in IST, we just have to add 5 hours and 30 minutes, like

=A2 + TIME(5, 30, 0)

Monday, October 05, 2026

getting started with Antigravity

Got access to Google Antigravity (via a telecom provider free offer for subscribers on 5G in India). This is google's agentic coding platform, where you just tell the agent to do specific tasks, and it will do the rest, like in their intro video. I'm exploring making antigravity write code to make OpenSpace run natively on Mac using OpenGL to Metal translation via MGL - where in the best case scenario, we might be able to see native performance similar to what we found with VMWare's driver.

Thursday, October 01, 2026

increasing per user quota in Google WorkSpace

There was a request from a user to increase the Google WorkSpace storage quota from 15 GB to 100 GB for two accounts. 

I asked Gemini via aistudio.google.com how I can increase the quota of a single user, (without changing their Organizational Unit quota) and it showed me this method. Accordingly, have set 100 GB for the group called higher storage users - the two user accounts have been added as members. Later, I got a confirmation from them that the quota increase was successful.
Here is how the admin can do it:

  1. Create a Group: In the Google Admin console, go to Directory > Groups and create a new group (e.g., "Higher Storage Users"). Add the single user to this group[3].
  2. Navigate to Storage: Go to Menu > Storage[4].
  3. Manage Limits: Under the Storage settings section, click Manage[4].
  4. Select the Group: On the left-hand panel, search for and select the configuration group you just created[3][4].
  5. Set the New Quota: Turn on the User storage limit, enter the new, higher storage amount for that user, and click Save[2][3].
Note: Group limits override Organizational Unit (OU) baseline limits, making this the best way to handle one-off storage increases.[3]

And the references cited were: