ATutor

Learning Management Tools







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


Test Attempt Notifications


  • 2009-07-13 00:59:50

    Test Attempt Notifications

    Has anyone developed code that will send an email notification each time a test is attempted to a nominated email address?

    I would also like to send the following data in the email;
    user name, test name, date taken, time spent and mark.
    I think this should be an option on a test by test basis.

    I looked through the modules and searched the forums but couldn't find anything already developed.

    I read on one of the forum replies that it might be possible to modify an existing announcement or forum notification patch, does this sound plausible or should this be a module?

  • 2009-07-13 09:03:22

    Re: Test Attempt Notifications

    Patches generally don't transfer from file to file. You'd need to create a new one specifically for the files to be modified. You might be able to learn from the patches your mention by examining them.

    This is fairly specific functionality, that might have limited usage. It would be up to the community to create, and if it were going to be added to the trunk code, it would need an appropriate way to enabled/disable.

  • 2009-07-13 22:53:46

    Re: Test Attempt Notifications

    Thank you for your reply Greg.

    I would like to add it as an option on the test properties page with a checkbox such as "Send Email Notifications on Each Test Attempt" with a textbox to add a recipient email address.

    What is the best way to store this data? Should I add extra fields to the existing database table which controls test properties or create a new table?

    Any advice would be appreciated.

  • 2009-07-14 01:11:14

    Re: Test Attempt Notifications

    Hi Joshua,

    If you are going to make the changes public, then, naturally, it's best to add a new field to the AT_tests table.

    Otherwise, I'd create a separate table.
    The rationale is that any change in the table structure requires changing existing code in several places (particularly in SQL queries inserting into that table). And if the change's not integrated into the trunk, you'll need to do that again and again after each upgrade. Having a separate table prevents such problems.

    Also don't forget about an appropriate change to mods/_standard/tests/module_backup.php.

    BTW, why do you need a custom email address? Will it differ from instructor's and admin's? I'm asking because having to input an email for each test is prone to typos, while the profile email is not (assuming that email confirmation is enabled).

  • 2009-07-14 08:48:48

    Re: Test Attempt Notifications

    Add the new field to the AT_tests table as Indie suggests.

    The change won't make it into the 1.6.3 release, but if you create a patch, we could make it available through the Patcher for this release, and add the patch to the trunk code for the next release.

    I agree with Indie regarding the email address, it makes sense to mail the notification to the email address already recorded for the instructor, and potentially for users in a course with test privileges.

  • 2009-07-14 18:57:22

    Re: Test Attempt Notifications

    The original reason for having a custom email field was to have the flexibility of sending the notification to a person who isn't the instructor but may be responsible for marking tests after they are attempted.

    Having the email notifications sent to the tests instructor's email is logical and easier so i will go down that path.

    @IndieRect;
    Will every SQL query that inserts into the table require updating? That seems like a lot of work sifting through every single file to check if the table is mentioned.

  • 2009-07-14 19:16:29

    Re: Test Attempt Notifications

    If by a test instructor you mean an assistant(s) that has a Tests&Surveys privilege, then, indeed, it'll be better. You could even let users select which of the assistants to send the email to, but I guess that's unlikely to be a real-world requirement.

    [purple]> Will every SQL query that inserts into the table require updating?[/purple]
    In general -- yes, all INSERT ... VALUES queries that don't list column names. You may want to check the MySQL man for cases when you don't need that: http://dev.mysql.com/doc/refman/5.1/en/insert.html
    Luckily, there're only few of such queries, and you may be able to filter all by grepping through the code.

  • 2009-07-14 23:28:50

    Re: Test Attempt Notifications

    Thank you for the info IndieRect. I had know idea what "Grepping" was and thought you had made a typo until i Googled it and found out it was an actual word. I downloaded a program called Windows Grep and it works like a charm. Thank you for saving me from searching every single file manually :)

    I will have a go at making a patch as soon as i find some time.

  • 2009-07-15 02:46:31

    Re: Test Attempt Notifications

    You're welcome. I bet you're going to love this tool. :)