Skip to content

Commit

Permalink
[UPDATE] Design change (#246)
Browse files Browse the repository at this point in the history
  • Loading branch information
ilyalehchylin committed Apr 12, 2024
2 parents 0372c0f + 8c39776 commit 28d778f
Show file tree
Hide file tree
Showing 16 changed files with 180 additions and 126 deletions.
12 changes: 6 additions & 6 deletions source/EduCATS/Localization/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@
"contributor_julia_popova": "Julia Popova",

"role_student": "Student",
"role_professor": "Professor",
"role_professor": "Lecturer",

"address_building": "b.",
"address_room": "а.",

"type_activity_lecture": "Lecture",
"type_activity_lab": "Lab work",
"type_activity_practical": "Practical work",
"type_activity_lab": "Lab",
"type_activity_practical": "Workshop",

"server_test": "Test server",
"server_local": "Local server",
Expand Down Expand Up @@ -84,7 +84,7 @@
"lectures_fetch_error": "Error occurred during retrieving lectures. Please try to refresh page or contact support.",

"learning_card_tests": "Tests",
"learning_card_eemc": "EEMC",
"learning_card_eemc": "Educational Complex",
"learning_card_files": "Files",
"learning_card_adaptive": "Adaptive learning",

Expand Down Expand Up @@ -213,7 +213,7 @@
"empty_fields_forgot_password": "Required fields (Login, Specific question, Answer, New Password, Confirm Password) must be filled!",

"set_marks": "Set marks",
"set_visiting": "Put up gaps",
"set_visiting": "Mark attendance",

"save_marks": "Save",
"practiсe_visiting": "Practiсe visiting",
Expand All @@ -226,7 +226,7 @@
"show_for_student": "Show for student",
"skipped_hours": "Skipped hours",

"demo_eemc_open_error": "Viewing EEMC documents is not available for a demo account.",
"demo_eemc_open_error": "Viewing Educational Complex documents is not available for a demo account.",
"demo_files_download_error": "Downloading tutorials is not available for a demo account.",
"demo_delete_account_error": "Deleting a demo account is not possible."
}
7 changes: 4 additions & 3 deletions source/EduCATS/Localization/lt.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@
"address_building": "p.",
"address_room": "a.",

"type_activity_lecture": "Lezione",
"type_activity_lab": "Lavoro di laboratorio",
"type_activity_practical": "Lavoro pratico",
"type_activity_lecture": "Paskaita",

"type_activity_lab": "Laboratoriniai darbai",
"type_activity_practical": "Praktinė pamoka",

"server_test": "Testavimo serveris",
"server_local": "Vietinis serveris",
Expand Down
2 changes: 2 additions & 0 deletions source/EduCATS/Localization/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
"type_activity_lecture": "Лекция",
"type_activity_lab": "Лаб. работа",
"type_activity_practical": "Практ. занятие",
"type_activity_kconsultation": "КП",
"type_activity_dconsultation": "ДП",

"server_test": "Тестовый сервер",
"server_local": "Локальный сервер",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public SavePracticeAndLabsPageView(string title, int subjectId, int groupId, str
BindingContext = new SavePracticeAndLabsPageViewModel(new PlatformServices(), subjectId, labMarksList, groupId, title);
createLabsMarks();
}

}

void createLabsMarks()
Expand All @@ -79,6 +79,7 @@ void createLabsMarks()
Style = AppStyles.GetLabelStyle(),
Font = Font.SystemFontOfSize(NamedSize.Large),
Text = CrossLocalization.Translate("choose_group") + " " + _groupName,
HorizontalOptions = LayoutOptions.Center,
};

var stackLayout = new StackLayout();
Expand Down Expand Up @@ -136,6 +137,7 @@ Picker subGroupPicker()
var subGroupPicker = new Picker
{
BackgroundColor = Color.White,
HeightRequest = 70,
};
subGroupPicker.SetBinding(Picker.ItemsSourceProperty, "SubGroup");
subGroupPicker.SetBinding(Picker.SelectedItemProperty, new Binding("SelectedSubGroup"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ private void createLabsMarksPage(LabsVisitingList labsVisitingList)
{
if (group.SubGroup == 1)
{
_currentLabsVisitingMarksSubGroup1.Add(new StudentsPageModel(group.Login ,group.FullName));
_currentLabsVisitingMarksSubGroup1.Add(new StudentsPageModel(group.Login, group.FullName));
FullNames.Add(group.FullName);
}
else
Expand Down Expand Up @@ -219,7 +219,7 @@ public string SelectedSubGroup
{
get
{
if (SubGroup.Count != 0)
if (SubGroup.Count != 0)
{
if (_selectedSubGroup == SubGroup[0])
{
Expand All @@ -232,7 +232,7 @@ public string SelectedSubGroup
LabsVisitingMarksSubGroup = LabsVisitingMarksSubGroupTwo;
DateLabs = Date2;
selSubGroup = 2;
}
}
}
return _selectedSubGroup;
}
Expand Down Expand Up @@ -261,7 +261,7 @@ void openPage(object selectedObject)
{
_services.Navigation.OpenAddSingleMark(_title, student.Name, labsVisitingList, _takedLabs, selSubGroup);
}

}
catch (Exception ex)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ public class SaveSingleStudentMarkPageView : ContentPage
const double _heightRequest = 40;

static Thickness _padding = new Thickness(10, 1);
static Thickness _margin = new Thickness(0, 10);
public List<int> Marks = new List<int> { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
public List<string> NameOfLabOrPractice = new List<string>();
public string _title { get; set; }
Expand All @@ -29,13 +28,13 @@ public SaveSingleStudentMarkPageView(string title, string name, LabsVisitingList
{
_title = title;

if(title == CrossLocalization.Translate("practice_mark"))
if (title == CrossLocalization.Translate("practice_mark"))
{
foreach(var pract in prOrLabStat.Practicals)
foreach (var pract in prOrLabStat.Practicals)
{
NameOfLabOrPractice.Add(pract.ShortName);
}
BindingContext = new SaveSingleStudentMarkPageViewModel(new PlatformServices(),
BindingContext = new SaveSingleStudentMarkPageViewModel(new PlatformServices(),
NameOfLabOrPractice.FirstOrDefault(), marks, prOrLabStat, title, name, subGruop);
}
else if (title == CrossLocalization.Translate("stats_page_labs_rating"))
Expand All @@ -57,11 +56,10 @@ public SaveSingleStudentMarkPageView(string title, string name, LabsVisitingList
var inicials = new Label
{
VerticalOptions = LayoutOptions.CenterAndExpand,
Margin = _margin,
HorizontalOptions = LayoutOptions.CenterAndExpand,
TextColor = Color.FromHex(Theme.Current.StatisticsDetailsTitleColor),
Style = AppStyles.GetLabelStyle(),
Font = Font.SystemFontOfSize(NamedSize.Large).WithSize(20).WithAttributes(FontAttributes.None),
Font = Font.SystemFontOfSize(NamedSize.Large).WithSize(20).WithAttributes(FontAttributes.Bold),
Text = name,
};

Expand Down Expand Up @@ -144,20 +142,6 @@ public SaveSingleStudentMarkPageView(string title, string name, LabsVisitingList

commentEntry.SetBinding(Entry.TextProperty, "Comment");

nameOfPrOrLb.PropertyChanged += delegate {
if (nameOfPrOrLb.SelectedItem is not null)
if (marks.Students.First(student => student.FullName == name).LabsMarks.First(labmarks => labmarks.LabId == prOrLabStat.Labs.First(lab => lab.ShortName == nameOfPrOrLb.SelectedItem as string).LabId).Mark != string.Empty)
{
markPicker.SelectedIndex = Convert.ToInt32(marks.Students.First(student => student.FullName == name).LabsMarks.First(labmarks => labmarks.LabId == prOrLabStat.Labs.First(lab => lab.ShortName == nameOfPrOrLb.SelectedItem as string).LabId).Mark) - 1;
commentEntry.Text = marks.Students.First(student => student.FullName == name).LabsMarks.First(labmarks => labmarks.LabId == prOrLabStat.Labs.First(lab => lab.ShortName == nameOfPrOrLb.SelectedItem as string).LabId).Comment;
}
else
{
markPicker.SelectedItem = null;
commentEntry.Text = string.Empty;
}
};

var gridLayout = new Grid
{
BackgroundColor = Color.FromHex(Theme.Current.BaseBlockColor),
Expand Down
40 changes: 20 additions & 20 deletions source/EduCATS/Pages/SaveMarks/ViewModels/SaveMarksPageViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,15 @@ public class SaveMarksPageViewModel : ViewModel
public List<VisitingPageModel> _currentLabsVisitingMarksSubGroup1;
public string _titleOfPage { get; set; }
public List<string> FullNames { get; set; }

public TakedLabs _takedLabs { get; set; }

public SaveMarksPageViewModel(IPlatformServices services, int _subjectId, object stat, int groupId, string title)
{
ServicePointManager.ServerCertificateValidationCallback += (sender, certificate, chain, sslPolicyErrors) => { return true; };

_titleOfPage = title;
_services = services;
_services = services;
if (title == CrossLocalization.Translate("stats_page_lectures_visiting"))
{
groupData = stat as VisitingLecturesList;
Expand Down Expand Up @@ -156,7 +156,7 @@ void createLecturesVisitingPage(VisitingLecturesList statistics)
Date.Add(groupVisit.Date);
}
if (Date[0] == groupVisit.Date &&
!(_currentLecturesVisitingMarks.Contains(new VisitingPageModel(groupVis.StudentName, groupVisit.Comment,
!(_currentLecturesVisitingMarks.Contains(new VisitingPageModel(groupVis.StudentName, groupVisit.Comment,
groupVisit.Mark, false))))
{
_currentLecturesVisitingMarks.Add(new VisitingPageModel(groupVis.StudentName, groupVisit.Comment,
Expand All @@ -165,7 +165,7 @@ void createLecturesVisitingPage(VisitingLecturesList statistics)
}
}
}
SelectedDate = Date[Date.Count-1];
SelectedDate = Date[Date.Count - 1];
LecturesMarks = _currentLecturesVisitingMarks;
}

Expand All @@ -190,7 +190,7 @@ public Command SaveMarksCommand
var i = 0;
foreach (var lect in lecturesVisiting.LecturesMarksVisiting)
{
for(int m = 0; m < lect.Marks.Count; m++)
for (int m = 0; m < lect.Marks.Count; m++)
{
if (lect.Marks[m].Date == selDateForSave)
{
Expand All @@ -215,7 +215,7 @@ public Command SaveMarksCommand
dateId = lab.ScheduleProtectionLabId;
}
int i = 0;
for(int stud = 0; stud < labsVisiting.Count; stud++)
for (int stud = 0; stud < labsVisiting.Count; stud++)
{
if (labsVisiting[stud].FullName == LabsVisitingMarksSubGroup[i].Title)
{
Expand Down Expand Up @@ -252,9 +252,9 @@ public Command SaveMarksCommand
dateId = pr.ScheduleProtectionPracticalId;
}
int i = 0;
for(int pract = 0; pract < practVisiting.Count; pract++)
for (int pract = 0; pract < practVisiting.Count; pract++)
{
foreach(var mark in practVisiting[pract].PracticalVisitingMark.Where(v => v.ScheduleProtectionPracticalId == dateId))
foreach (var mark in practVisiting[pract].PracticalVisitingMark.Where(v => v.ScheduleProtectionPracticalId == dateId))
{
mark.Mark = LecturesMarks[i].Mark;
mark.Comment = LecturesMarks[i].Comment;
Expand Down Expand Up @@ -368,9 +368,9 @@ public string SelectedDate
LecturesMarks = _currentLecturesVisitingMarks;
return _selectedDate;
}
set
{
SetProperty(ref _selectedDate, value);
set
{
SetProperty(ref _selectedDate, value);
}
}

Expand Down Expand Up @@ -405,7 +405,7 @@ public string SelectedPracDate
string _selectedLabDate;
public string SelectedLabDate
{
get
get
{
_currentLabsVisitingMarksSubGroup1 = new List<VisitingPageModel>();
foreach (var date in _takedLabs.ScheduleProtectionLabs.Where(v => v.Date == _selectedLabDate))
Expand All @@ -422,11 +422,11 @@ public string SelectedLabDate
}
}
LabsVisitingMarksSubGroup = _currentLabsVisitingMarksSubGroup1;
return _selectedLabDate;
return _selectedLabDate;
}
set
{
SetProperty(ref _selectedLabDate, value);
set
{
SetProperty(ref _selectedLabDate, value);
}
}

Expand Down Expand Up @@ -454,15 +454,15 @@ public string SelectedSubGroup
}
DateLabs = Date1;
LabsVisitingMarksSubGroup = _currentLabsVisitingMarksSubGroup1;

if (DateLabs.Count != 0)
SelectedLabDate = DateLabs[DateLabs.Count - 1];

return _selectedSubGroup;
}
set
set
{
SetProperty(ref _selectedSubGroup, value);
SetProperty(ref _selectedSubGroup, value);
}
}
}
Expand Down
13 changes: 7 additions & 6 deletions source/EduCATS/Pages/SaveMarks/Views/SaveMarksPageView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

namespace EduCATS.Pages.SaveMarks.Views
{
public class SaveMarksPageView : ContentPage
public class SaveMarksPageView : ContentPage
{

public string _title { get; set; }
Expand Down Expand Up @@ -45,14 +45,14 @@ public SaveMarksPageView(int subjectId, int groupId, string title, string groupN
if (title == CrossLocalization.Translate("stats_page_lectures_visiting"))
{
string link = Links.GetLecturesCalendarData + "subjectId=" + subjectId + "&groupId=" + groupId;
var obj = requestDataAsync(link,httpContent);
var obj = requestDataAsync(link, httpContent);
groupData = JsonConvert.DeserializeObject<VisitingLecturesList>(obj.Result.ToString());
BindingContext = new SaveMarksPageViewModel(new PlatformServices(), subjectId, groupData, groupId, title);
}
else if (title == CrossLocalization.Translate("stats_page_labs_visiting"))
{
string link = Links.GetLabsCalendarData + "subjectId=" + subjectId + "&groupId=" + groupId;
var obj = requestDataAsync(link,httpContent);
var obj = requestDataAsync(link, httpContent);
labsVisitingList = JsonConvert.DeserializeObject<LabsVisitingList>(obj.Result.ToString());
BindingContext = new SaveMarksPageViewModel(new PlatformServices(), subjectId, labsVisitingList, groupId, title);
}
Expand All @@ -64,7 +64,7 @@ public SaveMarksPageView(int subjectId, int groupId, string title, string groupN
groupItems.SubjectId = subjectId;
var body = JsonConvert.SerializeObject(groupItems);
httpContent = new StringContent(body, Encoding.UTF8, "application/json");
var obj = requestDataAsync(link,httpContent);
var obj = requestDataAsync(link, httpContent);
particialVisitingList = JsonConvert.DeserializeObject<LabsVisitingList>(obj.Result.ToString());
BindingContext = new SaveMarksPageViewModel(new PlatformServices(), subjectId, particialVisitingList, groupId, title);
}
Expand Down Expand Up @@ -97,6 +97,7 @@ void createView()
Style = AppStyles.GetLabelStyle(),
Font = Font.SystemFontOfSize(NamedSize.Large),
Text = CrossLocalization.Translate("choose_group") + " " + _groupName,
HorizontalOptions = LayoutOptions.Center,
};
var stackLayout = new StackLayout();
var resultsListView = new RoundedListView(typeof(VisitingPageViewCell));
Expand Down Expand Up @@ -175,15 +176,15 @@ void createView()

StackLayout stackView()
{

var save = saveMarksButton();
var form = new StackLayout
{
Padding = _headerPadding,
VerticalOptions = LayoutOptions.Center,
Children =
{
save,
save,
}
};
return form;
Expand Down
Loading

0 comments on commit 28d778f

Please sign in to comment.