声明一个自定义变量类型 public type topic question as string option1 as string option2 as string option3 as string option4 as string answer as string end type 定义一个数组来存储题目 dim arr(1 to 10) as topic arr(1).question=题干 arr(1).option1=选项1 …… arr(1).answer=正确答案 我就提供一个思路,题库你可以从文件读取,也可以封装在模块里,抽题就抽取arr数组的下标就行了
Score是分数计算函数,参数为答案是否正确。 Answer为你知道的正确答案, 这里把选项文字作为答案,也可以用其它方式。 Private Sub Option1_Click(Index As Integer) Call Score(Answer = Option1(Index).Caption) End Sub