def test_serialize_deserialize(self):
        res = Result()
        res.completion = True
        res.duration = timedelta(seconds=1.75)
        # res.duration = 'PT1.75S'     # ISO 8601
        res.extensions = self.extensions
        res.response = "Here's a response"
        res.score = self.score
        res.success = False

        self.assertSerializeDeserialize(res)
Beispiel #2
0
    def test_serialize_deserialize(self):
        res = Result()
        res.completion = True
        res.duration = timedelta(seconds=1.75)
        # res.duration = 'PT1.75S'     # ISO 8601
        res.extensions = self.extensions
        res.response = "Here's a response"
        res.score = self.score
        res.success = False

        self.assertSerializeDeserialize(res)
Beispiel #3
0
    def basic(cls, **kwargs):
        result = Result()

        if kwargs:
            if kwargs.get('success') != None:
                result.success = kwargs.get('success')
            if kwargs.get('completion') != None:
                result.completion = kwargs.get('completion')
            if kwargs.get('changes') != None:
                result.extensions = Extensions() if not result.extensions else result.extensions
                result.extensions['http://xapi.learninganalytics.ubc.ca/extension/changes'] = kwargs.get('changes')

        return result
Beispiel #4
0
    def basic(cls, **kwargs):
        result = Result()

        if kwargs:
            if kwargs.get('duration') != None:
                result.duration = kwargs.get('duration')
            if kwargs.get('success') != None:
                result.success = kwargs.get('success')
            if kwargs.get('completion') != None:
                result.completion = kwargs.get('completion')
            if kwargs.get('changes') != None:
                result.extensions = Extensions() if not result.extensions else result.extensions
                fields_changed_key = XAPIExtension.result_extensions.get('fields changed')
                result.extensions[fields_changed_key] = kwargs.get('changes')

        return result
Beispiel #5
0
    def basic(cls, **kwargs):
        result = Result()

        if kwargs:
            if kwargs.get('duration') != None:
                result.duration = kwargs.get('duration')
            if kwargs.get('success') != None:
                result.success = kwargs.get('success')
            if kwargs.get('completion') != None:
                result.completion = kwargs.get('completion')
            if kwargs.get('changes') != None:
                result.extensions = Extensions(
                ) if not result.extensions else result.extensions
                fields_changed_key = XAPIExtension.result_extensions.get(
                    'fields changed')
                result.extensions[fields_changed_key] = kwargs.get('changes')

        return result