Allow teacher to mark as graded when something is completed.

This commit is contained in:
Tim Young 2017-08-12 16:58:41 -05:00
parent 6fbaf98299
commit 71f43c4f24
4 changed files with 48 additions and 11 deletions

View File

@ -911,6 +911,21 @@ namespace EduNetworkBuilder
} }
} }
else else
{
PersonClass CurrentUser = NB.GetUser();
if (CurrentUser != null && CurrentUser.isAdmin)
{
//It was homework. Ask if we want to submit it.
DialogResult answer = MessageBox.Show(NB.Translate("N_PromptToGrade"), NB.Translate("_Solved"), MessageBoxButtons.YesNo);
if (answer == DialogResult.Yes)
{
KillAllExtraWindows(true);
BuilderWindow BW = NB.GetBuilderWin();
BW.MarkAsGraded();
}
}
else
{ {
//It was homework. Ask if we want to submit it. //It was homework. Ask if we want to submit it.
DialogResult answer = MessageBox.Show(NB.Translate("N_PromptToSubmit"), NB.Translate("_Solved"), MessageBoxButtons.YesNo); DialogResult answer = MessageBox.Show(NB.Translate("N_PromptToSubmit"), NB.Translate("_Solved"), MessageBoxButtons.YesNo);
@ -923,6 +938,7 @@ namespace EduNetworkBuilder
} }
} }
} }
}
void KillAllExtraWindows(bool EvenRTF=false) void KillAllExtraWindows(bool EvenRTF=false)
{ {

View File

@ -2088,7 +2088,8 @@ namespace EduNetworkBuilder
SubmitHomework(); SubmitHomework();
} }
private void markAsGradedToolStripMenuItem_Click(object sender, EventArgs e)
public void MarkAsGraded()
{ {
if (myNetwork.WhatFrom == null) return; //We cannot submit it if (myNetwork.WhatFrom == null) return; //We cannot submit it
@ -2102,6 +2103,11 @@ namespace EduNetworkBuilder
UpdateMenu(); UpdateMenu();
} }
private void markAsGradedToolStripMenuItem_Click(object sender, EventArgs e)
{
MarkAsGraded();
}
private void logoutToolStripMenuItem_Click(object sender, EventArgs e) private void logoutToolStripMenuItem_Click(object sender, EventArgs e)
{ {
if (CurrentUser == null) return; //Nobody to logout if (CurrentUser == null) return; //Nobody to logout

View File

@ -516,6 +516,7 @@ namespace EduNetworkBuilder
List<SchoolworkClass> DrawFrom = new List<SchoolworkClass>(); List<SchoolworkClass> DrawFrom = new List<SchoolworkClass>();
List<SchoolworkClass> MasterList = new List<SchoolworkClass>(); List<SchoolworkClass> MasterList = new List<SchoolworkClass>();
bool SomethingWasBolded = false; //Set this to true if we make something bold
DrawFrom.AddRange(Projects); DrawFrom.AddRange(Projects);
for (int i = DrawFrom.Count - 1; i >= 0; i--) for (int i = DrawFrom.Count - 1; i >= 0; i--)
@ -541,9 +542,12 @@ namespace EduNetworkBuilder
{ {
Top = theTop; Top = theTop;
} }
foreach(SchoolworkClass MasterSW in MasterList) Font tFont = NB.GetFont();
foreach (SchoolworkClass MasterSW in MasterList)
{ {
int count = 0; int count = 0;
int ungraded = 0;
Master = new TreeNode(MasterSW.Name); Master = new TreeNode(MasterSW.Name);
Master.Tag = MasterSW; Master.Tag = MasterSW;
@ -556,20 +560,27 @@ namespace EduNetworkBuilder
Master.Nodes.Add(Node); Master.Nodes.Add(Node);
if (ForTeacher && !DrawFrom[i].IsGraded) //Bold ungraded homework if (ForTeacher && !DrawFrom[i].IsGraded) //Bold ungraded homework
{ {
Font tFont = NB.GetFont();
Node.NodeFont = new Font(tFont.FontFamily, tFont.Size, FontStyle.Bold); Node.NodeFont = new Font(tFont.FontFamily, tFont.Size, FontStyle.Bold);
SomethingWasBolded = true;
ungraded++;
} }
count++; //How many submitted versions are there count++; //How many submitted versions are there
} }
} }
if(!ForTeacher && count ==0) //bold homework that has not yet been submitted if(!ForTeacher && count ==0) //bold homework that has not yet been submitted
{ {
Font tFont = NB.GetFont();
Master.NodeFont = new Font(tFont.FontFamily, tFont.Size, FontStyle.Bold); Master.NodeFont = new Font(tFont.FontFamily, tFont.Size, FontStyle.Bold);
SomethingWasBolded = true;
} else if(ForTeacher && ungraded > 0) //If we have ungraded submissions
{
Master.NodeFont = new Font(tFont.FontFamily, tFont.Size, FontStyle.Bold);
SomethingWasBolded = true;
} }
Top.Nodes.Add(Master); Top.Nodes.Add(Master);
} }
if(ForTeacher && SomethingWasBolded)
Top.NodeFont = new Font(tFont.FontFamily, tFont.Size, FontStyle.Bold);
return Top; return Top;
} }

View File

@ -1901,6 +1901,10 @@
<value>Unable to load user {0} : No such account found. No password available to decrypt account.</value> <value>Unable to load user {0} : No such account found. No password available to decrypt account.</value>
<comment>NB_TeacherUnableToLoadUserNoAcct = Unable to load user {0} : No such account found. No password available to decrypt account.</comment> <comment>NB_TeacherUnableToLoadUserNoAcct = Unable to load user {0} : No such account found. No password available to decrypt account.</comment>
</data> </data>
<data name="N_PromptToGrade" xml:space="preserve">
<value>The homework has passed all the tests. Would you like to Mark it as graded? If you want to keep wotking with it, click No. Go to "Edit" -&gt; "Mark as graded" when ready.</value>
<comment>N_PromptToGrade = The homework has passed all the tests. Would you like to Mark it as graded? If you want to keep wotking with it, click No. Go to "Edit" -&gt; "Mark as graded" when ready.</comment>
</data>
<data name="N_PromptToSubmit" xml:space="preserve"> <data name="N_PromptToSubmit" xml:space="preserve">
<value>You have completed the homework. Would you like to submit it? If you want to clean it up and submit later, click No. Go to "Edit" -&gt; "Submit" when you want to submit it.</value> <value>You have completed the homework. Would you like to submit it? If you want to clean it up and submit later, click No. Go to "Edit" -&gt; "Submit" when you want to submit it.</value>
<comment>N_PromptToSubmit = You have completed the homework. Would you like to submit it? If you want to clean it up and submit later, click No. Go to "Edit" -&gt; "Submit" when you want to submit it.</comment> <comment>N_PromptToSubmit = You have completed the homework. Would you like to submit it? If you want to clean it up and submit later, click No. Go to "Edit" -&gt; "Submit" when you want to submit it.</comment>