Add a button for generating student files

This commit is contained in:
Tim Young 2017-08-02 11:10:34 -05:00
parent 1675a000a1
commit b1e015e624
4 changed files with 113 additions and 85 deletions

View File

@ -11,6 +11,7 @@ namespace EduNetworkBuilder
public class PersonClass public class PersonClass
{ {
public string filepath=""; //the path of the file. We use the username as the file-name. public string filepath=""; //the path of the file. We use the username as the file-name.
public string StudentFilePath = "";//If admin, this is used to store the path of the directory where student files are stored.
string _UserName=""; string _UserName="";
/// <summary> /// <summary>
@ -123,6 +124,9 @@ namespace EduNetworkBuilder
case "altpassword": case "altpassword":
AltPassword = Individual.InnerText; AltPassword = Individual.InnerText;
break; break;
case "studentfilepath":
StudentFilePath = Individual.InnerText;
break;
case "isadmin": case "isadmin":
bool isadmin = false; bool isadmin = false;
bool.TryParse(Individual.InnerText, out isadmin); bool.TryParse(Individual.InnerText, out isadmin);
@ -190,6 +194,8 @@ namespace EduNetworkBuilder
writer.WriteElementString("UserName", UserName); writer.WriteElementString("UserName", UserName);
writer.WriteElementString("FullName", FullName); writer.WriteElementString("FullName", FullName);
writer.WriteElementString("PasswordHint", PasswordHint); writer.WriteElementString("PasswordHint", PasswordHint);
if(isAdmin) //only admins have students, so they are the only ones who need to store this path
writer.WriteElementString("StudentFilePath", StudentFilePath);
writer.WriteElementString("AltPassword", AltPassword); writer.WriteElementString("AltPassword", AltPassword);
writer.WriteElementString("IsAdmin", isAdmin.ToString()); writer.WriteElementString("IsAdmin", isAdmin.ToString());
writer.WriteElementString("ChangePasswordAtLogin", ChangePassAtFirstLogin.ToString()); writer.WriteElementString("ChangePasswordAtLogin", ChangePassAtFirstLogin.ToString());

View File

@ -38,6 +38,7 @@
this.TabClasswork = new System.Windows.Forms.TabPage(); this.TabClasswork = new System.Windows.Forms.TabPage();
this.tcTreeData = new System.Windows.Forms.TabControl(); this.tcTreeData = new System.Windows.Forms.TabControl();
this.tabClass = new System.Windows.Forms.TabPage(); this.tabClass = new System.Windows.Forms.TabPage();
this.btnImportStudents = new System.Windows.Forms.Button();
this.TabHomework = new System.Windows.Forms.TabPage(); this.TabHomework = new System.Windows.Forms.TabPage();
this.btnLaunch = new System.Windows.Forms.Button(); this.btnLaunch = new System.Windows.Forms.Button();
this.btnHWDelete = new System.Windows.Forms.Button(); this.btnHWDelete = new System.Windows.Forms.Button();
@ -52,16 +53,16 @@
this.tbHWName = new System.Windows.Forms.TextBox(); this.tbHWName = new System.Windows.Forms.TextBox();
this.tbHWClass = new System.Windows.Forms.TextBox(); this.tbHWClass = new System.Windows.Forms.TextBox();
this.TabStudents = new System.Windows.Forms.TabPage(); this.TabStudents = new System.Windows.Forms.TabPage();
this.TabStudent = new System.Windows.Forms.TabPage();
this.btnStudentUpdateFile = new System.Windows.Forms.Button();
this.btnStudentChangePassword = new System.Windows.Forms.Button();
this.lblStudentFullName = new System.Windows.Forms.Label();
this.tbStudentFullName = new System.Windows.Forms.TextBox();
this.lblStudentUserName = new System.Windows.Forms.Label();
this.tbStudentUsername = new System.Windows.Forms.TextBox();
this.tvClasswork = new System.Windows.Forms.TreeView(); this.tvClasswork = new System.Windows.Forms.TreeView();
this.btnExit = new System.Windows.Forms.Button(); this.btnExit = new System.Windows.Forms.Button();
this.TabStudent = new System.Windows.Forms.TabPage(); this.btnGenerateStudentFiles = new System.Windows.Forms.Button();
this.tbStudentUsername = new System.Windows.Forms.TextBox();
this.lblStudentUserName = new System.Windows.Forms.Label();
this.tbStudentFullName = new System.Windows.Forms.TextBox();
this.lblStudentFullName = new System.Windows.Forms.Label();
this.btnStudentChangePassword = new System.Windows.Forms.Button();
this.btnStudentUpdateFile = new System.Windows.Forms.Button();
this.btnImportStudents = new System.Windows.Forms.Button();
this.tcTabControl.SuspendLayout(); this.tcTabControl.SuspendLayout();
this.TabProfile.SuspendLayout(); this.TabProfile.SuspendLayout();
this.TabClasswork.SuspendLayout(); this.TabClasswork.SuspendLayout();
@ -169,6 +170,7 @@
// //
// tabClass // tabClass
// //
this.tabClass.Controls.Add(this.btnGenerateStudentFiles);
this.tabClass.Controls.Add(this.btnImportStudents); this.tabClass.Controls.Add(this.btnImportStudents);
this.tabClass.Location = new System.Drawing.Point(4, 25); this.tabClass.Location = new System.Drawing.Point(4, 25);
this.tabClass.Name = "tabClass"; this.tabClass.Name = "tabClass";
@ -178,6 +180,16 @@
this.tabClass.Text = "Class"; this.tabClass.Text = "Class";
this.tabClass.UseVisualStyleBackColor = true; this.tabClass.UseVisualStyleBackColor = true;
// //
// btnImportStudents
//
this.btnImportStudents.Location = new System.Drawing.Point(6, 6);
this.btnImportStudents.Name = "btnImportStudents";
this.btnImportStudents.Size = new System.Drawing.Size(152, 23);
this.btnImportStudents.TabIndex = 2;
this.btnImportStudents.Text = "Import Students";
this.btnImportStudents.UseVisualStyleBackColor = true;
this.btnImportStudents.Click += new System.EventHandler(this.btnImportStudents_Click);
//
// TabHomework // TabHomework
// //
this.TabHomework.Controls.Add(this.btnLaunch); this.TabHomework.Controls.Add(this.btnLaunch);
@ -311,6 +323,74 @@
this.TabStudents.Text = "Students"; this.TabStudents.Text = "Students";
this.TabStudents.UseVisualStyleBackColor = true; this.TabStudents.UseVisualStyleBackColor = true;
// //
// TabStudent
//
this.TabStudent.Controls.Add(this.btnStudentUpdateFile);
this.TabStudent.Controls.Add(this.btnStudentChangePassword);
this.TabStudent.Controls.Add(this.lblStudentFullName);
this.TabStudent.Controls.Add(this.tbStudentFullName);
this.TabStudent.Controls.Add(this.lblStudentUserName);
this.TabStudent.Controls.Add(this.tbStudentUsername);
this.TabStudent.Location = new System.Drawing.Point(4, 25);
this.TabStudent.Name = "TabStudent";
this.TabStudent.Padding = new System.Windows.Forms.Padding(3);
this.TabStudent.Size = new System.Drawing.Size(256, 206);
this.TabStudent.TabIndex = 3;
this.TabStudent.Text = "Student";
this.TabStudent.UseVisualStyleBackColor = true;
//
// btnStudentUpdateFile
//
this.btnStudentUpdateFile.Location = new System.Drawing.Point(54, 158);
this.btnStudentUpdateFile.Name = "btnStudentUpdateFile";
this.btnStudentUpdateFile.Size = new System.Drawing.Size(96, 42);
this.btnStudentUpdateFile.TabIndex = 6;
this.btnStudentUpdateFile.Text = "Update File";
this.btnStudentUpdateFile.UseVisualStyleBackColor = true;
//
// btnStudentChangePassword
//
this.btnStudentChangePassword.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.btnStudentChangePassword.Location = new System.Drawing.Point(156, 158);
this.btnStudentChangePassword.Name = "btnStudentChangePassword";
this.btnStudentChangePassword.Size = new System.Drawing.Size(94, 42);
this.btnStudentChangePassword.TabIndex = 5;
this.btnStudentChangePassword.Text = "Change Password";
this.btnStudentChangePassword.UseVisualStyleBackColor = true;
//
// lblStudentFullName
//
this.lblStudentFullName.AutoSize = true;
this.lblStudentFullName.Location = new System.Drawing.Point(17, 37);
this.lblStudentFullName.Name = "lblStudentFullName";
this.lblStudentFullName.Size = new System.Drawing.Size(71, 17);
this.lblStudentFullName.TabIndex = 3;
this.lblStudentFullName.Text = "Full Name";
//
// tbStudentFullName
//
this.tbStudentFullName.Location = new System.Drawing.Point(107, 34);
this.tbStudentFullName.Name = "tbStudentFullName";
this.tbStudentFullName.Size = new System.Drawing.Size(134, 22);
this.tbStudentFullName.TabIndex = 2;
//
// lblStudentUserName
//
this.lblStudentUserName.AutoSize = true;
this.lblStudentUserName.Location = new System.Drawing.Point(17, 9);
this.lblStudentUserName.Name = "lblStudentUserName";
this.lblStudentUserName.Size = new System.Drawing.Size(79, 17);
this.lblStudentUserName.TabIndex = 1;
this.lblStudentUserName.Text = "User Name";
//
// tbStudentUsername
//
this.tbStudentUsername.Enabled = false;
this.tbStudentUsername.Location = new System.Drawing.Point(107, 6);
this.tbStudentUsername.Name = "tbStudentUsername";
this.tbStudentUsername.Size = new System.Drawing.Size(134, 22);
this.tbStudentUsername.TabIndex = 0;
//
// tvClasswork // tvClasswork
// //
this.tvClasswork.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) this.tvClasswork.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
@ -332,83 +412,15 @@
this.btnExit.UseVisualStyleBackColor = true; this.btnExit.UseVisualStyleBackColor = true;
this.btnExit.Click += new System.EventHandler(this.btnExit_Click); this.btnExit.Click += new System.EventHandler(this.btnExit_Click);
// //
// TabStudent // btnGenerateStudentFiles
// //
this.TabStudent.Controls.Add(this.btnStudentUpdateFile); this.btnGenerateStudentFiles.Location = new System.Drawing.Point(6, 35);
this.TabStudent.Controls.Add(this.btnStudentChangePassword); this.btnGenerateStudentFiles.Name = "btnGenerateStudentFiles";
this.TabStudent.Controls.Add(this.lblStudentFullName); this.btnGenerateStudentFiles.Size = new System.Drawing.Size(152, 23);
this.TabStudent.Controls.Add(this.tbStudentFullName); this.btnGenerateStudentFiles.TabIndex = 3;
this.TabStudent.Controls.Add(this.lblStudentUserName); this.btnGenerateStudentFiles.Text = "Generate Files";
this.TabStudent.Controls.Add(this.tbStudentUsername); this.btnGenerateStudentFiles.UseVisualStyleBackColor = true;
this.TabStudent.Location = new System.Drawing.Point(4, 25); this.btnGenerateStudentFiles.Click += new System.EventHandler(this.btnGenerateStudentFiles_Click);
this.TabStudent.Name = "TabStudent";
this.TabStudent.Padding = new System.Windows.Forms.Padding(3);
this.TabStudent.Size = new System.Drawing.Size(256, 206);
this.TabStudent.TabIndex = 3;
this.TabStudent.Text = "Student";
this.TabStudent.UseVisualStyleBackColor = true;
//
// tbStudentUsername
//
this.tbStudentUsername.Enabled = false;
this.tbStudentUsername.Location = new System.Drawing.Point(107, 6);
this.tbStudentUsername.Name = "tbStudentUsername";
this.tbStudentUsername.Size = new System.Drawing.Size(134, 22);
this.tbStudentUsername.TabIndex = 0;
//
// lblStudentUserName
//
this.lblStudentUserName.AutoSize = true;
this.lblStudentUserName.Location = new System.Drawing.Point(17, 9);
this.lblStudentUserName.Name = "lblStudentUserName";
this.lblStudentUserName.Size = new System.Drawing.Size(79, 17);
this.lblStudentUserName.TabIndex = 1;
this.lblStudentUserName.Text = "User Name";
//
// tbStudentFullName
//
this.tbStudentFullName.Location = new System.Drawing.Point(107, 34);
this.tbStudentFullName.Name = "tbStudentFullName";
this.tbStudentFullName.Size = new System.Drawing.Size(134, 22);
this.tbStudentFullName.TabIndex = 2;
//
// lblStudentFullName
//
this.lblStudentFullName.AutoSize = true;
this.lblStudentFullName.Location = new System.Drawing.Point(17, 37);
this.lblStudentFullName.Name = "lblStudentFullName";
this.lblStudentFullName.Size = new System.Drawing.Size(71, 17);
this.lblStudentFullName.TabIndex = 3;
this.lblStudentFullName.Text = "Full Name";
//
// btnStudentChangePassword
//
this.btnStudentChangePassword.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.btnStudentChangePassword.Location = new System.Drawing.Point(156, 158);
this.btnStudentChangePassword.Name = "btnStudentChangePassword";
this.btnStudentChangePassword.Size = new System.Drawing.Size(94, 42);
this.btnStudentChangePassword.TabIndex = 5;
this.btnStudentChangePassword.Text = "Change Password";
this.btnStudentChangePassword.UseVisualStyleBackColor = true;
//
// btnStudentUpdateFile
//
this.btnStudentUpdateFile.Location = new System.Drawing.Point(54, 158);
this.btnStudentUpdateFile.Name = "btnStudentUpdateFile";
this.btnStudentUpdateFile.Size = new System.Drawing.Size(96, 42);
this.btnStudentUpdateFile.TabIndex = 6;
this.btnStudentUpdateFile.Text = "Update File";
this.btnStudentUpdateFile.UseVisualStyleBackColor = true;
//
// btnImportStudents
//
this.btnImportStudents.Location = new System.Drawing.Point(6, 6);
this.btnImportStudents.Name = "btnImportStudents";
this.btnImportStudents.Size = new System.Drawing.Size(152, 23);
this.btnImportStudents.TabIndex = 2;
this.btnImportStudents.Text = "Import Students";
this.btnImportStudents.UseVisualStyleBackColor = true;
this.btnImportStudents.Click += new System.EventHandler(this.btnImportStudents_Click);
// //
// PersonProfileForm // PersonProfileForm
// //
@ -470,5 +482,6 @@
private System.Windows.Forms.Button btnStudentUpdateFile; private System.Windows.Forms.Button btnStudentUpdateFile;
private System.Windows.Forms.Button btnStudentChangePassword; private System.Windows.Forms.Button btnStudentChangePassword;
private System.Windows.Forms.Button btnImportStudents; private System.Windows.Forms.Button btnImportStudents;
private System.Windows.Forms.Button btnGenerateStudentFiles;
} }
} }

View File

@ -71,6 +71,7 @@ namespace EduNetworkBuilder
btnHWDelete.Text = NB.Translate("_Delete"); btnHWDelete.Text = NB.Translate("_Delete");
btnImportStudents.Text = NB.Translate("PPF_ImportStudents"); btnImportStudents.Text = NB.Translate("PPF_ImportStudents");
btnLaunch.Text = NB.Translate("PPF_Launch"); btnLaunch.Text = NB.Translate("PPF_Launch");
btnGenerateStudentFiles.Text = NB.Translate("PPF_GenerateFiles");
} }
private void LocalSetup() private void LocalSetup()
@ -654,5 +655,9 @@ namespace EduNetworkBuilder
MessageBox.Show(message); MessageBox.Show(message);
} }
private void btnGenerateStudentFiles_Click(object sender, EventArgs e)
{
}
} }
} }

View File

@ -1789,6 +1789,10 @@
<value>Change password at first login</value> <value>Change password at first login</value>
<comment>PPF_ForcePWChange = Change password at first login</comment> <comment>PPF_ForcePWChange = Change password at first login</comment>
</data> </data>
<data name="PPF_GenerateFiles" xml:space="preserve">
<value>Generate Files</value>
<comment>PPF_GenerateFiles = Generate Files</comment>
</data>
<data name="PPF_ImportSettings" xml:space="preserve"> <data name="PPF_ImportSettings" xml:space="preserve">
<value>Specify Import Settings</value> <value>Specify Import Settings</value>
<comment>PPF_ImportSettings = Specify Import Settings</comment> <comment>PPF_ImportSettings = Specify Import Settings</comment>