Move homework test status to schoolwork class

This commit is contained in:
Tim Young 2017-08-14 16:17:50 -05:00
parent c07247bb66
commit eac09a2d80
3 changed files with 9 additions and 8 deletions

View File

@ -66,8 +66,6 @@ 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>
@ -245,9 +243,6 @@ 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;
@ -362,8 +357,6 @@ 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

View File

@ -998,7 +998,7 @@ namespace EduNetworkBuilder
{
foreach(SchoolworkClass homework in student.Projects)
{
if(homework.IsSumbitted && !homework.IsGraded)
if(homework.IsSumbitted && !homework.IsGraded && homework.theProject.HomeworkStatus == HomeworkSolvedStatus.NeverChecked)
{
//We only need to test homework that is submitted and not graded.

View File

@ -45,6 +45,9 @@ namespace EduNetworkBuilder
public DateTime SaveDate; //The date this file was saved.
public UInt64 ThisID { get; protected set; }
public HomeworkSolvedStatus HomeworkStatus = HomeworkSolvedStatus.NeverChecked;
protected SchoolworkClass() { }
public SchoolworkClass(XmlNode TheNode)
@ -177,6 +180,9 @@ namespace EduNetworkBuilder
case "savedate":
DateTime.TryParse(Individual.InnerText, out currentOne.SaveDate);
break;
case "homeworkstatus":
currentOne.HomeworkStatus = NB.ParseEnum<HomeworkSolvedStatus>(Individual.InnerText);
break;
case "ismaster":
bool.TryParse(Individual.InnerText, out currentOne.isMaster);
break;
@ -257,6 +263,8 @@ namespace EduNetworkBuilder
writer.WriteElementString("SaveDate", SaveDate.ToString());
writer.WriteElementString("IsMaster", isMaster.ToString());
writer.WriteElementString("IsGraded", IsGraded.ToString());
if (HomeworkStatus != HomeworkSolvedStatus.NeverChecked)
writer.WriteElementString("HomeworkStatus", HomeworkStatus.ToString());
writer.WriteElementString("IsSubmitted", IsSumbitted.ToString());
if (theProject != null) theProject.Save(writer);
writer.WriteEndElement();