0

Hi guys i am trying to close the window with in 20 seconds If a user is inactive in the class for 3 minutes, a window should pop-up with a notice saying, “due to inactivity the class will close in 20 seconds”, allowing the user to click to continue or the course to automatically close after the countdown.

I Have a course link like this

$linkvalue[$increment] = "../mod/scorm/player.php?a=" . $row->instance . "&currentorg=" . $orgidentifier . "&scoid=" . $scoid . "&sesskey=" . $_SESSION['USER']->sesskey . "&display=popup&mode=normal";
                        $linkvalue[$increment] = "../authenticate/enroll_to_course.php?a=" . $row->instance . "&currentorg=" . $orgidentifier . "&scoid=" . $scoid . "&sesskey=" . $_SESSION['USER']->sesskey . "&display=popup&mode=normal&course_id=" . $row->cid . "";
                        $link[] = $linkvalue[$increment];

And when user click on the below link it will open the course in a popup window in that popup window i would like to show that popup if user is inactive in a class up to 3mins

 <button class="btn btn-primary form-control" onclick="popup('<?php echo $link[0]; ?>')">Launch Course</button> 

Can anyone help me how can i do that.

Thanks in advance.

user200
  • 291
  • 1
  • 4
  • 21
  • Possible duplicate of [Javascript capturing user activity](https://stackoverflow.com/questions/27502709/javascript-capturing-user-activity) – Neha Aug 22 '18 at 04:29
  • so in which page i have to use that code on the same page which i posted my question or player.php page? – user200 Aug 22 '18 at 04:38
  • Most "real" inactivity timeouts are session based and handled by the server based on if the user has made any recent requests (page load, etc), and not running client side. Any javascript running a timer on user events could easily be disabled via the browser script console. – tremor Aug 22 '18 at 04:42
  • tremor i didn't understand you clearly can u please explain it in more details – user200 Aug 22 '18 at 04:44

0 Answers0