def survey_getWidgetFromQuestion(question_id):
 qtable = current.s3db.survey_question
 question = current.db((qtable.id == question_id)).select(qtable.type, limitby=(0, 1)).first()
 question_type = question.type
 widget_obj = survey_question_type[question_type](question_id)
 return widget_obj

def survey_getWidgetFromQuestion ( question_id ) : qtable = current . s3db . survey_question question = current . db ( ( qtable . id == question_id ) ) . select ( qtable . type , limitby = ( 0 , 1 ) ) . first ( ) question_type = question . type widget_obj = survey_question_type [ question_type ] ( question_id ) return widget_obj
function that gets the right widget for the question .