-
Notifications
You must be signed in to change notification settings - Fork 0
/
Program.cs
55 lines (45 loc) · 1.83 KB
/
Program.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
// internal class Program
// {
// private static void Main(string[] args)
// {
// Console.Write($"Ismingizni kiriting -> ");
// string ism = Console.ReadLine();
// string text = System.IO.File.ReadAllText(@"/home/abdulaziz/Abdulaziz/dotNetLessons/Multiple-choice-quiz-app/Testlar.txt");
// Console.WriteLine();
// string [] savollar = text
// .Split('^', StringSplitOptions.RemoveEmptyEntries)
// .ToArray() ;
// for (var i = 0; i < savollar.Length; i++)
// {
// Random rd = new Random();
// int rand_num = rd.Next(0,savollar.Length);
// string[] testSavoliArray = savollar[rand_num]
// .Split('@', StringSplitOptions.RemoveEmptyEntries)
// .ToArray();
// string testSavoli = testSavoliArray[0];
// string[] testVariantlari = testSavoliArray[1]
// .Split(' ', StringSplitOptions.RemoveEmptyEntries)
// .ToArray();
// var quest = new Questions(testSavoli,testVariantlari,i+1);
// int ball = 0;
// var test = new Test(ism,quest.ToString(),60,testVariantlari[4],ball);
// test.TakeTest();
// }
// // Start
// }
// }
List<string> savollar = new List<string>();
using (StreamReader read = new StreamReader("Testlar.txt"))
{
while (!read.EndOfStream)
{
savollar.Add(read.ReadLine());
}
}
List<string[]> javoblar = new List<string[]>();
for (var i = 0; i < savollar.Count; i++)
{
javoblar.Add(savollar[i].Split('(',StringSplitOptions.RemoveEmptyEntries));
}
var test = new Test("Mantiqiy!",javoblar,50);
test.TakeTest();