예제 #1
0
        public static Frame Can_Edit_Status_Frame(bool canEditStatus)
        {
            var inside_View = Structure_StackLayout.Inside_Frame_StackLayout();

            var theme = Structure_Label.Theme_Label("Изменение статуса");

            inside_View.Children.Add(theme);

            string text;

            if (canEditStatus == true)
            {
                text = "Студент может править свой ответ";
            }
            else
            {
                text = "Студент не может править свой ответ";
            }


            var editText = Structure_Label.Description_Label(text);

            inside_View.Children.Add(editText);

            var inside_Frame = Inside_Frame(inside_View);

            var view = Structure_StackLayout.View_Frame();

            view.Children.Add(inside_Frame);

            var view_Frame = View_Frame(view);

            return(view_Frame);
        }
예제 #2
0
        public static Frame Value_comments_on_the_answer_frame(List <Comment> comments)
        {
            var theme = Structure_Label.Theme_Label("Комментарии к ответу");

            var valueComments = comments.Count;
            var countComments = Structure_Label.Description_Label(("Комментарии (" + valueComments + ")"));

            var inside_View = Structure_StackLayout.Inside_Frame_StackLayout();

            inside_View.Children.Add(theme);
            inside_View.Children.Add(countComments);

            var inside_Frame = Inside_Frame(inside_View);

            var tapGestureRecognizer = new TapGestureRecognizer();

            tapGestureRecognizer.SetBinding(TapGestureRecognizer.CommandProperty, "goToCommentOnAnswerPage");
            var binding = new Binding();

            inside_View.GestureRecognizers.Add(tapGestureRecognizer);

            var view = Structure_StackLayout.View_Frame();

            view.Children.Add(inside_Frame);

            var view_Frame = View_Frame(view);

            return(view_Frame);
        }
예제 #3
0
        public static Frame Attempt_number_frame(int attempt_number, string max_attempt)
        {
            attempt_number++;

            var theme = Structure_Label.Theme_Label("Номер попытки");

            if (max_attempt == "-1")
            {
                max_attempt = "Неограничено";
            }

            var attempt = Structure_Label.Description_Label((attempt_number + " из " + max_attempt));

            var inside_View = Structure_StackLayout.Inside_Frame_StackLayout();

            inside_View.Children.Add(theme);
            inside_View.Children.Add(attempt);

            var inside_Frame = Inside_Frame(inside_View);

            var view = Structure_StackLayout.View_Frame();

            view.Children.Add(inside_Frame);

            var view_Frame = View_Frame(view);

            return(view_Frame);
        }
예제 #4
0
        public static Frame Comment_on_the_answer_frame(Comment comment)
        {
            var inside_View = Structure_StackLayout.Inside_Frame_StackLayout();

            var commentatorView = Structure_StackLayout.Inside_Frame_View_Orientation(StackOrientation.Horizontal);

            var urlImage      = Function.Take_Image_Url_From_String(comment.avatar);
            var profile_image = Structure_Image.Image_Profile(urlImage);

            commentatorView.Children.Add(profile_image);

            var commentatorInfoView = Structure_StackLayout.Inside_Frame_StackLayout();

            var nameOfСommentator = Structure_Label.Theme_Label(comment.fullname);

            commentatorInfoView.Children.Add(nameOfСommentator);

            var textDate = Function.Text_Unix_Time_In_Date_Time(
                comment.timecreated, "d MMMM yyyy г., HH:mm");
            var dateOfComment = Structure_Label.Description_Label(textDate);

            commentatorInfoView.Children.Add(dateOfComment);

            commentatorView.Children.Add(commentatorInfoView);

            var commentText = Structure_Label.Tag_Label(comment.content, Color.Black, 18);

            inside_View.Children.Add(commentatorView);
            inside_View.Children.Add(commentText);

            var inside_Frame = Inside_Frame(inside_View);

            var view = Structure_StackLayout.View_Frame();

            view.Children.Add(inside_Frame);

            var view_Frame = View_Frame(view);

            return(view_Frame);
        }
예제 #5
0
        public Grading_Participants(int participantId)
        {
            Title = Variables.true_assign.name;

            var grading_Part_Layout = new StackLayout();

            goToCommentOnAnswerPage = new Command(Go_To_Comments_On_Answer_Page);
            goToEditCommentOnGrade  = new Command(Go_To_Edit_Comment_On_Grade);

            var save_Result = new ToolbarItem
            {
                Text             = "Сохранить",
                Command          = new Command <int>(this.Save_Result),
                CommandParameter = participantId
            };

            this.ToolbarItems.Add(save_Result);

            Variables.submissionInfo = Task.Run(
                () => API.Get_Mod_Assign_Submission_Status(Variables.assignId, participantId)).Result;

            commentLabel = Structure_Label.Description_Label(
                Function.Check_Feedback_Plugins_For_Comments(Variables.submissionInfo.feedback));

            //Если задание оценено то берем информацию о том кто оценил
            if (Variables.submissionInfo.feedback != null)
            {
                var userInf = Task.Run(() => API.Get_Core_user_get_users_by_field(
                                           "id", Variables.submissionInfo.feedback.grade.grader.ToString()));
                foreach (var item in userInf.Result)
                {
                    if (item.id == Variables.submissionInfo.feedback.grade.grader)
                    {
                        Variables.grader_inf = item;
                    }
                }
                ;
            }

            Variables.sumbissionComments = Task.Run(
                () => API.Get_core_comment_get_comments("module", Variables.true_assign.cmid, "assignsubmission_comments",
                                                        Variables.submissionInfo.lastattempt.submission.id, "submission_comments", 0)).Result;

            var participantInformationList = Task.Run(() => API.Get_Core_user_get_users_by_field(
                                                          "id", participantId.ToString())).Result;
            var participantInformation = participantInformationList.Find(x => x.id == participantId);;

            var participantInformationFrame = Structure_Frame.Participants_Information_Frame(
                Variables.submissionInfo.lastattempt.submission.status,
                Variables.submissionInfo.lastattempt.gradingstatus,
                participantInformation.profileimageurl, participantInformation.fullname);

            grading_Part_Layout.Children.Add(participantInformationFrame);

            var tab_control = new Segmented_Control_Grading_Participant();

            grading_Part_Layout.Children.Add(tab_control);

            Padding         = 1;
            BackgroundColor = Color.FromHex("#293991");

            var scroll_View = new ScrollView
            {
                Content = grading_Part_Layout
            };

            this.Content = scroll_View;

            this.BindingContext = this;
        }