Quantcast
Channel: General developer forum
Viewing all articles
Browse latest Browse all 37679

Re: How can I extract the participants' data from current course?

$
0
0
by Rosario Carcò.  

Thanks again, it worked as expected. I just implemented it in mycourses block for Moodle 2.3

The code I used is very simple:

if (!$this->mycold && $CFG->block_mycourses_notvisitedsince > 0 ) {
      $timestamp = time() - $CFG->block_mycourses_notvisitedsince * 86400;//Cr: calculate timestamp - number of days in seconds from today back

      $lastaccess = $DB->get_field('user_lastaccess', 'timeaccess', array('courseid' => $course->id));
print_r(array('courseid and lastaccess: ',$course->id, $lastaccess));//Cr: for debugging
        if ($lastaccess < $timestamp) {//Cr: skip this course and do not show it
            return;
}


You will find my block in these forums, Rosario


Viewing all articles
Browse latest Browse all 37679

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>