It looks as if changes were made in the main module that negatively affected the tincanapi_vimeo and tincanapi_youtube modules...
I'm testing Vimeo user interaction tracking for my use case, but looking at the code I believe the youtube tracking would also be broken....
Are there updates to these modules coming soon that use the new offline statement sending functionality?
To get it sort of working again I had to:
put the menu item back in tincanapi.module for the path: ajax/tincanapi/track
put the callback in again for the above path, function tincanapi_ajax_track()
tossed in tincanapi_preprocess_page() from the 1.0 version
I had to manually load tincanapi/js/tincanapi.js in the build() method of the controller for my custom entity...
tincanapi_vimeo.js depends on the js function Drupal.tincanapi.track() defined in the main module js
I also had to edit line 22 of the tincanapi_vimeo.js to use https as my site is using https
this.url = "https://vimeo.com/"+this.id;
after all of this, it tracks the user interaction, but there are tons of javascript errors
in Firefox:
TypeError: d[f] is undefined
over and over forever into infinity
in Chrome:
On page load:
tincanapi_vimeo.js?ojlcfx:7 Uncaught TypeError: Cannot read property 'ready' of undefined
at l (tincanapi_vimeo.js?ojlcfx:7)
l @ tincanapi_vimeo.js?ojlcfx:7
tincanapi_vimeo.js?ojlcfx:7 Uncaught TypeError: Cannot read property 'getDuration' of undefined
at l (tincanapi_vimeo.js?ojlcfx:7)
Every second or more forever and ever:
l @ tincanapi_vimeo.js?ojlcfx:7
tincanapi_vimeo.js?ojlcfx:7 Uncaught TypeError: Cannot read property 'getCurrentTime' of undefined
when i diff the code between 1.0-dev and 2.0-alpha2 there are not many changes to tincanapi_vimeo
So I wonder why now these javascript errors?
Comments
Comment #2
nve commentedIs the tincanapi_sdk module enabled?
Comment #3
markusa commentedyes I have the tincanapi_sdk module enabled
Comment #5
nve commentedOkey, there was some legacy code. The tincanapi_vimeo and tincanapi_youtube modules aren't necessary anymore. You only need the tincanapi_sdk. Then when you enabled the tincanapi_content_types module, the tracking would be done on the designated content types and on those content types the vimeo and youtube tracking will be done.
To make that clear for the future, we added some changes in 7.x-2.0-alpha3. The obsolete code was removed, the sdk and content_types were marked dependency and we added config to enable and disable video tracking.
Comment #6
nve commentedComment #7
markusa commentedHmmm...Ok, so there is no support for Vimeo videos on other Drupal entities than Nodes, in 2.0.
I'll write a module similar to the content types module for other entities. Thanks for the tip!
Comment #8
markusa commentedYep this update to alpha3 fixes the problem for me.
I simply add one line to my custom entity controller buildContent() method, in my case the drupal non-aliased path to my entity is 'tincan-vimeo/[entity:id]' , so 'tincan-vimeo/3' is an example.
tincanapi_sdk_add_trackable_path('tincan-vimeo/' . $entity->id);
others could easily add this with hook_entity_view() implementation if it was desired
I noticed that the tracking sends a new statement to the LRS, with verb http://adlnet.gov/expapi/verbs/complete
Can you tell me the intended meaning of this statement? Does your tracking know that the entire video was watched? Or does complete just mean that they got to the end of the video, but they could have skipped some to get there?
Thanks for the new release!
Comment #9
nve commentedI think it now send complete when you are at the end of the movie. But you are right, it should track (the current session) and only send 'complete' if you have watched it fully.
Comment #10
markusa commentedgiving that meaning to the 'complete' verb by tracking the entire session would be neat for sure.
I'm currently doing a check when a statement is sent to the LRS, is it a watched statement, then if so, gather up all the user's watched statements for a video and then figuring out if the user has actually watched every second of the video or not, taking into allowance some variable slack, so we enforce 95% of seconds must watched of a video. If the current watched statement completes the criteria for the user to have watched enough, a pass record is created. All this happens in PHP after the statements are digested.
Comment #11
nve commentedThat is also the way we are doing it. All statements go to our LL, and we created a new API on top of xAPI that has knowlegde of the course tree, the movies and quizzes (We call it the State API). So for movies it aggregates all watched statements and shows the real progress (and complete is 90% for us) instead of using the completed statements.