📄 frmexamscreen.cs
字号:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.Collections.Specialized;
namespace OES
{
/// <summary>
/// //修改情况:部门:ACCP产品开发培训部 修改人:王文 时间:2004-12-26
/// </summary>
public class frmExamScreen : System.Windows.Forms.Form
{
private System.Windows.Forms.Button button3;
private System.Windows.Forms.Button btnHelp;
private System.Windows.Forms.RadioButton radOptionA;
private System.Windows.Forms.Button btnPrevious;
private System.Windows.Forms.Button btnNext;
private System.Windows.Forms.Button btnSubmit;
private System.Windows.Forms.Label lblTimeData;
private System.Windows.Forms.Label lblTime;
private System.Windows.Forms.Label lblQuestion;
private System.Windows.Forms.Label lblSelect;
private System.Windows.Forms.ComboBox cboQuestion;
private System.Windows.Forms.TextBox txtQuestion;
private System.Windows.Forms.RadioButton radOptionB;
private System.Windows.Forms.RadioButton radOptionC;
private System.Windows.Forms.RadioButton radOptionD;
private System.Windows.Forms.Timer tmrExamTime;
private System.ComponentModel.IContainer components;
private System.Windows.Forms.Label lblQNo;
//variables needed for the test paper
private string duration,selected;
private double time;
private double controltime;
private string [] searchValue;
private DataRow dr;
private DataTable dtPaper;
private int currentQNo;
private int questionCount;
private DataTable dtExam;
//declare an array for storing selected answers
private string[] selectedanswers;
//除去private string[] correctanswers;
private System.Windows.Forms.Label lblmins;
private int scoreval;
public frmExamScreen()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();
//
// TODO: Add any constructor code after InitializeComponent call
//
}
/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(frmExamScreen));
this.radOptionA = new System.Windows.Forms.RadioButton();
this.button3 = new System.Windows.Forms.Button();
this.btnPrevious = new System.Windows.Forms.Button();
this.btnNext = new System.Windows.Forms.Button();
this.btnSubmit = new System.Windows.Forms.Button();
this.lblTimeData = new System.Windows.Forms.Label();
this.lblTime = new System.Windows.Forms.Label();
this.lblQuestion = new System.Windows.Forms.Label();
this.lblQNo = new System.Windows.Forms.Label();
this.lblSelect = new System.Windows.Forms.Label();
this.cboQuestion = new System.Windows.Forms.ComboBox();
this.txtQuestion = new System.Windows.Forms.TextBox();
this.radOptionB = new System.Windows.Forms.RadioButton();
this.radOptionC = new System.Windows.Forms.RadioButton();
this.radOptionD = new System.Windows.Forms.RadioButton();
this.btnHelp = new System.Windows.Forms.Button();
this.tmrExamTime = new System.Windows.Forms.Timer(this.components);
this.lblmins = new System.Windows.Forms.Label();
this.SuspendLayout();
//
// radOptionA
//
this.radOptionA.BackColor = System.Drawing.Color.Transparent;
this.radOptionA.Font = new System.Drawing.Font("Century Gothic", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.radOptionA.ForeColor = System.Drawing.SystemColors.ActiveCaptionText;
this.radOptionA.Location = new System.Drawing.Point(230, 224);
this.radOptionA.Name = "radOptionA";
this.radOptionA.Size = new System.Drawing.Size(183, 26);
this.radOptionA.TabIndex = 4;
this.radOptionA.Text = "A. 答案 A";
//
// button3
//
this.button3.BackColor = System.Drawing.Color.Transparent;
this.button3.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
this.button3.Font = new System.Drawing.Font("Verdana", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.button3.ForeColor = System.Drawing.SystemColors.ActiveCaptionText;
this.button3.Location = new System.Drawing.Point(278, 594);
this.button3.Name = "button3";
this.button3.Size = new System.Drawing.Size(96, 26);
this.button3.TabIndex = 24;
this.button3.Text = "&Login";
this.button3.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// btnPrevious
//
this.btnPrevious.BackColor = System.Drawing.Color.Transparent;
this.btnPrevious.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
this.btnPrevious.Font = new System.Drawing.Font("Verdana", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.btnPrevious.ForeColor = System.Drawing.SystemColors.ActiveCaptionText;
this.btnPrevious.Location = new System.Drawing.Point(336, 345);
this.btnPrevious.Name = "btnPrevious";
this.btnPrevious.Size = new System.Drawing.Size(96, 25);
this.btnPrevious.TabIndex = 26;
this.btnPrevious.Text = "上一个(&P)";
this.btnPrevious.Click += new System.EventHandler(this.btnPrevious_Click);
//
// btnNext
//
this.btnNext.BackColor = System.Drawing.Color.Transparent;
this.btnNext.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
this.btnNext.Font = new System.Drawing.Font("Verdana", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.btnNext.ForeColor = System.Drawing.SystemColors.ActiveCaptionText;
this.btnNext.Location = new System.Drawing.Point(451, 345);
this.btnNext.Name = "btnNext";
this.btnNext.Size = new System.Drawing.Size(96, 25);
this.btnNext.TabIndex = 27;
this.btnNext.Text = "下一个(&N)";
this.btnNext.Click += new System.EventHandler(this.btnNext_Click);
//
// btnSubmit
//
this.btnSubmit.BackColor = System.Drawing.Color.Transparent;
this.btnSubmit.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
this.btnSubmit.Font = new System.Drawing.Font("Verdana", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.btnSubmit.ForeColor = System.Drawing.SystemColors.ActiveCaptionText;
this.btnSubmit.Location = new System.Drawing.Point(490, 78);
this.btnSubmit.Name = "btnSubmit";
this.btnSubmit.Size = new System.Drawing.Size(96, 25);
this.btnSubmit.TabIndex = 28;
this.btnSubmit.Text = "提交(&S)";
this.btnSubmit.Click += new System.EventHandler(this.btnSubmit_Click);
//
// lblTimeData
//
this.lblTimeData.AutoSize = true;
this.lblTimeData.BackColor = System.Drawing.Color.Transparent;
this.lblTimeData.Font = new System.Drawing.Font("Century Gothic", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.lblTimeData.ForeColor = System.Drawing.SystemColors.HighlightText;
this.lblTimeData.Location = new System.Drawing.Point(374, 26);
this.lblTimeData.Name = "lblTimeData";
this.lblTimeData.Size = new System.Drawing.Size(40, 22);
this.lblTimeData.TabIndex = 30;
this.lblTimeData.Text = "时间";
this.lblTimeData.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// lblTime
//
this.lblTime.AutoSize = true;
this.lblTime.BackColor = System.Drawing.Color.Transparent;
this.lblTime.Font = new System.Drawing.Font("Century Gothic", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.lblTime.ForeColor = System.Drawing.SystemColors.HighlightText;
this.lblTime.Location = new System.Drawing.Point(230, 26);
this.lblTime.Name = "lblTime";
this.lblTime.Size = new System.Drawing.Size(79, 19);
this.lblTime.TabIndex = 31;
this.lblTime.Text = "剩余时间:";
this.lblTime.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// lblQuestion
//
this.lblQuestion.BackColor = System.Drawing.Color.Transparent;
this.lblQuestion.Font = new System.Drawing.Font("Century Gothic", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.lblQuestion.ForeColor = System.Drawing.SystemColors.HighlightText;
this.lblQuestion.Location = new System.Drawing.Point(230, 78);
this.lblQuestion.Name = "lblQuestion";
this.lblQuestion.Size = new System.Drawing.Size(140, 17);
this.lblQuestion.TabIndex = 32;
this.lblQuestion.Text = "试题编号:";
//
// lblQNo
//
this.lblQNo.BackColor = System.Drawing.Color.Transparent;
this.lblQNo.Font = new System.Drawing.Font("Century Gothic", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.lblQNo.ForeColor = System.Drawing.SystemColors.HighlightText;
this.lblQNo.Location = new System.Drawing.Point(355, 78);
this.lblQNo.Name = "lblQNo";
this.lblQNo.Size = new System.Drawing.Size(29, 17);
this.lblQNo.TabIndex = 33;
this.lblQNo.Text = "1";
//
// lblSelect
//
this.lblSelect.AutoSize = true;
this.lblSelect.BackColor = System.Drawing.Color.Transparent;
this.lblSelect.Font = new System.Drawing.Font("Century Gothic", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.lblSelect.ForeColor = System.Drawing.SystemColors.HighlightText;
this.lblSelect.Location = new System.Drawing.Point(19, 121);
this.lblSelect.Name = "lblSelect";
this.lblSelect.Size = new System.Drawing.Size(59, 18);
this.lblSelect.TabIndex = 35;
this.lblSelect.Text = "选择试题";
this.lblSelect.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// cboQuestion
//
this.cboQuestion.BackColor = System.Drawing.SystemColors.Info;
this.cboQuestion.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cboQuestion.Font = new System.Drawing.Font("Century Gothic", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.cboQuestion.Location = new System.Drawing.Point(19, 146);
this.cboQuestion.Name = "cboQuestion";
this.cboQuestion.Size = new System.Drawing.Size(123, 24);
this.cboQuestion.TabIndex = 36;
this.cboQuestion.SelectedIndexChanged += new System.EventHandler(this.cboQuestion_SelectedIndexChanged);
//
// txtQuestion
//
this.txtQuestion.BackColor = System.Drawing.SystemColors.Info;
this.txtQuestion.Location = new System.Drawing.Point(230, 112);
this.txtQuestion.Multiline = true;
this.txtQuestion.Name = "txtQuestion";
this.txtQuestion.ReadOnly = true;
this.txtQuestion.ScrollBars = System.Windows.Forms.ScrollBars.Both;
this.txtQuestion.Size = new System.Drawing.Size(471, 95);
this.txtQuestion.TabIndex = 37;
this.txtQuestion.Text = "在此答题";
//
// radOptionB
//
this.radOptionB.BackColor = System.Drawing.Color.Transparent;
this.radOptionB.Font = new System.Drawing.Font("Century Gothic", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.radOptionB.ForeColor = System.Drawing.SystemColors.ActiveCaptionText;
this.radOptionB.Location = new System.Drawing.Point(230, 250);
this.radOptionB.Name = "radOptionB";
this.radOptionB.Size = new System.Drawing.Size(183, 26);
this.radOptionB.TabIndex = 38;
this.radOptionB.Text = "B. 答案 B";
//
// radOptionC
//
this.radOptionC.BackColor = System.Drawing.Color.Transparent;
this.radOptionC.Font = new System.Drawing.Font("Century Gothic", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.radOptionC.ForeColor = System.Drawing.SystemColors.ActiveCaptionText;
this.radOptionC.Location = new System.Drawing.Point(230, 276);
this.radOptionC.Name = "radOptionC";
this.radOptionC.Size = new System.Drawing.Size(183, 26);
this.radOptionC.TabIndex = 39;
this.radOptionC.Text = "C. 答案 C";
//
// radOptionD
//
this.radOptionD.BackColor = System.Drawing.Color.Transparent;
this.radOptionD.Font = new System.Drawing.Font("Century Gothic", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.radOptionD.ForeColor = System.Drawing.SystemColors.ActiveCaptionText;
this.radOptionD.Location = new System.Drawing.Point(230, 302);
this.radOptionD.Name = "radOptionD";
this.radOptionD.Size = new System.Drawing.Size(183, 25);
this.radOptionD.TabIndex = 40;
this.radOptionD.Text = "D. 答案 D";
//
// btnHelp
//
this.btnHelp.BackColor = System.Drawing.Color.Transparent;
this.btnHelp.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
this.btnHelp.Font = new System.Drawing.Font("Verdana", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.btnHelp.ForeColor = System.Drawing.SystemColors.ActiveCaptionText;
this.btnHelp.Location = new System.Drawing.Point(624, 78);
this.btnHelp.Name = "btnHelp";
this.btnHelp.Size = new System.Drawing.Size(72, 26);
this.btnHelp.TabIndex = 41;
this.btnHelp.Text = "帮助(&H)";
this.btnHelp.Click += new System.EventHandler(this.btnHelp_Click);
//
// tmrExamTime
//
this.tmrExamTime.Enabled = true;
this.tmrExamTime.Interval = 10000;
this.tmrExamTime.Tick += new System.EventHandler(this.tmrExamTime_Tick);
//
// lblmins
//
this.lblmins.AutoSize = true;
this.lblmins.BackColor = System.Drawing.Color.Transparent;
this.lblmins.Font = new System.Drawing.Font("Century Gothic", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.lblmins.ForeColor = System.Drawing.SystemColors.HighlightText;
this.lblmins.Location = new System.Drawing.Point(432, 28);
this.lblmins.Name = "lblmins";
this.lblmins.Size = new System.Drawing.Size(49, 19);
this.lblmins.TabIndex = 42;
this.lblmins.Text = "分钟。";
this.lblmins.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// frmExamScreen
//
this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
this.BackColor = System.Drawing.SystemColors.ControlLight;
this.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("$this.BackgroundImage")));
this.ClientSize = new System.Drawing.Size(783, 520);
this.Controls.Add(this.lblmins);
this.Controls.Add(this.txtQuestion);
this.Controls.Add(this.lblSelect);
this.Controls.Add(this.lblTime);
this.Controls.Add(this.lblTimeData);
this.Controls.Add(this.btnHelp);
this.Controls.Add(this.radOptionD);
this.Controls.Add(this.radOptionC);
this.Controls.Add(this.radOptionB);
this.Controls.Add(this.cboQuestion);
this.Controls.Add(this.lblQNo);
this.Controls.Add(this.lblQuestion);
this.Controls.Add(this.btnSubmit);
this.Controls.Add(this.btnNext);
this.Controls.Add(this.btnPrevious);
this.Controls.Add(this.button3);
this.Controls.Add(this.radOptionA);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.Location = new System.Drawing.Point(146, 115);
this.Name = "frmExamScreen";
this.ShowInTaskbar = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
this.Text = "frmExamScreen";
this.Load += new System.EventHandler(this.frmExamScreen_Load);
this.ResumeLayout(false);
}
#endregion
private bool promptSumbit = true;
//修改情况:部门:ACCP产品开发培训部 修改人:王文 时间:2004-12-25
private void btnSubmit_Click(object sender, System.EventArgs e)
{
//CheckAnswers();
//add by dongping 2004-12-26
// Initializes the variables to pass to the MessageBox.Show method.
if (promptSumbit)
{
string message = "如果您要提交试卷,将结束考试。继续此项操作?";
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -