From 8c600642b678a1bb4e4f3bd462f5af015d4dfbd5 Mon Sep 17 00:00:00 2001 From: Tim Young Date: Mon, 14 Aug 2017 17:21:24 -0500 Subject: [PATCH] button calls function to try one for testing --- EduNetworkBuilder/Network.cs | 6 +++++- EduNetworkBuilder/PersonProfileForm.cs | 9 +++++++-- EduNetworkBuilder/SchoolworkClass.cs | 9 +++++++++ 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/EduNetworkBuilder/Network.cs b/EduNetworkBuilder/Network.cs index 40d588b..91c0771 100644 --- a/EduNetworkBuilder/Network.cs +++ b/EduNetworkBuilder/Network.cs @@ -1776,12 +1776,16 @@ namespace EduNetworkBuilder /// This func tries to non-visually process all the tests, seeing if the network is /// "solved." This is for homework that is "submitted." /// - public void CheckThatHomeworkIsSolved() + public HomeworkSolvedStatus CheckThatHomeworkIsSolved() { + bool HadIssues = false; foreach(NetTest NT in NetTests) { } + if(HadIssues) + return HomeworkSolvedStatus.CheckedFailed; + return HomeworkSolvedStatus.CheckedSucceeded; } } diff --git a/EduNetworkBuilder/PersonProfileForm.cs b/EduNetworkBuilder/PersonProfileForm.cs index e63cb8c..e42aa7f 100644 --- a/EduNetworkBuilder/PersonProfileForm.cs +++ b/EduNetworkBuilder/PersonProfileForm.cs @@ -994,16 +994,21 @@ namespace EduNetworkBuilder { if (CurrentUser == null) return; //Test all student's homework that is ungraded. + bool didone = false; foreach(PersonClass student in CurrentUser.Students) { foreach(SchoolworkClass homework in student.Projects) { - if(homework.IsSumbitted && !homework.IsGraded && homework.theProject.HomeworkStatus == HomeworkSolvedStatus.NeverChecked) + if(homework.IsSumbitted && !homework.IsGraded && homework.HomeworkStatus == HomeworkSolvedStatus.NeverChecked) { //We only need to test homework that is submitted and not graded. - + homework.CheckThatHomeworkIsSolved(); //Process it + didone = true; + break; //for now, just do one. For testing purposes } } + if(didone) + break; //For now, just do one. } } } diff --git a/EduNetworkBuilder/SchoolworkClass.cs b/EduNetworkBuilder/SchoolworkClass.cs index 8294116..7cf7274 100644 --- a/EduNetworkBuilder/SchoolworkClass.cs +++ b/EduNetworkBuilder/SchoolworkClass.cs @@ -249,6 +249,15 @@ namespace EduNetworkBuilder ThisID = WhoFor.UserSettings.IssueID(); } + public HomeworkSolvedStatus CheckThatHomeworkIsSolved() + { + if(theProject != null) + { + HomeworkStatus = theProject.CheckThatHomeworkIsSolved(); + } + return HomeworkStatus; + } + public void Save(XmlWriter writer) { //Save the language name