Categories
Azure LMS Microsoft Moodle Uncategorized

Microsoft Azure Web Application Firewall (WAF) blocks some Moodle calls

Moodle 3.9.11+ was recently installed in Azure Cloud. The installation was not an easy ride because Moodle was not prepared to install the application behind an SSL proxy. You may find the solution for this here: Installing Moodle using SSL Proxy.
I started to use Moodle then I realize that I cannot add an activity or resource. And this is something that without this feature Moodle is useless. So first of all, I checked the Javascript console on the client-side and I’d found that some of the Javascript could not be loaded because the response was 403 Forbidden.
The error message was:
Failed to load resource: the server responded with a status 403 (ModSecurity Action)

Categories
e-learning LMS Microsoft Moodle Uncategorized

Moodle – Connecting to an Active Directory with PHP using LDAPs Connection

PHP and LDAP are not good friends. I had always issues connecting to a Microsoft Active Directory with PHP using the php_ldap module. And it was always a pain in the ass to figure out what went wrong or why it does not want to connect.

My Moodle did not want to connect to the Active Directory and of course, the only feedback by Moodle was an empty string. So let’s start the troubleshooting.

Categories
LMS Moodle Uncategorized

Another Moodle report – List submitted files of an assignment by cohort users

My boss wanted a report to show who had submitted a certification of their debit by courses. We have approximately 120 courses. All courses have a consultant with teacher role. All the student are in separate cohorts. Each cohorts added  one-by-one to courses so one cohort to one course.  Consultants need to know who paid or who not. So I have made a separate course with a single assignment where students upload their certifications. In each course I have to made configurable report where the consultants see only their students upload status.

So the SQL is:

SELECT u.lastname Lastname, u.firstname Firstname, u.username Username, u.email Email, ch.name Cohortname, s.status SubmissionStatus, concat('<a target="_blank" href="%%WWWROOT%%/pluginfile.php/Submission-id/assignsubmission_file/submission_files/',f.itemid,'/',f.filename,'?forcedownload=1">',f.filename,'</a>') Download, FROM_UNIXTIME(f.timecreated) SubmissionDate
FROM prefix_user AS u
JOIN prefix_cohort_members AS cm ON cm.userid = u.id 
JOIN prefix_cohort AS ch ON ch.id = cm.cohortid and ch.idnumber = 'Cohort-id' 
JOIN prefix_role_assignments AS ra ON ra.userid=u.id and ra.contextid in 
(SELECT co.id from prefix_context co WHERE co.contextlevel = 50 and instanceid in (
SELECT id from prefix_course where id = Course-id)
) AND ra.roleid=5 
LEFT JOIN prefix_assign_submission AS s on u.id = s.userid AND s.assignment = (SELECT instance FROM prefix_course_modules WHERE course=Course-id and id=Assignment-id)
LEFT JOIN prefix_assignsubmission_file AS asf ON s.id = asf.submission AND s.assignment = asf.assignment
left join prefix_files f ON f.itemid = asf.submission AND f.filesize > 0
LEFT JOIN prefix_files_reference r ON f.referencefileid = r.id
ORDER BY ch.name, u.lastname, u.firstname

And finally all the consultants are satisfied.

Categories
Uncategorized Windows

Can’t access DVD with fresh new installed Windows 8.1 (Code 19)

I have a Windows that cannot start this hardware device because its configuration information (in the registry) is incomplete or damaged. To fix this problem you should uninstall and then reinstall the hardware device. (Code 19) error code in Device Manager.

I checked many sites, for me this has been worked:

reg.exe add "HKLM\System\CurrentControlSet\Services\atapi\Controller0" /f /v EnumDevice1 /t REG_DWORD /d 0x00000001

NOTE: It is only works when you run Command promt as administrator.

Reboot.

Thanks for http://www.askvg.com/optical-drives-are-not-showing-in-my-computer/

Categories
Mahara Moodle Uncategorized

MAHOODLE Payload not encryptedERROR 1:1:Payload not encrypted

When trying to export an assignment document to Mahara and we get the following error:

Payload not encryptedERROR 1:1:Payload not encryptedDebug: \nError code: failedtopingline 280 of /portfolio/mahara/lib.php: portfolio_export_exception thrown
line 57 of /portfolio/mahara/preconfig.php: call to portfolio_plugin_mahara->send_intent()\n, referer: http://moodle.appi.bme.hu/mod/assign/view.php

Most likely we are behind a firewall. If both Moodle and Mahara servers are behind the firewall simply add the inner IP address of the Mahara server to the Moodle server /etc/hosts file like this:

192.168.x.x<-->mahara.example.org

Or if you have a DNS inside the firewall, check the settings of it.

Categories
Debian Uncategorized

Install Debian Wheezy on Citrix XenServer 6.0.2

As Citrix XenServer 6.0.2 does not offer template for Debian Wheezy we have to install it in two steps.

First install Debian Squeeze as usual.

Second step is to upgrade Squeeze to Wheezy. Here are the sub-steps:

As it is a new install you do not have to update your system but for sure you can type the following commands:

apt-get update
apt-get upgrade
apt-get dist-upgrade

Also check that there are no packages are on hold or in any half installed state:

dpkg --audit 
dpkg --get-selections | grep hold

Now update /etc/apt/sources.list to the following:

# deb http://ftp.hu.debian.org/debian/ wheezy main

deb http://ftp.hu.debian.org/debian/ wheezy main
deb-src http://ftp.hu.debian.org/debian/ wheezy main

deb http://security.debian.org/ wheezy/updates main
deb-src http://security.debian.org/ wheezy/updates main

# wheezy-updates, previously known as 'volatile'
deb http://ftp.hu.debian.org/debian/ wheezy-updates main
deb-src http://ftp.hu.debian.org/debian/ wheezy-updates main

After this type:

apt-get update

Then perform the upgrade. It is recommended to use a two stage upgrade approach.

apt-get upgrade
apt-get dist-upgrade

When it is ready reboot twice. After the first reboot I have found that all filesystems are read only due to an unknown error. After rebooting again everything was ok.

Enjoy your Debian Wheezy.

Links:

Debian: http://www.debian.org/
Debian Wheezy Release Notes: http://www.debian.org/releases/wheezy/amd64/release-notes/

Categories
Uncategorized

How programming is important

“Everybody in this country should learn how to program a computer…

Because it teaches you how to think.”

Steve Jobs