Replaced all numeric occurrences of type_id with their CONSTANT value as defined in questionnaire.class.php

Signed-off-by: Joseph Rézeau <moodle@rezeau.org>