Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Пантелеева_БСТ1904.docx
Скачиваний:
11
Добавлен:
04.03.2022
Размер:
16.2 Mб
Скачать

7 Структурная схема

Построим структурную схему программного продукта и представим ее на рисунке 1.

Рисунок 1 – Структурная схема

8 Код программы

TestProject.dll

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using System.Threading.Tasks;

using System.Windows.Forms;

using Microsoft.Office.Interop.Word;

using Microsoft.Office.Interop.Excel;

namespace TestProject

{

public class Test

{

public static int n { get; set; }

public static int m { get; set; }

public static string[] mass { get; set; } = new string[16];

public static void Question1(System.Windows.Forms.TextBox t, System.Windows.Forms.TextBox box)

{

if ((t.Text == "творчеству") && (box.Text == "деятельности"))

{

MessageBox.Show("Вы ответили правильно");

n++;

mass[0] = "правильно";

}

else

{

MessageBox.Show("Вы ответили неправильно");

mass[0] = "не правильно";

}

}

public static void Question2(System.Windows.Forms.TextBox t)

{

if ((t.Text == "квартира"))

{

MessageBox.Show("Вы ответили правильно");

n++;

mass[1] = "правильно";

}

else

{

MessageBox.Show("Вы ответили неправильно");

mass[1] = "не правильно";

}

}

public static void Question3(System.Windows.Forms.CheckBox box1, System.Windows.Forms.CheckBox box2, System.Windows.Forms.CheckBox check, System.Windows.Forms.CheckBox box3, System.Windows.Forms.CheckBox box4)

{

if ((box1.Checked) && (!box2.Checked) && (check.Checked) && (!box3.Checked) && (!box4.Checked))

{

n++;

MessageBox.Show("Вы ответили правильно");

mass[2] = "правильно";

}

else

{

MessageBox.Show("Вы ответили неправильно");

mass[2] = "не правильно";

}

}

public static void Question4(System.Windows.Forms.CheckBox box1, System.Windows.Forms.CheckBox box2, System.Windows.Forms.CheckBox box3, System.Windows.Forms.CheckBox box4, System.Windows.Forms.CheckBox box5)

{

if ((box1.Checked) && (!box2.Checked) && (!box3.Checked) && (box4.Checked) && (box5.Checked))

{

n++;

mass[3] = "правильно";

MessageBox.Show("Вы ответили правильно");

}

else

{

mass[3] = "не правильно";

MessageBox.Show("Вы ответили неправильно");

}

}

public static void Qestion5(RadioButton button1, RadioButton button2, RadioButton button3, RadioButton button4, RadioButton button5)

{

if ((!button1.Checked) && (!button2.Checked) && (button3.Checked) && (!button4.Checked) && (!button5.Checked))

{

n++;

mass[4] = "правильно";

MessageBox.Show("Вы ответили правильно");

}

else

{

mass[4] = "не правильно";

MessageBox.Show("Вы ответили неправильно");

}

}

public static void Question6(RadioButton button1, RadioButton button2, RadioButton button3, RadioButton button4, RadioButton button5)

{

if ((button1.Checked) && (!button2.Checked) && (!button3.Checked) && (!button4.Checked) && (!button5.Checked))

{

n++;

mass[5] = "правильно";

MessageBox.Show("Вы ответили правильно");

}

else

{

mass[5] = "не правильно";

MessageBox.Show("Вы ответили неправильно");

}

}

public static void Qestion71but(System.Windows.Forms.ListBox box1, System.Windows.Forms.ListBox box2)

{

if (box1.SelectedIndex == 0)

{

box2.Items.Add(box1.Text);

box2.Text = Convert.ToString(box1.SelectedIndex);

box1.Items.RemoveAt(0);

}

else

if (box1.SelectedIndex == 1)

{

box2.Items.Add(box1.Text);

box2.Text = Convert.ToString(box1.SelectedIndex);

box1.Items.RemoveAt(1);

}

else

if (box1.SelectedIndex == 2)

{

box2.Items.Add(box1.Text);

box2.Text = Convert.ToString(box1.SelectedIndex);

box1.Items.RemoveAt(2);

}

else

if (box1.SelectedIndex == 3)

{

box2.Items.Add(box1.Text);

box2.Text = Convert.ToString(box1.SelectedIndex);

box1.Items.RemoveAt(3);

}

}

public static void Qestion72but(System.Windows.Forms.ListBox box1, System.Windows.Forms.ListBox box3)

{

if (box1.SelectedIndex == 0)

{

box3.Items.Add(box1.Text);

box3.Text = Convert.ToString(box1.SelectedIndex);

box1.Items.RemoveAt(0);

}

else

if (box1.SelectedIndex == 1)

{

box3.Items.Add(box1.Text);

box3.Text = Convert.ToString(box1.SelectedIndex);

box1.Items.RemoveAt(1);

}

else

if (box1.SelectedIndex == 2)

{

box3.Items.Add(box1.Text);

box3.Text = Convert.ToString(box1.SelectedIndex);

box1.Items.RemoveAt(2);

}

else

if (box1.SelectedIndex == 3)

{

box3.Items.Add(box1.Text);

box3.Text = Convert.ToString(box1.SelectedIndex);

box1.Items.RemoveAt(3);

}

}

public static void Qestion73but(System.Windows.Forms.ListBox box1, System.Windows.Forms.ListBox box4)

{

if (box1.SelectedIndex == 0)

{

box4.Items.Add(box1.Text);

box4.Text = Convert.ToString(box1.SelectedIndex);

box1.Items.RemoveAt(0);

}

else

if (box1.SelectedIndex == 1)

{

box4.Items.Add(box1.Text);

box4.Text = Convert.ToString(box1.SelectedIndex);

box1.Items.RemoveAt(1);

}

else

if (box1.SelectedIndex == 2)

{

box4.Items.Add(box1.Text);

box4.Text = Convert.ToString(box1.SelectedIndex);

box1.Items.RemoveAt(2);

}

else

if (box1.SelectedIndex == 3)

{

box4.Items.Add(box1.Text);

box4.Text = Convert.ToString(box1.SelectedIndex);

box1.Items.RemoveAt(3);

}

}

public static void Qestion74but(System.Windows.Forms.ListBox box1, System.Windows.Forms.ListBox box5)

{

if (box1.SelectedIndex == 0)

{

box5.Items.Add(box1.Text);

box5.Text = Convert.ToString(box1.SelectedIndex);

box1.Items.RemoveAt(0);

}

else

if (box1.SelectedIndex == 1)

{

box5.Items.Add(box1.Text);

box5.Text = Convert.ToString(box1.SelectedIndex);

box1.Items.RemoveAt(1);

}

else

if (box1.SelectedIndex == 2)

{

box5.Items.Add(box1.Text);

box5.Text = Convert.ToString(box1.SelectedIndex);

box1.Items.RemoveAt(2);

}

else

if (box1.SelectedIndex == 3)

{

box5.Items.Add(box1.Text);

box5.Text = Convert.ToString(box1.SelectedIndex);

box1.Items.RemoveAt(3);

}

}

public static void Question7prod(System.Windows.Forms.ListBox box2, System.Windows.Forms.ListBox box3, System.Windows.Forms.ListBox box4, System.Windows.Forms.ListBox box5)

{

if ((box2.Items[0] == "способность человека к творчеству, олицетворяет творческие способности человека, проявляющиеся в мышлении, общении, чувствах, отдельных видах деятельности и характеризующие личность в целом или ее отдельные стороны.") && (box3.Items[0] == "сниженная способность адаптироваться к изменяющимся условиям среды, проявляющаяся в затруднении к перестройке намеченных целей или программы поведения в соответствии с новыми ситуационными требованиями.") && (box4.Items[0] == "эмоциональный отклик человека на переживания других людей.") && (box5.Items[0] == "непосредственное постижение истины без логического обоснования, основанное на предшествующем опыте; чутье, проницательность."))

{

n++;

mass[6] = "правильно";

MessageBox.Show("Вы ответили правильно");

}

else

{

mass[6] = "не правильно";

MessageBox.Show("Вы ответили неправильно");

}

}

public static void Qestion81but(System.Windows.Forms.ListBox box1, System.Windows.Forms.ListBox box2)

{

if (box1.SelectedIndex == 0)

{

box2.Items.Add(box1.Text);

box2.Text = Convert.ToString(box1.SelectedIndex);

box1.Items.RemoveAt(0);

}

else

if (box1.SelectedIndex == 1)

{

box2.Items.Add(box1.Text);

box2.Text = Convert.ToString(box1.SelectedIndex);

box1.Items.RemoveAt(1);

}

else

if (box1.SelectedIndex == 2)

{

box2.Items.Add(box1.Text);

box2.Text = Convert.ToString(box1.SelectedIndex);

box1.Items.RemoveAt(2);

}

else

if (box1.SelectedIndex == 3)

{

box2.Items.Add(box1.Text);

box2.Text = Convert.ToString(box1.SelectedIndex);

box1.Items.RemoveAt(3);

}

}

public static void Qestion82but(System.Windows.Forms.ListBox box1, System.Windows.Forms.ListBox box3)

{

if (box1.SelectedIndex == 0)

{

box3.Items.Add(box1.Text);

box3.Text = Convert.ToString(box1.SelectedIndex);

box1.Items.RemoveAt(0);

}

else

if (box1.SelectedIndex == 1)

{

box3.Items.Add(box1.Text);

box3.Text = Convert.ToString(box1.SelectedIndex);

box1.Items.RemoveAt(1);

}

else

if (box1.SelectedIndex == 2)

{

box3.Items.Add(box1.Text);

box3.Text = Convert.ToString(box1.SelectedIndex);

box1.Items.RemoveAt(2);

}

else

if (box1.SelectedIndex == 3)

{

box3.Items.Add(box1.Text);

box3.Text = Convert.ToString(box1.SelectedIndex);

box1.Items.RemoveAt(3);

}

}

public static void Qestion83but(System.Windows.Forms.ListBox box1, System.Windows.Forms.ListBox box4)

{

if (box1.SelectedIndex == 0)

{

box4.Items.Add(box1.Text);

box4.Text = Convert.ToString(box1.SelectedIndex);

box1.Items.RemoveAt(0);

}

else

if (box1.SelectedIndex == 1)

{

box4.Items.Add(box1.Text);

box4.Text = Convert.ToString(box1.SelectedIndex);

box1.Items.RemoveAt(1);

}

else

if (box1.SelectedIndex == 2)

{

box4.Items.Add(box1.Text);

box4.Text = Convert.ToString(box1.SelectedIndex);

box1.Items.RemoveAt(2);

}

else

if (box1.SelectedIndex == 3)

{

box4.Items.Add(box1.Text);

box4.Text = Convert.ToString(box1.SelectedIndex);

box1.Items.RemoveAt(3);

}

}

public static void Qestion84but(System.Windows.Forms.ListBox box1, System.Windows.Forms.ListBox box5)

{

if (box1.SelectedIndex == 0)

{

box5.Items.Add(box1.Text);

box5.Text = Convert.ToString(box1.SelectedIndex);

box1.Items.RemoveAt(0);

}

else

if (box1.SelectedIndex == 1)

{

box5.Items.Add(box1.Text);

box5.Text = Convert.ToString(box1.SelectedIndex);

box1.Items.RemoveAt(1);

}

else

if (box1.SelectedIndex == 2)

{

box5.Items.Add(box1.Text);

box5.Text = Convert.ToString(box1.SelectedIndex);

box1.Items.RemoveAt(2);

}

else

if (box1.SelectedIndex == 3)

{

box5.Items.Add(box1.Text);

box5.Text = Convert.ToString(box1.SelectedIndex);

box1.Items.RemoveAt(3);

}

}

public static void Question8prod(System.Windows.Forms.ListBox box2, System.Windows.Forms.ListBox box3, System.Windows.Forms.ListBox box4, System.Windows.Forms.ListBox box5)

{

if ((box2.Items[0] == "стала настоящей акробаткой") && (box3.Items[0] == "выучил французский язык") && (box4.Items[0] == "научился играть на флейте") && (box5.Items[0] == "научилась играть на арфе"))

{

n++;

mass[7] = "правильно";

MessageBox.Show("Вы ответили правильно");

}

else

{

mass[7] = "не правильно";

MessageBox.Show("Вы ответили неправильно");

}

}

public static void Question9(ComboBox box1)

{

if (box1.SelectedIndex == 0)

{

n++;

mass[8] = "правильно";

MessageBox.Show("Вы ответили правильно");

}

else

{

mass[8] = "не правильно";

MessageBox.Show("Вы ответили неправильно");

}

}

public static void Question10(ComboBox box1)

{

if (box1.SelectedIndex == 1)

{

n++;

mass[9] = "правильно";

MessageBox.Show("Вы ответили правильно");

}

else

{

mass[9] = "не правильно";

MessageBox.Show("Вы ответили неправильно");

}

}

public static void Question11(System.Windows.Forms.Label l, TrackBar bar1)

{

if (bar1.Value == 1)

{

n++;

mass[10] = "правильно";

MessageBox.Show("Вы ответили правильно");

}

else

{

mass[10] = "не правильно";

MessageBox.Show("Вы ответили неправильно");

}

}

public static void Question12(System.Windows.Forms.Label l, TrackBar bar1)

{

if (bar1.Value == 2)

{

n++;

mass[11] = "правильно";

MessageBox.Show("Вы ответили правильно");

}

else

{

mass[11] = "не правильно";

MessageBox.Show("Вы ответили неправильно");

}

}

public static void Question13(System.Windows.Forms.Label l,HScrollBar bar1)

{

if (bar1.Value == 4)

{

n++;

mass[12] = "правильно";

MessageBox.Show("Вы ответили правильно");

}

else

{

mass[12] = "не правильно";

MessageBox.Show("Вы ответили неправильно");

}

}

public static void Question14(System.Windows.Forms.Label l, HScrollBar bar1)

{

if (bar1.Value == 3)

{

n++;

mass[13] = "правильно";

MessageBox.Show("Вы ответили правильно");

}

else

{

mass[13] = "не правильно";

MessageBox.Show("Вы ответили неправильно");

}

}

public static void Question15(CheckedListBox box1)

{

if ((box1.CheckedItems.Count == 3) && (box1.CheckedItems.Contains(1) && box1.CheckedItems.Contains(2) && box1.CheckedItems.Contains(4)))

{

n++;

mass[14] = "правильно";

MessageBox.Show("Вы ответили правильно");

}

else

{

mass[14] = "не правильно";

MessageBox.Show("Вы ответили неправильно");

}

}

public static void Question16(CheckedListBox box1)

{

if ((box1.CheckedItems.Count == 2) && (box1.CheckedItems.Contains(1) && box1.CheckedItems.Contains(2)))

{

n++;

mass[15] = "правильно";

MessageBox.Show("Вы ответили правильно");

}

else

{

mass[15] = "не правильно";

MessageBox.Show("Вы ответили неправильно");

}

}

public static void Result(System.Windows.Forms.Label l)

{

l.Text = ("Ваш рузультат:" + n + "/16");

}

public static void ZapisWord()

{

Microsoft.Office.Interop.Word.Application application = new Microsoft.Office.Interop.Word.Application();

application.Visible = true;

var type = Type.Missing;

var doc = application.Documents.Add(type, type, type, type);

application.Selection.TypeText("Результаты тестирования");

object tableBehavior = Microsoft.Office.Interop.Word.WdDefaultTableBehavior.wdWord9TableBehavior;

object autoFitBehavior = Microsoft.Office.Interop.Word.WdAutoFitBehavior.wdAutoFitContent;

Microsoft.Office.Interop.Word.Table table = application.ActiveDocument.Tables.Add(application.Selection.Range, 2, 16, tableBehavior, autoFitBehavior);

for (int i = 0; i < 16; i++)

{

table.Cell(1, i + 1).Range.InsertAfter( " " + (i + 1) + " ");

table.Cell(2, i + 1).Range.InsertAfter(mass[i]);

}

}

public static void ZapisExel()

{

Microsoft.Office.Interop.Excel.Application exelApp = new Microsoft.Office.Interop.Excel.Application();

Microsoft.Office.Interop.Excel.Workbook workBook;

Microsoft.Office.Interop.Excel.Worksheet workSheet;

workBook = exelApp.Workbooks.Add();

workSheet = (Microsoft.Office.Interop.Excel.Worksheet)workBook.Worksheets.get_Item(1);

workSheet.Name = "Результаты тестирования";

for (int i = 0; i < 16; i++)

{

workSheet.Cells[i + 1, 1] = i + 1;

workSheet.Cells[i + 1, 2] = mass[i];

}

Microsoft.Office.Interop.Excel.Range range1 = workSheet.Range[workSheet.Cells[1, 1], workSheet.Cells[16, 2]];

range1.Cells.Font.Name = "Times New Roman";

range1.Cells.Font.Size = 15;

Microsoft.Office.Interop.Excel.Range range2 = workSheet.Range[workSheet.Cells[1, 1], workSheet.Cells[16, 2]];

range2.Cells.Columns.AutoFit();

range2.Borders.get_Item(Microsoft.Office.Interop.Excel.XlBordersIndex.xlEdgeBottom).LineStyle = Microsoft.Office.Interop.Excel.XlLineStyle.xlContinuous;

range2.Borders.get_Item(Microsoft.Office.Interop.Excel.XlBordersIndex.xlEdgeRight).LineStyle = Microsoft.Office.Interop.Excel.XlLineStyle.xlContinuous;

range2.Borders.get_Item(Microsoft.Office.Interop.Excel.XlBordersIndex.xlInsideHorizontal).LineStyle = Microsoft.Office.Interop.Excel.XlLineStyle.xlContinuous;

range2.Borders.get_Item(Microsoft.Office.Interop.Excel.XlBordersIndex.xlInsideVertical).LineStyle = Microsoft.Office.Interop.Excel.XlLineStyle.xlContinuous;

range2.Borders.get_Item(Microsoft.Office.Interop.Excel.XlBordersIndex.xlEdgeTop).LineStyle = Microsoft.Office.Interop.Excel.XlLineStyle.xlContinuous;

workSheet.Range[("C1")].Select();

exelApp.Visible = true;

exelApp.UserControl = true;

}

}

}

Form1.cs

using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Linq;

using System.Text;

using System.Threading.Tasks;

using System.Windows.Forms;

namespace _3semectr

{

public partial class Form1 : Form

{

public Form1()

{

InitializeComponent();

}

private void button1_Click(object sender, EventArgs e)

{

Form2 f = new Form2();

this.Hide();

f.ShowDialog();

}

private void button2_Click(object sender, EventArgs e)

{

Form5 f = new Form5();

this.Hide();

f.ShowDialog();

}

private void button3_Click(object sender, EventArgs e)

{

Form6 f = new Form6();

this.Hide();

f.ShowDialog();

}

private void button4_Click(object sender, EventArgs e)

{

Form23 f = new Form23();

this.Hide();

f.ShowDialog();

}

private void button5_Click(object sender, EventArgs e)

{

Form26 f = new Form26();

this.Hide();

f.ShowDialog();

}

}

}

Form11.cs

using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Linq;

using System.Text;

using System.Threading.Tasks;

using System.Windows.Forms;

namespace Второй_курс

{

public partial class Form11 : Form

{

public Form11()

{

InitializeComponent();

}

private void timer1_Tick(object sender, EventArgs e)

{

progressBar1.Maximum = 1000;

progressBar1.Value = 0;

for (int i=0;i<=progressBar1.Maximum-1;i++)

{

progressBar1.Increment(1);

label1.Text = progressBar1.Value.ToString();

label1.Refresh();

}

if (progressBar1.Value==progressBar1.Maximum)

{

timer1.Enabled = false;

Form7 f = new Form7();

this.Hide();

f.ShowDialog();

}

}

}

Form 7.cs

using System;

using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Linq;

using System.Text;

using System.Threading.Tasks;

using System.Windows.Forms;

namespace _3semectr

{

public partial class Form7 : Form

{

public Form7()

{

InitializeComponent();

openFileDialog1.Filter = "Text files(*.txt)|*.txt|All files(*.*)|*.*";

}

private void button1_Click(object sender, EventArgs e)

{

if (openFileDialog1.ShowDialog() == DialogResult.Cancel)

return;

string filename = openFileDialog1.FileName;

string fileText = System.IO.File.ReadAllText(filename);

textBox1.Text = fileText;

MessageBox.Show("Файл открыт");

}

private void textBox1_TextChanged(object sender, EventArgs e)

{

}

private void button2_Click(object sender, EventArgs e)

{

Form8 f = new Form8();

this.Hide();

f.ShowDialog();

}

}

}

Form 8.cs

using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Linq;

using System.Text;

using System.Threading.Tasks;

using System.Windows.Forms;

using TestProject;

namespace _3semectr

{

public partial class Form8 : Form

{

public Form8()

{

InitializeComponent();

}

private void button1_Click(object sender, EventArgs e)

{

if ((textBox1.Text == "") && (textBox2.Text == ""))

MessageBox.Show("Вы не ответили на вопрос", "", MessageBoxButtons.OK, MessageBoxIcon.Information);

else

{

Test.Question1(textBox1, textBox2);

Form9 f = new Form9();

this.Hide();

f.ShowDialog();

}

}

}

}

Form 9.cs

using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Linq;

using System.Text;

using System.Threading.Tasks;

using System.Windows.Forms;

namespace _3semectr

{

public partial class Form9 : Form

{

public Form9()

{

InitializeComponent();

}

private void button1_Click(object sender, EventArgs e)

{

if ((textBox1.Text == ""))

MessageBox.Show("Вы не ответили на вопрос", " ", MessageBoxButtons.OK, MessageBoxIcon.Information);

else

{

TestProject.Test.Question2(textBox1);

Form10 f = new Form10();

this.Hide();

f.ShowDialog();

}

}

}

}

Form 10.cs

using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Linq;

using System.Text;

using System.Threading.Tasks;

using System.Windows.Forms;

namespace _3semectr

{

public partial class Form10 : Form

{

public Form10()

{

InitializeComponent();

}

private void button1_Click(object sender, EventArgs e)

{

if ((!checkBox1.Checked) && (!checkBox2.Checked) && (!checkBox3.Checked) && (!checkBox3.Checked) && (!checkBox4.Checked))

MessageBox.Show("Вы не ответили на вопрос", "выберите формы эмпатии", MessageBoxButtons.OK, MessageBoxIcon.Information);

else

{

TestProject.Test.Question3(checkBox1, checkBox2, checkBox3, checkBox4, checkBox5);

Form11 f = new Form11();

this.Hide();

f.ShowDialog();

}

}

}

}

Form11.cs

using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Linq;

using System.Text;

using System.Threading.Tasks;

using System.Windows.Forms;

namespace _3semectr

{

public partial class Form11 : Form

{

public Form11()

{

InitializeComponent();

}

private void button1_Click(object sender, EventArgs e)

{

if ((!checkBox1.Checked) && (!checkBox2.Checked) && (!checkBox3.Checked) && (!checkBox4.Checked) && (!checkBox5.Checked))

MessageBox.Show("Вы не ответили на вопрос", "выберите, какую книгу написала Н.В.Рождественская", MessageBoxButtons.OK, MessageBoxIcon.Information);

else

{

TestProject.Test.Question4(checkBox1, checkBox2, checkBox3, checkBox4, checkBox5);

Form12 f = new Form12();

this.Hide();

f.ShowDialog();

}

}

private void checkBox5_CheckedChanged(object sender, EventArgs e)

{

}

}

}

Form12.cs

using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Linq;

using System.Text;

using System.Threading.Tasks;

using System.Windows.Forms;

namespace _3semectr

{

public partial class Form12 : Form

{

public Form12()

{

InitializeComponent();

}

private void button1_Click(object sender, EventArgs e)

{

if ((!radioButton1.Checked) && (!radioButton2.Checked) && (!radioButton3.Checked) && (!radioButton4.Checked) && (!radioButton5.Checked))

MessageBox.Show("Вы не ответили на вопрос", "Эмпатия - это...", MessageBoxButtons.OK, MessageBoxIcon.Information);

else

{

TestProject.Test.Qestion5(radioButton1, radioButton2, radioButton3, radioButton4, radioButton5);

Form13 f = new Form13();

this.Hide();

f.ShowDialog();

}

}

}

}

Form13.cs

using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Linq;

using System.Text;

using System.Threading.Tasks;

using System.Windows.Forms;

namespace _3semectr

{

public partial class Form13 : Form

{

public Form13()

{

InitializeComponent();

}

private void button1_Click_1(object sender, EventArgs e)

{

if ((!radioButton1.Checked) && (!radioButton2.Checked) && (!radioButton3.Checked) && (!radioButton4.Checked) && (!radioButton5.Checked))

MessageBox.Show("Вы не ответили на вопрос", "Талант актера опирается на ...", MessageBoxButtons.OK, MessageBoxIcon.Information);

else

{

TestProject.Test.Question6(radioButton1, radioButton2, radioButton3, radioButton4, radioButton5);

Form14 f = new Form14();

this.Hide();

f.ShowDialog();

}

}

}

}

Form14.cs

using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Linq;

using System.Text;

using System.Threading.Tasks;

using System.Windows.Forms;

namespace _3semectr

{

public partial class Form14 : Form

{

public Form14()

{

InitializeComponent();

}

private void button1_Click(object sender, EventArgs e)

{

TestProject.Test.Qestion71but(listBox1, listBox2);

}

private void Form14_Load_1(object sender, EventArgs e)

{

string[] a = new string[4];

a[0] = "способность человека к творчеству, олицетворяет творческие способности человека, проявляющиеся в мышлении, общении, чувствах, отдельных видах деятельности и характеризующие личность в целом или ее отдельные стороны.";

a[1] = "непосредственное постижение истины без логического обоснования, основанное на предшествующем опыте; чутье, проницательность.";

a[2] = "эмоциональный отклик человека на переживания других людей.";

a[3] = "сниженная способность адаптироваться к изменяющимся условиям среды, проявляющаяся в затруднении к перестройке намеченных целей или программы поведения в соответствии с новыми ситуационными требованиями.";

for (int i = 0; i < 4; i++)

listBox1.Items.Add(a[i]);

}

private void button2_Click_1(object sender, EventArgs e)

{

TestProject.Test.Qestion72but(listBox1, listBox3);

}

private void button3_Click_1(object sender, EventArgs e)

{

TestProject.Test.Qestion73but(listBox1, listBox4);

}

private void button4_Click_1(object sender, EventArgs e)

{

TestProject.Test.Qestion74but(listBox1, listBox5);

}

private void button5_Click_1(object sender, EventArgs e)

{

if ((listBox2.Text == "") && (listBox3.Text == "") && (listBox4.Text == "") && (listBox5.Text == ""))

MessageBox.Show("Вы не ответили на вопрос", "Эмпатия - это...", MessageBoxButtons.OK, MessageBoxIcon.Information);

else

{

TestProject.Test.Question7prod(listBox2, listBox3, listBox4, listBox5);

Form15 f = new Form15();

this.Hide();

f.ShowDialog();

}

}

}

}

Form15.cs

using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Linq;

using System.Text;

using System.Threading.Tasks;

using System.Windows.Forms;

namespace _3semectr

{

public partial class Form15 : Form

{

public Form15()

{

InitializeComponent();

}

private void Form15_Load(object sender, EventArgs e)

{

string[] a = new string[4];

a[0] = "стала настоящей акробаткой";

a[1] = "научился играть на флейте";

a[2] = "научилась играть на арфе";

a[3] = "выучил французский язык";

for (int i = 0; i < 4; i++)

listBox1.Items.Add(a[i]);

}

private void button1_Click(object sender, EventArgs e)

{

TestProject.Test.Qestion81but(listBox1, listBox2);

}

private void button2_Click_1(object sender, EventArgs e)

{

TestProject.Test.Qestion82but(listBox1, listBox3);

}

private void button3_Click_1(object sender, EventArgs e)

{

TestProject.Test.Qestion83but(listBox1, listBox4);

}

private void button4_Click_1(object sender, EventArgs e)

{

TestProject.Test.Qestion84but(listBox1, listBox5);

}

private void button5_Click_1(object sender, EventArgs e)

{

if ((listBox2.Text == "") && (listBox3.Text == "") && (listBox4.Text == "") && (listBox5.Text == ""))

MessageBox.Show("Вы не ответили на вопрос", "Эмпатия - это...", MessageBoxButtons.OK, MessageBoxIcon.Information);

else

{

TestProject.Test.Question8prod(listBox2, listBox3, listBox4, listBox5);

Form16 f = new Form16();

this.Hide();

f.ShowDialog();

}

}

}

}

Form16.cs

using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Linq;

using System.Text;

using System.Threading.Tasks;

using System.Windows.Forms;

namespace _3semectr

{

public partial class Form16 : Form

{

public Form16()

{

InitializeComponent();

}

private void button1_Click(object sender, EventArgs e)

{

if ((comboBox1.SelectedIndex == -1))

MessageBox.Show("Вы не ответили на вопрос", "Талант актера опирается на ...", MessageBoxButtons.OK, MessageBoxIcon.Information);

else

{

TestProject.Test.Question9(comboBox1);

Form17 f = new Form17();

this.Hide();

f.ShowDialog();

}

}

}

}

Form17.cs

using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Linq;

using System.Text;

using System.Threading.Tasks;

using System.Windows.Forms;

namespace _3semectr

{

public partial class Form17 : Form

{

public Form17()

{

InitializeComponent();

}

private void button1_Click(object sender, EventArgs e)

{

if ((comboBox1.SelectedIndex == -1))

MessageBox.Show("Вы не ответили на вопрос", "Талант актера опирается на ...", MessageBoxButtons.OK, MessageBoxIcon.Information);

else

{

TestProject.Test.Question10(comboBox1);

Form18 f = new Form18();

this.Hide();

f.ShowDialog();

}

}

}

}

Form18.cs

using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Linq;

using System.Text;

using System.Threading.Tasks;

using System.Windows.Forms;

namespace _3semectr

{

public partial class Form18 : Form

{

public Form18()

{

InitializeComponent();

}

private void Form18_Load(object sender, EventArgs e)

{

trackBar1.Maximum = 1;

trackBar1.Maximum = 6;

trackBar1.Value = 0;

trackBar1.LargeChange = 1;

}

private void button1_Click(object sender, EventArgs e)

{

if (label2.Text == "")

MessageBox.Show("Вы не ответили на вопрос", "Эмпатия - это...", MessageBoxButtons.OK, MessageBoxIcon.Information);

else

{

TestProject.Test.Question11(label2, trackBar1);

Form19 f = new Form19();

this.Hide();

f.ShowDialog();

}

}

private void trackBar1_Scroll(object sender, EventArgs e)

{

label2.Text = ("Ваш ответ:" + Convert.ToString(trackBar1.Value));

}

}

}

Form19.cs

using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Linq;

using System.Text;

using System.Threading.Tasks;

using System.Windows.Forms;

namespace _3semectr

{

public partial class Form19 : Form

{

public Form19()

{

InitializeComponent();

}

private void button1_Click(object sender, EventArgs e)

{

if (label2.Text == "")

MessageBox.Show("Вы не ответили на вопрос", "Эмпатия - это...", MessageBoxButtons.OK, MessageBoxIcon.Information);

else

{

TestProject.Test.Question12(label2, trackBar1);

Form20 f = new Form20();

this.Hide();

f.ShowDialog();

}

}

private void Form19_Load(object sender, EventArgs e)

{

trackBar1.Value = 0;

trackBar1.Maximum = 6;

trackBar1.Minimum = 1;

trackBar1.LargeChange = 1;

}

private void trackBar1_Scroll(object sender, EventArgs e)

{

label2.Text = ("Ваш ответ:" + Convert.ToString(trackBar1.Value));

}

}

}

Form20.cs

using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Linq;

using System.Text;

using System.Threading.Tasks;

using System.Windows.Forms;

namespace _3semectr

{

public partial class Form20 : Form

{

public Form20()

{

InitializeComponent();

}

private void button1_Click(object sender, EventArgs e)

{

if (label2.Text == "")

MessageBox.Show("Вы не ответили на вопрос", "Эмпатия - это...", MessageBoxButtons.OK, MessageBoxIcon.Information);

else

{

TestProject.Test.Question13(label2, hScrollBar1);

Form21 f = new Form21();

this.Hide();

f.ShowDialog();

}

}

private void hScrollBar1_Scroll(object sender, ScrollEventArgs e)

{

label2.Text = ("Ваш ответ:" + Convert.ToString(hScrollBar1.Value));

}

private void Form20_Load(object sender, EventArgs e)

{

hScrollBar1.Value = 0;

hScrollBar1.Maximum = 6;

hScrollBar1.Minimum = 1;

hScrollBar1.LargeChange = 1;

}

}

}

Form21.cs

using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Linq;

using System.Text;

using System.Threading.Tasks;

using System.Windows.Forms;

namespace _3semectr

{

public partial class Form21 : Form

{

public Form21()

{

InitializeComponent();

}

private void Form21_Load(object sender, EventArgs e)

{

hScrollBar1.Value = 0;

hScrollBar1.Maximum = 6;

hScrollBar1.Minimum = 1;

hScrollBar1.LargeChange = 1;

}

private void hScrollBar1_Scroll(object sender, ScrollEventArgs e)

{

label2.Text = ("Ваш ответ:" + Convert.ToString(hScrollBar1.Value));

}

private void button1_Click(object sender, EventArgs e)

{

if (label2.Text == "")

MessageBox.Show("Вы не ответили на вопрос", "Эмпатия - это...", MessageBoxButtons.OK, MessageBoxIcon.Information);

else

{

TestProject.Test.Question14(label2, hScrollBar1);

Form22 f = new Form22();

this.Hide();

f.ShowDialog();

}

}

}

}

Form22.cs

using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Linq;

using System.Text;

using System.Threading.Tasks;

using System.Windows.Forms;

namespace _3semectr

{

public partial class Form22 : Form

{

public Form22()

{

InitializeComponent();

}

private void checkedListBox1_SelectedIndexChanged(object sender, EventArgs e)

{

}

private void button1_Click(object sender, EventArgs e)

{

if (checkedListBox1.CheckedItems.Count == 0)

MessageBox.Show("Вы не ответили на вопрос", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Information);

else

{

TestProject.Test.Question15(checkedListBox1);

Form24 f = new Form24();

this.Hide();

f.ShowDialog();

}

}

}

}

Form23.cs

using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Linq;

using System.Text;

using System.Threading.Tasks;

using System.Windows.Forms;

namespace _3semectr

{

public partial class Form23 : Form

{

public Form23()

{

InitializeComponent();

}

private void timer1_Tick(object sender, EventArgs e)

{

progressBar1.Maximum = 1000;

progressBar1.Value = 0;

for (int i = 0; i <= progressBar1.Maximum - 1; i++)

{

progressBar1.Increment(1);

label1.Text = progressBar1.Value.ToString();

label1.Refresh();

}

if (progressBar1.Value == progressBar1.Maximum)

{

timer1.Enabled = false;

Form7 f = new Form7();

this.Hide();

f.ShowDialog();

}

}

}

}

Form24.cs

using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Linq;

using System.Text;

using System.Threading.Tasks;

using System.Windows.Forms;

namespace _3semectr

{

public partial class Form24 : Form

{

public Form24()

{

InitializeComponent();

}

private void button1_Click(object sender, EventArgs e)

{

if (checkedListBox1.CheckedItems.Count == 0)

MessageBox.Show("Вы не ответили на вопрос", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Information);

else

{

TestProject.Test.Question16(checkedListBox1);

Form25 f = new Form25();

this.Hide();

f.ShowDialog();

}

}

}

}

Form25.cs

using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Linq;

using System.Text;

using System.Threading.Tasks;

using System.Windows.Forms;

namespace _3semectr

{

public partial class Form25 : Form

{

public Form25()

{

InitializeComponent();

}

private void button1_Click(object sender, EventArgs e)

{

TestProject.Test.Result(label1);

}

private void button2_Click(object sender, EventArgs e)

{

Form1 f = new Form1();

this.Hide();

f.ShowDialog();

}

private void button3_Click(object sender, EventArgs e)

{

TestProject.Test.ZapisWord();

}

private void button4_Click(object sender, EventArgs e)

{

TestProject.Test.ZapisExel();

}

}

}

Соседние файлы в предмете Технологии программирования