随机进行测验 [英] randomising for a quiz
问题描述
亲爱的所有
我正在进行一个四选项多项选择的测验。
进入测验时,你提供一个答案和三个错误答案。
然后参赛者打开测验,我试图在页面上向他们展示四个
答案随机化的方式(即你不知道哪一个首先是
)。
我知道rnd命令,但你怎么做而没有替换? br />
TIA
- Nicolaas
Dear All
I am making a quiz with a four-option-multiple-choice scenario.
When you enter the quiz, you provide one answer and three wrong answers.
Then the contestant opens the quiz and I trying to present them the four
answers on the page in a randomized way (i.e. you have no idea which one
comes first).
I know the rnd command, but how do you do rnd without replacement?
TIA
- Nicolaas
推荐答案
这是数学而不是计算机组。
WindAndWaves <交流**** @ ngaru.com>在消息中写道
新闻:TH ******************** @ news.xtra.co.nz ...
This is math not a computer group.
"WindAndWaves" <ac****@ngaru.com> wrote in message
news:TH********************@news.xtra.co.nz...
亲爱的所有
我正在进行一个四选项多项选择的测验。
当你进入测验时,你提供一个答案,三个错误答案。
然后参赛者打开测验,我试图以随机的方式在页面上呈现他们的四个答案(即你不知道哪一个首先出现? )。
我知道rnd命令,但你怎么做而没有替换?
TIA
- Nicolaas
Dear All
I am making a quiz with a four-option-multiple-choice scenario.
When you enter the quiz, you provide one answer and three wrong answers.
Then the contestant opens the quiz and I trying to present them the four
answers on the page in a randomized way (i.e. you have no idea which one
comes first).
I know the rnd command, but how do you do rnd without replacement?
TIA
- Nicolaas
2004年8月27日星期五15:14:52 +1200,WindAndWaves < ac **** @ ngaru.com>
写道:
On Fri, 27 Aug 2004 15:14:52 +1200, "WindAndWaves" <ac****@ngaru.com>
wrote:
亲爱的所有
我正在做一个测验一个四选项多选方案。
当你进入测验时,你提供一个答案和三个错误的答案。
然后参赛者打开测验,我尝试以随机的方式在页面上呈现他们的四个答案(即你不知道哪一个首先出现)。
我知道rnd命令,但怎么做你没有替换吗?
TIA
- Nicolaas
Dear All
I am making a quiz with a four-option-multiple-choice scenario.
When you enter the quiz, you provide one answer and three wrong answers.
Then the contestant opens the quiz and I trying to present them the four
answers on the page in a randomized way (i.e. you have no idea which one
comes first).
I know the rnd command, but how do you do rnd without replacement?
TIA
- Nicolaas
设置一个数组4个元素。
随机选择一个。
从列表中删除它。
随机选择其中一个。
依此类推。
Set up an array of 4 elements.
Randomly choose one.
Remove it from the list.
Randomly choose one of the 3.
And so on.
亲爱的Michael
我有一个这方面的事情,这就是我想出来的(略有不同):
私人子Form_Current()
''随机化anwsers
Const ProEro = 12: '出错了GoTo ERR
''---
Dim Ctl As Control
Dim C(3)As Byte
Dim I As Integer
Dim J As Integer
''---分配数字
For I = 0 to 3
TryAgain:
C(I)= Int(Rnd * 5)
如果C(I)= 0或C(I)= 5那么GoTo TryAgain
如果我= 0那么GoTo looper
''---检查它是否已经存在并再试一次如果是这样的话
对于J =(I - 1)到0步-1
如果C(I)= C(J)那么GoTo TryAgain
下一个J
looper:
下一页我
''---地点数据
我= 0到3
设置Ctl = Me.Controls(O)。 &安培; C(I))
Ctl.ControlSource =" = [QA" &安培;我和我"]"
Ctl.Tag = I
''---重置复选框
Me.Controls(" C"& ;我+ 1)=错误
下一页我
xit:
退出子
错误:
调用FerrorLog(ERR.Number,0,ProEro + Modero):继续下一步
End Sub
" Michael Gray" < FL **** @ newsguy.spam.com>在消息中写道
news:dh ******************************** @ 4ax.com ...
Dear Michael
I had a go at this and this is what I came up with (slightly different):
Private Sub Form_Current()
''randomises the anwsers
Const ProEro = 12: ''on error GoTo ERR
''---
Dim Ctl As Control
Dim C(3) As Byte
Dim I As Integer
Dim J As Integer
''---assign numbers
For I = 0 To 3
TryAgain:
C(I) = Int(Rnd * 5)
If C(I) = 0 Or C(I) = 5 Then GoTo TryAgain
If I = 0 Then GoTo looper
''--- check if it exists already and try again if this is so
For J = (I - 1) To 0 Step -1
If C(I) = C(J) Then GoTo TryAgain
Next J
looper:
Next I
''---place data
For I = 0 To 3
Set Ctl = Me.Controls("O" & C(I))
Ctl.ControlSource = "=[QA" & I & "]"
Ctl.Tag = I
''---reset tickbox
Me.Controls("C" & I + 1) = False
Next I
xit:
Exit Sub
ERR:
Call FerrorLog(ERR.Number, 0, ProEro + Modero): Resume Next
End Sub
"Michael Gray" <fl****@newsguy.spam.com> wrote in message
news:dh********************************@4ax.com...
2004年8月27日星期五15:14:52 +1200,WindAndWaves < ac **** @ ngaru.com>
写道:
On Fri, 27 Aug 2004 15:14:52 +1200, "WindAndWaves" <ac****@ngaru.com>
wrote:
亲爱的所有
我正在进行四选项的测验 - 多选择场景。
当你进入测验时,你提供一个答案和三个错误的答案。
然后参赛者打开测验,我试图向他们展示页面上的四个答案是以随机的方式(即你不知道哪一个首先出现)。
我知道rnd命令,但你怎么做没有更换?
TIA
- Nicolaas
Dear All
I am making a quiz with a four-option-multiple-choice scenario.
When you enter the quiz, you provide one answer and three wrong answers.
Then the contestant opens the quiz and I trying to present them the four
answers on the page in a randomized way (i.e. you have no idea which one
comes first).
I know the rnd command, but how do you do rnd without replacement?
TIA
- Nicolaas
设置一个包含4个元素的数组。
随机选择一个。
从列表中删除它。
随机选择其中一个。
依旧。
Set up an array of 4 elements.
Randomly choose one.
Remove it from the list.
Randomly choose one of the 3.
And so on.
这篇关于随机进行测验的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!