LearningLocker / learninglocker

Learning Locker - The Open Source Learning Record Store. Started in 2014.
https://learningpool.com/solutions/learning-record-store-learning-locker/learning-locker-community-overview/
GNU General Public License v3.0
553 stars 276 forks source link

Duration validation issue #1427

Closed nikos-glikis closed 4 years ago

nikos-glikis commented 5 years ago

What version were you using?

I am using Learning Locker v3.19.1

What steps can we follow to reproduce the behaviour?

I am sending Below json, with result.duration: P16559.14S taken from the spec: https://github.com/adlnet/xAPI-Spec/blob/master/xAPI-Data.md#46-iso-8601-durations

[
    {
        "actor": {
            "name": "Test email",
            "mbox": "mailto:info@example.com"
        },
        "object": {
            "id": "http:\/\/client.localhost\/cources?courseid=test-course&unit=test-unit",
            "definition": {
                "name": {
                    "en-US": "Test unit for test score"
                }
            }
        },
        "verb": {
            "id": "http:\/\/adlnet.gov\/expapi\/verbs\/completed",
            "display": {
                "en-US": "Completed"
            }
        },
        "timestamp": "2019-08-08T09:29:40+03:00",
        "result": {
            "duration": "P16559.14S"
        }
    }
]

What is the actual behaviour?

I get an error:

{
    "errorId": "7754cd8b-3f45-4729-9578-c9e26b14f76b",
    "warnings": [
        "Problem in 'statements.0.result.duration'. Received '\"P16559.14S\"'"
    ]
}

What is the expected behavior?

The statement should be accepted.

Is there any additional information that will help us replicate/understand the problem?

ryasmi commented 4 years ago

That duration is actually invalid, you're missing a "T". It should be PT16559.14S.

nikos-glikis commented 4 years ago

So the specification XAPI specification is wrong ?

ryasmi commented 4 years ago

That example is yes.

nikos-glikis commented 4 years ago

Great.

Thanks for the support.

ryasmi commented 4 years ago

No worries 😄 sorry for the slow reply here, just realised the date.