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

def validate(self, valueList, qstn_id):

    result = S3QuestionTypeAbstractWidget.validate(self, valueList)
    if (result != ANSWER_VALID):
        return result
    length = self.get('length', 10)
    format = self.get('format')
    data = value(valueList, 0)
    if (format != None):
        try:
            self.formattedValue(data, format)
            return self.ANSWER_VALID
        except exceptions.ValueError:
            return self.ANSWER_INVALID
    return self.ANSWER_VALID
