Pop up a "submit homework" button when the homework has been completed.

This commit is contained in:
Tim Young 2017-08-11 15:25:22 -05:00
parent 042d66e7c9
commit c905a5a952
3 changed files with 27 additions and 7 deletions

View File

@ -120,6 +120,7 @@ namespace EduNetworkBuilder
dest.PuzzleName = source.PuzzleName; dest.PuzzleName = source.PuzzleName;
dest.NetMessage = new LanguageStrings(source.NetMessage); dest.NetMessage = new LanguageStrings(source.NetMessage);
dest.WhatFrom = source.WhatFrom; //We remember the schoolwork class we came from. dest.WhatFrom = source.WhatFrom; //We remember the schoolwork class we came from.
dest.PuzzleIsSolved = source.PuzzleIsSolved;
} }
public Network Clone() public Network Clone()
@ -898,6 +899,8 @@ namespace EduNetworkBuilder
//kill all extra windows that no longer need to be open. //kill all extra windows that no longer need to be open.
KillAllExtraWindows(); KillAllExtraWindows();
if (WhatFrom == null)
{
DialogResult answer = MessageBox.Show(NB.Translate("N_MarkAsSolvedDone"), NB.Translate("_Solved"), MessageBoxButtons.YesNo); DialogResult answer = MessageBox.Show(NB.Translate("N_MarkAsSolvedDone"), NB.Translate("_Solved"), MessageBoxButtons.YesNo);
if (answer == DialogResult.Yes) if (answer == DialogResult.Yes)
@ -907,6 +910,19 @@ namespace EduNetworkBuilder
LBW.ShowDialog(); LBW.ShowDialog();
} }
} }
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)
{
KillAllExtraWindows(true);
BuilderWindow BW = NB.GetBuilderWin();
BW.SubmitHomework();
}
}
}
void KillAllExtraWindows(bool EvenRTF=false) void KillAllExtraWindows(bool EvenRTF=false)
{ {

View File

@ -2034,7 +2034,7 @@ namespace EduNetworkBuilder
UpdateMenu(); UpdateMenu();
} }
private void SubmitHomework() public void SubmitHomework()
{ {
if (myNetwork.WhatFrom == null) return; //We cannot submit it if (myNetwork.WhatFrom == null) return; //We cannot submit it

View File

@ -1881,4 +1881,8 @@
<value>Name already exists.</value> <value>Name already exists.</value>
<comment>PC_HWHasName = Name already exists.</comment> <comment>PC_HWHasName = Name already exists.</comment>
</data> </data>
<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>
<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>
</root> </root>