Pieces for testing and tracking status of homework checking.

This commit is contained in:
Tim Young 2017-08-14 16:13:17 -05:00
parent 98fae3192f
commit c07247bb66
4 changed files with 51 additions and 1 deletions

View File

@ -84,6 +84,7 @@ namespace EduNetworkBuilder
Level6_NeedVLANs, Level6_SwitchedUp,
}
public enum HomeworkSolvedStatus { NeverChecked, CheckedFailed, CheckedSucceeded }
public enum DebugPausePoint { none=0, packet_create=1, packet_kill=2,
packet_in=4, packet_out=8, packet_duplicate=16, all=63,
dump=256, pause=512}

View File

@ -66,6 +66,8 @@ namespace EduNetworkBuilder
private List<Image> PacketImages = new List<Image>();
private List<PingTestStatus> PingTestStats = new List<PingTestStatus>();
public HomeworkSolvedStatus HomeworkStatus = HomeworkSolvedStatus.NeverChecked;
/// <summary>
/// WhatFrom: If we are launched from a homework, we remember it here.
/// </summary>
@ -243,6 +245,9 @@ namespace EduNetworkBuilder
case "sortorder":
double.TryParse(Individual.InnerText, out SortOrder);
break;
case "homeworkstatus":
HomeworkStatus = NB.ParseEnum<HomeworkSolvedStatus>(Individual.InnerText);
break;
case "startinghelplevel":
StartingHelpLevel = NB.ParseEnum<NetTestVerbosity>(Individual.InnerText);
HintsToDisplay = StartingHelpLevel;
@ -357,6 +362,8 @@ namespace EduNetworkBuilder
writer.WriteElementString("startinghelplevel", StartingHelpLevel.ToString());
writer.WriteElementString("vlansenabled", VLANsEnabled.ToString());
writer.WriteElementString("VLANPacketColors", VLANPacketColors.ToString());
if(HomeworkStatus != HomeworkSolvedStatus.NeverChecked)
writer.WriteElementString("HomeworkStatus", HomeworkStatus.ToString());
if (!StraightToFile)
writer.WriteElementString("PuzzleName", PuzzleName);
//Save all the devices
@ -1771,6 +1778,18 @@ namespace EduNetworkBuilder
return b;
}
/// <summary>
/// This func tries to non-visually process all the tests, seeing if the network is
/// "solved." This is for homework that is "submitted."
/// </summary>
public void CheckThatHomeworkIsSolved()
{
foreach(NetTest NT in NetTests)
{
}
}
}
}

View File

@ -70,6 +70,7 @@
this.tvClasswork = new System.Windows.Forms.TreeView();
this.btnExit = new System.Windows.Forms.Button();
this.cbTeacherAutoDHCP = new System.Windows.Forms.CheckBox();
this.bthAutoTestStudentHomework = new System.Windows.Forms.Button();
this.tcTabControl.SuspendLayout();
this.TabProfile.SuspendLayout();
this.TabClasswork.SuspendLayout();
@ -379,6 +380,7 @@
//
// TabStudents
//
this.TabStudents.Controls.Add(this.bthAutoTestStudentHomework);
this.TabStudents.Controls.Add(this.btnReadAllStudentHomework);
this.TabStudents.Controls.Add(this.btnAllHomeworkToStudents);
this.TabStudents.Location = new System.Drawing.Point(4, 25);
@ -509,6 +511,16 @@
this.cbTeacherAutoDHCP.UseVisualStyleBackColor = true;
this.cbTeacherAutoDHCP.CheckedChanged += new System.EventHandler(this.cbTeacherAutoDHCP_CheckedChanged);
//
// bthAutoTestStudentHomework
//
this.bthAutoTestStudentHomework.Location = new System.Drawing.Point(23, 108);
this.bthAutoTestStudentHomework.Name = "bthAutoTestStudentHomework";
this.bthAutoTestStudentHomework.Size = new System.Drawing.Size(207, 23);
this.bthAutoTestStudentHomework.TabIndex = 8;
this.bthAutoTestStudentHomework.Text = "Auto-test homework";
this.bthAutoTestStudentHomework.UseVisualStyleBackColor = true;
this.bthAutoTestStudentHomework.Click += new System.EventHandler(this.bthAutoTestStudentHomework_Click);
//
// PersonProfileForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
@ -578,5 +590,6 @@
private System.Windows.Forms.Button btnReadAllStudentHomework;
private System.Windows.Forms.Button btnExportStudentPasswords;
private System.Windows.Forms.CheckBox cbTeacherAutoDHCP;
private System.Windows.Forms.Button bthAutoTestStudentHomework;
}
}

View File

@ -989,5 +989,22 @@ namespace EduNetworkBuilder
{
CurrentUser.UserSettings.AutoDHCPAllMachinesAtNetworkLoad = cbTeacherAutoDHCP.Checked;
}
private void bthAutoTestStudentHomework_Click(object sender, EventArgs e)
{
if (CurrentUser == null) return;
//Test all student's homework that is ungraded.
foreach(PersonClass student in CurrentUser.Students)
{
foreach(SchoolworkClass homework in student.Projects)
{
if(homework.IsSumbitted && !homework.IsGraded)
{
//We only need to test homework that is submitted and not graded.
}
}
}
}
}
}