Automatic generation of exam tasks