Exemplo n.º 1
0
        private void SelectedQitem_CheckedChange(UCExamQuestionListItem item, IQuestion question)
        {
            if (!item.Checked)

            {
                if (MessageBox.Show("آیا میخواهید این پرسش حذف شود؟", "حذف پرسش", MessageBoxButtons.YesNo, MessageBoxIcon.Asterisk) == DialogResult.Yes)
                {
                    flpSelectedQuestions.Controls.Remove(item);
                    Questions.Remove(question);
                    totalMark        -= question.Score;
                    lblTotalMark.Text = totalMark.ToString();
                }
            }
            else
            {
                item.Checked = true;
            }
        }
Exemplo n.º 2
0
 private void FrmMakeExam_Load(object sender, EventArgs e)
 {
     foreach (var q in Questions)
     {
         var qitem = new UCExamQuestionListItem(q, q.LessonName, flpSelectedQuestions.Controls.Count + 1);
         qitem.HasRemoveButton  = false;
         qitem.Width            = flpSelectedQuestions.Width - 50;
         qitem.RightToLeft      = RightToLeft.Yes;
         qitem.Anchor           = AnchorStyles.Right | AnchorStyles.Left;
         qitem.Resize          += (s, ev) => { qitem.MaximumSize = new Size(Width - 50, 0); };
         qitem.Name             = q.Id;
         qitem.Checked          = true;
         qitem.CheckedChange   += SelectedQitem_CheckedChange;
         qitem.MouseDown       += (s, ev) => { qitem.DoDragDrop(qitem, DragDropEffects.Move); };
         qitem.QuestionEdited  += Qitem_QuestionEdited;
         qitem.CausesValidation = false;
         qitem.Cursor           = Cursors.Hand;
         qitem.MarkChanged     += Qitem_MarkChanged;
         //qitem.AllowDrop = true;
         flpSelectedQuestions.Controls.Add(qitem);
     }
 }
Exemplo n.º 3
0
 private void Qitem_QuestionEdited(UCExamQuestionListItem item, IQuestion question)
 {
     item.init(question.RegisterTime.ToLocalTime().ToPrettyTime());
 }
Exemplo n.º 4
0
 private void Qitem_MarkChanged(UCExamQuestionListItem item, IQuestion question)
 {
     totalMark         = Questions.Sum(q => q.Score);
     lblTotalMark.Text = totalMark.ToString();
 }