⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 frmadditems.frm

📁 这是我们公司的题库管理系统
💻 FRM
📖 第 1 页 / 共 4 页
字号:
               Object.ToolTipText     =   "1040"
               ImageKey        =   "Cut"
            EndProperty
            BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628} 
               Key             =   "复制"
               Object.ToolTipText     =   "1041"
               ImageKey        =   "Copy"
            EndProperty
            BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628} 
               Key             =   "粘贴"
               Object.ToolTipText     =   "1042"
               ImageKey        =   "Paste"
            EndProperty
            BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628} 
               Style           =   3
            EndProperty
            BeginProperty Button5 {66833FEA-8583-11D1-B16A-00C0F0283628} 
               Key             =   "粗体"
               Object.ToolTipText     =   "1043"
               ImageKey        =   "Bold"
            EndProperty
            BeginProperty Button6 {66833FEA-8583-11D1-B16A-00C0F0283628} 
               Key             =   "斜体"
               Object.ToolTipText     =   "1044"
               ImageKey        =   "Italic"
            EndProperty
            BeginProperty Button7 {66833FEA-8583-11D1-B16A-00C0F0283628} 
               Key             =   "下划线"
               Object.ToolTipText     =   "1045"
               ImageKey        =   "Underline"
            EndProperty
            BeginProperty Button8 {66833FEA-8583-11D1-B16A-00C0F0283628} 
               Style           =   3
            EndProperty
            BeginProperty Button9 {66833FEA-8583-11D1-B16A-00C0F0283628} 
               Key             =   "左对齐"
               Object.ToolTipText     =   "1046"
               ImageKey        =   "Align Left"
               Style           =   2
            EndProperty
            BeginProperty Button10 {66833FEA-8583-11D1-B16A-00C0F0283628} 
               Key             =   "置中"
               Object.ToolTipText     =   "1047"
               ImageKey        =   "Center"
               Style           =   2
            EndProperty
            BeginProperty Button11 {66833FEA-8583-11D1-B16A-00C0F0283628} 
               Key             =   "右对齐"
               Object.ToolTipText     =   "1048"
               ImageKey        =   "Align Right"
               Style           =   2
            EndProperty
         EndProperty
      End
      Begin RichTextLib.RichTextBox rtfTextQuestion 
         Height          =   1995
         Left            =   120
         TabIndex        =   9
         Top             =   720
         Width           =   3000
         _ExtentX        =   5292
         _ExtentY        =   3519
         _Version        =   393217
         ScrollBars      =   3
         TextRTF         =   $"frmAddItemS.frx":0DEA
      End
      Begin RichTextLib.RichTextBox rtfTextAnswer 
         Height          =   1995
         Left            =   120
         TabIndex        =   10
         Top             =   3120
         Width           =   3000
         _ExtentX        =   5292
         _ExtentY        =   3519
         _Version        =   393217
         ScrollBars      =   3
         TextRTF         =   $"frmAddItemS.frx":0E87
      End
      Begin VB.Label lAnswer 
         AutoSize        =   -1  'True
         Caption         =   "参考答案:(请在下面输入试题的解析和答案)"
         Height          =   180
         Left            =   120
         TabIndex        =   14
         Top             =   2880
         Width           =   3780
      End
      Begin VB.Label lQuestion 
         AutoSize        =   -1  'True
         Caption         =   "题目内容:(请在下面编辑试题内容)"
         Height          =   180
         Left            =   120
         TabIndex        =   13
         Top             =   480
         Width           =   3060
      End
   End
   Begin AIFCmp1.asxToolbar myToolbar 
      Height          =   615
      Left            =   360
      Top             =   7560
      Width           =   9915
      _ExtentX        =   17489
      _ExtentY        =   1085
      BeginProperty ToolTipFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "宋体"
         Size            =   9
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ButtonGap       =   10
      BorderStyle     =   0
      DoubleBottomBorder=   -1  'True
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "宋体"
         Size            =   9
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ButtonCount     =   9
      BoldOnChecked   =   -1  'True
      ButtonCaption1  =   "前一题"
      ButtonKey1      =   "previous"
      ButtonPicture1  =   "frmAddItemS.frx":0F24
      ButtonPictureOver1=   "frmAddItemS.frx":1B76
      ButtonToolTipText1=   "Previous"
      ButtonCaption2  =   "后一题"
      ButtonKey2      =   "next"
      ButtonPicture2  =   "frmAddItemS.frx":27C8
      ButtonPictureOver2=   "frmAddItemS.frx":341A
      ButtonToolTipText2=   "Next"
      ButtonCaption3  =   "新增试题"
      ButtonKey3      =   "new"
      ButtonPicture3  =   "frmAddItemS.frx":406C
      ButtonToolTipText3=   "New"
      ButtonCaption4  =   "编辑试题"
      ButtonKey4      =   "edit"
      ButtonPicture4  =   "frmAddItemS.frx":4CBE
      ButtonPictureOver4=   "frmAddItemS.frx":5910
      ButtonToolTipText4=   "edit"
      ButtonCaption5  =   "删除试题"
      ButtonKey5      =   "delete"
      ButtonPicture5  =   "frmAddItemS.frx":6562
      ButtonToolTipText5=   "Delete"
      ButtonCaption6  =   "关闭"
      ButtonKey6      =   "close"
      ButtonPicture6  =   "frmAddItemS.frx":71B4
      ButtonToolTipText6=   "Close"
      ButtonCaption7  =   "保存更改"
      ButtonKey7      =   "save"
      ButtonPicture7  =   "frmAddItemS.frx":7E06
      ButtonPictureOver7=   "frmAddItemS.frx":8A58
      ButtonToolTipText7=   "Save"
      ButtonVisible7  =   0   'False
      ButtonCaption8  =   "取消更改"
      ButtonKey8      =   "cancel"
      ButtonPicture8  =   "frmAddItemS.frx":96AA
      ButtonPictureOver8=   "frmAddItemS.frx":A2FC
      ButtonToolTipText8=   "cancel"
      ButtonVisible8  =   0   'False
      ButtonCaption9  =   "审核通过"
      ButtonKey9      =   "verify"
      ButtonPicture9  =   "frmAddItemS.frx":AF4E
      ButtonToolTipText9=   "Verify"
      ButtonVisible9  =   0   'False
   End
End
Attribute VB_Name = "frmItemAddS"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim mvBookMark As Variant
Dim mbAddNewFlag As Boolean

Dim rsItem As adodb.Recordset

'Dim SuperCategoryId As Integer

'Dim categoryId As Integer
Dim fieldId As Integer
Dim courseId As Integer
Dim pointId As Integer

Dim itemId As Integer

Dim focusOnQuestion As Boolean
Dim focusOnAnswer As Boolean

Dim rsSerial As adodb.Recordset  '添加试题序号所用
Dim serialExistAlready As Boolean
Dim itemSerial As String   '初始化试题序号
Dim oldItemSerial As String
Dim suggestedItemSerial As String

Dim checkIfCorrectSerial As Boolean

Private Sub rtfTextQuestion_GotFocus()
    focusOnQuestion = True
    focusOnAnswer = False
End Sub

Private Sub rtfTextAnswer_GotFocus()
    focusOnQuestion = False
    focusOnAnswer = True
End Sub

Private Sub rtfTextQuestion_SelChange()
    tbToolBar.Buttons("粗体").Value = IIf(rtfTextQuestion.SelBold, tbrPressed, tbrUnpressed)
    tbToolBar.Buttons("斜体").Value = IIf(rtfTextQuestion.SelItalic, tbrPressed, tbrUnpressed)
    tbToolBar.Buttons("下划线").Value = IIf(rtfTextQuestion.SelUnderline, tbrPressed, tbrUnpressed)
    tbToolBar.Buttons("左对齐").Value = IIf(rtfTextQuestion.SelAlignment = rtfLeft, tbrPressed, tbrUnpressed)
    tbToolBar.Buttons("置中").Value = IIf(rtfTextQuestion.SelAlignment = rtfCenter, tbrPressed, tbrUnpressed)
    tbToolBar.Buttons("右对齐").Value = IIf(rtfTextQuestion.SelAlignment = rtfRight, tbrPressed, tbrUnpressed)
End Sub

Private Sub rtfTextAnswer_SelChange()
    tbToolBar.Buttons("粗体").Value = IIf(rtfTextAnswer.SelBold, tbrPressed, tbrUnpressed)
    tbToolBar.Buttons("斜体").Value = IIf(rtfTextAnswer.SelItalic, tbrPressed, tbrUnpressed)
    tbToolBar.Buttons("下划线").Value = IIf(rtfTextAnswer.SelUnderline, tbrPressed, tbrUnpressed)
    tbToolBar.Buttons("左对齐").Value = IIf(rtfTextAnswer.SelAlignment = rtfLeft, tbrPressed, tbrUnpressed)
    tbToolBar.Buttons("置中").Value = IIf(rtfTextAnswer.SelAlignment = rtfCenter, tbrPressed, tbrUnpressed)
    tbToolBar.Buttons("右对齐").Value = IIf(rtfTextAnswer.SelAlignment = rtfRight, tbrPressed, tbrUnpressed)
End Sub

Private Sub setSerialFormat()
    If categoryId = 1 Then
        Label1.Caption = "类 别  -  科 目 -  课 程 -  知识点 - 评价要素 - 题 型 - 难 度 - 目标层次 - 分 值 - 答题时间 - 试题编号"
        lBar(5).Visible = True
        lBar(6).Visible = True
        lBar(7).Visible = True
        lBar(8).Visible = True
        lBar(9).Visible = True
        txtSerial(5).Visible = True
        txtSerial(6).Visible = True
        txtSerial(7).Visible = True
        txtSerial(8).Visible = True
        txtSerial(9).Visible = True
        txtS.Left = 10560
    ElseIf categoryId = 2 Then
        Label1.Caption = "类 别  -  专 业 -  课 程 -  知识点 -  题 型 - 难 度 - 目标层次 - 分 值 - 答题时间 - 试题编号"
        lBar(5).Visible = True
        lBar(6).Visible = True
        lBar(7).Visible = True
        lBar(8).Visible = True
        lBar(9).Visible = False
        txtSerial(5).Visible = True
        txtSerial(6).Visible = True
        txtSerial(7).Visible = True
        txtSerial(8).Visible = True
        txtSerial(9).Visible = False
        txtS.Left = 9720
    ElseIf categoryId = 3 Then
        Label1.Caption = "类 别  - 评价要素 - 难 度 - 分 值 - 答题时间 - 试题编号"
        lBar(5).Visible = False
        lBar(6).Visible = False
        lBar(7).Visible = False
        lBar(8).Visible = False
        lBar(9).Visible = False
        txtSerial(5).Visible = False
        txtSerial(6).Visible = False
        txtSerial(7).Visible = False
        txtSerial(8).Visible = False
        txtSerial(9).Visible = False
        txtS.Left = 6360
    End If

End Sub

Private Sub Form_Load()
    Screen.MousePointer = vbHourglass
        
    If categoryId = 1 Then
        Me.Caption = "试题录入——公共题库"
    ElseIf categoryId = 2 Then
        Me.Caption = "试题录入——专业题库"
    ElseIf categoryId = 3 Then
        Me.Caption = "试题录入——面试题库"
    End If
    
    setSerialFormat
    
    ' 打开连接
    Set cnn = New Connection
    cnn.Open sConnect
    Set rs = New Recordset
    rs.CursorLocation = adUseClient
    rs.CursorType = adOpenKeyset
    rs.LockType = adLockOptimistic
    Set rsItem = New Recordset
    rsItem.CursorLocation = adUseClient
    rsItem.CursorType = adOpenKeyset
    rsItem.LockType = adLockOptimistic
    If categoryId = 1 Or categoryId = 2 Then
        sSQL = "select * from ITEM where VERIFY_STATUS = '待审'" _
                & " and CATEGORY_ID in " _
                & " (select CATEGORY_ID from CATEGORIES where SUPER_CATEGORY_ID in " _
                & " (select CATEGORY_ID from CATEGORIES where SUPER_CATEGORY_ID in " _
                & " (select CATEGORY_ID from CATEGORIES where SUPER_CATEGORY_ID = " & categoryId & ")))"
    ElseIf categoryId = 3 Then
        sSQL = "select * from ITEM where VERIFY_STATUS = '待审'" _
                & " and CATEGORY_ID in " _
                & " (select CATEGORY_ID from CATEGORIES where SUPER_CATEGORY_ID = " & categoryId & ")"
    End If
    rsItem.Open sSQL, cnn
    If rsItem.BOF Then
        addNewItem
    Else
        showItem
        SetButtons True
    End If
    
    LoadResStrings Me
    Form_Resize
    Screen.MousePointer = Default
End Sub

Private Sub Form_Resize()
    On Error Resume Next
    
    frSerial.Width = Me.ScaleWidth - 200
    picItemContent.Width = Me.ScaleWidth - 200
    myToolbar.Top = Me.ScaleHeight - 750
    
    picItemContent.Height = Me.ScaleHeight - 2000

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -