Quantcast
Channel: Web services
Viewing all articles
Browse latest Browse all 2362

Re: Access "Last access to course" via the Web services Api

$
0
0
by Daniel Bower.  

I ended up having to write a plugin to get the data that I wanted.


This is the part that I used to determine last logins for a course:

        // fetch last logins
        $lastLoginSql = "select mu.email, mula.timeaccess
                from {user_lastaccess} mula
                  inner join {user} mu on mula.userid = mu.id
                  inner join {course} mc on mc.id = mula.courseid
                where mc.id = :courseid"; 
        $lastLoginSqlparams = array('courseid' => $course->id);
        $lastLoginResults = $DB ->get_records_sql($lastLoginSql, $lastLoginSqlparams);



Viewing all articles
Browse latest Browse all 2362

Trending Articles



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