fixing bug in question type determination and adding unnecessary unit tests