We would like to have some employee tests in forms. Is there a way to restrict submission only once per ip address? This would at least keep someone from sitting down and doing the test repeatedly on the same device.
Question
Question
Replies
If this isn't anonymous, I would have a 2-step verification built in at the start of the test.
--Could use DOB and Employee ID
When verified fill hidden field with the 0 or 1 from DB column, 0 being they haven't taken and 1 they have.
If 1, then you can hide all and show message they've already taken test.
If 0, they take test and store in a database for user and set column value to 1 from 0.
It is not anonymous, but that would still allow 1 device to take tests for multiple people. Every employee is issued an iPad, and they could take the test on their own device. I like the database lookup to hide all in it has a 1 count, and i could add the ip to the database.
How can you increase the count in the database?
When the user submits the form. Invoke a workflow.
When running SQL Queries, I tend to like Try-Catch to monitor any possible disconnect from the SQL Server. I track all the information and send an Email to myself to know a failure needs my attention.
The Query is straight forward. I like to do a row check within my query as this will only index once if the row does not exist. This helps avoid any duplicates.
UPDATE Table1 SET (TestTaken=1) WHERE UserName='@SomeValue' and DOB=@SomeDate IF @@ROWCOUNT=0 INSERT INTO Table1 (UserName, DOB, TestTaken) VALUES (1, '@SomeValue', @SomeDate)
If you are controlling your submits from the Form level, your workflow can just write the 1.