Global Search for Moodle on Centos

My students are using a Moodle VLE to access resources and teaching materials and it became evident that some kind of global search function would help them find things quickly, especially later in the programme when they come to write their assignments.

I’m running Moodle on a CentOS 7.3 virtual private server with Plesk Onyx. The server hosts several other sites running WordPress, bespoke PHP and some other bits and pieces including the usual mail services. Some of the containers require the OS-standard PHP5.4 but a recent upgrade to Moodle 3.3 required me to switch the container to PHP 7.0.

Installing Global Search was a little tricky because of the multiple PHP versions running on the server, but I eventually figured it out to these key steps:

Install the Solr Server

$ cd /opt
$ wget http://apache.mirrors.nublue.co.uk/lucene/solr/6.6.0/solr-6.6.0.tgz
$ tar zxvf solr-6.6.0.tgz
$ cp solr-6.6.0/bin/install_solr_service.sh .
$ rm -rf solr-6.6.0
$ ./install_solr_service.sh solr-6.6.0.tgz
$ chkconfig solr on
$ su - solr -c "/opt/solr/bin/solr create_core -c moodle"

You should be able to visit http://your-domain.tld:8983 to verify the Solr server is running OK.

Secure the Solr Server

By default, Solr is open to the world. You might want to secure it by adding this at the end of /opt/solr/server/etc/webdefault.xml:

  <security-constraint>
   <web-resource-collection>
       <web-resource-name>Solr Administration</web-resource-name>
       <url-pattern>/*</url-pattern>
   </web-resource-collection>
   <auth-constraint>
       <role-name>solr-admin</role-name>
   </auth-constraint>
  </security-constraint>

  <login-config>
   <auth-method>BASIC</auth-method>
   <realm-name>Solr Administration</realm-name>
  </login-config>

Create a file in the same directory called realm.properties containing your chosen authentication details (matching the role above) in a single line:

admin: password, solr-admin

Finally, add this just before the last line in jetty.xml in the same directory:

<Call name="addBean">
 <Arg>
  <New class="org.eclipse.jetty.security.HashLoginService">
    <Set name="name">Solr Administration</Set>
    <Set name="config"><SystemProperty name="jetty.home" default="."/>/etc/realm.properties</Set>
    <Set name="refreshInterval">0</Set>
  </New>
 </Arg>
</Call>

Install the PHP Solr Extension

$ rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
$ rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
$ yum install libxml2-devel pcre-devel libcurl-devel php70w-devel php70w-pear

You’ll need to build the extension using the right versions of phpize and php-config for your version of PHP, in my case, 7.0:

$ cd /opt
$ curl -O https://pecl.php.net/get/solr-2.4.0.tgz
$ tar zxvf solr-2.4.0.tgz
$ cd solr-2.4.0/
$ ../plesk/php/7.0/bin/phpize
$ ./configure --with-php-config=/opt/plesk/php/7.0/bin/php-config
$ make
$ make install
$ cp /opt/solr-2.4.0/modules/solr.so /opt/plesk/php/7.0/lib64/php/modules/
$ sudo service httpd restart

Visit the Site administration / ▶︎ Plugins / ▶︎ Search / ▶︎ Manage global search page in your Moodle installation to configure, index and enable the Solr Search Engine.

I am impressed with how quickly this has been used and appreciated by the students.

Scholarly Open Access

I kept a link to Beall’s list on my PhD Resources Reddit and received a comment that alerted me to the post (reposted below) which reported the take-down of this incredibly useful resource.

Science itself is under attack by those governments, corporations and gangsters who profit from ignorance: Beall did a great service by “outing” bogus and fake journals who increasingly have been undermining the robust verification and publication of hard science findings.

The comment on the reddit post is available here and calls for a distributed response that is resilient to the challenges that cannot be sustained by one man in academia.

The post-truth era is here, now. Objective enquiry is under attack.

Beall’s list of “predatory” publishers and journals no longer available

Scholarly Open Access, a popular blog that listed questionable journals and publishers, has recently been taken down. The blog was maintained since 2008 by Jeffrey Beall who is an academic librarian at the University of Colorado in Denver. Incidentally, his faculty page too is no longer available. While the exact reasons behind this decision remain unclear, according to a UC Denver spokesperson, it was Beall’s personal decision to take this step and added that, “Professor Beall remains on the faculty at the university and will be pursuing new areas of research.” Lacey Earle, Vice President of Business Development at Cabell’s International, tweeted that “threats & politics” forced Beall to shut down the site.

Beall’s blog that listed more than 1000 “potential, possible or probable predatory scholarly open-access publishers” now stands blank, and it is not known whether this closure is permanent. While his efforts at exposing fraudulent publishers were applauded by many academics, his list – popularly known as “Beall’s list” – had been a source of controversy as some open access advocates believed that he was negative toward the model. He also received flak from some publishers and journals that objected to being included in his list. One such publisher is OMICS Publishing Group that threatened to sue Beall with a $1 billion lawsuit for defaming the company.

Cabell’s International, a publishing services company, had announced that it has been working with Beall since 2015 to develop a blacklist of publishers. Hence, there has been some speculation as to whether this was the reason behind pulling down of Beall’s blog. However, the company publicly stated that it is not involved with this incident. The shutdown of Beall’s blog is perceived by many as a loss to academia. Though it received considerable criticism for being overly biased, it was unique in the industry and many researchers considered it to be a valuable resource. It remains to be seen what effect the closedown of this blog has on academic publishing.

References:

Mystery as controversial list of predatory publishers disappears

Why did Beall’s List of potential predatory publishers go dark?

No More ‘Beall’s List’

This post Beall’s list of “predatory” publishers and journals no longer available was originally published on Editage Insights.

The Moray House Sundial

The Moray House Sundial
The Moray House Sundial
The Sundial stands again before Old Moray House.

Yesterday, after a year in careful storage, the Sundial Memorial returned to a place of honour and inspiration in the newly re-designed quad in front of Old Moray House.

The memorial was made in 1998 to commemorate 150 years of teacher training and education here.

It stands now to inspire teachers from all over the world, whether just beginning their journey as educators, enhancing it or returning to it, of one of the most powerful aspirations and consequences of being an effective and transformative teacher: know yourself.

Slaughtering Pixies

Well, it’s been quite an interesting couple of weeks. One of the things I am doing this week is to close down the Scottish Physics Teaching Resources site (sptr.net), which for the past few years has provided a vehicle for Physics teachers in Scotland to share all kinds of teaching resources. It has been useful in a time of badly conceived and implemented curriculum change in Scotland.

Why close it down? Two reasons. Until very recently, I was intending to leave the country and work overseas and I was uncertain that I could sustain the required commitment to keep the site functioning well. Plans have changed (and continue to do so on a daily basis) but the community of teachers needs something reliable to help them deliver a workable curriculum. The second reason is that I need to remove as many distractions as possible to enable me to pick up a project I have been trying to progress for the past two years, without having the time to do so satisfactorily. Like the overseas project, it may yet come to nothing but a learning experience, but I have to give it my best shot.

Scottish Education: the best in the world?

Keir Bloomer, in an article for Reform Scotland, notices what many of us in Scottish Education already know – it’s not as good an education system as it thinks it is. One aspect that has exercised me in the most recent few years is the blind, stupid, and patronising denial of the existence of problems when they are raised by the only people who really know how good the education system is – the teachers. These denials come from the politicians and the various agencies that are responsible for aspects of our educational infrastructure, most notably the SQA and the ironically named Education Scotland. Over a decade after its launch, Curriculum for Excellence is still not working, let alone “embedded”. The Secondary part of CfE is still a seven-year programme that school leaders and teachers are trying to make fit the six years available. Weaker managers, notably in certain parts of our Primary system, continue to use bullying and intimidation to drive teachers to deliver a curriculum that has been reduced ad absurdum to an impenetrable administrative ticky-box tangle. Unions have utterly failed to even recognise the challenges and abuses, let alone tackle them. The resulting damage to teacher morale, the quality of teaching and learning, and the consequences for life chances of our children and the prosperity of the country has been incalculable.

For reasons that some readers will be aware of, I have had cause recently to look at other curricular models and find their clarity, principle and self-consistent feasibility to stand in very stark contrast to the gibberish that is the current curriculum in Scotland. If you want an executive overview of an example, check out the Cambridge International Curriculum. It will show you what’s possible.

The Scottish Academy

I had intended to offer a short talk at Teachmeet – Scottish Learning Festival 2015 this week but had to cancel due to work commitments. Instead, and so as to still put it “out there”, I recorded a podcast of the talk which you can find over at AudioBoom:

The presentation text can be found on Evernote. What do you think? Comments welcome.

Hello, World! Nice HAT.

Hello World!
Hello World!
Hello World!

For those of you trying to get to grips with the Raspberry Pi’s Astro-Pi Sense HAT… wait, what?

The Raspberry Pi is the amazing, powerful and compact computer-on-a-board that has got children of all ages around the world coding and investigating computational thinking. For less than fifty bucks, this machine includes a fast processor, a decent amount of RAM and USB, Ethernet and HDMI interfaces that let you connect it up to a TV and keyboard and do almost anything you can do on machines twenty times the price (like write this post, for example). If, like me, you like things tidy, you can add a box to put it in and if, like me, you’re a physics teacher, you can add on a sense HAT (Hardware Attached on Top) that is exactly the same as the kit to be used by Astronaut Tim Peake on the International Space Station to conduct experiments in space using the many sensors on board the HAT.

The whole kit cost me £75 including power supply and SD card with operating system (Raspbian – a version of Debian Linux) software pre-installed.

The setting up is simple and step-by-step, I got it working as a stand-alone machine before installing the Sense HAT. I had to take a knife to the official Raspberry Pi box once the HAT was added to the Pi board – it almost fits but just needs a little adjustment near the corner of the lid to make it snap into place. There are plenty of resources on the web to help you get started but development has taken place at such a pace that some of the guides don’t quite match the installed software. The Getting Started with the Sense Hat page at raspberrypi.org is no exception. There is a simple “Hello World!” program:

from sense_hat import SenseHat
sense=SenseHat()
sense.show_message("Hello, World!")

On my Pi 3B, I got an error at this point:

Traceback (most recent call last):
 File "/home/pi/hw.py", line 1, in <module>
 from sense_hat import SenseHat
 File "/usr/lib/python3/dist-packages/sense_hat/__init__.py", line 2, in <module>
 from .sense_hat import SenseHat, SenseHat as AstroPi
 File "/usr/lib/python3/dist-packages/sense_hat/sense_hat.py", line 14, in <module>
 from PIL import Image # pillow
ImportError: No module named PIL

This was because there was a step missing from the sense-HAT installation instructions which should have read:

sudo apt-get install sense-hat
sudo pip-3.2 install pillow

The second line was omitted, leading to the above error. Once the pillow module was installed OK, running the test python script above produced the results I was looking for (see picture). There is a lot of decent documentation at pythonhosted.org that I hope to take a look at in order to get some ideas for physics teaching using the sensors in my new HAT. I’m loving the sense of really playing (and learning) with computers: those of you old enough will remember the same joy of getting a BASIC program to run properly on your BBC or ZX Spectrum. Suddenly, computers are fun again.

A rocky road to run

Out running in the pleasant countryside of Fife this afternoon, a friend passed some young gentlemen who seemed to be entertained by the lone female getting fit in the fresh air. A sudden sharp pain in her hip as she ran by brought her to the shocking realisation that these were not the well-bred, well-educated youth of her everyday experience: one had thrown a rock at her which struck its target. The lone female took a fright and ran back to her car to examine the damage and consider next steps.

The next step, on establishing that there was no bleeding, was to drive to the next cut in the path where she met them cycling on the wrong side of the road towards her. She stopped in a passing place and took a photograph of them and asked them to explain their actions. No satisfactory rationale was forthcoming but in the attempt at a justification, an admission was obtained. Initially indignant at the breach of their right not to be photographed in a public place, they became fearful as the lone female got into her car and drove away with evidence that linked them to the crime.

The really awful thing about this episode, aside from the fact that a lone female is not safe to run in the lovely Fife countryside for fear of assault, is that this lone female is a teacher and, if she were to publish the faces of these assailants or pursue redress or apology through the good offices of Police Scotland, it is possible that questions and accusations may be raised that challenge her professionalism. That’s a road not worth running down.