public void EnterAnswerChallenge()
{
foreach (Team teamCS in flp_Team.Controls)
{
if (Convert.ToInt32(teamCS.lbl_Sequence.Text) == sequenceplayer(records.ElementAt(team).IDPlayer) || teamCS.chk_Challenged.Checked == true)
{
if (typequestion == "onechoice")
{
foreach (PlayerAnswer playerAnswer in audience.flp_PlayerAnswers.Controls)
{
//check team on controller screen and TeamAnswer on audience screen is equal
if (teamCS.lbl_IDPlayer.Text == playerAnswer.lbl_IDPlayer.Text)
{
foreach (RadioButton oneChoice in teamCS.flp_Answer.Controls)
{
if (oneChoice.Checked == true)
{
playerAnswer.lbl_TeamAnswer.Text = oneChoice.Text;
}
}
//show notify to know challenged team
if (Convert.ToInt32(playerAnswer.lbl_IDPlayer.Text) == records.ElementAt(team).IDPlayer)
{
playerAnswer.lbl_TeamName.BackColor = Color.LightSeaGreen;
}
}
}
}
else
{
if (typequestion == "multichoice")
{
foreach (PlayerAnswer playerAnswer in audience.flp_PlayerAnswers.Controls)
{
//check team on controller screen and TeamAnswer on audience screen is equal
if (teamCS.lbl_IDPlayer.Text == playerAnswer.lbl_IDPlayer.Text)
{
foreach (CheckBox multiChoice in teamCS.flp_Answer.Controls)
{
if (multiChoice.Checked == true)
{
playerAnswer.lbl_TeamAnswer.Text += multiChoice.Text + " ";
}
}
//show notify to know challenged team
if (Convert.ToInt32(playerAnswer.lbl_IDPlayer.Text) == records.ElementAt(team).IDPlayer)
{
playerAnswer.lbl_TeamName.BackColor = Color.LightSeaGreen;
}
}
}
}
else
{
foreach (PlayerAnswer playerAnswer in audience.flp_PlayerAnswers.Controls)
{
//check team on controller screen and TeamAnswer on audience screen is equal
if (teamCS.lbl_IDPlayer.Text == playerAnswer.lbl_IDPlayer.Text)
{
foreach (TextBox shortanswer in teamCS.flp_Answer.Controls)
{
playerAnswer.lbl_TeamAnswer.Text = shortanswer.Text;
//PlayerAnswerShortQuestion = shortanswer.txt_ShortAnswer.Text;
if (playerAnswer.lbl_TeamAnswer.Text.Count() > 8)
{
if (playerAnswer.lbl_TeamAnswer.Text.Count() <= 10)
{
playerAnswer.lbl_TeamAnswer.Font = new Font(playerAnswer.lbl_TeamAnswer.Font.FontFamily, 18.0f, playerAnswer.lbl_TeamAnswer.Font.Style);
}
else
{
if (playerAnswer.lbl_TeamAnswer.Text.Count() <= 13)
{
playerAnswer.lbl_TeamAnswer.Font = new Font(playerAnswer.lbl_TeamAnswer.Font.FontFamily, 14.0f, playerAnswer.lbl_TeamAnswer.Font.Style);
}
else
{
playerAnswer.lbl_TeamAnswer.Font = new Font(playerAnswer.lbl_TeamAnswer.Font.FontFamily, 12.0f, playerAnswer.lbl_TeamAnswer.Font.Style);
}
//playerAnswer.lbl_TeamAnswer.Font = new Font(playerAnswer.lbl_TeamAnswer.Font.FontFamily, 10.0f, playerAnswer.lbl_TeamAnswer.Font.Style);
}
}
}
//show notify to know challenged team
if (Convert.ToInt32(playerAnswer.lbl_IDPlayer.Text) == records.ElementAt(team).IDPlayer)
{
playerAnswer.lbl_TeamName.BackColor = Color.LightSeaGreen;
}
}
}
}
}
teamCS.gb_team.Visible = false;
}
else
{
teamCS.gb_team.Visible = false;
}
}
}