June 16, 2017:
We're moving to a New Community!
https://talk.atomisystems.com/

html5 http report

0 like 0 dislike
asked Jun 9 in Support Questions by mitjad (340 points)
edited Jun 9 by mitjad
Hi,

we are testing the HTTP reporting through POST method. The thing works , we are saving JSON data to a .txt file (for now). We use Practice mode.

We are bothered by the demand that user has to type the user id. In our case it does not matter, because we just record the survey responses from the last slide (survey slide).

How can we skip the USER id question?

Thank you

1 Answer

1 like 0 dislike
answered Jun 10 by Toan Le (11,530 points)

Hi,

HTML5 player will try reading the user id from the cookie name userId first. If that cookie is not available, it'll ask the user. So you can set a dummy user id to that cookie to skip the question. To set that cookie, please add the following JavaScript code to Event tab of Project Properties dialog:

jQuery.cookie("userid", "dummyUserID");

Regards.

commented Jun 10 by mitjad (340 points)
edited Jun 10 by mitjad

Thanks, this is great. Now wink if I could only put Moodle username from session info/cookie instead of the "dummyUserID" ....

Maybe $USER->username

commented Jun 12 by Toan Le (11,530 points)
If you use Moodle or other LMSs, you don't need to send report through HTTP POST method anymore. The LMS will track the user result and allow you to view it.
commented Jun 12 by mitjad (340 points)

True, but the other option is SCORM which a has visual downside. HTML5 is much more adaptable. So my question still standswink.

We tested SCORM, but within moodle mobile, on smartphones, it is a problem - actual size, resizing, scrolling.

commented Jun 12 by Toan Le (11,530 points)
If so I think you should contact Moodle for support. You can ask them how to get and store username into a cookie (the cookie userId in this case). The HTML5 player just reads the cookie, so you can use any method to store the cookie (JavaScript or server-side script).
commented Jun 13 by mitjad (340 points)
Problem solved, I changed the PHP on the server, to get the user ID, Active presenter still sends a dummyUserID which is OK, as long as it progresses without interruption of the user.

Sorry, problem solved.

<?php
require_once('config.php');
$PAGE->set_context(get_system_context());
$PAGE->set_url($CFG->wwwroot.'/myfile.php');

echo "Usesrid:" . $USER->id;
 ?>

Related questions

0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
June 16, 2017:
We're moving to a New Community!
https://talk.atomisystems.com/

This Q&A community will be put in read-only mode and will retire soon.

1,643 questions

1,688 answers

1,738 comments

12,070 users

...