Lesson's Activity Completion does not work correctly

Re: Lesson's Activity Completion does not work correctly

by Chris Khoo -
Number of replies: 0

Well my first solution that works. I replaced the button with the codes far below.

I had issues location.reload().

Once location.reload(); is activated, nothing else remains.

That's why I needed to use localStorage.

I wished I knew why the lesson page needs to refreshed for it to be marked complete.

If anyone can chip in any solution, please do.

This solution is not that good.

It's just a reload (with the original lesson page showing briefly) and then redirect to quiz page.

It would have been better if the original lesson page not showing during the reload.


<div class="btn btn-info" onclick="myReload();">Take Quiz</div>

<script type="text/javascript">//<![CDATA[

function myReload() {

localStorage.setItem("pass", "yes");

location.reload();

};

$(document).ready(function() {

if (localStorage.getItem("pass") == "yes") {

    localStorage.removeItem("pass");

    location.href = "../quiz/view.php?id=26";

}

});

//]]></script>