c#中的考试问题管理程序[需要研究来源] [英] Exam Question management program in c#[need source to research]

查看:56
本文介绍了c#中的考试问题管理程序[需要研究来源]的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我是编程的新手,我需要一些通用的想法/资源来看待:

I'm new to programming, i need some generic ideas/sources to look at:

我的想法是为小学教师开发一个基本的Windows窗体应用程序,他们可以将问题列表上传到程序中,并能够编辑其中的每个问题。编辑用户后,选择一些问题(通过复选框?)
打印出来供学生测试。

My idea is to develop a basic windows form application for primary school teachers, whereby they can upload a list of question into the program and able to edit each question within it. After editing the user than choose a number of questions(via checkbox?) to print out for students to test.

如下所示:

1。问题页面

[复选框]                                                                     
                                [导出到xx]

[checkbox]                                                                                                      [Export to xx]

      [问题xx]

     [question xx]

      [问题内容]

     [question content]

2。主页

[上传问题文件]

[查看/编辑问题文件]

[view/edit a question file]

[查看以前导出的文件]

[view previous exported files]

我的目标是:

My objective is:

1.可以通过word / pdf /手动输入将多个问题上传到表单中(因此我不需要每次为程序创建一个文本框有一个新问题)

1.able to upload multiple question into the form via word/pdf/manually type in (whereby i dont need to create a textbox for the program each time i have a new question)

2.可以编辑并选择问题的复选框并将其导出为pdf /打印出来(带数字顺序)

2.able to edit and select the checkbox of the question and export it to pdf/print it out (with numerical order)

   例如。我选择问题1,4& 6然后单击导出,程序将选择1,4和6将其导出为pdf / word..etc,如问题1,2,3..etc

   eg. i choose question 1,4 & 6 and click export, the program will then pick 1,4&6 export it to pdf/word..etc as question 1,2,3..etc

3.a数据库到存储所有这些文件

3.a database to store all these files

提前感谢那些可以帮助我的人。如果你设法找到它,请提供这个类似想法的链接,这对我来说非常有帮助。 

Thanks in advance for those who can help me out on this. Please provide a link to this similar idea if you manage to find out, it'll be very helpful for me. 

BTW我仍然没有这个类型的程序的名称/系统任何想法我该怎么命名?

BTW i still dont have a name for this type of program/system any idea what should i name this?

推荐答案

您好

这是一些代码可能会帮助您开发自己的问题/答案应用程序。注意:下面的代码只是一个非常基本的"通用"应用程序,因此,它没有有意义的示例问题 - 实际上只是随机单词的一个方块,但是
可能会显示一个可能有用的布局。此示例采用测试项目的形式,只需要一个空白的默认Form1 - 并使用下面的代码复制/替换所有Form1代码。由于您没有指定,此代码在VB.NET中完成。

Here is some code that might help you to develop your own question/answer application. Note: the code below is just a very basic 'generic' application and as such, it doesn't have meaningful sample questions - just a palaver of random words really, but it may show a layout that could help. This example is in the form of a test project, just needs a blank derfault Form1 - and copy/replace all of Form1 code with the code below. Since you didn't specify, this code is done in VB.NET.

编辑:道歉,我刚刚注意到您在问题标题中指定了C#。好吧,那么就忽略这篇文章吧。

EDIT: apologies, I just noticed you did specify C# in the question title. Ah well, just ignore this post then.

Option Strict On
Option Infer Off
Option Explicit On

Public Class Form1
    Private Questions As New List(Of Question)
    Private Rand As New Random
    Private QtextBox As New TextBox
    Private butt As New Button
    Private Panel As New Panel
    Private RightWrong As New Label
    Private UserAnswers As New List(Of UserInput)
    Private Lab1, lab2, lab3, lab4 As New Label
    Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load

        Dim q As New Question With {.Quest = "What is the distance between cars?", .Choices = New List(Of String)({"50", "25", "10", "5"}), .Answer = 3}
        Questions.Add(q)

        q = New Question With {.Quest = "How many trailors can you pull?", .Choices = New List(Of String)({"1", "2", "3", "4"}), .Answer = 1}
        Questions.Add(q)

        q = New Question With {.Quest = "Does your car have brakes?", .Choices = New List(Of String)({"Yes", "No", "Sometimes", "Never"}), .Answer = 1}
        Questions.Add(q)

        q = New Question With {.Quest = "Are we there Yet?", .Choices = New List(Of String)({"Yes", "No", "Sometimes", "Never"}), .Answer = 2}
        Questions.Add(q)

        q = New Question With {.Quest = "You are done.", .Choices = New List(Of String)({"Ha Ha Ha", "No", "Nearly", "You must be joking", "Mind your own business!"}), .Answer = 2}
        Questions.Add(q)

        With QtextBox
            .Font = New Font("Arial", 14)
            .Width = 450
            .Location = New Point(20, 20)
        End With
        With Panel
            .Location = New Point(20, QtextBox.Bottom + 20)
            .Width = 450
            .Height = 200
            .BorderStyle = BorderStyle.FixedSingle
        End With
        With butt
            .Text = "Next Question"
            .AutoSize = True
            .Location = New Point(20, Panel.Bottom + 20)
        End With
        With RightWrong
            .Text = "Click button for Next Question"
            .Location = New Point(butt.Right + 30, butt.Top)
            .Width = 300
            .Font = New Font("Arial", 14)
        End With
        With Lab1
            .Text = "Right"
            .Location = New Point(Panel.Right + 8, Panel.Top)
        End With
        With lab2
            .Text = "Wrong"
            .Location = New Point(Panel.Right + 8, Panel.Top + 100)
        End With
        With lab3
            .Text = "0"
            .Location = New Point(Panel.Right + 8, Panel.Top + 30)
        End With
        With lab4
            .Text = "0"
            .Location = New Point(Panel.Right + 8, Panel.Top + 130)
        End With
        Me.Controls.AddRange({QtextBox, Panel, butt, RightWrong, Lab1, lab2, lab3, lab4})
        AddHandler butt.Click, AddressOf NewQuest
    End Sub
    Private Sub NewQuest(sender As Object, e As EventArgs)
        Static FirstQuestion As Boolean = True
        Static indx As Integer = 0
        If Not FirstQuestion Then
            Dim User As New UserInput With {.Quest = QtextBox.Text, .Answer = FindUserInput()}
            UserAnswers.Add(User)
            If User.Answer = Questions(indx).Answer Then
                lab3.Text = (GetInteger(lab3.Text) + 1).ToString
            Else
                lab4.Text = (GetInteger(lab4.Text) + 1).ToString
            End If
        End If
        indx = Rand.Next(0, Questions.Count)
        QtextBox.Text = Questions(indx).Quest
        Dim y As Integer = 4
        Dim tg As Integer = 1
        Panel.Controls.Clear()
        For Each s As String In Questions(indx).Choices
            Dim rb As New RadioButton With {.Text = s, .Location = New Point(8, y), .Tag = tg}
            Panel.Controls.Add(rb)
            y += 20
            tg += 1
        Next
        FirstQuestion = False
    End Sub
    Private Function FindUserInput() As Integer
        Dim answer As Integer = -1
        For Each c As Control In Me.Panel.Controls
            If c.GetType() Is GetType(RadioButton) Then
                Dim rb As RadioButton = DirectCast(c, RadioButton)
                If rb.Checked Then
                    answer = CInt(rb.Tag)
                End If
            End If
        Next
        Return answer
    End Function
    Private Function GetInteger(s As String) As Integer
        Dim v As Integer = 0
        If Integer.TryParse(s, v) Then Return v
        Return 0
    End Function
    Class Question
        Property Quest As String
        Property Choices As List(Of String)
        Property Answer As Integer
    End Class
    Class UserInput
        Property Quest As String
        Property Answer As Integer
    End Class
End Class


这篇关于c#中的考试问题管理程序[需要研究来源]的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆