www.pudn.com > stu_rag.rar > ModifyPaper.frm, change:2003-04-04,size:12781b


VERSION 5.00 
Object = "{CDE57A40-8B86-11D0-B3C6-00A0C90AEA82}#1.0#0"; "MSDATGRD.OCX" 
Begin VB.Form frmModifyPaper  
   BorderStyle     =   0  'None 
   Caption         =   "Form1" 
   ClientHeight    =   7770 
   ClientLeft      =   0 
   ClientTop       =   0 
   ClientWidth     =   7920 
   LinkTopic       =   "Form1" 
   ScaleHeight     =   7770 
   ScaleWidth      =   7920 
   ShowInTaskbar   =   0   'False 
   StartUpPosition =   2  'CenterScreen 
   Begin VB.Frame MainFrame  
      Height          =   5535 
      Left            =   120 
      TabIndex        =   8 
      Top             =   240 
      Width           =   7695 
      Begin VB.Frame OptFrame  
         Caption         =   "试题选择" 
         Height          =   975 
         Left            =   120 
         TabIndex        =   15 
         Top             =   4320 
         Width           =   3975 
         Begin VB.CommandButton CmdLast  
            Caption         =   ">|" 
            Height          =   375 
            Left            =   1920 
            TabIndex        =   20 
            Top             =   360 
            Width           =   615 
         End 
         Begin VB.CommandButton CmdNext  
            Caption         =   ">" 
            Height          =   375 
            Left            =   1320 
            TabIndex        =   19 
            Top             =   360 
            Width           =   615 
         End 
         Begin VB.CommandButton CmdPrev  
            Caption         =   "<" 
            Height          =   375 
            Left            =   720 
            TabIndex        =   18 
            Top             =   360 
            Width           =   615 
         End 
         Begin VB.CommandButton CmdFirst  
            Caption         =   "|<" 
            Height          =   375 
            Left            =   120 
            TabIndex        =   17 
            Top             =   360 
            Width           =   615 
         End 
         Begin VB.CommandButton CmdFilter  
            Caption         =   "查询设置" 
            Height          =   375 
            Left            =   2880 
            TabIndex        =   16 
            Top             =   360 
            Width           =   975 
         End 
      End 
      Begin VB.CommandButton AddQ  
         Caption         =   "==>>" 
         Height          =   375 
         Left            =   3840 
         TabIndex        =   11 
         Top             =   1560 
         Width           =   735 
      End 
      Begin VB.CommandButton DelQ  
         Caption         =   "<<==" 
         Height          =   375 
         Left            =   3840 
         TabIndex        =   10 
         Top             =   2400 
         Width           =   735 
      End 
      Begin VB.ListBox QstList  
         Height          =   4545 
         Left            =   4680 
         TabIndex        =   9 
         Top             =   720 
         Width           =   2895 
      End 
      Begin MSDataGridLib.DataGrid DataLib  
         Height          =   3495 
         Left            =   120 
         TabIndex        =   12 
         Top             =   720 
         Width           =   3495 
         _ExtentX        =   6165 
         _ExtentY        =   6165 
         _Version        =   393216 
         AllowUpdate     =   0   'False 
         HeadLines       =   1 
         RowHeight       =   15 
         BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851}  
            Name            =   "MS Sans Serif" 
            Size            =   8.25 
            Charset         =   0 
            Weight          =   400 
            Underline       =   0   'False 
            Italic          =   0   'False 
            Strikethrough   =   0   'False 
         EndProperty 
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}  
            Name            =   "MS Sans Serif" 
            Size            =   8.25 
            Charset         =   0 
            Weight          =   400 
            Underline       =   0   'False 
            Italic          =   0   'False 
            Strikethrough   =   0   'False 
         EndProperty 
         ColumnCount     =   2 
         BeginProperty Column00  
            DataField       =   "" 
            Caption         =   "" 
            BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}  
               Type            =   0 
               Format          =   "" 
               HaveTrueFalseNull=   0 
               FirstDayOfWeek  =   0 
               FirstWeekOfYear =   0 
               LCID            =   2052 
               SubFormatType   =   0 
            EndProperty 
         EndProperty 
         BeginProperty Column01  
            DataField       =   "" 
            Caption         =   "" 
            BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}  
               Type            =   0 
               Format          =   "" 
               HaveTrueFalseNull=   0 
               FirstDayOfWeek  =   0 
               FirstWeekOfYear =   0 
               LCID            =   2052 
               SubFormatType   =   0 
            EndProperty 
         EndProperty 
         SplitCount      =   1 
         BeginProperty Split0  
            BeginProperty Column00  
            EndProperty 
            BeginProperty Column01  
            EndProperty 
         EndProperty 
      End 
      Begin VB.Label LblPaper  
         Caption         =   "试卷" 
         BeginProperty Font  
            Name            =   "隶书" 
            Size            =   21.75 
            Charset         =   134 
            Weight          =   400 
            Underline       =   0   'False 
            Italic          =   0   'False 
            Strikethrough   =   0   'False 
         EndProperty 
         ForeColor       =   &H00FF0000& 
         Height          =   375 
         Left            =   4680 
         TabIndex        =   14 
         Top             =   240 
         Width           =   2775 
      End 
      Begin VB.Label LblTestLib  
         Caption         =   "题库" 
         BeginProperty Font  
            Name            =   "隶书" 
            Size            =   21.75 
            Charset         =   134 
            Weight          =   400 
            Underline       =   0   'False 
            Italic          =   0   'False 
            Strikethrough   =   0   'False 
         EndProperty 
         ForeColor       =   &H00FF0000& 
         Height          =   375 
         Left            =   240 
         TabIndex        =   13 
         Top             =   240 
         Width           =   3375 
      End 
   End 
   Begin VB.CommandButton CmdReport  
      Caption         =   "试卷报表" 
      Height          =   495 
      Left            =   4920 
      TabIndex        =   7 
      Top             =   7080 
      Width           =   1335 
   End 
   Begin VB.CommandButton CmdExit  
      Caption         =   "退出" 
      Height          =   495 
      Left            =   6360 
      TabIndex        =   6 
      Top             =   7080 
      Width           =   1335 
   End 
   Begin VB.Frame FrameSel  
      Caption         =   "题型" 
      Height          =   1095 
      Left            =   120 
      TabIndex        =   0 
      Top             =   5880 
      Width           =   7695 
      Begin VB.OptionButton OptEssayQ  
         Caption         =   "问答题" 
         Height          =   255 
         Left            =   6120 
         TabIndex        =   5 
         Top             =   480 
         Width           =   1215 
      End 
      Begin VB.OptionButton OptMulSel  
         Caption         =   "多选题" 
         Height          =   255 
         Left            =   4710 
         TabIndex        =   4 
         Top             =   480 
         Width           =   1215 
      End 
      Begin VB.OptionButton OptSglSel  
         Caption         =   "单选题" 
         Height          =   255 
         Left            =   3300 
         TabIndex        =   3 
         Top             =   480 
         Width           =   1215 
      End 
      Begin VB.OptionButton OptRorW  
         Caption         =   "判断题" 
         Height          =   255 
         Left            =   1890 
         TabIndex        =   2 
         Top             =   480 
         Width           =   1215 
      End 
      Begin VB.OptionButton OptFill  
         Caption         =   "填空题" 
         Height          =   255 
         Left            =   480 
         TabIndex        =   1 
         Top             =   480 
         Width           =   1215 
      End 
   End 
End 
Attribute VB_Name = "frmModifyPaper" 
Attribute VB_GlobalNameSpace = False 
Attribute VB_Creatable = False 
Attribute VB_PredeclaredId = True 
Attribute VB_Exposed = False 
Option Explicit 
Dim dbrs As ADODB.Recordset 
Dim QName(1 To 5) As String 
Dim Ttype As Byte 
 
Private Sub AddQ_Click() 
    If Not dbrs.EOF And Not dbrs.BOF Then 
        Dim r As Boolean 
        Dim QSerial As Long 
        QSerial = QPaper.LastQSerial + 1 
        r = QPaper.AddQuestion(QSerial, dbrs.Fields("QuestionID"), Ttype, dbrs.Fields("Score")) 
        If Not r Then 
            MsgBox "添加试题发生错误,请检查试卷中是否已经有该题目", vbCritical, "添加失败" 
        Else 
            ListQst 
        End If 
    Else 
        MsgBox "请正确选择要加入试卷的题目", vbCritical, "添加失败" 
    End If 
End Sub 
 
Private Sub CmdCancel_Click() 
 
Unload Me 
End Sub 
 
Private Sub CmdExit_Click() 
    Unload Me 
End Sub 
 
Private Sub CmdFilter_Click() 
    Set frmQuerryS.dbrs = dbrs 
    frmQuerryS.Show vbModal 
    dbrs.Filter = frmQuerryS.QuerryString 
    If dbrs.RecordCount < 1 Then 
        MsgBox "没有满足查询条件的记录", vbCritical, "操作无法完成" 
        dbrs.Filter = "" 
    End If 
    Unload frmQuerryS 
End Sub 
 
Private Sub CmdFirst_Click() 
    If dbrs.RecordCount > 0 Then 
        dbrs.MoveFirst 
    End If 
End Sub 
 
Private Sub CmdLast_Click() 
    If dbrs.RecordCount > 0 Then 
        dbrs.MoveLast 
    End If 
End Sub 
 
Private Sub CmdNext_Click() 
    If Not dbrs.EOF Then 
        dbrs.MoveNext 
    End If 
End Sub 
 
Private Sub CmdPrev_Click() 
    If Not dbrs.BOF Then 
        dbrs.MovePrevious 
    End If 
End Sub 
 
Private Sub ListQst() 
    dbrs.Close 
    QstList.Clear 
    Dim iCount As Long 
    Dim Qstring As String 
    For iCount = 1 To QPaper.LastQSerial 
        Qstring = QPaper.GetQuestion(iCount) 
        If Qstring <> "" Then 
            QstList.AddItem Qstring 
        End If 
    Next 
    dbrs.Open 
    Set DataLib.DataSource = dbrs 
    DataLib.Refresh 
End Sub 
 
Private Sub CmdReport_Click() 
    Me.Hide 
    dbrs.Close 
    QPaper.ReportToFile "varFile.tmp" 
    frmReport.FileName = "varFile.tmp" 
    Kill "varFile.tmp" 
    frmReport.Show vbModal 
    dbrs.Open 
    Me.Show vbModal 
End Sub 
 
Private Sub DelQ_Click() 
    If QstList.ListIndex < 0 Then 
        MsgBox "请选择要删减的题目", vbCritical, "错误" 
        Exit Sub 
    End If 
    Dim s As String 
    Dim p As Integer 
    Dim RCount As Long 
    s = QstList.Text 
    p = InStr(s, ".") 
    RCount = Val(Left(s, p - 1)) 
    QPaper.DelQuestion RCount 
    QstList.RemoveItem QstList.ListIndex 
End Sub 
 
Private Sub Form_Load() 
    QName(1) = "填空题" 
    QName(2) = "判断题" 
    QName(3) = "单选题" 
    QName(4) = "多选题" 
    QName(5) = "问答题" 
    MainFrame.Caption = "试题选择" 
    Set dbrs = DataEnv.rsFillingQ 
    dbrs.Open 
    Set DataLib.DataSource = dbrs 
    DataLib.Refresh 
    OptFill.Value = True 
    Ttype = 1 
    ListQst 
End Sub 
 
Private Sub Form_Unload(Cancel As Integer) 
    dbrs.Close 
    Set dbrs = Nothing 
End Sub 
 
Private Sub OptEssayQ_Click() 
dbrs.Close 
Set dbrs = DataEnv.rsEssayQ 
dbrs.Open 
Set DataLib.DataSource = dbrs 
DataLib.Refresh 
LblTestLib.Caption = "问答题题库" 
Ttype = 5 
 
End Sub 
 
Private Sub OptFill_Click() 
dbrs.Close 
Set dbrs = DataEnv.rsFillingQ 
dbrs.Open 
Set DataLib.DataSource = dbrs 
DataLib.Refresh 
LblTestLib.Caption = "填空题题库" 
Ttype = 1 
End Sub 
 
Private Sub OptMulSel_Click() 
dbrs.Close 
Set dbrs = DataEnv.rsMultiSelQ 
dbrs.Open 
Set DataLib.DataSource = dbrs 
DataLib.Refresh 
LblTestLib.Caption = "多选题题库" 
Ttype = 4 
End Sub 
 
Private Sub OptRorW_Click() 
dbrs.Close 
Set dbrs = DataEnv.rsRorWQ 
dbrs.Open 
Set DataLib.DataSource = dbrs 
DataLib.Refresh 
LblTestLib.Caption = "判断题题库" 
Ttype = 2 
End Sub 
 
Private Sub OptSglSel_Click() 
dbrs.Close 
Set dbrs = DataEnv.rsSingleSelQ 
dbrs.Open 
Set DataLib.DataSource = dbrs 
DataLib.Refresh 
LblTestLib.Caption = "单选题题库" 
Ttype = 3 
End Sub