If teacher opens a homework that is already graded. Do not prompt to grade it again

This commit is contained in:
Tim Young 2017-08-12 17:09:35 -05:00
parent 61aa50044e
commit 6a51ed058a
3 changed files with 35 additions and 10 deletions

View File

@ -934,14 +934,29 @@ namespace EduNetworkBuilder
} }
else else
{ {
//It was homework. Ask if we want to submit it. if (!WhatFrom.IsGraded)
DialogResult answer = MessageBox.Show(NB.Translate("N_PromptToSubmit"), NB.Translate("_Solved"), MessageBoxButtons.YesNo);
if (answer == DialogResult.Yes)
{ {
KillAllExtraWindows(true); //It was homework. Ask if we want to submit it.
BuilderWindow BW = NB.GetBuilderWin(); DialogResult answer = MessageBox.Show(NB.Translate("N_PromptToSubmit"), NB.Translate("_Solved"), MessageBoxButtons.YesNo);
BW.SubmitHomework();
if (answer == DialogResult.Yes)
{
KillAllExtraWindows(true);
BuilderWindow BW = NB.GetBuilderWin();
BW.SubmitHomework();
}
}
else
{
//It was homework. Ask if we want to submit it.
DialogResult answer = MessageBox.Show(NB.Translate("N_SolvedAlreadyGraded"), NB.Translate("_Solved"), MessageBoxButtons.YesNo);
if (answer == DialogResult.Yes)
{
KillAllExtraWindows(true);
BuilderWindow BW = NB.GetBuilderWin();
BW.ReturnToProfile();
}
} }
} }
} }

View File

@ -2098,9 +2098,7 @@ namespace EduNetworkBuilder
myNetwork.WhatFrom.IsGraded = true; myNetwork.WhatFrom.IsGraded = true;
PersonProfileForm PPF = new PersonProfileForm(CurrentUser); ReturnToProfile();
PPF.Edit();
UpdateMenu();
} }
private void markAsGradedToolStripMenuItem_Click(object sender, EventArgs e) private void markAsGradedToolStripMenuItem_Click(object sender, EventArgs e)
@ -2108,6 +2106,14 @@ namespace EduNetworkBuilder
MarkAsGraded(); MarkAsGraded();
} }
public void ReturnToProfile()
{
if (CurrentUser == null) return; //We need to have a user or we will blow up
PersonProfileForm PPF = new PersonProfileForm(CurrentUser);
PPF.Edit();
UpdateMenu();
}
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

@ -1909,4 +1909,8 @@
<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>
</data> </data>
<data name="N_SolvedAlreadyGraded" xml:space="preserve">
<value>The homework passed all the tests, but is already graded. Would you like to return to the Profile?</value>
<comment>N_SolvedAlreadyGraded = The homework passed all the tests, but is already graded. Would you like to return to the Profile?</comment>
</data>
</root> </root>