Chinh sua UI
This commit is contained in:
parent
277177a476
commit
8f144c1a8b
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -10,21 +10,25 @@
|
|||||||
"AbsoluteMoniker": "D:0:0:{582DBFA6-720D-44B4-B48C-909F4DD98783}|QuizMaster.csproj|e:\\quizmaster\\quizmaster\\form2.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
|
"AbsoluteMoniker": "D:0:0:{582DBFA6-720D-44B4-B48C-909F4DD98783}|QuizMaster.csproj|e:\\quizmaster\\quizmaster\\form2.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
|
||||||
"RelativeMoniker": "D:0:0:{582DBFA6-720D-44B4-B48C-909F4DD98783}|QuizMaster.csproj|solutionrelative:form2.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
|
"RelativeMoniker": "D:0:0:{582DBFA6-720D-44B4-B48C-909F4DD98783}|QuizMaster.csproj|solutionrelative:form2.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"AbsoluteMoniker": "D:0:0:{582DBFA6-720D-44B4-B48C-909F4DD98783}|QuizMaster.csproj|e:\\quizmaster\\quizmaster\\form2.designer.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
|
|
||||||
"RelativeMoniker": "D:0:0:{582DBFA6-720D-44B4-B48C-909F4DD98783}|QuizMaster.csproj|solutionrelative:form2.designer.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"AbsoluteMoniker": "D:0:0:{582DBFA6-720D-44B4-B48C-909F4DD98783}|QuizMaster.csproj|e:\\quizmaster\\quizmaster\\form1.designer.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
|
"AbsoluteMoniker": "D:0:0:{582DBFA6-720D-44B4-B48C-909F4DD98783}|QuizMaster.csproj|e:\\quizmaster\\quizmaster\\form1.designer.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
|
||||||
"RelativeMoniker": "D:0:0:{582DBFA6-720D-44B4-B48C-909F4DD98783}|QuizMaster.csproj|solutionrelative:form1.designer.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
|
"RelativeMoniker": "D:0:0:{582DBFA6-720D-44B4-B48C-909F4DD98783}|QuizMaster.csproj|solutionrelative:form1.designer.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"AbsoluteMoniker": "D:0:0:{582DBFA6-720D-44B4-B48C-909F4DD98783}|QuizMaster.csproj|e:\\quizmaster\\quizmaster\\dbhelper.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
|
|
||||||
"RelativeMoniker": "D:0:0:{582DBFA6-720D-44B4-B48C-909F4DD98783}|QuizMaster.csproj|solutionrelative:dbhelper.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"AbsoluteMoniker": "D:0:0:{582DBFA6-720D-44B4-B48C-909F4DD98783}|QuizMaster.csproj|e:\\quizmaster\\quizmaster\\service\\datautil.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
|
"AbsoluteMoniker": "D:0:0:{582DBFA6-720D-44B4-B48C-909F4DD98783}|QuizMaster.csproj|e:\\quizmaster\\quizmaster\\service\\datautil.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
|
||||||
"RelativeMoniker": "D:0:0:{582DBFA6-720D-44B4-B48C-909F4DD98783}|QuizMaster.csproj|solutionrelative:service\\datautil.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
|
"RelativeMoniker": "D:0:0:{582DBFA6-720D-44B4-B48C-909F4DD98783}|QuizMaster.csproj|solutionrelative:service\\datautil.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"AbsoluteMoniker": "D:0:0:{582DBFA6-720D-44B4-B48C-909F4DD98783}|QuizMaster.csproj|E:\\QuizMaster\\QuizMaster\\form1.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}|Form",
|
||||||
|
"RelativeMoniker": "D:0:0:{582DBFA6-720D-44B4-B48C-909F4DD98783}|QuizMaster.csproj|solutionrelative:form1.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}|Form"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"AbsoluteMoniker": "D:0:0:{582DBFA6-720D-44B4-B48C-909F4DD98783}|QuizMaster.csproj|e:\\quizmaster\\quizmaster\\form2.designer.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
|
||||||
|
"RelativeMoniker": "D:0:0:{582DBFA6-720D-44B4-B48C-909F4DD98783}|QuizMaster.csproj|solutionrelative:form2.designer.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"AbsoluteMoniker": "D:0:0:{582DBFA6-720D-44B4-B48C-909F4DD98783}|QuizMaster.csproj|e:\\quizmaster\\quizmaster\\dbhelper.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
|
||||||
|
"RelativeMoniker": "D:0:0:{582DBFA6-720D-44B4-B48C-909F4DD98783}|QuizMaster.csproj|solutionrelative:dbhelper.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"DocumentGroupContainers": [
|
"DocumentGroupContainers": [
|
||||||
@ -44,7 +48,7 @@
|
|||||||
"RelativeDocumentMoniker": "Form1.cs",
|
"RelativeDocumentMoniker": "Form1.cs",
|
||||||
"ToolTip": "E:\\QuizMaster\\QuizMaster\\Form1.cs",
|
"ToolTip": "E:\\QuizMaster\\QuizMaster\\Form1.cs",
|
||||||
"RelativeToolTip": "Form1.cs",
|
"RelativeToolTip": "Form1.cs",
|
||||||
"ViewState": "AQIAAKoDAAAAAAAAAAAuwLMDAAAzAAAA",
|
"ViewState": "AQIAAAYEAAAAAAAAAAAcwBEEAAApAAAA",
|
||||||
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
|
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
|
||||||
"WhenOpened": "2025-05-26T01:54:54.164Z",
|
"WhenOpened": "2025-05-26T01:54:54.164Z",
|
||||||
"IsPinned": true,
|
"IsPinned": true,
|
||||||
@ -58,10 +62,22 @@
|
|||||||
"RelativeDocumentMoniker": "Form2.cs",
|
"RelativeDocumentMoniker": "Form2.cs",
|
||||||
"ToolTip": "E:\\QuizMaster\\QuizMaster\\Form2.cs",
|
"ToolTip": "E:\\QuizMaster\\QuizMaster\\Form2.cs",
|
||||||
"RelativeToolTip": "Form2.cs",
|
"RelativeToolTip": "Form2.cs",
|
||||||
"ViewState": "AQIAADoAAAAAAAAAAAAkwFwAAABOAAAA",
|
"ViewState": "AQIAAGMAAAAAAAAAAAAAAGwAAAAxAAAA",
|
||||||
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
|
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
|
||||||
"WhenOpened": "2025-10-02T06:28:48.666Z",
|
"WhenOpened": "2025-10-02T06:28:48.666Z",
|
||||||
"IsPinned": true
|
"IsPinned": true,
|
||||||
|
"EditorCaption": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"$type": "Document",
|
||||||
|
"DocumentIndex": 4,
|
||||||
|
"Title": "Form1.cs [Design]",
|
||||||
|
"DocumentMoniker": "E:\\QuizMaster\\QuizMaster\\Form1.cs",
|
||||||
|
"RelativeDocumentMoniker": "Form1.cs",
|
||||||
|
"ToolTip": "E:\\QuizMaster\\QuizMaster\\Form1.cs [Design]",
|
||||||
|
"RelativeToolTip": "Form1.cs [Design]",
|
||||||
|
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
|
||||||
|
"WhenOpened": "2025-10-08T02:47:37.753Z"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"$type": "Bookmark",
|
"$type": "Bookmark",
|
||||||
@ -81,43 +97,44 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"$type": "Document",
|
"$type": "Document",
|
||||||
"DocumentIndex": 5,
|
"DocumentIndex": 3,
|
||||||
"Title": "DataUtil.cs",
|
"Title": "DataUtil.cs",
|
||||||
"DocumentMoniker": "E:\\QuizMaster\\QuizMaster\\Service\\DataUtil.cs",
|
"DocumentMoniker": "E:\\QuizMaster\\QuizMaster\\Service\\DataUtil.cs",
|
||||||
"RelativeDocumentMoniker": "Service\\DataUtil.cs",
|
"RelativeDocumentMoniker": "Service\\DataUtil.cs",
|
||||||
"ToolTip": "E:\\QuizMaster\\QuizMaster\\Service\\DataUtil.cs",
|
"ToolTip": "E:\\QuizMaster\\QuizMaster\\Service\\DataUtil.cs",
|
||||||
"RelativeToolTip": "Service\\DataUtil.cs",
|
"RelativeToolTip": "Service\\DataUtil.cs",
|
||||||
"ViewState": "AQIAAC4BAAAAAAAAAAAAAEABAAAAAAAA",
|
"ViewState": "AQIAABsBAAAAAAAAAAAwwEABAAAAAAAA",
|
||||||
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
|
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
|
||||||
"WhenOpened": "2025-05-29T01:45:12.308Z"
|
"WhenOpened": "2025-05-29T01:45:12.308Z"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"$type": "Document",
|
"$type": "Document",
|
||||||
"DocumentIndex": 3,
|
"DocumentIndex": 2,
|
||||||
"Title": "Form1.Designer.cs",
|
"Title": "Form1.Designer.cs",
|
||||||
"DocumentMoniker": "E:\\QuizMaster\\QuizMaster\\Form1.Designer.cs",
|
"DocumentMoniker": "E:\\QuizMaster\\QuizMaster\\Form1.Designer.cs",
|
||||||
"RelativeDocumentMoniker": "Form1.Designer.cs",
|
"RelativeDocumentMoniker": "Form1.Designer.cs",
|
||||||
"ToolTip": "E:\\QuizMaster\\QuizMaster\\Form1.Designer.cs",
|
"ToolTip": "E:\\QuizMaster\\QuizMaster\\Form1.Designer.cs",
|
||||||
"RelativeToolTip": "Form1.Designer.cs",
|
"RelativeToolTip": "Form1.Designer.cs",
|
||||||
"ViewState": "AQIAAFEAAAAAAAAAAAArwGMAAAAqAAAA",
|
"ViewState": "AQIAABoBAAAAAAAAAAAYwCcBAAAwAAAA",
|
||||||
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
|
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
|
||||||
"WhenOpened": "2025-09-30T04:14:48.709Z"
|
"WhenOpened": "2025-09-30T04:14:48.709Z",
|
||||||
|
"EditorCaption": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"$type": "Document",
|
"$type": "Document",
|
||||||
"DocumentIndex": 2,
|
"DocumentIndex": 5,
|
||||||
"Title": "Form2.Designer.cs",
|
"Title": "Form2.Designer.cs",
|
||||||
"DocumentMoniker": "E:\\QuizMaster\\QuizMaster\\Form2.Designer.cs",
|
"DocumentMoniker": "E:\\QuizMaster\\QuizMaster\\Form2.Designer.cs",
|
||||||
"RelativeDocumentMoniker": "Form2.Designer.cs",
|
"RelativeDocumentMoniker": "Form2.Designer.cs",
|
||||||
"ToolTip": "E:\\QuizMaster\\QuizMaster\\Form2.Designer.cs",
|
"ToolTip": "E:\\QuizMaster\\QuizMaster\\Form2.Designer.cs",
|
||||||
"RelativeToolTip": "Form2.Designer.cs",
|
"RelativeToolTip": "Form2.Designer.cs",
|
||||||
"ViewState": "AQIAACAAAAAAAAAAAAArwDYAAAArAAAA",
|
"ViewState": "AQIAAAAAAAAAAAAAAAAAACcAAAAbAAAA",
|
||||||
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
|
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
|
||||||
"WhenOpened": "2025-10-02T06:23:49.946Z"
|
"WhenOpened": "2025-10-02T06:23:49.946Z"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"$type": "Document",
|
"$type": "Document",
|
||||||
"DocumentIndex": 4,
|
"DocumentIndex": 6,
|
||||||
"Title": "DbHelper.cs",
|
"Title": "DbHelper.cs",
|
||||||
"DocumentMoniker": "E:\\QuizMaster\\QuizMaster\\DbHelper.cs",
|
"DocumentMoniker": "E:\\QuizMaster\\QuizMaster\\DbHelper.cs",
|
||||||
"RelativeDocumentMoniker": "DbHelper.cs",
|
"RelativeDocumentMoniker": "DbHelper.cs",
|
||||||
|
|||||||
197
QuizMaster/Form1.Designer.cs
generated
197
QuizMaster/Form1.Designer.cs
generated
@ -30,6 +30,9 @@
|
|||||||
{
|
{
|
||||||
tabControl1 = new TabControl();
|
tabControl1 = new TabControl();
|
||||||
tabPage1 = new TabPage();
|
tabPage1 = new TabPage();
|
||||||
|
panel1 = new Panel();
|
||||||
|
panelcb = new Panel();
|
||||||
|
panelop = new Panel();
|
||||||
textBox1 = new TextBox();
|
textBox1 = new TextBox();
|
||||||
btnUpload = new Button();
|
btnUpload = new Button();
|
||||||
BtnOpen = new Button();
|
BtnOpen = new Button();
|
||||||
@ -39,113 +42,184 @@
|
|||||||
tabPage2 = new TabPage();
|
tabPage2 = new TabPage();
|
||||||
chkIncludeAnswers = new CheckBox();
|
chkIncludeAnswers = new CheckBox();
|
||||||
lblNumberOfCopies = new Label();
|
lblNumberOfCopies = new Label();
|
||||||
txtNumberOfCopies = new TextBox();
|
txtNumberOfCopies = new NumericUpDown();
|
||||||
tabControl1.SuspendLayout();
|
tabControl1.SuspendLayout();
|
||||||
tabPage1.SuspendLayout();
|
tabPage1.SuspendLayout();
|
||||||
|
panel1.SuspendLayout();
|
||||||
|
panelcb.SuspendLayout();
|
||||||
|
panelop.SuspendLayout();
|
||||||
tabPage2.SuspendLayout();
|
tabPage2.SuspendLayout();
|
||||||
|
((System.ComponentModel.ISupportInitialize)txtNumberOfCopies).BeginInit();
|
||||||
SuspendLayout();
|
SuspendLayout();
|
||||||
//
|
//
|
||||||
// tabControl1
|
// tabControl1
|
||||||
//
|
//
|
||||||
|
tabControl1.Appearance = TabAppearance.FlatButtons;
|
||||||
tabControl1.Controls.Add(tabPage1);
|
tabControl1.Controls.Add(tabPage1);
|
||||||
tabControl1.Controls.Add(tabPage2);
|
tabControl1.Controls.Add(tabPage2);
|
||||||
|
tabControl1.Font = new Font("Segoe UI", 10F, FontStyle.Regular, GraphicsUnit.Point);
|
||||||
|
tabControl1.ItemSize = new Size(200, 40);
|
||||||
tabControl1.Location = new Point(12, 12);
|
tabControl1.Location = new Point(12, 12);
|
||||||
tabControl1.Name = "tabControl1";
|
tabControl1.Name = "tabControl1";
|
||||||
tabControl1.SelectedIndex = 0;
|
tabControl1.SelectedIndex = 0;
|
||||||
tabControl1.Size = new Size(1499, 955);
|
tabControl1.Size = new Size(1499, 955);
|
||||||
|
tabControl1.SizeMode = TabSizeMode.Fixed;
|
||||||
tabControl1.TabIndex = 0;
|
tabControl1.TabIndex = 0;
|
||||||
//
|
//
|
||||||
// tabPage1
|
// tabPage1
|
||||||
//
|
//
|
||||||
tabPage1.Controls.Add(textBox1);
|
tabPage1.BackColor = Color.FromArgb(248, 249, 250);
|
||||||
tabPage1.Controls.Add(btnUpload);
|
tabPage1.Controls.Add(panel1);
|
||||||
tabPage1.Controls.Add(BtnOpen);
|
tabPage1.Location = new Point(4, 44);
|
||||||
tabPage1.Controls.Add(label2);
|
|
||||||
tabPage1.Controls.Add(button1);
|
|
||||||
tabPage1.Controls.Add(label1);
|
|
||||||
tabPage1.Location = new Point(4, 34);
|
|
||||||
tabPage1.Name = "tabPage1";
|
tabPage1.Name = "tabPage1";
|
||||||
tabPage1.Padding = new Padding(3);
|
tabPage1.Padding = new Padding(3);
|
||||||
tabPage1.Size = new Size(1491, 917);
|
tabPage1.Size = new Size(1491, 907);
|
||||||
tabPage1.TabIndex = 0;
|
tabPage1.TabIndex = 0;
|
||||||
tabPage1.Text = "Tải lên bộ câu hỏi";
|
tabPage1.Text = "📁 Tải lên bộ câu hỏi";
|
||||||
tabPage1.UseVisualStyleBackColor = true;
|
//
|
||||||
|
// panel1
|
||||||
|
//
|
||||||
|
panel1.BackColor = Color.White;
|
||||||
|
panel1.BorderStyle = BorderStyle.FixedSingle;
|
||||||
|
panel1.Controls.Add(textBox1);
|
||||||
|
panel1.Controls.Add(btnUpload);
|
||||||
|
panel1.Controls.Add(BtnOpen);
|
||||||
|
panel1.Controls.Add(label2);
|
||||||
|
panel1.Controls.Add(button1);
|
||||||
|
panel1.Controls.Add(label1);
|
||||||
|
panel1.Location = new Point(50, 50);
|
||||||
|
panel1.Name = "panel1";
|
||||||
|
panel1.Size = new Size(1000, 254);
|
||||||
|
panel1.TabIndex = 0;
|
||||||
|
//
|
||||||
|
// panel_cb
|
||||||
|
//
|
||||||
|
panelcb.BackColor = Color.White;
|
||||||
|
panelcb.BorderStyle = BorderStyle.FixedSingle;
|
||||||
|
panelcb.Location = new Point(50, 50);
|
||||||
|
panelcb.Name = "panelcb";
|
||||||
|
panelcb.Size = new Size(600, 300);
|
||||||
|
panelcb.MaximumSize = new Size(600, 300);
|
||||||
|
panelcb.TabIndex = 1;
|
||||||
|
panelcb.AutoScroll = true;
|
||||||
|
panelcb.AutoSize = true;
|
||||||
|
//
|
||||||
|
// panel_op
|
||||||
|
//
|
||||||
|
panelop.BackColor = Color.White;
|
||||||
|
panelop.BorderStyle = BorderStyle.FixedSingle;
|
||||||
|
panelop.Location = new Point(50, 350);
|
||||||
|
panelop.Controls.Add(chkIncludeAnswers);
|
||||||
|
panelop.Controls.Add(lblNumberOfCopies);
|
||||||
|
panelop.Controls.Add(txtNumberOfCopies);
|
||||||
|
panelop.Name = "panelop";
|
||||||
|
panelop.Size = new Size(600, 100);
|
||||||
|
panelop.MaximumSize = new Size(600, 300);
|
||||||
|
panelop.TabIndex = 2;
|
||||||
|
panelop.AutoScroll = true;
|
||||||
|
panelop.AutoSize = true;
|
||||||
//
|
//
|
||||||
// textBox1
|
// textBox1
|
||||||
//
|
//
|
||||||
textBox1.Location = new Point(193, 92);
|
textBox1.BackColor = Color.FromArgb(248, 249, 250);
|
||||||
|
textBox1.BorderStyle = BorderStyle.FixedSingle;
|
||||||
|
textBox1.Font = new Font("Segoe UI", 10F, FontStyle.Regular, GraphicsUnit.Point);
|
||||||
|
textBox1.Location = new Point(259, 103);
|
||||||
textBox1.Name = "textBox1";
|
textBox1.Name = "textBox1";
|
||||||
textBox1.ReadOnly = true;
|
textBox1.ReadOnly = true;
|
||||||
textBox1.Size = new Size(273, 31);
|
textBox1.Size = new Size(300, 34);
|
||||||
textBox1.TabIndex = 7;
|
textBox1.TabIndex = 7;
|
||||||
//
|
//
|
||||||
// btnUpload
|
// btnUpload
|
||||||
//
|
//
|
||||||
btnUpload.Location = new Point(579, 92);
|
btnUpload.BackColor = Color.FromArgb(40, 167, 69);
|
||||||
|
btnUpload.Cursor = Cursors.Hand;
|
||||||
|
btnUpload.FlatAppearance.BorderSize = 0;
|
||||||
|
btnUpload.FlatStyle = FlatStyle.Flat;
|
||||||
|
btnUpload.Font = new Font("Segoe UI", 10F, FontStyle.Bold, GraphicsUnit.Point);
|
||||||
|
btnUpload.ForeColor = Color.White;
|
||||||
|
btnUpload.Location = new Point(721, 103);
|
||||||
btnUpload.Name = "btnUpload";
|
btnUpload.Name = "btnUpload";
|
||||||
btnUpload.Size = new Size(112, 32);
|
btnUpload.Size = new Size(150, 34);
|
||||||
btnUpload.TabIndex = 8;
|
btnUpload.TabIndex = 8;
|
||||||
btnUpload.Text = "Upload";
|
btnUpload.Text = "📤 Upload";
|
||||||
btnUpload.UseVisualStyleBackColor = true;
|
btnUpload.UseVisualStyleBackColor = false;
|
||||||
btnUpload.Click += btnUpload_Click;
|
btnUpload.Click += btnUpload_Click;
|
||||||
//
|
//
|
||||||
// BtnOpen
|
// BtnOpen
|
||||||
//
|
//
|
||||||
BtnOpen.Location = new Point(461, 92);
|
BtnOpen.BackColor = Color.FromArgb(0, 123, 255);
|
||||||
|
BtnOpen.Cursor = Cursors.Hand;
|
||||||
|
BtnOpen.FlatAppearance.BorderSize = 0;
|
||||||
|
BtnOpen.FlatStyle = FlatStyle.Flat;
|
||||||
|
BtnOpen.Font = new Font("Segoe UI", 10F, FontStyle.Bold, GraphicsUnit.Point);
|
||||||
|
BtnOpen.ForeColor = Color.White;
|
||||||
|
BtnOpen.Location = new Point(555, 103);
|
||||||
BtnOpen.Name = "BtnOpen";
|
BtnOpen.Name = "BtnOpen";
|
||||||
BtnOpen.Size = new Size(112, 32);
|
BtnOpen.Size = new Size(151, 34);
|
||||||
BtnOpen.TabIndex = 6;
|
BtnOpen.TabIndex = 6;
|
||||||
BtnOpen.Text = "Choose File";
|
BtnOpen.Text = "📂 Chọn File";
|
||||||
BtnOpen.UseVisualStyleBackColor = true;
|
BtnOpen.UseVisualStyleBackColor = false;
|
||||||
BtnOpen.Click += btnOpen_Click;
|
BtnOpen.Click += btnOpen_Click;
|
||||||
//
|
//
|
||||||
// label2
|
// label2
|
||||||
//
|
//
|
||||||
label2.AutoSize = true;
|
label2.AutoSize = true;
|
||||||
label2.Location = new Point(28, 92);
|
label2.Font = new Font("Segoe UI", 10F, FontStyle.Bold, GraphicsUnit.Point);
|
||||||
|
label2.ForeColor = Color.FromArgb(52, 58, 64);
|
||||||
|
label2.Location = new Point(30, 105);
|
||||||
label2.Name = "label2";
|
label2.Name = "label2";
|
||||||
label2.Size = new Size(159, 25);
|
label2.Size = new Size(223, 28);
|
||||||
label2.TabIndex = 5;
|
label2.TabIndex = 5;
|
||||||
label2.Text = "Upload bộ câu hỏi";
|
label2.Text = "📄 Upload bộ câu hỏi:";
|
||||||
//
|
//
|
||||||
// button1
|
// button1
|
||||||
//
|
//
|
||||||
button1.Location = new Point(195, 20);
|
button1.BackColor = Color.FromArgb(108, 117, 125);
|
||||||
|
button1.Cursor = Cursors.Hand;
|
||||||
|
button1.FlatAppearance.BorderSize = 0;
|
||||||
|
button1.FlatStyle = FlatStyle.Flat;
|
||||||
|
button1.Font = new Font("Segoe UI", 10F, FontStyle.Bold, GraphicsUnit.Point);
|
||||||
|
button1.ForeColor = Color.White;
|
||||||
|
button1.Location = new Point(228, 34);
|
||||||
button1.Name = "button1";
|
button1.Name = "button1";
|
||||||
button1.Size = new Size(112, 34);
|
button1.Size = new Size(186, 40);
|
||||||
button1.TabIndex = 4;
|
button1.TabIndex = 4;
|
||||||
button1.Text = "Download";
|
button1.Text = "📥 Tải File Mẫu";
|
||||||
button1.UseVisualStyleBackColor = true;
|
button1.UseVisualStyleBackColor = false;
|
||||||
button1.Click += button1_Click;
|
button1.Click += button1_Click;
|
||||||
//
|
//
|
||||||
// label1
|
// label1
|
||||||
//
|
//
|
||||||
label1.AutoSize = true;
|
label1.AutoSize = true;
|
||||||
label1.Location = new Point(28, 25);
|
label1.Font = new Font("Segoe UI", 10F, FontStyle.Bold, GraphicsUnit.Point);
|
||||||
|
label1.ForeColor = Color.FromArgb(52, 58, 64);
|
||||||
|
label1.Location = new Point(30, 40);
|
||||||
label1.Name = "label1";
|
label1.Name = "label1";
|
||||||
label1.Size = new Size(125, 25);
|
label1.Size = new Size(192, 28);
|
||||||
label1.TabIndex = 3;
|
label1.TabIndex = 3;
|
||||||
label1.Text = "Tải về file mẫu";
|
label1.Text = "📋 Tải về file mẫu:";
|
||||||
//
|
//
|
||||||
// tabPage2
|
// tabPage2
|
||||||
//
|
//
|
||||||
tabPage2.Controls.Add(chkIncludeAnswers);
|
tabPage2.BackColor = Color.FromArgb(248, 249, 250);
|
||||||
tabPage2.Controls.Add(lblNumberOfCopies);
|
tabPage2.Controls.Add(panelcb);
|
||||||
tabPage2.Controls.Add(txtNumberOfCopies);
|
tabPage2.Controls.Add(panelop);
|
||||||
tabPage2.Location = new Point(4, 34);
|
tabPage2.Location = new Point(4, 44);
|
||||||
tabPage2.Name = "tabPage2";
|
tabPage2.Name = "tabPage2";
|
||||||
tabPage2.Padding = new Padding(3);
|
tabPage2.Padding = new Padding(3);
|
||||||
tabPage2.Size = new Size(1491, 917);
|
tabPage2.Size = new Size(1491, 907);
|
||||||
tabPage2.TabIndex = 1;
|
tabPage2.TabIndex = 1;
|
||||||
tabPage2.Text = "Tạo bộ câu hỏi ngẫu nhiên";
|
tabPage2.Text = "🎲 Tạo bộ câu hỏi ngẫu nhiên";
|
||||||
tabPage2.UseVisualStyleBackColor = true;
|
|
||||||
//
|
//
|
||||||
// chkIncludeAnswers
|
// chkIncludeAnswers
|
||||||
//
|
//
|
||||||
chkIncludeAnswers.AutoSize = true;
|
chkIncludeAnswers.AutoSize = true;
|
||||||
chkIncludeAnswers.Location = new Point(250, 10);
|
chkIncludeAnswers.Font = new Font("Segoe UI", 10F, FontStyle.Regular, GraphicsUnit.Point);
|
||||||
|
chkIncludeAnswers.ForeColor = Color.FromArgb(52, 58, 64);
|
||||||
|
chkIncludeAnswers.Location = new Point(324, 0);
|
||||||
chkIncludeAnswers.Name = "chkIncludeAnswers";
|
chkIncludeAnswers.Name = "chkIncludeAnswers";
|
||||||
chkIncludeAnswers.Size = new Size(137, 29);
|
chkIncludeAnswers.Size = new Size(145, 32);
|
||||||
chkIncludeAnswers.TabIndex = 2;
|
chkIncludeAnswers.TabIndex = 2;
|
||||||
chkIncludeAnswers.Text = "In có đáp án";
|
chkIncludeAnswers.Text = "In có đáp án";
|
||||||
chkIncludeAnswers.UseVisualStyleBackColor = true;
|
chkIncludeAnswers.UseVisualStyleBackColor = true;
|
||||||
@ -154,37 +228,54 @@
|
|||||||
// lblNumberOfCopies
|
// lblNumberOfCopies
|
||||||
//
|
//
|
||||||
lblNumberOfCopies.AutoSize = true;
|
lblNumberOfCopies.AutoSize = true;
|
||||||
lblNumberOfCopies.Location = new Point(19, 10);
|
lblNumberOfCopies.Font = new Font("Segoe UI", 10F, FontStyle.Bold, GraphicsUnit.Point);
|
||||||
|
lblNumberOfCopies.ForeColor = Color.FromArgb(52, 58, 64);
|
||||||
|
lblNumberOfCopies.Location = new Point(33, 0);
|
||||||
lblNumberOfCopies.Name = "lblNumberOfCopies";
|
lblNumberOfCopies.Name = "lblNumberOfCopies";
|
||||||
lblNumberOfCopies.Size = new Size(102, 25);
|
lblNumberOfCopies.Size = new Size(151, 28);
|
||||||
lblNumberOfCopies.TabIndex = 0;
|
lblNumberOfCopies.TabIndex = 0;
|
||||||
lblNumberOfCopies.Text = "Số bản ghi:";
|
lblNumberOfCopies.Text = "📊 Số bản ghi:";
|
||||||
lblNumberOfCopies.Visible = false;
|
lblNumberOfCopies.Visible = false;
|
||||||
//
|
//
|
||||||
// txtNumberOfCopies
|
// txtNumberOfCopies
|
||||||
//
|
//
|
||||||
txtNumberOfCopies.Location = new Point(125, 7);
|
txtNumberOfCopies.BackColor = Color.FromArgb(248, 249, 250);
|
||||||
|
txtNumberOfCopies.BorderStyle = BorderStyle.FixedSingle;
|
||||||
|
txtNumberOfCopies.Font = new Font("Segoe UI", 10F, FontStyle.Regular, GraphicsUnit.Point);
|
||||||
|
txtNumberOfCopies.Location = new Point(190, 0);
|
||||||
|
txtNumberOfCopies.Minimum = new decimal(new int[] { 1, 0, 0, 0 });
|
||||||
txtNumberOfCopies.Name = "txtNumberOfCopies";
|
txtNumberOfCopies.Name = "txtNumberOfCopies";
|
||||||
txtNumberOfCopies.Size = new Size(100, 31);
|
txtNumberOfCopies.Size = new Size(100, 34);
|
||||||
txtNumberOfCopies.TabIndex = 1;
|
txtNumberOfCopies.TabIndex = 1;
|
||||||
txtNumberOfCopies.Text = "1";
|
|
||||||
txtNumberOfCopies.TextAlign = HorizontalAlignment.Right;
|
txtNumberOfCopies.TextAlign = HorizontalAlignment.Right;
|
||||||
|
txtNumberOfCopies.Value = new decimal(new int[] { 1, 0, 0, 0 });
|
||||||
txtNumberOfCopies.Visible = false;
|
txtNumberOfCopies.Visible = false;
|
||||||
//
|
//
|
||||||
// Form1
|
// Form1
|
||||||
//
|
//
|
||||||
AutoScaleDimensions = new SizeF(10F, 25F);
|
AutoScaleDimensions = new SizeF(11F, 28F);
|
||||||
AutoScaleMode = AutoScaleMode.Font;
|
AutoScaleMode = AutoScaleMode.Font;
|
||||||
ClientSize = new Size(1515, 971);
|
BackColor = Color.FromArgb(240, 242, 245);
|
||||||
|
ClientSize = new Size(1140, 800);
|
||||||
Controls.Add(tabControl1);
|
Controls.Add(tabControl1);
|
||||||
|
Font = new Font("Segoe UI", 10F, FontStyle.Regular, GraphicsUnit.Point);
|
||||||
Name = "Form1";
|
Name = "Form1";
|
||||||
Text = "Form1";
|
StartPosition = FormStartPosition.CenterScreen;
|
||||||
|
Text = "📋 QuizMaster - Hệ thống tạo đề trắc nghiệm";
|
||||||
Load += Form1_Load;
|
Load += Form1_Load;
|
||||||
tabControl1.ResumeLayout(false);
|
tabControl1.ResumeLayout(false);
|
||||||
tabPage1.ResumeLayout(false);
|
tabPage1.ResumeLayout(false);
|
||||||
tabPage1.PerformLayout();
|
panel1.ResumeLayout(false);
|
||||||
|
panel1.PerformLayout();
|
||||||
|
|
||||||
|
panelcb.ResumeLayout(false);
|
||||||
|
panelcb.PerformLayout();
|
||||||
|
panelop.ResumeLayout(false);
|
||||||
|
panelop.PerformLayout();
|
||||||
|
|
||||||
tabPage2.ResumeLayout(false);
|
tabPage2.ResumeLayout(false);
|
||||||
tabPage2.PerformLayout();
|
tabPage2.PerformLayout();
|
||||||
|
((System.ComponentModel.ISupportInitialize)txtNumberOfCopies).EndInit();
|
||||||
ResumeLayout(false);
|
ResumeLayout(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -193,14 +284,18 @@
|
|||||||
private TabControl tabControl1;
|
private TabControl tabControl1;
|
||||||
private TabPage tabPage1;
|
private TabPage tabPage1;
|
||||||
private TabPage tabPage2;
|
private TabPage tabPage2;
|
||||||
|
private Panel panel1;
|
||||||
|
private Panel panelcb;
|
||||||
|
private Panel panelop;
|
||||||
private Label label2;
|
private Label label2;
|
||||||
private Button button1;
|
private Button button1;
|
||||||
private Label label1;
|
private Label label1;
|
||||||
private TextBox textBox1;
|
private TextBox textBox1;
|
||||||
private Button BtnOpen;
|
private Button BtnOpen;
|
||||||
private Button btnUpload;
|
private Button btnUpload;
|
||||||
private TextBox txtNumberOfCopies;
|
private NumericUpDown txtNumberOfCopies;
|
||||||
private CheckBox chkIncludeAnswers;
|
private CheckBox chkIncludeAnswers;
|
||||||
private Label lblNumberOfCopies;
|
private Label lblNumberOfCopies;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -83,13 +83,20 @@ namespace QuizMaster
|
|||||||
|
|
||||||
private async void Form1_Load(object sender, EventArgs e)
|
private async void Form1_Load(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
|
// Thêm hiệu ứng hover cho các buttons
|
||||||
|
AddButtonHoverEffects();
|
||||||
|
|
||||||
ComboBox comboMain = new ComboBox();
|
ComboBox comboMain = new ComboBox();
|
||||||
comboMain.Location = new Point(pointX, startY);
|
comboMain.Location = new Point(pointX + 90, startY + 20);
|
||||||
comboMain.Size = new Size(182, 33);
|
comboMain.Size = new Size(400, 35);
|
||||||
comboMain.Name = $"comboMain";
|
comboMain.Name = $"comboMain";
|
||||||
comboMain.SelectedIndexChanged += comboBoxMain_SelectedIndexChanged;
|
comboMain.SelectedIndexChanged += comboBoxMain_SelectedIndexChanged;
|
||||||
comboMain.DropDownStyle = ComboBoxStyle.DropDownList;
|
comboMain.DropDownStyle = ComboBoxStyle.DropDownList;
|
||||||
tabPage2.Controls.Add(comboMain);
|
comboMain.Font = new System.Drawing.Font("Segoe UI", 10F, FontStyle.Regular, GraphicsUnit.Point);
|
||||||
|
comboMain.BackColor = Color.WhiteSmoke;
|
||||||
|
comboMain.FlatStyle = FlatStyle.Flat;
|
||||||
|
|
||||||
|
panelcb.Controls.Add(comboMain);
|
||||||
|
|
||||||
// Thêm validation cho TextBox số bản ghi
|
// Thêm validation cho TextBox số bản ghi
|
||||||
txtNumberOfCopies.KeyPress += OnlyAllowPositiveIntegers;
|
txtNumberOfCopies.KeyPress += OnlyAllowPositiveIntegers;
|
||||||
@ -174,28 +181,33 @@ namespace QuizMaster
|
|||||||
tb.Visible = false;
|
tb.Visible = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
var existingTextBox = tabPage2.Controls.Find(txtBoxName, true).FirstOrDefault() as TextBox;
|
var existingTextBox = panelcb.Controls.Find(txtBoxName, true).FirstOrDefault() as TextBox;
|
||||||
|
|
||||||
|
|
||||||
if (existingTextBox == null)
|
if (existingTextBox == null)
|
||||||
{
|
{
|
||||||
TextBox txt = new TextBox();
|
TextBox txt = new TextBox();
|
||||||
txt.Name = txtBoxName;
|
txt.Name = txtBoxName;
|
||||||
txt.Size = new Size(300, 34);
|
txt.Size = new Size(300, 35);
|
||||||
txt.Location = new Point(cbbChange.Right + 10, cbbChange.Top);
|
txt.Location = new Point(cbbChange.Right + 20, cbbChange.Top);
|
||||||
txt.PlaceholderText = $"Nhập số câu hỏi về {selectedText}";
|
txt.PlaceholderText = $"Nhập số câu hỏi về {selectedText}";
|
||||||
txt.TextAlign = HorizontalAlignment.Right;
|
txt.TextAlign = HorizontalAlignment.Right;
|
||||||
|
txt.Font = new System.Drawing.Font("Segoe UI", 10F, FontStyle.Regular, GraphicsUnit.Point);
|
||||||
|
txt.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
|
||||||
|
txt.BackColor = Color.FromArgb(248, 249, 250);
|
||||||
txt.KeyPress += OnlyAllowPositiveIntegers;
|
txt.KeyPress += OnlyAllowPositiveIntegers;
|
||||||
txt.Tag = indexCombo; // Gắn textbox với ComboBox này
|
txt.Tag = indexCombo; // Gắn textbox với ComboBox này
|
||||||
tabPage2.Controls.Add(txt);
|
|
||||||
txt.Visible = true;
|
txt.Visible = true;
|
||||||
txt.BringToFront();
|
txt.BringToFront();
|
||||||
textBoxes.Add(txt);
|
textBoxes.Add(txt);
|
||||||
|
|
||||||
|
panelcb.Controls.Add(txt);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
existingTextBox.Tag = indexCombo; // Đảm bảo gắn đúng ComboBox
|
existingTextBox.Tag = indexCombo; // Đảm bảo gắn đúng ComboBox
|
||||||
existingTextBox.PlaceholderText = $"Nhập số câu hỏi về {selectedText}";
|
existingTextBox.PlaceholderText = $"Nhập số câu hỏi về {selectedText}";
|
||||||
existingTextBox.Location = new Point(cbbChange.Right + 10, cbbChange.Top);
|
existingTextBox.Location = new Point(cbbChange.Right + 20, cbbChange.Top);
|
||||||
existingTextBox.Visible = true;
|
existingTextBox.Visible = true;
|
||||||
existingTextBox.BringToFront();
|
existingTextBox.BringToFront();
|
||||||
}
|
}
|
||||||
@ -219,19 +231,19 @@ namespace QuizMaster
|
|||||||
|
|
||||||
foreach (var cb in comboBoxes)
|
foreach (var cb in comboBoxes)
|
||||||
{
|
{
|
||||||
tabPage2.Controls.Remove(cb);
|
panelcb.Controls.Remove(cb);
|
||||||
cb.Dispose();
|
cb.Dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (var btn in buttons)
|
foreach (var btn in buttons)
|
||||||
{
|
{
|
||||||
tabPage2.Controls.Remove(btn);
|
panelop.Controls.Remove(btn);
|
||||||
btn.Dispose();
|
btn.Dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (var txt in textBoxes)
|
foreach (var txt in textBoxes)
|
||||||
{
|
{
|
||||||
tabPage2.Controls.Remove(txt);
|
panelcb.Controls.Remove(txt);
|
||||||
txt.Dispose();
|
txt.Dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -244,21 +256,21 @@ namespace QuizMaster
|
|||||||
// Xóa các ComboBox đã thêm trước đó khỏi giao diện
|
// Xóa các ComboBox đã thêm trước đó khỏi giao diện
|
||||||
foreach (var cb in comboBoxes)
|
foreach (var cb in comboBoxes)
|
||||||
{
|
{
|
||||||
tabPage2.Controls.Remove(cb);
|
panelcb.Controls.Remove(cb);
|
||||||
cb.Dispose();
|
cb.Dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Xóa các ComboBox đã thêm trước đó khỏi giao diện
|
// Xóa các ComboBox đã thêm trước đó khỏi giao diện
|
||||||
foreach (var btn in buttons)
|
foreach (var btn in buttons)
|
||||||
{
|
{
|
||||||
tabPage2.Controls.Remove(btn);
|
panelop.Controls.Remove(btn);
|
||||||
btn.Dispose();
|
btn.Dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Xóa các ComboBox đã thêm trước đó khỏi giao diện
|
// Xóa các ComboBox đã thêm trước đó khỏi giao diện
|
||||||
foreach (var txt in textBoxes)
|
foreach (var txt in textBoxes)
|
||||||
{
|
{
|
||||||
tabPage2.Controls.Remove(txt);
|
panelcb.Controls.Remove(txt);
|
||||||
txt.Dispose();
|
txt.Dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -290,20 +302,33 @@ namespace QuizMaster
|
|||||||
for (int i = 0; i < departmentCategories.Count; i++)
|
for (int i = 0; i < departmentCategories.Count; i++)
|
||||||
{
|
{
|
||||||
ComboBox cb = new ComboBox();
|
ComboBox cb = new ComboBox();
|
||||||
cb.Location = new Point(pointX, startY + spacing + (i * spacing));
|
cb.Location = new Point(pointX + 20, startY + spacing + (i * spacing) + 30);
|
||||||
cb.Size = new Size(182, 33);
|
cb.Size = new Size(200, 35);
|
||||||
cb.Name = $"comboBox{i + 1}";
|
cb.Name = $"comboBox{i + 1}";
|
||||||
cb.TabIndex = i;
|
cb.TabIndex = i;
|
||||||
cb.FormattingEnabled = true;
|
cb.FormattingEnabled = true;
|
||||||
cb.DropDownStyle = ComboBoxStyle.DropDownList;
|
cb.DropDownStyle = ComboBoxStyle.DropDownList;
|
||||||
|
cb.Font = new System.Drawing.Font("Segoe UI", 10F, FontStyle.Regular, GraphicsUnit.Point);
|
||||||
|
cb.BackColor = Color.WhiteSmoke;
|
||||||
|
cb.FlatStyle = FlatStyle.Flat;
|
||||||
cb.SelectedIndexChanged += ComboBox_SelectedIndexChanged;
|
cb.SelectedIndexChanged += ComboBox_SelectedIndexChanged;
|
||||||
|
|
||||||
// Gán danh sách categories của department
|
// Gán danh sách categories của department
|
||||||
cb.DataSource = new List<string>(initCombobox);
|
cb.DataSource = new List<string>(initCombobox);
|
||||||
|
|
||||||
// Thêm vào tabPage2 và danh sách quản lý
|
|
||||||
tabPage2.Controls.Add(cb);
|
|
||||||
comboBoxes.Add(cb);
|
comboBoxes.Add(cb);
|
||||||
|
|
||||||
|
panelcb.Controls.Add(cb);
|
||||||
|
|
||||||
|
int lastCbb = comboBoxes.Last().Location.Y;
|
||||||
|
int heightCbb = comboBoxes.Last().Height;
|
||||||
|
int panelopX = panelcb.Size.Width;
|
||||||
|
panelcb.Size = new Size(panelopX, lastCbb + heightCbb + 20);
|
||||||
|
|
||||||
|
int x = panelcb.Location.X;
|
||||||
|
int y = panelcb.Location.Y;
|
||||||
|
int pcbHeight = panelcb.Size.Height;
|
||||||
|
panelop.Location = new Point(x,y + pcbHeight + 20);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Cập nhật categorys để dùng cho logic khác
|
// Cập nhật categorys để dùng cho logic khác
|
||||||
@ -311,21 +336,39 @@ namespace QuizMaster
|
|||||||
|
|
||||||
if (comboBoxes.Count > 0)
|
if (comboBoxes.Count > 0)
|
||||||
{
|
{
|
||||||
int lastCbb = comboBoxes.Last().Location.Y;
|
|
||||||
int heightCbb = comboBoxes.Last().Height;
|
|
||||||
int rightCbb = comboBoxes.Last().Right;
|
int rightCbb = comboBoxes.Last().Right;
|
||||||
|
|
||||||
// Hiển thị các controls số bản ghi và checkbox
|
// Hiển thị các controls số bản ghi và checkbox
|
||||||
ShowPrintControls(lastCbb + heightCbb + 20);
|
ShowPrintControls(10);
|
||||||
|
|
||||||
// Tạo nút Generate ở vị trí dưới các controls mới
|
// Tạo nút Generate ở vị trí dưới các controls mới
|
||||||
Button btGenerate = new Button();
|
Button btGenerate = new Button();
|
||||||
btGenerate.Location = new Point(rightCbb, lastCbb + heightCbb + 60); // Tăng khoảng cách để chừa chỗ cho controls mới
|
btGenerate.Location = new Point(rightCbb + 20, 70); // Tăng khoảng cách để chừa chỗ cho controls mới
|
||||||
btGenerate.Size = new Size(182, 33);
|
btGenerate.Size = new Size(200, 40);
|
||||||
btGenerate.Text = "Generate";
|
btGenerate.Text = "📝 Tạo Files";
|
||||||
|
btGenerate.UseVisualStyleBackColor = false;
|
||||||
|
btGenerate.BackColor = Color.FromArgb(220, 53, 69);
|
||||||
|
btGenerate.ForeColor = Color.White;
|
||||||
|
btGenerate.FlatStyle = FlatStyle.Flat;
|
||||||
|
btGenerate.FlatAppearance.BorderSize = 0;
|
||||||
|
btGenerate.Font = new System.Drawing.Font("Segoe UI", 11F, FontStyle.Bold, GraphicsUnit.Point);
|
||||||
|
btGenerate.Cursor = Cursors.Hand;
|
||||||
btGenerate.Click += btnGenClick;
|
btGenerate.Click += btnGenClick;
|
||||||
|
|
||||||
|
btGenerate.MouseEnter += (s, e) =>
|
||||||
|
{
|
||||||
|
btGenerate.BackColor = Color.FromArgb(200, 35, 50);
|
||||||
|
btGenerate.Size = new Size(205, 40);
|
||||||
|
};
|
||||||
|
|
||||||
|
btGenerate.MouseLeave += (s, e) =>
|
||||||
|
{
|
||||||
|
btGenerate.BackColor = Color.FromArgb(220, 53, 69);
|
||||||
|
btGenerate.Size = new Size(200, 40);
|
||||||
|
};
|
||||||
|
|
||||||
buttons.Add(btGenerate);
|
buttons.Add(btGenerate);
|
||||||
tabPage2.Controls.Add(btGenerate);
|
panelop.Controls.Add(btGenerate);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
@ -486,7 +529,7 @@ namespace QuizMaster
|
|||||||
|
|
||||||
if (string.IsNullOrWhiteSpace(filePath) || !File.Exists(filePath))
|
if (string.IsNullOrWhiteSpace(filePath) || !File.Exists(filePath))
|
||||||
{
|
{
|
||||||
MessageBox.Show("Vui lòng nhấn open và chọn file Excel trước.", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
MessageBox.Show("Vui lòng nhấn nút 'Chọn File' và chọn file Excel trước.", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -640,10 +683,10 @@ namespace QuizMaster
|
|||||||
private async Task GenerateSingleQuiz(Dictionary<string, string> lstCategory)
|
private async Task GenerateSingleQuiz(Dictionary<string, string> lstCategory)
|
||||||
{
|
{
|
||||||
string randomCode = Rng.Next(100, 999).ToString();
|
string randomCode = Rng.Next(100, 999).ToString();
|
||||||
|
|
||||||
int number = 1;
|
int number = 1;
|
||||||
StringBuilder result = new StringBuilder();
|
StringBuilder result = new StringBuilder();
|
||||||
|
|
||||||
result.AppendLine($"Mã đề: {randomCode}");
|
result.AppendLine($"Mã đề: {randomCode}");
|
||||||
result.AppendLine();
|
result.AppendLine();
|
||||||
|
|
||||||
@ -768,10 +811,10 @@ namespace QuizMaster
|
|||||||
private string CreateQuizContent(List<dynamic> questionsData, bool includeAnswers, string randomCode)
|
private string CreateQuizContent(List<dynamic> questionsData, bool includeAnswers, string randomCode)
|
||||||
{
|
{
|
||||||
StringBuilder result = new StringBuilder();
|
StringBuilder result = new StringBuilder();
|
||||||
|
|
||||||
result.AppendLine($"Mã đề: {randomCode}");
|
result.AppendLine($"Mã đề: {randomCode}");
|
||||||
result.AppendLine();
|
result.AppendLine();
|
||||||
|
|
||||||
int questionNumber = 1;
|
int questionNumber = 1;
|
||||||
|
|
||||||
foreach (dynamic question in questionsData)
|
foreach (dynamic question in questionsData)
|
||||||
@ -863,11 +906,11 @@ namespace QuizMaster
|
|||||||
string title = "ĐỀ TRẮC NGHIỆM";
|
string title = "ĐỀ TRẮC NGHIỆM";
|
||||||
var titleParagraph = doc.InsertParagraph(title);
|
var titleParagraph = doc.InsertParagraph(title);
|
||||||
titleParagraph.FontSize(16).Bold().Alignment = Alignment.center;
|
titleParagraph.FontSize(16).Bold().Alignment = Alignment.center;
|
||||||
|
|
||||||
var codeParagraph = doc.InsertParagraph($"Mã đề: {randomCode}");
|
var codeParagraph = doc.InsertParagraph($"Mã đề: {randomCode}");
|
||||||
codeParagraph.FontSize(14).Bold().Alignment = Alignment.center;
|
codeParagraph.FontSize(14).Bold().Alignment = Alignment.center;
|
||||||
|
|
||||||
string hoTen = "Họ và tên: " + new string('.', 106) ;
|
string hoTen = "Họ và tên: " + new string('.', 106);
|
||||||
string sdt = "Số điện thoại: " + new string('.', 100);
|
string sdt = "Số điện thoại: " + new string('.', 100);
|
||||||
string email = "Email: " + new string('.', 113);
|
string email = "Email: " + new string('.', 113);
|
||||||
|
|
||||||
@ -910,7 +953,7 @@ namespace QuizMaster
|
|||||||
{
|
{
|
||||||
var questionParagraph = doc.InsertParagraph($"Câu {questionNumber}: {question.Question}");
|
var questionParagraph = doc.InsertParagraph($"Câu {questionNumber}: {question.Question}");
|
||||||
questionParagraph.FontSize(12).Bold();
|
questionParagraph.FontSize(12).Bold();
|
||||||
questionParagraph.SpacingAfter(12);
|
questionParagraph.SpacingAfter(12);
|
||||||
|
|
||||||
char optionLabel = 'A';
|
char optionLabel = 'A';
|
||||||
string correctAnswer = "";
|
string correctAnswer = "";
|
||||||
@ -924,8 +967,8 @@ namespace QuizMaster
|
|||||||
string label = $"{optionLabel}.";
|
string label = $"{optionLabel}.";
|
||||||
string text = " " + option.Text;
|
string text = " " + option.Text;
|
||||||
|
|
||||||
optionParagraph.Append(label).Bold();
|
optionParagraph.Append(label).Bold();
|
||||||
optionParagraph.Append(text);
|
optionParagraph.Append(text);
|
||||||
optionParagraph.FontSize(11);
|
optionParagraph.FontSize(11);
|
||||||
optionParagraph.SpacingAfter(6);
|
optionParagraph.SpacingAfter(6);
|
||||||
|
|
||||||
@ -936,7 +979,7 @@ namespace QuizMaster
|
|||||||
questionNumber++;
|
questionNumber++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
string end = new string('_', 20) + " Hết" + new string('_', 20);
|
string end = new string('_', 20) + "Hết" + new string('_', 20);
|
||||||
doc.InsertParagraph(end).FontSize(12).Bold().SpacingAfter(6).SpacingBefore(18).Alignment = Alignment.center;
|
doc.InsertParagraph(end).FontSize(12).Bold().SpacingAfter(6).SpacingBefore(18).Alignment = Alignment.center;
|
||||||
doc.Save();
|
doc.Save();
|
||||||
}
|
}
|
||||||
@ -950,7 +993,7 @@ namespace QuizMaster
|
|||||||
string title = "ĐỀ TRẮC NGHIỆM (CÓ ĐÁP ÁN)";
|
string title = "ĐỀ TRẮC NGHIỆM (CÓ ĐÁP ÁN)";
|
||||||
var titleParagraph = doc.InsertParagraph(title);
|
var titleParagraph = doc.InsertParagraph(title);
|
||||||
titleParagraph.FontSize(16).Bold().Alignment = Alignment.center;
|
titleParagraph.FontSize(16).Bold().Alignment = Alignment.center;
|
||||||
|
|
||||||
var codeParagraph = doc.InsertParagraph($"Mã đề: {randomCode}");
|
var codeParagraph = doc.InsertParagraph($"Mã đề: {randomCode}");
|
||||||
codeParagraph.FontSize(14).Bold().Alignment = Alignment.center;
|
codeParagraph.FontSize(14).Bold().Alignment = Alignment.center;
|
||||||
|
|
||||||
@ -985,11 +1028,11 @@ namespace QuizMaster
|
|||||||
string displayLabel = option.IsCorrect ? $"{optionLabel}.*" : $"{optionLabel}.";
|
string displayLabel = option.IsCorrect ? $"{optionLabel}.*" : $"{optionLabel}.";
|
||||||
|
|
||||||
var optionParagraph = doc.InsertParagraph();
|
var optionParagraph = doc.InsertParagraph();
|
||||||
string label = displayLabel;
|
string label = displayLabel;
|
||||||
string text = " " + option.Text;
|
string text = " " + option.Text;
|
||||||
|
|
||||||
optionParagraph.Append(label).Bold();
|
optionParagraph.Append(label).Bold();
|
||||||
optionParagraph.Append(text);
|
optionParagraph.Append(text);
|
||||||
optionParagraph.FontSize(11);
|
optionParagraph.FontSize(11);
|
||||||
optionParagraph.SpacingAfter(6);
|
optionParagraph.SpacingAfter(6);
|
||||||
|
|
||||||
@ -999,7 +1042,7 @@ namespace QuizMaster
|
|||||||
questionNumber++;
|
questionNumber++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
string end = new string('_', 20) + " Hết" + new string('_', 20);
|
string end = new string('_', 20) + "Hết" + new string('_', 20);
|
||||||
doc.InsertParagraph(end).FontSize(12).Bold().SpacingAfter(6).SpacingBefore(18).Alignment = Alignment.center;
|
doc.InsertParagraph(end).FontSize(12).Bold().SpacingAfter(6).SpacingBefore(18).Alignment = Alignment.center;
|
||||||
doc.Save();
|
doc.Save();
|
||||||
}
|
}
|
||||||
@ -1010,11 +1053,13 @@ namespace QuizMaster
|
|||||||
lblNumberOfCopies.Location = new Point(pointX, yPosition);
|
lblNumberOfCopies.Location = new Point(pointX, yPosition);
|
||||||
lblNumberOfCopies.Visible = true;
|
lblNumberOfCopies.Visible = true;
|
||||||
|
|
||||||
txtNumberOfCopies.Location = new Point(pointX + 100, yPosition - 3);
|
txtNumberOfCopies.Location = new Point(pointX + 150, yPosition - 3);
|
||||||
txtNumberOfCopies.Visible = true;
|
txtNumberOfCopies.Visible = true;
|
||||||
|
|
||||||
chkIncludeAnswers.Location = new Point(pointX + 220, yPosition);
|
chkIncludeAnswers.Location = new Point(pointX + 290, yPosition);
|
||||||
chkIncludeAnswers.Visible = true;
|
chkIncludeAnswers.Visible = true;
|
||||||
|
|
||||||
|
panelop.Visible = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void HidePrintControls()
|
private void HidePrintControls()
|
||||||
@ -1022,6 +1067,46 @@ namespace QuizMaster
|
|||||||
lblNumberOfCopies.Visible = false;
|
lblNumberOfCopies.Visible = false;
|
||||||
txtNumberOfCopies.Visible = false;
|
txtNumberOfCopies.Visible = false;
|
||||||
chkIncludeAnswers.Visible = false;
|
chkIncludeAnswers.Visible = false;
|
||||||
|
panelop.Visible= false;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void AddButtonHoverEffects()
|
||||||
|
{
|
||||||
|
// Thêm hiệu ứng hover cho button1 (Download)
|
||||||
|
button1.MouseEnter += (s, e) =>
|
||||||
|
{
|
||||||
|
button1.BackColor = Color.FromArgb(95, 103, 110);
|
||||||
|
button1.Size = new Size(191, 40);
|
||||||
|
};
|
||||||
|
button1.MouseLeave += (s, e) =>
|
||||||
|
{
|
||||||
|
button1.BackColor = Color.FromArgb(108, 117, 125);
|
||||||
|
button1.Size = new Size(186, 40);
|
||||||
|
};
|
||||||
|
|
||||||
|
// Thêm hiệu ứng hover cho BtnOpen
|
||||||
|
BtnOpen.MouseEnter += (s, e) =>
|
||||||
|
{
|
||||||
|
BtnOpen.BackColor = Color.FromArgb(0, 86, 179);
|
||||||
|
BtnOpen.Size = new Size(156, 34);
|
||||||
|
};
|
||||||
|
BtnOpen.MouseLeave += (s, e) =>
|
||||||
|
{
|
||||||
|
BtnOpen.BackColor = Color.FromArgb(0, 123, 255);
|
||||||
|
BtnOpen.Size = new Size(151, 34);
|
||||||
|
};
|
||||||
|
|
||||||
|
// Thêm hiệu ứng hover cho btnUpload
|
||||||
|
btnUpload.MouseEnter += (s, e) =>
|
||||||
|
{
|
||||||
|
btnUpload.BackColor = Color.FromArgb(30, 126, 52);
|
||||||
|
btnUpload.Size = new Size(155, 34);
|
||||||
|
};
|
||||||
|
btnUpload.MouseLeave += (s, e) =>
|
||||||
|
{
|
||||||
|
btnUpload.BackColor = Color.FromArgb(40, 167, 69);
|
||||||
|
btnUpload.Size = new Size(150, 34);
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -17,7 +17,6 @@ namespace QuizMaster
|
|||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
_content = content;
|
_content = content;
|
||||||
txtResult.Text = content;
|
txtResult.Text = content;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void btnExportWord_Click(object sender, EventArgs e)
|
private void btnExportWord_Click(object sender, EventArgs e)
|
||||||
@ -103,8 +102,6 @@ namespace QuizMaster
|
|||||||
else if (trimmedLine.Length > 2 && trimmedLine[1] == '.')
|
else if (trimmedLine.Length > 2 && trimmedLine[1] == '.')
|
||||||
{
|
{
|
||||||
paragraph = doc.InsertParagraph();
|
paragraph = doc.InsertParagraph();
|
||||||
|
|
||||||
|
|
||||||
string label = trimmedLine.Substring(0, 2);
|
string label = trimmedLine.Substring(0, 2);
|
||||||
string text = trimmedLine.Substring(2).Trim();
|
string text = trimmedLine.Substring(2).Trim();
|
||||||
|
|
||||||
@ -118,11 +115,9 @@ namespace QuizMaster
|
|||||||
paragraph = doc.InsertParagraph(trimmedLine);
|
paragraph = doc.InsertParagraph(trimmedLine);
|
||||||
paragraph.FontSize(11);
|
paragraph.FontSize(11);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
string end = new string('_', 20) + " Hết" + new string('_', 20);
|
string end = new string('_', 20) + "Hết" + new string('_', 20);
|
||||||
doc.InsertParagraph(end).Bold().FontSize(12).SpacingAfter(6).SpacingBefore(18).Alignment = Alignment.center;
|
doc.InsertParagraph(end).Bold().FontSize(12).SpacingAfter(6).SpacingBefore(18).Alignment = Alignment.center;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Binary file not shown.
Loading…
Reference in New Issue
Block a user