Comments (6)
@phgrosjean I am a little confused, whether this is some suggestion for H5PxAPIkatchu or for H5P.
H5PxAPIkatchu stores the time of each that the statement was received https://github.com/otacke/h5pxapikatchu/blob/master/class-database.php#L464.
If you want a timestamp to be included in every xAPI statement emitted by H5P, you should address the H5P core team. It's possible to implement, but it is an optional property in the xAPI specification, and Learning Record Stores (or whatever stores the events) should set it if not provided (https://github.com/adlnet/xAPI-Spec/blob/master/xAPI-Data.md#details-1) like H5PxAPIkatchu or the H5P plugins do for reporting.
from h5pxapikatchu.
@phgrosjean Ah, I think now I get it. You were referencing the xAPI data that you can retrieve from the filter, and those don't contain the timestamp. Shouldn't be an issue for you to set it yourself. I might do that in the future if I find some time.
from h5pxapikatchu.
@otacke Yes, that's it. But as soon as it is recorded in the database, it is fine. I can recover it and I don't need more. But it would be fine to retrieve the timestamp from the filter too.
from h5pxapikatchu.
Hi @phgrosjean !
I have given this some thought, and I think I won't add this to H5PxAPIkatchu. It might be convenient, but it feels weird to have an extra function just for getting the time or to modify the original statement that I want to preserve. As I mentioned, it's up to the LRS (or whatever stores the data) anyway to set the timestamp if it's not included in the xAPI statement. So if you require it, I suggest you set it yourself. You can use the h5pxapikatchu_insert_data_xapi filter and add the time like:
function handle_xapi_data( $xapi ) {
// Change from JavaScript
$xapi = str_replace( '\"', '"', $xapi );
$xapi = str_replace( "\'", "'", $xapi );
$xapi = str_replace( '\\\\"', '"', $xapi );
$xapi_decoded = json_decode( $xapi, true );
// xAPI Timestamp following RFC 3339
$xapi_decoded['timestamp'] = current_time( 'Y-m-d\TH:i:s.vP' );
/*
* Process $xapi_decoded as required here
* ...
*/
return $xapi;
}
add_filter( 'h5pxapikatchu_insert_data_xapi', 'handle_xapi_data' );```
from h5pxapikatchu.
Hello @otacke OK, I understand. I already did this, but I was considering it as a basic feature useful for everyone because xAPI events without time indication represent really only partial information. So now, I close the issue.
from h5pxapikatchu.
@phgrosjean Feel free to add a feature request addressing the H5P core team. They could add the timestamp to every single xAPI statement.
from h5pxapikatchu.
Related Issues (19)
- TODO before first release
- Code cleaning
- Add filters for columns
- Add capabilities HOT 1
- Add hooks/filters
- Deprecation notice on PrivacyPolicy::register_h5pxapikatchu_eraser() HOT 2
- Tracking choices in Branching Scenario media type HOT 6
- Export in JSON format HOT 4
- Add IDs HOT 1
- Amend list of xAPI properties that are saved HOT 2
- WP multisite mode missing HOT 2
- Not working on Firefox
- Support new privacy features of WordPress
- Add pagination for exporter and eraser HOT 1
- Statements not being stored HOT 8
- Add option to hide/ignore fields
- Add blocklist/passlist for xAPI verbs
- Fix (presumably) too long statements not recorded HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from h5pxapikatchu.