Ejemplo n.º 1
0
        public void Handle_ValueChanged(
            object o,
            SegmentedControl.FormsPlugin.Abstractions.ValueChangedEventArgs e)
        {
            view_frames.Children.Clear();
            switch (e.NewValue)
            {
            case 0:
                if (Variables.submissionInfo.lastattempt.submission.status == "new")
                {
                    view_frames.Children.Add(Structure_Frame.Value_comments_on_the_answer_frame(
                                                 Variables.sumbissionComments.comments));

                    view_frames.Children.Add(Structure_Frame.Can_Edit_Status_Frame(
                                                 Variables.submissionInfo.lastattempt.caneditowner));
                }
                else
                {
                    view_frames.Children.Add(Structure_Frame.Answer_Frame(
                                                 Variables.submissionInfo.lastattempt.submission.plugins));

                    view_frames.Children.Add(Structure_Frame.Value_comments_on_the_answer_frame(
                                                 Variables.sumbissionComments.comments));

                    view_frames.Children.Add(Structure_Frame.Last_Change_Frame(
                                                 Variables.submissionInfo.lastattempt.submission.timemodified));

                    view_frames.Children.Add(Structure_Frame.Can_Edit_Status_Frame(
                                                 Variables.submissionInfo.lastattempt.caneditowner));
                }
                break;

            case 1:
                if (Variables.submissionInfo.lastattempt.gradingstatus == "graded")
                {
                    view_frames.Children.Add(Structure_Frame.Rate_Participant_Submission_Frame(
                                                 Variables.true_assign.grade,
                                                 Variables.submissionInfo.feedback.grade.grade));
                }
                else
                {
                    var frame = Structure_Frame.Rate_Participant_Submission_Frame(
                        Variables.true_assign.grade, "");

                    view_frames.Children.Add(frame);
                }

                view_frames.Children.Add(Structure_Frame.Edit_Comment_On_Grade_Frame());

                if (Variables.submissionInfo.feedback != null)
                {
                    var frame = Structure_Frame.Grader_Frame(
                        Variables.grader_inf, Variables.submissionInfo.feedback.grade.timemodified);

                    view_frames.Children.Add(frame);
                }

                break;
            }
        }
Ejemplo n.º 2
0
        public static void Check_Submission_Status_View(StackLayout view, Lastattempt lastattempt)
        {
            if (lastattempt.submission.status == "new")
            {
                if (lastattempt.gradingstatus == "graded")
                {
                    view.Children.Add(Structure_Frame.Value_comments_on_the_answer_frame(
                                          Variables.sumbissionComments.comments));

                    view.Children.Add(Structure_Frame.Time_Left_Frame(
                                          Variables.submissionInfo.lastattempt.submission.timemodified,
                                          Variables.true_assign.duedate));

                    view.Children.Add(Structure_Frame.Grading_Due_Date_Frame(
                                          Variables.true_assign.duedate));
                }
                else
                {
                    view.Children.Add(Structure_Frame.Value_comments_on_the_answer_frame(
                                          Variables.sumbissionComments.comments));

                    view.Children.Add(Structure_Frame.Time_Left_Frame(
                                          Variables.submissionInfo.lastattempt.submission.timemodified,
                                          Variables.true_assign.duedate));

                    view.Children.Add(Structure_Frame.Grading_Due_Date_Frame(
                                          Variables.true_assign.duedate));
                }

                if (lastattempt.canedit == true)
                {
                    view.Children.Add(Structure_Frame.Go_To_Submission_Page_Frame("Добавить ответ на задание"));
                }
            }
            else
            {
                if (lastattempt.gradingstatus == "graded")
                {
                    view.Children.Add(Structure_Frame.Answer_Frame(
                                          lastattempt.submission.plugins));

                    view.Children.Add(Structure_Frame.Value_comments_on_the_answer_frame(
                                          Variables.sumbissionComments.comments));

                    view.Children.Add(Structure_Frame.Last_Change_Frame(
                                          Variables.submissionInfo.lastattempt.submission.timemodified));

                    view.Children.Add(Structure_Frame.Attempt_number_frame(
                                          Variables.submissionInfo.lastattempt.submission.attemptnumber,
                                          Variables.true_assign.maxattempts.ToString()));
                }
                else
                {
                    view.Children.Add(Structure_Frame.Answer_Frame(
                                          Variables.submissionInfo.lastattempt.submission.plugins));

                    view.Children.Add(Structure_Frame.Value_comments_on_the_answer_frame(
                                          Variables.sumbissionComments.comments));

                    view.Children.Add(Structure_Frame.Last_Change_Frame(
                                          Variables.submissionInfo.lastattempt.submission.timemodified));

                    view.Children.Add(Structure_Frame.Time_Left_Frame(
                                          Variables.submissionInfo.lastattempt.submission.timemodified,
                                          Variables.true_assign.duedate));

                    view.Children.Add(Structure_Frame.Grading_Due_Date_Frame(
                                          Variables.true_assign.duedate));

                    view.Children.Add(Structure_Frame.Attempt_number_frame(
                                          Variables.submissionInfo.lastattempt.submission.attemptnumber,
                                          Variables.true_assign.maxattempts.ToString()));
                }

                if (lastattempt.canedit == true)
                {
                    view.Children.Add(Structure_Frame.Go_To_Submission_Page_Frame("Редактировать ответ"));
                }
            }
        }