mysqldump all databases from XAMPP on Windows

A quick note to hopefully save others the time I’ve just wasted. If you want to dump out all your databases, perhaps in preparation for an upgrade to XAMPP as I’m about to try:

  1. Open up a command prompt (in Win 8+ type ‘Command’ and press <Enter> from the Start screen);
  2. Type:
    cd\xampp\mysql\bin

    (or wherever your myslq.exe is located)

  3. Type:
    mysqldump --user=root --password=myrootpwd --all-databases > backup.sql

Other options for this command can be found on the MySQL site.

Note that you are doing this from the Windows Command prompt – don’t get distracted, as I was, by running the MySQL command line tool. If you try and run mysqldump from the:

mysql>

prompt, you’ll get various syntax errors such as:

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mysqldump...' at line 1

However, if running the MySQL command line tool is what has brought you to this post, you launch this by following steps 1 & 2 above and then typing:

mysql --user=root --password=myrootpwd

When executing commands at the:

mysql>

prompt, don’t forget that it allows you to enter multiple lines at once and that clicking <Enter> will just give you a new line unless you finish your line with a semi-colon – this will tell MySQl that you want to execute the command.

 

AngularJS: Images failing to load (Not Found) with curly brackets in URL

This is one of those schoolboy errors that, in hindsight, is blindingly obvious and I should have been able to work out for myself, but required a bit of searching before I managed to ask Google (other search providers are available) the right question.

Basically, I had a load of image src paths that were defined using AngularJS expressions, e.g.

<img src="content/images/results/{{result.id}}.jpg" />

The images loaded fine, but I kept getting 404 (Not Found) errors on image URLs that contained the curly brackets of my expressions (/content/images/results/%7B%7Bresult.id%7D%7D.jpg). This seemed like it was because the page was trying to load the images before Angular has done it’s work and converted the expressions into sensible URLs. And that’s exactly the problem!

The solution is a simple one: use ng-src instead of src if the URL has an expression in it, e.g.

<img ng-src="content/images/results/{{result.id}}.jpg" />

OxTALENT Awards for Medical Sciences

The 2015 OxTALENT (Teaching and Learning Enhanced with Technology) Awards saw a triple success for Medical Sciences, recognising innovative use of technology for teaching and learning within the Division:

Dr Lizzie Burns – Winner in the Outreach and Public Engagement: TES Connect category, for ‘CSlide’: a Nobel Prize-Winner Inspires Science, Art and Creativity

Dr Richard Harrington – Runner-up in the Use of WebLearn to Support Teaching, Learning or Outreach category for Promoting Online Learning and Collaboration with Graduate-Entry Medical Students

Dr Damion Young and Jon Mason – Runner-up in the Innovative Teaching with Technology category for PULSE – Pop-Up Learning Space Experiment

Congratulations to all the winners and runners-up at the awards. If you would like to talk to us about any aspect of using technology for teaching or learning, or simply have a learning/teaching challenge for which technology could provide the answer, please contact us.

InfoPath list of countries for drop-down

Want a drop-down list of countries for use in your InfoPath form? The guys at forms on fire have kindly created an XML file which makes this easy.

  1. Save the file (countries or US states – we’ll work with countries from now on) from the link above;
  2. In InfoPath, add a new Drop-Down List Box control, then right-click it and choose Drop Down List Box Properties
  3. On the Data tab, under List box choices, choose Get choices from an external data source and click the Add… button to the right of Data source.
  4. In the Data Connection Wizard, Select Create a new connection to: and Receive data then click Next >.
  5. Choose XML Document then Next >.
  6. Click Resource Files…
  7. In the Resource Files dialogue, click the Add… button and choose the CountryLookup.xml file you downloaded above. Click Open, then OK.
  8. Back in the wizard, click Next >, enter a name for the data connection e.g CountryLookup and click Finish
  9. Back in the Drop Down List Box Properties dialogue we need to specify the name of the repeating entries in the xml file so click the button to the right of Entries and select the repeating group – in this case ‘country’:
    CountryLookup
  10. Click OK, then use the similar buttons to choose which fields you wish to use for the Value (what is saved when users choose this country) and Display Name (what they see in the box) – in this case, ‘name’. Click OK and test.

PHP: Naturally sorting multidimension arrays by string values

This is just one of those things that I have to do often enough for it to be useful to have it close at hand, but not often enough that I actually remember how to do it.

I often run into this problem when using CakePHP, as results are returned from the database in a multidimensional array. Since MySQL doesn’t (as far as I’m aware) have an easy natural sort option, even if the results are sorted by name, strings that have numbers in can end up in the wrong order, e.g. “Item 10” before “Item 2”. Using a combination of usort() and strnatcasecmp(), it’s pretty easy to naturally sort an array by a value that appears in each subarray, like this:

usort($array, function($a, $b) {
    return strnatcasecmp($a['name'], $b['name']);
});

As an example, say I got the following array back from MySQL:

$array = array(
    array(
        'id' => 265,
        'name' => 'Drawer 1'
    ),
    array(
        'id' => 971,
        'name' => 'Drawer 10'
    ),
    array(
        'id' => 806,
        'name' => 'Drawer 2'
    ),
    array(
        'id' => 429,
        'name' => 'Drawer 20'
    )
);

“Drawer 10” comes before “Drawer 2”, which is obviously not what I want. Using strcasecmp() as the sort function on the above array wouldn’t change it, but using strnatcasecmp() gives the required result:

$array = array(
    array(
        'id' => 265,
        'name' => 'Drawer 1'
    ),
    array(
        'id' => 806,
        'name' => 'Drawer 2'
    ),
    array(
        'id' => 971,
        'name' => 'Drawer 10'
    ),
    array(
        'id' => 429,
        'name' => 'Drawer 20'
    )
);

Prevent Win 8/Win 8.1 connecting to an open/public network

You’ll find a lot out there about how you can make one or more networks, that you want to connect to, have higher priority than others. You do this by clicking the Connect automatically tick (check) box when connecting to your preferred networks, and un-ticking (unchecking) it for those that you don’t want to connect to. However, that won’t actually stop your computer from connecting to an unwanted network if it’s an open/public network and your preferred network isn’t available. To make sure it never connects to that unwanted network, you can use the magic of netsh:

netsh wlan add filter permission=block ssid=UnWantedNetwork networktype=infrastructure

You can either run this from a command prompt (don’t forget to replace UnWantedNetwork with your own unwanted network name) opened with administrator permissions: press the Start button, type

cmd

, right-click the Command Prompt item found by Search and choose Run as administrator); or, if you want to add to multiple machines, pop in in a batch file (create a file in Notepad, paste in the netsh command above, and save with a .bat extension), copy that batch file onto a USB stick then pop in the stick, right-click the batch file and choose Run as administrator.

In Win 8.1 it will no longer even appear in the list of available networks – result.

Kiosk Win 8.1 with touchscreen swipe gestures and fast user switching disabled

After a lot of searching and trial and error, here’s a quick guide to setting up a user account to run a webpage in as near-kiosk as it’s possible to be in Win 8.1 if the built in managed access method isn’t suitable for you: either because you’re running 8.1 Standard (managed access isn’t included) or because you need other applications to be able to launch from your webpage (managed access doesn’t permit this).

I’ve implemented it as two .bat files:

KioskAdministrator.bat is run once by an administrator to make some necessary changes (although this could just as easily be typed in at a command prompt running as Administrator):

REM KioskAdministrator.bat
REM Prevent autorestart of explorer
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v "AutoRestartShell" /t REG_DWORD /d 0 /f
REM Prevent fast user switching
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" /v "HideFastUserSwitching" /t REG_DWORD /d 1 /f

KioskUser.bat is run at whenever the kiosked user logs on:

REM KioskUser.bat
REM Kill explorer
taskkill /f /im explorer.exe
REM Start Chrome
C:\Progra~1\Google\Chrome\Application\chrome.exe --incognito --kiosk http://www.mysebsite.com

To run through what these are doing:

KioskAdministrator.bat

Touchscreen gestures (swiping from left to switch between apps, swipe from right to access start, settings, etc.) are part of explorer.exe and, while you can stop the trackpad equivalents while explorer is still running, the only way to stop the touchscreen gestures, without turning off the touchscreen altogether, appears to be by stopping explorer.exe. AutoRestartShell is a key which determines whether Windows will automatically try to restart explorer.exe if it shuts down unexpectedly – we have to set this to 0 to allow our kiosked user to turn it off in KioskUser.bat. Setting HideFastUserSwitching to 1 means that users can only switch between users by logging off – we only need this because we are running online exams. Note this this changes these settings for all users on the machine.

KioskUser.bat

The first thing this does in kill explorer.exe to prevent access to those touchscreen gestures. It then launches chrome (or any other application you want to launch). –incognito puts Chrome into incognito mode, which prevents it displaying the option to restore a previous session if it closed unexpectedly and –kiosk starts it in full screen mode.

In order to get KioskUser.bat to run at logon, use Scheduled Tasks as described (for Win 7 but it’s very similar) here. Note the gotcha if you want this to happen when on battery as well as when plugged in, that under the Conditions tab in task properties, there is a Start the task only if the computer is on AC power checkbox which is ticked by default.

Note that this is a quick and easy solution – there may well be a way to do this with group or local policies that might suit your situation better.

There doesn’t seem to be any way to disable Ctrl-Alt-Del and access to the Task Manager from where you can re-enabled explorer by choosing Run new task from the File menu – I’d be interested in any ideas…

 

Sources of reusable images for medical sciences education

[Updated 31/08/21] We are frequently asked where to find medical sciences  images than can be reused in lectures, exams and on web pages and will attempt to maintain a list here of potential sources. Do always check though, before you publish an images that you have met all the criteria (attribution, whether you are allowed to modify, etc.) for publication:

General Web

  1. CC Search (Free) is one of the best places to start as it will take you straight through to some of the main search engines/repositories for images which are reusable under the various Creative Commons licences. Enter your search query and press the button for the Google Images, Flickr, etc. Unfortunately you can search only one at a time and it doesn’t necessarily cover the sites below.
  2. Wellcome Images (Free) – Creative Commons-licensed images related to current and historical medical science.
  3. MedPix (Free) – largely case-based medical imaging with quizzes – thanks @radcliffescilib
  4. Pixabay (Free) and Pexels (Free)– images, vector graphics and illustration
  5. CDC Public Health Image Library (Free) – for photos, illustrations and video related to public health (thank you to Abdulmohsen Alzalabani on Linked In)
  6. Rheumatology Image Library (Free only for live educational use – paid for any other reproduction) Over 1,700 rheumatology diseases and conditions (thank you to Anne Marie Cunningham on LinkedIn)
  7. The Health Education Assets Library (Free) is a collection of over 22,000 freely available digital materials for health sciences education (thank you to Christof Daetwyler on Linked In)

Do check the terms of use – unless clearly stated otherwise, most sites require you to acknowledge the image source – see: Copyright for instruction (ox.ac.uk) for more information.

Journals

For those at Oxford, who are thinking of using images in materials which will only be accessible to Oxford students (through, e.g our VLE WebLearn/Sakai), it is also possible to use images from many of the journals to which the Bodleian Libraries subscribe, as described in the Bodleian’s Quick guide to copyright and licensing for e-journals.

For those both within and outside Oxford:

  1. Proceedings of the National Academy of Sciences of the United States of America (Free) Spans biological, physical, and social sciences – “Anyone may, without requesting permission, use original figures or tables published in PNAS for noncommercial and educational use (i.e., in a review article, in a book that is not for sale) provided that the original source and the applicable copyright notice are cited.”
  2. New England Journal of Medicine (Free)

We’ll add others as we discover/remember them but do let us know if you can recommend any others…

Please note: I have deliberately not included sources that primarily contain images for the arts

Adventures with the the Asus T100T Transformer Book for mobile eLearning – the background

An enabling environment

In response to the explosion in the use of mobile devices in recent years, wireless access to the Oxford University network is now more common than not across departments, colleges and the teaching hospitals. Students expect to be able to access learning materials wherever they are. Academic staff, exploring more interactive ways of teaching, expect students to be able to use mobile technology in ‘flipped’ classrooms.

Across higher education more widely, some courses have embraced mobile technology wholeheartedly – they have begun providing mobile devices for students or requiring students to bring a mobile device which meets certain specifications. While there has undoubtedly been a feeling for some time in our group that ‘we ought to be doing more with mobile technology’, it is only relatively recently that we have identified some specific and pressing needs for mobile devices that allowed us to make a case for the necessary investment of time and money.

The need for mobile devices

1. Objective Structured Clinical Examinations

These are a crucial part of the examination of clinical medical students and involve students moving around ‘stations’ at which they are marked on various aspects of their performance. Currently marks are recorded on paper mark sheets. Barcodes on the sheets enable scores to be read fairly quickly using a barcode scanner but the process is still fairly involved and any text comments have to be transcribed.

Mobile devices, using one of the many OSCE marking systems (such as the Open Source OSCE Manager), could potentially improve the speed and accuracy of this process, although moving from handwritten comments to writing with a keyboard would need to be made as simple as possible. The recording potential of mobile devices might also allow audio feedback or provide an auditable record of the examination in case of disputes.

2. Online assessment

We deliver in excess of 160 online assessments annually, using Questionmark Perception, of which 55 are formal, summative exams.

2.1 Multiple sittings

Of these 160+, 11 summative assessments and 5 formative assessments (which are sat under exam conditions) involve all 150-165 medical students in a given year. In order to accommodate these in the the largest computer-equipped venue in the Medical Sciences Division (MSD), with just under 90 computers, we have to examine the students in two sittings. Quarantining the first sitting until the second sitting has started, holding the second sitting until the first has finished, moving students around the building and resetting computers between sittings needs extra staff as well as rooms. Two sittings also means that many staff (administrators, IT support, invigilators and examiners) are required for at least twice as long as for a single sitting.

We have used another, relatively close, IT suite for several years now, when the larger venue is not available. This provides 50 extra machines but, even when added to those in the larger venue, this is still inadequate for a whole year of medical students. However, 30 mobile devices would enable the whole cohort to sit an assessment at the same time.

2.2 Smaller groups and resits

The bulk of formal online assessment within the Division – 29 formal assessments per annum, plus 16 resit examinations, is actually with groups of 30 students or fewer. There are often clashes with teaching or other uses of computer-equipped rooms and students based at the teaching hospitals often have to travel to different sites, sometimes a mile or two away away.

With 30 mobile devices, we could examine these students anywhere with a wireless connection to the Oxford network and that provides sufficient spacing between students. This would reduce staff and student travel time and the convenience might encourage more courses to take advantage of the benefits of online assessment: objective marking; speed of ‘marking’; ease of access to performance data which can be used to improve questions; and the ability to easily provide formative assessments for students to test themselves.

3. Polling/Audience Response

Although not currently very widely used within MSD, technology-enabled audience response is used regularly by a number of academic staff. Some use ‘clickers’ (voting pads handed out to each student) in lectures but these are a relatively expensive item which can only be used for a single purpose. Others have attempted to use the University’s VLE in IT suites, but, again, availability of devices is an issue and to cope with e.g 75 students in a 45 PC suite, academic staff have asked those with smartphones to connect to the wireless network and answer questions through the VLE’s mobile interface. Despite technical support, the success of the phone users was disappointing. Another academic runs a practical class where students rotate around various practical tasks, answering questions, through the Sakai Poll tool, according to which task they are doing. At the end of the practical, she collates the results from each task, and deals with any problems with the group as a whole. She has also attempted to get students to use their own smartphones with limited success.

By far the biggest hurdle for those students who have their smartphones with them (and surprisingly, many do not) was connection to the wireless network. This requires a remote access password which many students apparently do not have/know and which absorbs valuable contact time to resolve.

Mobile devices which are automatically connected to the wireless network, could be handed out (for the period of the lecture or practical class) to students without smartphones or with connection problems, enabling all of them to take part in the audience response.

4. Virtual microscopy in histology classes

MSDLT has developed a virtual microscopy site, CSlide, which allows microscope slides to be viewed on the web. They are ‘zoomable’ and important features can be labelled. They can also be embedded in other online learning materials.

The pre-clinical histology teaching slide collections have already been scanned in and are included in various online learning materials for various courses. They have also been used by lecturers in histology practical classes to demonstrate to students what to look for down their own laboratory microscopes – screens above each bench show CSlide as it is used on the lecturer’s computer screen.

One or two mobile devices on each bench would allow lecturers/demonstrators to show small groups of students points of interest on virtual microscope slides, rather than having to share a real microscope or involve the whole class. They could also be used by students to access learning materials to relate the structures they are seeing on their microscopes to their wider medical context.

The project begins.

We successfully applied for funding from the MSD Teaching Excellence Project Awards. Read on for how have got on so far…

CSS pseudo element for caret in WordPress Advanced Sidebar Menu

I have been using the fantastic Advanced Sidebar Menu for WordPress – a plugin which gives you configurable widgets which automatically generate a sidebar menu. However, out of the box, the free version lacks (CSS) style – most importantly, some way to indicate whether a menu item is selected and/or has sub-items.

Luckily it provides plentiful classes to attach your styles to – in particular, all you need to tell whether an item is open or not. Combine this with the elegantly simple CSS only technique to generate a caret and you can easily create a simple menu like this (working example on History of Medical Sciences website)

AdvancedSideBarMenu

Basic styling

Three styles give me the simple look I wanted:

ul.child-sidebar-menu{
 padding-left:0; /*stop browser indenting too far*/
 }
ul.child-sidebar-menu li{
 list-style:none; /*get rid of bullets*/
 }
ul.child-sidebar-menu li>a{
 color:#777; /*make text a laid-back grey*/
 }

Active menu item

To indicate the currently active item, the developers have given us the

current_page_item

class which is used like this:

ul.child-sidebar-menu li.current_page_item>a{
 font-weight: 700; /*bold for <a> children of the active list item*/
 }

Has item got children

The developers attach a

has_children

class to items with children. We can pick this up and use the magic of CSS pseudo classes to add a right-pointing caret after every link that has children.

li.has_children>a::after{
	width: 0px; 
	height: 0px; 
	border-top: 5px solid transparent;
	border-bottom: 5px solid transparent;
	border-left: 5px solid #d1dee4;
	content:"";
	position: absolute; /*to prevent it picking up the height of the <a> that is before it*/
	margin-left: 5px; /*now it's absolutely positioned, we need to add suitable margins (not padding which would change its shape)
	margin-top: 5px;
}

However, in big menus, it’s nice to see when an item is open. Again, the developers have given us a class to achieve this:

current_page_ancestor

.

li.current_page_ancestor>a::after{
	border-right: 5px solid transparent;
	border-left: 5px solid transparent;
	border-top: 5px solid #d1dee4;
	margin-top: 8px; /*adjust margin to make caret look as if it has rotated*/
}

But this will only show a down caret on the parent if one of the children is selected. To show it as soon as you can see its children (ie when the parent is selected), we need to add an additional selector as follows:

li.current_page_ancestor>a::after, li.has_children.current_page_item>a::after{
	border-right: 5px solid transparent;
	border-left: 5px solid transparent;
	border-top: 5px solid #d1dee4;
	margin-top: 8px;
}