ATutor

Learning Management Tools







Pages:1 2 3 4 5 6 7 8 9 10 11 12 13 14 15


last accessed test id


  • 2009-04-14 21:11:15

    last accessed test id

    Is there currently a variable which stores the last accessed test id which is stored even if the user logs out, similar to last_cid ?

    If there isn't does anyone have any ideas on how i could capture and store this so it can be accessed when the user logs back in?

  • 2009-04-15 02:24:26

    Re: last accessed test id

    Last test ID is not stored.
    The best way would be to create a separate DB table, I think.

  • 2009-04-15 18:37:59

    Re: last accessed test id

    I added a field called last_tid to the course_enrollment table where last_cid is stored but then realised that i don't know enough PHP to be able to store the variable. I guessed it would be a sql update statement perhaps at the time of accessing a test but i'm not sure which file to insert the code into, maybe test_intro.php or take_test.php or both?

  • 2009-04-23 13:02:35

    Re: last accessed test id

    It depends on what you want to achieve. If you want to note which test introduction page a user saw, put it into test_intro; if you want to note the last test that a user actually [i]took[/i], put it into take_test and take_test_q.

    In general, storing custom data in a separate table, while being messy, helps avoiding conflicts with another chunks of code, including backup code and code of future versions. You'll need to make sure your change doesn't conflict in such a way, and then maintain the changes after each upgrade.