Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix iri validate error #13

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .idea/edx-xapi-bridge.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/encodings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions .idea/inspectionProfiles/profiles_settings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions xapi-bridge/__main__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# -*- coding: utf-8 -*-
import sys, os, json, requests, threading
from urlparse import urljoin
from pyinotify import WatchManager, Notifier, EventsCodes, ProcessEvent
Expand Down
37 changes: 19 additions & 18 deletions xapi-bridge/converter.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# -*- coding: utf-8 -*-
import json, re, xml.etree.ElementTree as ET


Expand Down Expand Up @@ -65,7 +66,7 @@ def to_xapi(evt):
},
'context': {
'contextActivities': {
'parent': [{'id': 'i4x://'+evt['context']['course_id']}]
'parent': [{'id': 'i4x:'+evt['context']['course_id']}]
}
}
})
Expand Down Expand Up @@ -104,7 +105,7 @@ def to_xapi(evt):
},
'context': {
'contextActivities': {
'parent': [{'id': 'i4x://'+evt['context']['course_id']}]
'parent': [{'id': 'i4x:'+evt['context']['course_id']}]
}
}
})
Expand All @@ -126,14 +127,14 @@ def to_xapi(evt):
},
'object': {
'objectType': 'Activity',
'id': 'i4x://' + evt['context']['course_id'] + event['id'],
'id': 'i4x:' + evt['context']['course_id'] + event['id'],
'definition': {
'name': {'en-US': "Loaded Video" }
}
},
'context': {
'contextActivities': {
'parent': [{'id': 'i4x://'+evt['context']['course_id']}]
'parent': [{'id': 'i4x:'+evt['context']['course_id']}]
}
}
})
Expand All @@ -154,7 +155,7 @@ def to_xapi(evt):
},
'object': {
'objectType': 'Activity',
'id': 'i4x://' + evt['context']['course_id'] + event['id'],
'id': 'i4x:' + evt['context']['course_id'] + event['id'],
'definition': {
'name': {'en-US': "Played Video" }
}
Expand All @@ -166,7 +167,7 @@ def to_xapi(evt):
},
'context': {
'contextActivities': {
'parent': [{'id': 'i4x://'+evt['context']['course_id']}]
'parent': [{'id': 'i4x:'+evt['context']['course_id']}]
}
}
})
Expand All @@ -187,7 +188,7 @@ def to_xapi(evt):
},
'object': {
'objectType': 'Activity',
'id': 'i4x://' + evt['context']['course_id'] + event['id'],
'id': 'i4x:' + evt['context']['course_id'] + event['id'],
'definition': {
'name': {'en-US': "Paused Video" }
}
Expand All @@ -199,7 +200,7 @@ def to_xapi(evt):
},
'context': {
'contextActivities': {
'parent': [{'id': 'i4x://'+evt['context']['course_id']}]
'parent': [{'id': 'i4x:'+evt['context']['course_id']}]
}
}
})
Expand All @@ -220,7 +221,7 @@ def to_xapi(evt):
},
'object': {
'objectType': 'Activity',
'id': 'i4x://' + evt['context']['course_id'] + event['id'],
'id': 'i4x:' + evt['context']['course_id'] + event['id'],
'definition': {
'name': {'en-US': "Completed Video" }
}
Expand All @@ -232,7 +233,7 @@ def to_xapi(evt):
},
'context': {
'contextActivities': {
'parent': [{'id': 'i4x://'+evt['context']['course_id']}]
'parent': [{'id': 'i4x:'+evt['context']['course_id']}]
}
}
})
Expand All @@ -253,7 +254,7 @@ def to_xapi(evt):
},
'object': {
'objectType': 'Activity',
'id': 'i4x://' + evt['context']['course_id'] + event['id'],
'id': 'i4x:' + evt['context']['course_id'] + event['id'],
'definition': {
'name': {'en-US': "Video seek" }
}
Expand All @@ -267,7 +268,7 @@ def to_xapi(evt):
},
'context': {
'contextActivities': {
'parent': [{'id': 'i4x://'+evt['context']['course_id']}]
'parent': [{'id': 'i4x:'+evt['context']['course_id']}]
}
}
})
Expand All @@ -288,7 +289,7 @@ def to_xapi(evt):
},
'object': {
'objectType': 'Activity',
'id': 'i4x://' + evt['context']['course_id'] + event['id'],
'id': 'i4x:' + evt['context']['course_id'] + event['id'],
'definition': {
'name': {'en-US': "Video speed change" }
}
Expand All @@ -302,7 +303,7 @@ def to_xapi(evt):
},
'context': {
'contextActivities': {
'parent': [{'id': 'i4x://'+evt['context']['course_id']}]
'parent': [{'id': 'i4x:'+evt['context']['course_id']}]
}
}
})
Expand All @@ -323,7 +324,7 @@ def to_xapi(evt):
},
'object': {
'objectType': 'Activity',
'id': 'i4x://' + evt['context']['course_id'] + event['id'],
'id': 'i4x:' + evt['context']['course_id'] + event['id'],
'definition': {
'name': {'en-US': "Video transcript hidden" }
}
Expand All @@ -335,7 +336,7 @@ def to_xapi(evt):
},
'context': {
'contextActivities': {
'parent': [{'id': 'i4x://'+evt['context']['course_id']}]
'parent': [{'id': 'i4x:'+evt['context']['course_id']}]
}
}
})
Expand All @@ -356,7 +357,7 @@ def to_xapi(evt):
},
'object': {
'objectType': 'Activity',
'id': 'i4x://' + evt['context']['course_id'] + event['id'],
'id': 'i4x:' + evt['context']['course_id'] + event['id'],
'definition': {
'name': {'en-US': "Video transcript shown" }
}
Expand All @@ -368,7 +369,7 @@ def to_xapi(evt):
},
'context': {
'contextActivities': {
'parent': [{'id': 'i4x://'+evt['context']['course_id']}]
'parent': [{'id': 'i4x:'+evt['context']['course_id']}]
}
}
})
Expand Down