如何记住和随机化MCQ中的问题?

时间:2017-12-08 07:03:58

标签: vb.net

逗人,

我正在寻找有关多项选择题(MCQ)的视觉基础方面的帮助。

使用Visual Basic 2015的Visual Basic

不使用数据库应用代码:

1-如何在问题中不重复?(为了记忆目的......有什么不对,什么是对的?)例如假设我打开程序,第一个问题是“富有”这个词,我选择了正确的答案,即“IT”,我不想再看到“富有”,直到我完成整个列表。但是,如果我为其他任何事情做出“富有”的错误选择,例如“HR”,我想在一段时间后出现“富有”这个词,直到我得到正确的问题。让人记住“富有”的重点是“IT”。

请在评论中写下代码(您回答的那一点)

很抱歉提出长问题

谢谢

Public Class Form1

Private Structure questionsNanswers
    Public Q As String
    Public A As String
    Public QT As Integer
    Public QC As Integer
End Structure

Private wstart As Integer = 0
Private adad As Integer = 10
Private QA(9999) As questionsNanswers


Private word(15) As String

Private aray(15) As Integer



Private Sub RandomizeArray(a As Integer, ByRef array() As Integer)

    Dim i As Integer
    Dim j As Integer
    Dim tmp As Integer

    Randomize()
    For i = 0 To a - 1
        j = Int((6 - i + 1) * Rnd() + i)

        tmp = array(i)
        array(i) = array(j)
        array(j) = tmp

    Next

End Sub

Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
    ' next

    CheckEntry()

    wstart = wstart + 1
    If wstart >= adad Then
        wstart = 0
    End If

    WriteText()
End Sub

Private Sub Button2_Click(sender As System.Object, e As System.EventArgs) Handles Button2.Click
    ' previous

    CheckEntry()

    wstart = wstart - 1
    If wstart < 0 Then
        wstart = adad - 1
    End If

    WriteText()
End Sub

Private Sub CheckEntry()

    RadioButton1.Visible = True
    RadioButton2.Visible = True
    RadioButton3.Visible = True
    RadioButton4.Visible = True

    RadioButton1.ForeColor = Color.Black
    RadioButton2.ForeColor = Color.Black
    RadioButton3.ForeColor = Color.Black
    RadioButton4.ForeColor = Color.Black

    RadioButton1.Checked = False
    RadioButton2.Checked = False
    RadioButton3.Checked = False
    RadioButton4.Checked = False

End Sub


Private Sub WriteText()

    Dim out As Boolean = False

    For kk = 0 To 6
        aray(kk) = kk
    Next
    RandomizeArray(7, aray)

    Do Until out
        For j = 0 To 3
            If out = False Then
                If aray(j) = QA(wstart).QT Then
                    out = True
                    Exit Do
                End If
            End If
        Next

        For kkk = 0 To 6
            aray(kkk) = kkk
        Next
        RandomizeArray(7, aray)
    Loop

    RadioButton1.Text = word(aray(0))
    RadioButton2.Text = word(aray(1))
    RadioButton3.Text = word(aray(2))
    RadioButton4.Text = word(aray(3))

    Label1.Text = CStr(wstart + 1) & ") " & QA(wstart).Q
    ' ==============================
    Dim go As Boolean = False
    If go Then
        Dim msg As String
        For ll = 0 To 6
            msg = msg + CStr(aray(ll)) + "|"
        Next

        MsgBox(msg)
    End If

End Sub

Public Sub New()

    ' This call is required by the designer.
    InitializeComponent()

    ' Add any initialization after the InitializeComponent() call.

    word(0) = "TA"
    word(1) = "GR"
    word(2) = "HR"
    word(3) = "FIN"
    word(4) = "commercial"
    word(5) = "Proc"
    word(6) = "IT"

    QA(0).Q = "rich"
    QA(0).A = word(6)
    QA(0).QT = 6
    QA(0).QC = -1

    QA(1).Q = "Tal"
    QA(1).A = word(1)
    QA(1).QT = 1
    QA(1).QC = -1

    QA(2).Q = "sau"
    QA(2).A = word(2)
    QA(2).QT = 2
    QA(2).QC = -1

    QA(3).Q = "pat"
    QA(3).A = word(3)
    QA(3).QT = 3
    QA(3).QC = -1

    QA(4).Q = "del"
    QA(4).A = word(5)
    QA(4).QT = 5
    QA(4).QC = -1



    WriteText()

End Sub

End Class

1 个答案:

答案 0 :(得分:1)

程序:

1•将问题存储在数据库中(例如,MySql / MSSQL / EXCEL)

2•在数据库中,创建一个包含6列的表(第1列用于问题,第2列用于mcq选项1,第3列用于mcq选项2,第4列用于mcq选项3,第5列用于mcq选项4和最后一列6为mcq回答)

3•添加1个标签和4个单选按钮

现在您要做的就是关注this并使用代码..

即将开展工作