ยากทำสอบถามพนักงานแบบเปลี่ยนครับ
Posted: Tue Oct 22, 2019 8:25 am
ผมยากทำ test พนักงานครับแต่ตอนนี้ติดปัญหาคือยากให้ทุกข้อสลับกันทุกครั้งที่ทำเสร็จครับ
Code: Select all
Dim answer(50) As String
answer(1) = "A"
answer(2) = "B"
answer(3) = "A"
answer(4) = "A"
answer(5) = "D"
answer(6) = "D"
answer(7) = "B"
answer(8) = "A"
answer(9) = "C"
answer(10) = "A"
answer(11) = "B"
answer(12) = "D"
answer(13) = "C"
answer(14) = "A"
answer(15) = "A"
answer(16) = "A"
answer(17) = "C"
answer(18) = "D"
answer(19) = "A"
answer(20) = "C"
answer(21) = "A"
answer(22) = "A"
answer(23) = "A"
answer(24) = "B"
answer(25) = "C"
answer(26) = "D"
answer(27) = "A"
answer(28) = "B"
answer(29) = "A"
answer(30) = "A"
answer(31) = "A"
answer(32) = "C"
answer(33) = "B"
answer(34) = "C"
answer(35) = "D"
answer(36) = "C"
answer(37) = "A"
answer(38) = "C"
answer(39) = "B"
answer(40) = "A"
answer(41) = "A"
answer(42) = "C"
answer(43) = "D"
answer(44) = "A"
answer(45) = "A"
answer(46) = "A"
answer(47) = "C"
answer(48) = "A"
answer(49) = "C"
answer(50) = "A"
Dim Score As Integer
Dim i As Integer
Score = 0
For i = 1 To 50
If ChoiceSelected(i) = answer(i) Then
Score = Score + 1
End If
Next
Dim strSQL As String
strSQL = "INSERT INTO tblScore(SName,Score) VALUES("
strSQL = strSQL & "'" & SName & "',"
strSQL = strSQL & "" & Score & ")"
Dim comm As New ADODB.Command
With comm
.ActiveConnection = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & ActivePresentation.Path & "\DBExam2.accdb" & ";Persist Security Info=False;"
.CommandText = strSQL
.CommandType = adCmdText
.Execute
End With
MsgBox ("Complete! Your score is " & Score)
ActivePresentation.SlideShowWindow.View.GotoSlide (1)