Example #1
0
        public MainWindow()
        {
            InitializeComponent();
            nextButton.IsEnabled = false;
            showButton.IsEnabled = false;

            qm = new QuestionManager();
        }
Example #2
0
 public MainWindow()
 {
     InitializeComponent();
     nextButton.IsEnabled = false;
     showButton.IsEnabled = false;
     //two ways of parsing files
     nenad_pars = false;
     besa_pars = false;
     bp = new BesaParser();
     qm = new QuestionManager();
     /*
     qm.loadFile("wut");
     curr = qm.getRandom();
     pitanjeText.Text = curr.Item1;*/
 }
Example #3
0
        public bool parseFile()
        {
            //contains method for opening files with
            QuestionManager qm = new QuestionManager();
            string path = qm.openQuestions();

            int counter = 0;
            string line;
            string[] quiestions = new string[1000];
            string[] answers = new string[1000];
            int cnt_q = 0;
            int cnt_a = 0;

            // Read the file and display it line by line.
            System.IO.StreamReader file =
               new System.IO.StreamReader(path);
            while ((line = file.ReadLine()) != null)
            {

                if (counter % 2 == 0)
                {
                    quiestions[cnt_q] = line;
                    cnt_q++;

                }
                else {
                    answers[cnt_a] = line;
                    cnt_a++;
                }
                counter++;

            }

            file.Close();

            for(int i = 0; i < answers.Length; i++){
                qaList.Add(new Tuple<string,string>(quiestions[i],answers[i]));

            }

            return false;
        }
 public LoaderWindow(QuestionManager manager)
 {
     InitializeComponent();
     this.qm = manager;
 }