diff --git a/EduNetworkBuilder/PersonProfileForm.cs b/EduNetworkBuilder/PersonProfileForm.cs
index 1078745..c364e65 100644
--- a/EduNetworkBuilder/PersonProfileForm.cs
+++ b/EduNetworkBuilder/PersonProfileForm.cs
@@ -749,8 +749,20 @@ namespace EduNetworkBuilder
private void btnHWSave_Click(object sender, EventArgs e)
{
+ if (ViewedSchoolwork == null) return;
//Prompt for the filename where to save it
//Save the Schoolwork file
+ SaveFileDialog SFD = new SaveFileDialog();
+ SFD.InitialDirectory = CurrentUser.filepath; //Save wherever the teacher file is stored
+ SFD.OverwritePrompt = true;
+ SFD.FileName = ViewedSchoolwork.FileName;
+ SFD.AddExtension = true;
+ SFD.Filter = "EduNetworkBuilder Homework File (*.eduh)|*.eduh";
+ DialogResult Answer = SFD.ShowDialog();
+ if (Answer == DialogResult.Cancel) return;
+
+ //If we are here, we are ready to save it
+ ViewedSchoolwork.Save(SFD.FileName);
}
}
}
\ No newline at end of file
diff --git a/EduNetworkBuilder/SchoolworkClass.cs b/EduNetworkBuilder/SchoolworkClass.cs
index e86c17d..dbc21ed 100644
--- a/EduNetworkBuilder/SchoolworkClass.cs
+++ b/EduNetworkBuilder/SchoolworkClass.cs
@@ -18,6 +18,11 @@ namespace EduNetworkBuilder
/// The name of the project. Homework3, Quiz 4, etc.
///
public string Name = "";
+
+ ///
+ /// The Suggested filename for this homework. The Name + ".eduh"
+ ///
+ public string FileName { get { return Name + ".eduh"; } }
///
/// The short description of the project.
///