Adding common function for both add and edit question to use. Adding unittests for add question.