Closed fishfree closed 3 years ago
Hi,
Could you open your browser console and observe the network activity when you click on the Play/Pause button of the player?
You should see some POST requests on the statements
API. Do you see errors?
@sfraysse Hi, no errors in my console as below. When I paused or seeked the video, it triggered the requests as below: The response code is 303.
@fishfree I am surprised by the 303 response which is a redirection code. You are showing me the request, but could I see the content of the response please?
@sfraysse I attatched 2 screenshots. The first one is the statements request triggered by clicking pause/resume button of the player, the second one is the response.
@fishfree Ok so you get a 303 response code and an empty response body. You should get a 200 response code with an array of UUID in the body.
The reason may be that the redirection is not correctly managed.
You should check why you have this redirection on your LRS server and see if you can avoid it.
If this is not possible, you can take a look at this code which handles your requests: admin/toll/log/store/trax/proxy/statements_post.php
, line 64, and see what happens exactly.
You can also play with the Guzzle
redirection options which are documented here: https://docs.guzzlephp.org/en/stable/request-options.html
I hope this will help.
@sfraysse Thank you! Now I noticed another error in the console when clicking on pause/resume button of the video player:
And in the trax video activity page source, I notice that crypto.js is loaded after the xapiwrapper.js
I changed the loading order of the 2 js files by modifying the view.php file. But what's worse, the statements request is even not triggered now. The error is in the console:
@fishfree Regarding the message in your console, you can ignore it. It has no impact. I have the same message and it works. So you don't have to change the view.php.
Regarding your previous issue, as I said, it is related to the 303 status returned by your LRS. Did you investigate this?
@sfraysse I turn on the debug log on my Learninglocker LRS, but there is no related logs. I guess the xhr request URL is not right in the file xapiwrapper.js, should be there a ".php" after /admin/tool/log/store/trax/proxy/statements ? Becuase I added some debug codes in the statements_post.php, the codes did not execute.
Finally, I add a hard-coded rewrite rule in my Nginx conf, it works now:
rewrite /admin/tool/log/store/trax/proxy/statements /admin/tool/log/store/trax/proxy/statements.php;
Hi @fishfree. Thanks for your feedback.
There is a .htaccess
with such rewriting rules located in the proxy
folder of the plugin.
Maybe it was not taken into account with your config.
RewriteEngine On
RewriteRule "^statements" "statements.php" [PT,QSA]
RewriteRule "^activities/state" "states.php" [PT,QSA]
@sfraysse Yes, Nginx ignore the .htaccess, which is applicable ot Apache.
Thanks for your feedback. I updated the doc: https://github.com/trax-project/moodle-trax-logs/blob/master/doc/install.md#lrs-proxy
I install the latest master branches of trax-log and trax-video from Github in my Moodle 3.10. But only send navigated-in action, no seek/pause/mute/time spent actions. The navigated-in log is as below: