I use Haskell for processing the examination marks of our 900 students. Our University has a system that can do all of this, but to ensure that I understood all the rules and regulations I coded up a simple version in Haskell, which comprises around 400 lines. It takes a CSV (comma separated values) file downloaded from our central marks database, from which five different marks reports can be produced, which are then written out as CSV files for viewing and further processing using Excel. Interesting, this simple Haskell program showed that the University system implemented one of the progression rules incorrectly :-) Graham +---------------------------------------------------------------------+ | Dr Graham Hutton Email : gmh@cs.nott.ac.uk | | School of Computer Science and IT Web : www.cs.nott.ac.uk/~gmh | | University of Nottingham | | Jubilee Campus, Wollaton Road | | Nottingham NG8 1BB Phone : +44 (0)115 951 4220 | | United Kingdom Fax : +44 (0)115 951 4254 | +---------------------------------------------------------------------+
Graham's post reminded me. We have been using a 1000 LOC Haskell program to automatically test and grade two assignments in a course on Distributed Systems (where assignments are implemented in C and Erlang). The testing program is, in fact, general purpose in that it implements an EDSL for marking programming assignments. Manuel
I use Haskell and Wash/CGI for administering students lab work. Students solve programming exercises in pairs, register their pair, and upload their solution over the web. The pair gets a "home page" on which they can see their grade and comments from their tutor, and also submit new solutions if their tutor is unhappy with the first. Tutors have a home page on which they can see which assignments they still need to mark, download the student's code, set grades and enter comments, and also view a summary of results for all students they are responsible for. As the administrator, I can see results for each student, which submissions are waiting to be marked, what the success rate is, and so on. (The administrator's interface is a bit cruder than the other two, since I can always hack the code when I need some more information...). The system also packages up all submitted solutions ready for submission to an automated plagiarism detector. The benefits of the system are that students, tutors, and the administrator can work from any machine on the Internet -- for example, at home; submission and returns are quicker and easier for both students and tutors, so feedback is quicker; tutors and the administrator have a much better overview of the state of students' work; solutions are kept in a uniform form which makes automated cheat detection easy. I wrote the system for my (Haskell!) programming course, with 170 students last year, and it is now also being used (at least) for our Java course and a cryptography course. It consists of about 600 lines of Haskell and 18 lines of C. John Hughes
On Thu, 4 Sep 2003, John Hughes wrote:
I wrote the system for my (Haskell!) programming course, with 170 students last year, and it is now also being used (at least) for our Java course and a cryptography course. It consists of about 600 lines of Haskell and 18 lines of C.
Just curious. What was C used for? /One of the students in the mentioned haskell programming course... -- ---------------------------------------- | Sebastian Sylvan | | ICQ: 44640862 | | Tel: 073-6818655 / 031-812 817 | | | | | | Hard Work Often Pays Off After Time | | But Laziness Always Pays Off Now! | ----------------------------------------
On Thu, 4 Sep 2003, Sebastian Sylvan wrote:
On Thu, 4 Sep 2003, John Hughes wrote:
I wrote the system for my (Haskell!) programming course, with 170 students last year, and it is now also being used (at least) for our Java course and a cryptography course. It consists of about 600 lines of Haskell and 18 lines of C.
Just curious. What was C used for?
/One of the students in the mentioned haskell programming course...
I implemented a trivial "database", stored in ordinary files, and had to ensure mutual exclusion of database access between simultaneously running CGI scripts. Since each CGI run is short, I simply locked the entire database for the entire run. Claiming a lock on a file is easy in C (well, it takes 18 lines...), but there's nothing in the standard Haskell libraries that can do it. So I borrowed a little C code from the net, and called it via the FFI. John
On Thu, 4 Sep 2003, John Hughes wrote:
I use Haskell and Wash/CGI for administering students lab work.
same here (in addition to Haskell programs for actually grading the homework). just curious: what kind of data base do you use? we take Krasimir Angelov's MySql binding (from HToolkit). this has the advantage that the administrator can directly view/edit the data base via the sql shell resp. via webmin. best regards, -- -- Johannes Waldmann ---- http://www.informatik.uni-leipzig.de/~joe/ -- -- joe@informatik.uni-leipzig.de -- phone/fax (+49) 341 9732 204/209 -- .. .. Viertes Leipziger Jongliertreffen, 17. - 19. Oktober 2003 .. .. .. .. http://www.informatik.uni-leipzig.de/~joe/juggling/vier/ .. ..
On Fri, 5 Sep 2003, Johannes Waldmann wrote:
On Thu, 4 Sep 2003, John Hughes wrote:
I use Haskell and Wash/CGI for administering students lab work.
same here (in addition to Haskell programs for actually grading the homework).
just curious: what kind of data base do you use? we take Krasimir Angelov's MySql binding (from HToolkit).
this has the advantage that the administrator can directly view/edit the data base via the sql shell resp. via webmin.
I wrote a very simple database implementation in Haskell, which stores and fetches Showable Haskell values with an associated key. The interface is very simple: just getRecord :: Key k r => k -> IO (Maybe r) putRecord :: Key k r => k -> r -> IO () where the instance of the Key class determines where the records are stored. Advantages: * Trivial interface * No need to worry about configuring any other software * Very quick to implement * Can store most kinds of Haskell data * I can directly view/edit the database with emacs! Disadvantages: * Must handle locking myself * No transactions, so no rollback on failure * Leads to a "network style", where records explicitly contain the keys of related records. * Must maintain invariants such as "if A points to B then B points to A" myself. * Performance is poor, but... With 170 students the amount of data involved is small, and with each accessing the system a few dozen times over a period of weeks, this isn't a performance critical application. I know this isn't the "right" way to do it, but it was quick, easy, and it works pretty well. John
participants (5)
-
Graham Hutton -
Johannes Waldmann -
John Hughes -
Manuel M T Chakravarty -
Sebastian Sylvan