diff --git a/source/EduCATS/Localization/ru.json b/source/EduCATS/Localization/ru.json index 318bb13d..346835f5 100644 --- a/source/EduCATS/Localization/ru.json +++ b/source/EduCATS/Localization/ru.json @@ -24,7 +24,7 @@ "type_activity_lecture": "Лекция", "type_activity_lab": "Лаб. работа", - "type_activity_practical": "Практ. работа", + "type_activity_practical": "Практ. занятие", "server_test": "Тестовый сервер", "server_local": "Локальный сервер", @@ -217,8 +217,8 @@ "set_visiting": "Выставить пропуски", "save_marks": "Сохранить", - "practiсe_visiting": "Пропуски практических работ", - "practice_mark": "Оценки по практическим работам", + "practiсe_visiting": "Пропуски практических занятий", + "practice_mark": "Оценки по практическим занятиям", "sub_group": "Подгруппа ", "mark": "Оценка", diff --git a/source/EduCATS/Pages/SaveLabsAndPracticeMarks/ViewModels/SaveSingleStudentMarkPageViewModel.cs b/source/EduCATS/Pages/SaveLabsAndPracticeMarks/ViewModels/SaveSingleStudentMarkPageViewModel.cs index 0c02f334..bbb79a6d 100644 --- a/source/EduCATS/Pages/SaveLabsAndPracticeMarks/ViewModels/SaveSingleStudentMarkPageViewModel.cs +++ b/source/EduCATS/Pages/SaveLabsAndPracticeMarks/ViewModels/SaveSingleStudentMarkPageViewModel.cs @@ -61,7 +61,7 @@ public Command SaveMarksButton } } - private async Task> saveMarks() + private async Task saveMarks() { string body = ""; string link = ""; @@ -72,6 +72,7 @@ public Command SaveMarksButton foreach (var pract in _takedLabs.Practicals.Where(v => v.ShortName == SelectedShortName)) { save.practicalId = pract.PracticalId; + save.subjectId = _services.Preferences.ChosenSubjectId; foreach (var practic in fullPractice.Students.Where(v => v.FullName == studentName)) { save.studentId = practic.StudentId; @@ -109,8 +110,11 @@ public Command SaveMarksButton } body = JsonController.ConvertObjectToJson(save); } + + await AppServicesController.Request(link, body); await _services.Navigation.ClosePage(false); - return await AppServicesController.Request(link, body); + + return; } string _selectedShortName; diff --git a/source/EduCATS/Pages/SaveLabsAndPracticeMarks/Views/SaveSingleStudentMarkPageView.cs b/source/EduCATS/Pages/SaveLabsAndPracticeMarks/Views/SaveSingleStudentMarkPageView.cs index 080d5962..49ca2e8b 100644 --- a/source/EduCATS/Pages/SaveLabsAndPracticeMarks/Views/SaveSingleStudentMarkPageView.cs +++ b/source/EduCATS/Pages/SaveLabsAndPracticeMarks/Views/SaveSingleStudentMarkPageView.cs @@ -17,7 +17,7 @@ public class SaveSingleStudentMarkPageView : ContentPage { static Thickness _gridPadding = new Thickness(15); const double _controlHeight = 50; - const double _heightRequest = 30; + const double _heightRequest = 40; static Thickness _padding = new Thickness(10, 1); public List Marks = new List { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }; @@ -103,7 +103,7 @@ public SaveSingleStudentMarkPageView(string title, string name, LabsVisitingList VerticalOptions = LayoutOptions.CenterAndExpand, TextColor = Color.FromHex(Theme.Current.StatisticsDetailsTitleColor), Style = AppStyles.GetLabelStyle(), - HeightRequest = _heightRequest, + HeightRequest = 50, Text = CrossLocalization.Translate("show_for_student"), }; @@ -161,6 +161,13 @@ public SaveSingleStudentMarkPageView(string title, string name, LabsVisitingList saveBut.SetBinding(Button.CommandProperty, "SaveMarksButton"); + gridLayout.RowDefinitions.Add(new RowDefinition { Height = new GridLength(0, GridUnitType.Auto) }); + gridLayout.RowDefinitions.Add(new RowDefinition { Height = new GridLength(1, GridUnitType.Auto) }); + gridLayout.RowDefinitions.Add(new RowDefinition { Height = new GridLength(2, GridUnitType.Auto) }); + gridLayout.RowDefinitions.Add(new RowDefinition { Height = new GridLength(3, GridUnitType.Auto) }); + gridLayout.RowDefinitions.Add(new RowDefinition { Height = new GridLength(5, GridUnitType.Auto) }); + gridLayout.RowDefinitions.Add(new RowDefinition { Height = new GridLength(6, GridUnitType.Auto) }); + gridLayout.Children.Add(inicials, 0, 0); gridLayout.Children.Add(nameOfPrOrLb, 0, 1); gridLayout.Children.Add(markLabel, 0, 2); @@ -178,6 +185,9 @@ public SaveSingleStudentMarkPageView(string title, string name, LabsVisitingList Grid.SetColumnSpan(markLabel, 2); Grid.SetColumnSpan(saveBut, 3); Grid.SetColumnSpan(nameOfPrOrLb, 3); + + gridLayout.RowSpacing = 10; + Content = gridLayout; } diff --git a/source/EduCATS/Pages/SaveMarks/SavePractSingle.cs b/source/EduCATS/Pages/SaveMarks/SavePractSingle.cs index 31e69e94..2e034541 100644 --- a/source/EduCATS/Pages/SaveMarks/SavePractSingle.cs +++ b/source/EduCATS/Pages/SaveMarks/SavePractSingle.cs @@ -15,5 +15,6 @@ public class SavePractSingle public int mark { get; set; } public bool showForStudent { get; set; } public int studentId { get; set; } + public int subjectId { get; set; } } } diff --git a/source/EduCATS/Pages/SaveMarks/ViewModels/SaveMarksPageViewModel.cs b/source/EduCATS/Pages/SaveMarks/ViewModels/SaveMarksPageViewModel.cs index e9c05900..efa5f1ba 100644 --- a/source/EduCATS/Pages/SaveMarks/ViewModels/SaveMarksPageViewModel.cs +++ b/source/EduCATS/Pages/SaveMarks/ViewModels/SaveMarksPageViewModel.cs @@ -454,7 +454,10 @@ public string SelectedSubGroup } DateLabs = Date1; LabsVisitingMarksSubGroup = _currentLabsVisitingMarksSubGroup1; - SelectedLabDate = DateLabs[DateLabs.Count - 1]; + + if (DateLabs.Count != 0) + SelectedLabDate = DateLabs[DateLabs.Count - 1]; + return _selectedSubGroup; } set diff --git a/source/EduCATS/Pages/SaveMarks/Views/SaveMarksPageView.cs b/source/EduCATS/Pages/SaveMarks/Views/SaveMarksPageView.cs index a50362db..f47962ab 100644 --- a/source/EduCATS/Pages/SaveMarks/Views/SaveMarksPageView.cs +++ b/source/EduCATS/Pages/SaveMarks/Views/SaveMarksPageView.cs @@ -24,7 +24,7 @@ public class SaveMarksPageView : ContentPage static Thickness _padding = new Thickness(10, 1); static Thickness _headerPadding = new Thickness(0, 10, 0, 10); - static int _heightRequest = 30; + static int _heightRequest = 40; private string _groupName; const double _controlHeight = 50; diff --git a/source/EduCATS/Pages/Statistics/Marks/Views/ViewCells/VisitingPageViewCell.cs b/source/EduCATS/Pages/Statistics/Marks/Views/ViewCells/VisitingPageViewCell.cs index fbe8f720..b53d32af 100644 --- a/source/EduCATS/Pages/Statistics/Marks/Views/ViewCells/VisitingPageViewCell.cs +++ b/source/EduCATS/Pages/Statistics/Marks/Views/ViewCells/VisitingPageViewCell.cs @@ -69,7 +69,7 @@ public VisitingPageViewCell() var markPicker = new Picker { BackgroundColor = Color.White, - HeightRequest = 30, + HeightRequest = 40, ItemsSource = listOfMarks, HorizontalTextAlignment = TextAlignment.Center }; @@ -80,7 +80,7 @@ public VisitingPageViewCell() { Style = entryStyle, ReturnType = ReturnType.Done, - HeightRequest = 30 + HeightRequest = 40 }; commentEntry.SetBinding(Entry.TextProperty, "Comment"); @@ -90,7 +90,11 @@ public VisitingPageViewCell() Padding = _gridPadding, VerticalOptions = LayoutOptions.CenterAndExpand, }; - + + gridLayout.RowDefinitions.Add(new RowDefinition { Height = new GridLength(0, GridUnitType.Auto) }); + gridLayout.RowDefinitions.Add(new RowDefinition { Height = new GridLength(1, GridUnitType.Auto) }); + gridLayout.RowDefinitions.Add(new RowDefinition { Height = new GridLength(2, GridUnitType.Auto) }); + gridLayout.RowDefinitions.Add(new RowDefinition { Height = new GridLength(3, GridUnitType.Auto) }); gridLayout.Children.Add(inicials, 0, 0); gridLayout.Children.Add(markLabel, 0, 1); gridLayout.Children.Add(markPicker, 2, 1); diff --git a/source/EduCATS/Pages/Statistics/Results/ViewModels/StatsResultsPageViewModel.cs b/source/EduCATS/Pages/Statistics/Results/ViewModels/StatsResultsPageViewModel.cs index c20131e5..1f48c699 100644 --- a/source/EduCATS/Pages/Statistics/Results/ViewModels/StatsResultsPageViewModel.cs +++ b/source/EduCATS/Pages/Statistics/Results/ViewModels/StatsResultsPageViewModel.cs @@ -403,24 +403,30 @@ void setLabsVisiting(StatsStudentModel student, LaboratoryWorksModel labs) } } + var labsVisitingList = _currentLabsVisitingList.OrderBy(vis => DateTime.Parse(vis.Date)).ToList(); - var visitingLabsTestResult = labs.LabVisitingMark.Select(v => + List temp = new List(); + + foreach (var vis in labsVisitingList) { - var lab = _currentLabsVisitingList.FirstOrDefault( - l => l.ProtectionLabId == v.ScheduleProtectionLabId); + var lab = labs.LabVisitingMark.FirstOrDefault(l => l.ScheduleProtectionLabId == vis.ProtectionLabId); - Theme theme = null; - if (queueTheme.Count > 0) + if (lab != null) { - theme = queueTheme.Dequeue(); - } + Theme theme = null; + if (queueTheme.Count > 0) + { + theme = queueTheme.Dequeue(); + } - var labTitle = lab == null ? null : $"{theme.ShortName}. {theme.LabTheme}"; - var result = string.IsNullOrEmpty(v.Mark) ? _emptyRatingString : v.Mark; - return new StatsResultsPageModel(labTitle, lab?.Date, setCommentByRole(v.Comment, v.ShowForStudent), result); - }); + var labTitle = lab == null ? null : $"{theme.ShortName}. {theme.LabTheme}"; + var result = string.IsNullOrEmpty(lab.Mark) ? _emptyRatingString : lab.Mark; + + temp.Add(new StatsResultsPageModel(labTitle, vis?.Date, setCommentByRole(lab.Comment, lab.ShowForStudent), result)); + } + } ; - Marks = new List(visitingLabsTestResult).OrderBy(x => DateTime.Parse(x.Date)).ToList(); + Marks = new List(temp); } else {