'This will validate the data passed in to the widget'

def validate(self, valueList, qstn_id):

    if (len(valueList) == 0):
        return self.ANSWER_MISSING
    data = valueList[0]
    if (data is None):
        return self.ANSWER_MISSING
    self._store_metadata(qstn_id)
    if (data in self.getList()):
        return self.ANSWER_VALID
    else:
        return self.ANSWER_VALID
    return self.ANSWER_INVALID
