Imports System
Namespace QuestionTree
Public MustInherit Class HierarchyElement
Private _id As Integer
Private name as String
Public ReadOnly Property Name() As String
Get
Return _name
End Get
End Property
Public ReadOnly Property Id() As Integer
Get
End Get
End Property
Protected Sub New(ByVal _name As String, ByVal _id As Integer)
Me._name = _name
Me._id = _id
End Sub
End Class
Public Class SectionElement
Inherits HierachyElement
Public Sub New(ByVal _name As String, ByVal _id As Integer)
MyBase.New(_name, _id)
End Sub
End Class
Public Class SubsectionElement
Inherits HierachyElement
Public Sub New(ByVal _name As String, ByVal _id As Integer)
MyBase.New(_name, _id)
End Sub
End Class
Public Class QuestionElement
Inherits HierachyElement
Public Enum AnswerType
ANSWER_TYPE_CHECKBOX
ANSWER_TYPE_RADIO
End Enum
Private _answerType As AnswerType
Private [_text] As String
Private answered As Boolean
Public Sub New(ByVal [_text] As String, ByVal _id As Integer, ByVal _answerType As AnswerType)
MyBase.New("question", _id)
Me._text = [_text]
Me._answerType = _answerType
End Sub
Public ReadOnly Property [Text]() As String
Get
Return [_text]
End Get
End Property
Public Property Answered() As Boolean
Get
Return _answered
End Get
Set(ByVal Value As Boolean)
_answered = Value
End Set
End Property
End Class
End Namespace