Archive

Posts Tagged ‘c’

Bash script to fix indentation for C++ code

28 November 2012 Leave a comment

This small scripts allows me fix the indentation of C++ source files with very little effort.

Usage:

  1. Drop one or more C++ source files in the “toindent” folder
  2. Run the script “./indenter.sh toindent” (this calls the bcpp indenter to indent all files in the ‘toindent’ folder)
  3. Done

There are some options for step 2:

  • Select one file to indent: “indent.sh file.cpp”
  • Select all files in the ‘toindent’ folder: “./indent.sh toindent/”
  • Select only files with a certain extension in a folder (e.g. “.h”):  “./indent.sh toindent h”

Download

Indentations options can be changed in the “bcpp_indenter.cfg” file.

Advertisements

Automated multiple choice exam grading

6 June 2011 4 comments

I wrote a little tool for automated multiple choice exam grading.

The idea:

  1. Students receive two sheets: one questions sheet and one answer sheet
  2. They indicate their correct answer by erasing the wrong answers (letters) on the answer sheet (see scan on the right)
  3. When all students have finished their exam, the answer sheets are batch-scanned and send to some email address.
  4. The server receives this email, starts processing the scans, calculates the grades and sends out a report to the lecturer

Read more…