This was a PowerShell script to convert student essays into a variety of formats for further analysis by other pieces of software.

Team Members

Tagged MSPs

Categories

The department I used to work for was a language school and one of the avenues of business that they pursue is preparing overseas students for UK universities. One of their projects for improving how they teach students is to create a corpus of essays produced by students in this program for future analysis (picking out common mistakes students would make on their essays for example). The different pieces of software that they were using had different format requirements so I was asked for a method of creating these with minimum interaction for the staff involved.

As I was starting to learn PowerShell at the time I settled on this as a method of achieving this. The script was initially fed a folder to look for essays in and a CSV with a variety of extra details. This then evaluated the CSV and the folder to try and marry up details in the CSV to an essay. Once it had done this it opened a copy of Word and using COM objects it opened each individual essay and saved it into a plain text format (My original idea was to access the essays directly using PowerShell and reading the XML that these are built on. However this was dropped as it was becoming very time consuming and did not allow for conversion from alternate formats such as .doc and open office formats). The script then read these in and merged the essay currently being accessed with the details from the CSV into a variety of specified plain text and XML formats for later analysis by other software.

This core functionality did exactly what was needed once a few bugs were ironed out and it was confirmed that the formats were suitable (one of the pieces of software did not like XML comments for example). I then added some basic GUI functionality using .net to make it as easy for the lecturers to use as possible and signed the script to allow them to run the script on their own without worry that the script could be modified or that they could be tricked into running a malicious script.

Later versions of the software added a progress bar, better error reporting and additional optional functionality such as anonymising the essays, filtering out certain phrases (such as the question that the students were asked to write essays on), and removing student attempts at white-space formatting.

Previously this process was being done manually by admin staff and the lecturers themselves, whilst some of this (such as creating the CSV) still has to be done manually this has saved the department many hours of work time and money.