private string getCorrect(Query q, int c) { return q.answer[c]; }
private void GetNextNotPlayed(int k) { int i; maxlist = userList.Count; for ( i = 0; i < maxlist; i++) { //IF SHOWN OR NOT::NEVER ANSWERED if ((userList [i+k].played <=1) && (userList [i+k].type == userType) && (userList [i+k].difficulty == userDifficulty)) { //userList[i].Played = 1;-->>DO IN SHOW_ON_SCREEN //SECOND CHANGE::private QUERY ShowOnScreen //to return played changed status for current current = ShowOnScreen(userList[i + k]); //userList.Add(exchangeTemp); //maxlist = userList.Count; //userList[i] = current; break; } else { current = null; ShowOnScreen(new Query(80,3,3,3,3,"",0,"","","","")); } } if (i == maxlist) { if (current == null) { lblMessage.Text = "ΤΕΛΟΣ ΕΡΩΤΗΣΕΩΝ"; MessageBox.Show("Δεν υπάρχουν διαθέσιμες ερωτησεις!"); PrintResults(); } } }
//show question on screen and buttons private Query ShowOnScreen(Query q) { //CHANGE SHOWN PROPERTY q.played = 1; lblQuote.Text = q.quote; lblScore.Text = "Βαθμοί ερώτησης: " + q.degrees; lblMessage.Text = "Αναμονή για απάντηση..."; btn1.Text = "Α. "+q.answer[1]; btn2.Text = "Β. "+q.answer[2]; btn3.Text = "Γ. "+q.answer[3]; btn4.Text = "Δ. "+q.answer[4]; tmrGame.Enabled = true; tmrGame.Start(); return q; }
//button next question private void btnGetNext_Click(object sender, EventArgs e) { LockStatus(); if (current == null) { GetNextNotPlayed(0); } else { //current.Played = 0; //userList.Remove(current); //userList.Add(current); exchangeTemp = current; //userList.Remove(exchangeTemp); //userList.m GetNextNotPlayed(0); } }