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
{
//It was homework. Ask if we want to submit it.
DialogResult answer = MessageBox.Show(NB.Translate("N_PromptToSubmit"), NB.Translate("_Solved"), MessageBoxButtons.YesNo);
if (answer == DialogResult.Yes)
if (!WhatFrom.IsGraded)
{
KillAllExtraWindows(true);
BuilderWindow BW = NB.GetBuilderWin();
BW.SubmitHomework();
//It was homework. Ask if we want to submit it.
DialogResult answer = MessageBox.Show(NB.Translate("N_PromptToSubmit"), NB.Translate("_Solved"), MessageBoxButtons.YesNo);
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;
PersonProfileForm PPF = new PersonProfileForm(CurrentUser);
PPF.Edit();
UpdateMenu();
ReturnToProfile();
}
private void markAsGradedToolStripMenuItem_Click(object sender, EventArgs e)
@ -2108,6 +2106,14 @@ namespace EduNetworkBuilder
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)
{
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>
<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 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>