Verify if the student accessed a page

Verify if the student accessed a page

by Gustavo Matheus -
Number of replies: 3

Hey guys,

 

Is there an easy way to verify if the student accessed a page I created? This verification should be inside the HTML area of the course's main page. For example, if a specific page was accessed by the student, a text is printed in this HTML area (but only if the student accessed the page before).

 

Thanks!

Average of ratings: -
In reply to Gustavo Matheus

Re: Verify if the student accessed a page

by Kimber Warden -

Assuming the page you created is a page within Moodle, you could probably write some code that queried the log table and echo some text if the log.action field=view.

But maybe there's an easier way to accomplish your goal. Would it work to create a conditional activity that couldn't be accessed unless a student visited your other page first?

In reply to Kimber Warden

Re: Verify if the student accessed a page

by Gustavo Matheus -
"Assuming the page you created is a page within Moodle, you could probably write some code that queried the log table and echo some text if the log.action field=view."
 
Ok, how could I get this information from database in my code?
 
"Would it work to create a conditional activity that couldn't be accessed unless a student visited your other page first?"

Not for this case... sad

In reply to Gustavo Matheus

Re: Verify if the student accessed a page

by Kimber Warden -

Unfortunately, my coding skills aren't sufficient to be of much use to you. I had hoped you could just insert a little PHP script into a label, but on further investigation, Moodle doesn't allow that.

So you'd have to write something a little more involved. I did find some information about how to get information from the database to use in your code: http://docs.moodle.org/dev/Data_manipulation_API, but that's as far as I can probably help you. Good luck!