Example #1
0
 public void Update(KalutQuestion q)
 {
     question_txt.Text   = q.Question;
     ans0_tile.Text      = q.Answers[0].Key;
     ans1_tile.Text      = q.Answers[1].Key;
     ans2_tile.Text      = q.Answers[2].Key;
     ans3_tile.Text      = q.Answers[3].Key;
     timeout_spn.Maximum = q.Time;
     timeout_spn.Value   = q.Time;
     timeout_txt.Text    = q.Time.ToString();
 }
Example #2
0
 private int[] FindCorrectAnsIndex(KalutQuestion q)
 {
     int[] retdata = new int[4];
     for (int i = 0; i < 4; i++)
     {
         if (curr_q.Answers[i].Value)
         {
             retdata[i] = i;
         }
         else
         {
             retdata[i] = -1;
         }
     }
     return(retdata);
 }
Example #3
0
        public void Update(KalutQuestion q)
        {
            curr_q            = q;
            question_txt.Text = q.Question;
            ans0_tile.Text    = q.Answers[0].Key;
            ans1_tile.Text    = q.Answers[1].Key;
            ans2_tile.Text    = q.Answers[2].Key;
            ans3_tile.Text    = q.Answers[3].Key;
            string html = string.Format("<img src=\"{0}\" width=\"{1}\" height=\"{2}\">", q.HTMLContent, webBrowser.Size.Width, webBrowser.Size.Height);

            if (html != webBrowser.DocumentText)
            {
                webBrowser.Navigate("about:blank");
                webBrowser.Document.OpenNew(false);
                webBrowser.Document.Write(html);
                webBrowser.Refresh();
            }
        }
Example #4
0
 private void UpdateQuestion(KalutQuestion q)
 {
     if (q == null)
     {
         return;
     }
     ans1_tog.Checked      = q.Answers[0].Value;
     ans2_tog.Checked      = q.Answers[1].Value;
     ans3_tog.Checked      = q.Answers[2].Value;
     ans4_tog.Checked      = q.Answers[3].Value;
     ans1_txt.Text         = q.Answers[0].Key;
     ans2_txt.Text         = q.Answers[1].Key;
     ans3_txt.Text         = q.Answers[2].Key;
     ans4_txt.Text         = q.Answers[3].Key;
     html_content_txt.Text = q.HTMLContent;
     q_time_adjust.Value   = q.Time;
     q_gpbox.Text          = q.Question;
     question_txt.Text     = q.Question;
 }