Ctrl Alt Del - Workaround (1 Viewer)

murray83

Games Collector
Local time
Today, 11:20
Joined
Mar 31, 2017
Messages
728
Ok so quick question,


My quiz database, which we are using on site to bump up morale during this time and have a bit of inter office banter, one user has found a unique flaw, maybe in windows or how I have made the Db, but here is the what he does

"as long as he doesn’t finish the quiz (its 20 questions long) so stops at question 17, and then ctrl alt del out and close the Db he can open again and his score is added as he uses the same name"

so my question is, if some decides it’s too hard or wants to have a laugh and bump there score to 77 out of 20, how do I combat them closing the dB by using the ctrl alt del

as I already have code in place to check the name( code below ) and to make sure if or is not present, the if for login sfm005 is due to two people sharing that login and so had to do that to allow second person a chance of doing the quiz

Code:
Dim PlayerName As TempVars
Dim QRoundNo As TempVars

   
    If Me.txt_UserName <> "" Then                                                       'checks wethere the persons name is in the table
    If Me.txtPCLogin.Value = "SFM005.D002" Then
    Set rs = CurrentDb.OpenRecordset("SELECT * FROM tblLeaderBoard WHERE Person = '" & txt_UserName & "' AND UserID = '" & txtPCLogin & "' AND QuizNo = '" & QuestionRoundNo & "' ")
    Else
    Set rs = CurrentDb.OpenRecordset("SELECT * FROM tblLeaderBoard WHERE UserID = '" & txtPCLogin & "' AND QuizNo = '" & QuestionRoundNo & "' ")
    rs.Requery
    End If
        End If
            
    If rs.recordcount < 1 Then
     TempVars!PlayerName = Me.txt_UserName.Value
     TempVars!QRoundNo = Me.QuestionRoundNo.Value
     Me.Visible = False
     DoCmd.OpenForm "frmQuestions", , , , , , Me.QuestionRoundNo
    Else
    MsgBox ("You Have Allready Taken Part")                                             'if they are says so and exits sub
    txt_UserName.Value = ""
    txt_UserName.SetFocus
    cmd_Start.Enabled = False
    Exit Sub
    End If
 

theDBguy

I’m here to help
Staff member
Local time
Today, 03:20
Joined
Oct 29, 2018
Messages
21,467
Hi. Maybe add two more fields (date/time): QuizStart and QuizFinished

When the user starts the quiz, record the current time. When they finish, record the current time. When the app opens, if any records don't have "quit" time, they didn't leave the quiz normally.
 

ontopofmalvern

Registered User.
Local time
Today, 11:20
Joined
Mar 24, 2017
Messages
64
reset score to zero each time you login and restart quiz from Qu1?

or

have a table that records each players state, each time they answer a question update question number and current score, when they log back in quiz starts back at same question with score.

or

ban cheats
 

murray83

Games Collector
Local time
Today, 11:20
Joined
Mar 31, 2017
Messages
728
i have got it to add start and end time, but im a bit flumoxed at how i would get the start page/form check if the endtime is blank

would any one mind help one last time
 

theDBguy

I’m here to help
Staff member
Local time
Today, 03:20
Joined
Oct 29, 2018
Messages
21,467
i have got it to add start and end time, but im a bit flumoxed at how i would get the start page/form check if the endtime is blank

would any one mind help one last time
Assuming you have a username available (because you said you check for their current score already), then maybe something like:
Code:
If DCount("*","QuizTable","EndTime Is Null AND UserName='" & UserNameVariable & "'")>0 Then
    Msgbox "Cheater!!!"
End If
Just a thought...
 

murray83

Games Collector
Local time
Today, 11:20
Joined
Mar 31, 2017
Messages
728
Assuming you have a username available (because you said you check for their current score already), then maybe something like:
Code:
If DCount("*","QuizTable","EndTime Is Null AND UserName='" & UserNameVariable & "'")>0 Then
    Msgbox "Cheater!!!"
End If
Just a thought...


i like that a lot but im not to sure on where i would plum that snippet of code in

here is my current start quiz code

Code:
Private Sub cmd_Start_Click()

Dim PlayerName As TempVars
Dim QRoundNo As TempVars

   
    If Me.txt_UserName <> "" Then                                                       'checks wethere the persons name is in the table
    If Me.txtPCLogin.Value = "SFM005.D002" Then
    Set rs = CurrentDb.OpenRecordset("SELECT * FROM tblLeaderBoard WHERE Person = '" & txt_UserName & "' AND UserID = '" & txtPCLogin & "' AND QuizNo = '" & QuestionRoundNo & "' ")
    Else
    Set rs = CurrentDb.OpenRecordset("SELECT * FROM tblLeaderBoard WHERE UserID = '" & txtPCLogin & "' AND QuizNo = '" & QuestionRoundNo & "' ")
    rs.Requery
    End If
        End If
        
  
            
    If rs.recordcount < 1 Then
     TempVars!PlayerName = Me.txt_UserName.Value
     TempVars!QRoundNo = Me.QuestionRoundNo.Value
     DoCmd.SetWarnings False
     'adds details to leader board
     DoCmd.RunSQL ("INSERT INTO tblLeaderBoard (Person, Score, QuizNo, UserID, QuizStart, QuizEnd) VALUES (txt_UserName.Value, 0, QuestionRoundNo.Value, txtPCLogin.Value, QuizStartTime.Value, 0)")
     Me.Visible = False
     DoCmd.OpenForm "frmQuestions", , , , , , Me.QuestionRoundNo
    Else
    MsgBox ("You Have Allready Taken Part")                                             'if they are says so and exits sub
    txt_UserName.Value = ""
    txt_UserName.SetFocus
    cmd_Start.Enabled = False
    Exit Sub
    End If
    
End Sub
 

Micron

AWF VIP
Local time
Today, 06:20
Joined
Oct 20, 2018
Messages
3,478
Haven't looked at your db, but if the q's are associated with a player, did you consider flagging a question as answered for that player? Then they can resume where they left off, which can be a handy feature in case they can't complete in one sitting. If you're already doing that, then it should take care of situation where they try to cheat. When they reload, they're back to where they left off, thus their score doesn't increment.
 

Users who are viewing this thread

Top Bottom