diff --git a/EduNetworkBuilder/NB.cs b/EduNetworkBuilder/NB.cs index f7b1047..133e07d 100644 --- a/EduNetworkBuilder/NB.cs +++ b/EduNetworkBuilder/NB.cs @@ -432,6 +432,12 @@ namespace EduNetworkBuilder return myWin; } + public static PersonProfileForm GetProfileWin() + { + PersonProfileForm myWin = (PersonProfileForm)Application.OpenForms["PersonProfileForm"]; + if (myWin == null) return null; + return myWin; + } public static PersonClass GetUser() { BuilderWindow BW = GetBuilderWin(); @@ -1083,6 +1089,13 @@ namespace EduNetworkBuilder return Combined; } + public static Font GetFont() + { + PersonProfileForm PPF = GetProfileWin(); + if (PPF != null) return PPF.GetFont(); + return new Font(FontFamily.GenericSansSerif, 10.0F, FontStyle.Bold); + } + public static void NotImplimentedMessage() { MessageBox.Show(Translate("NB_NotImplimented")); diff --git a/EduNetworkBuilder/NetworkBuilder.cs b/EduNetworkBuilder/NetworkBuilder.cs index 0ebd1fc..c4eb6ca 100644 --- a/EduNetworkBuilder/NetworkBuilder.cs +++ b/EduNetworkBuilder/NetworkBuilder.cs @@ -1841,6 +1841,11 @@ namespace EduNetworkBuilder } } + public Font GetFont() + { + return Font; + } + public void OpenNetHelpWindow() { RTFWindow rtwin = (RTFWindow)Application.OpenForms["RTFWindow"]; diff --git a/EduNetworkBuilder/PersonClass.cs b/EduNetworkBuilder/PersonClass.cs index 0ec6f23..8739f64 100644 --- a/EduNetworkBuilder/PersonClass.cs +++ b/EduNetworkBuilder/PersonClass.cs @@ -6,6 +6,7 @@ using System.Threading.Tasks; using System.Xml; using System.IO; using System.Windows.Forms; +using System.Drawing; namespace EduNetworkBuilder { @@ -359,7 +360,7 @@ namespace EduNetworkBuilder /// Organize the projects into a nice project tree. /// /// - public TreeNode WorkTree(TreeNode theTop=null) + public TreeNode WorkTree(TreeNode theTop=null, bool ForTeacher = false) { //Sort by due date, and within the due dates, sort by save date Projects.Sort((q, p) => p.DueDate == q.DueDate ? p.SaveDate.CompareTo(q.SaveDate) : p.DueDate.CompareTo(q.DueDate)); @@ -393,6 +394,7 @@ namespace EduNetworkBuilder } foreach(SchoolworkClass MasterSW in MasterList) { + int count = 0; Master = new TreeNode(MasterSW.Name); Master.Tag = MasterSW; @@ -403,8 +405,19 @@ namespace EduNetworkBuilder Node = new TreeNode(DrawFrom[i].Name); Node.Tag = DrawFrom[i]; Master.Nodes.Add(Node); + if (isAdmin && !DrawFrom[i].IsGraded) //Bold ungraded homework + { + Font tFont = NB.GetFont(); + Node.NodeFont = new Font(tFont.FontFamily, tFont.Size, FontStyle.Bold); + } + count++; //How many submitted versions are there } } + if(!isAdmin && count ==0) //bold homework that has not yet been submitted + { + Font tFont = NB.GetFont(); + Master.NodeFont = new Font(tFont.FontFamily, tFont.Size, FontStyle.Bold); + } Top.Nodes.Add(Master); } diff --git a/EduNetworkBuilder/PersonProfileForm.cs b/EduNetworkBuilder/PersonProfileForm.cs index 186f5af..826124a 100644 --- a/EduNetworkBuilder/PersonProfileForm.cs +++ b/EduNetworkBuilder/PersonProfileForm.cs @@ -308,7 +308,7 @@ namespace EduNetworkBuilder { Node = new TreeNode(PC.UserName); Node.Tag = PC; - PC.WorkTree(Node); + PC.WorkTree(Node, true); Top.Nodes.Add(Node); } } @@ -374,6 +374,15 @@ namespace EduNetworkBuilder CurrentUser.ChangePassword(Password1); } + public Font GetFont() + { + if(tvClasswork.Font != null) return tvClasswork.Font; + if (Font != null) return Font; + BuilderWindow BW = NB.GetBuilderWin(); + if (BW != null) return BW.GetFont(); + return new Font(FontFamily.GenericSansSerif, 10.0F, FontStyle.Bold); + } + private void ChangeTreeDataTab(TreeDataTab WhatTo) { foreach (TreeDataTab one in Enum.GetValues(typeof(TreeDataTab)))