Ejemplo n.º 1
0
        public static void startFull(RequiredClasses Obj, String folder)
        {
            Obj.splitRequiredClasses();
            string[]  lines  = System.IO.File.ReadAllLines(@Obj.getStudentPath()); //use studentPathway
            ArrayList newDoc = LineSplit.splitLine(lines);

            string[]       oneColumn   = (string[])newDoc.ToArray(typeof(string));
            List <Student> studentList = FullClearance.createStudent(oneColumn);

            modifyEU(studentList); //fixes the in progress semester case

            ParseData.partTime(studentList);
            ParseData.setTotalCredComplete(studentList, Obj);
            foreach (Course x in Obj.blank)
            {
                Console.WriteLine(x.getCourseName());
            }
            foreach (Student x in studentList)
            {
                requiredCourseMethods.checkRequiredCourses(x, Obj);
                requiredCourseMethods.checkSkills(x, Obj);
                requiredCourseMethods.checkWriting(x, Obj);
            }
            FullClearance.sortStudents(studentList);
            List <Student> Cl = FullClearance.createTrFiles();

            ParseData.GenExcelFull(folder, FullClearance.getNew(), FullClearance.getCleared(), FullClearance.getPending());
            Application.Exit();
        }
Ejemplo n.º 2
0
        public static void Start(RequiredClasses Obj, String folder)
        {
            Obj.splitRequiredClasses();
            string[]  lines  = System.IO.File.ReadAllLines(@Obj.getStudentPath()); //use studentPathway
            ArrayList newDoc = LineSplit.splitLine(lines);

            string[]       oneColumn   = (string[])newDoc.ToArray(typeof(string));
            List <Student> studentList = ParseData.createStudent(oneColumn);

            modifyEU(studentList); //fixes the in progress semester case
            ParseData.partTime(studentList);
            ParseData.setTotalCredComplete(studentList, Obj);
            foreach (Course x in Obj.blank)
            {
                Console.WriteLine(x.getCourseName());
            }
            foreach (Student x in studentList)
            {
                requiredCourseMethods.checkRequiredCourses(x, Obj);
                requiredCourseMethods.checkSkills(x, Obj);
                requiredCourseMethods.checkWriting(x, Obj);
            }
            ParseData.GenExcel(studentList, Obj, folder);
            //string currentDir = Form1.getFolder();
            createTextDoc.createText(folder, studentList, Obj);
            Application.Exit();
        }
        public static void checkSkills(Student student, RequiredClasses Object) //This method checks and sets each student's Skill courses (if any) with the correct information
                                                                                //always use the same requiredClasses object when calling these methods
        {
            List <Semester> semest = student.getStudentSemesters();

            for (int i = 0; i < semest.Count; i++)
            {
                if (semest[i].getInProg() && !student.getSkillSat().Contains("SATISFIED"))    //if the stud's writing req hasn't been satisfied, check for Skill courses in progress
                                                                                              //if it has, don't need to go through this process, hence the '!'
                {
                    for (int j = 0; j < semest[i].getCourseList().Count; j++)
                    {
                        List <Course> temp = semest[i].getCourseList();
                        for (int k = 0; k < Object.skills.Count; k++)
                        {
                            if (Object.skills[k].Contains(temp[j].getCourseNum()))  //if each name in the writing arraylist(string) contains this requirement,
                            {
                                temp[j].setStatus("ON TRACK");                      //set necessary info
                                student.setSkillSat("ON TRACK");
                                student.addSkills(temp[j]);                         //add course to student's Skill course array
                            }
                        }
                    }
                }
            }
        }
            public static void setTotalCredComplete(List <Student> stud, RequiredClasses rc)
            {
                for (int i = 0; i < stud.Count; i++)
                {
                    double          gradedInProg = 0.0;
                    List <Semester> semList      = stud[i].getStudentSemesters();
                    int             count        = 0; //the count for total credits completed
                    double          count1       = 0; //the count for credits in progess
                    int             count2       = 0; //the count for graded credits
                    for (int j = 0; j < semList.Count; j++)
                    {
                        List <Course> courseList = semList[j].getCourseList();
                        for (int k = 0; k < courseList.Count; k++)
                        {
                            string sub = courseList[k].getGrade(); // HERE
                            if (sub.Equals("A+") || sub.Equals("A") || sub.Equals("A-") ||
                                sub.Equals("B") || sub.Equals("B+") || sub.Equals("B-") ||
                                sub.Equals("C") || sub.Equals("C+") || sub.Equals("C-") ||
                                sub.Equals("D") || sub.Equals("D+") || sub.Equals("D-"))//gets all the graded credits and adds them in
                            //ojdhfalskdjf;alskjd
                            {
                                count2 += (int)courseList[k].getCreds();
                            }
                        }
                        if (!semList[j].getInProg())
                        {
                            count += semList[j].getCreditHours();//indicates in progress credits
                        }
                        else
                        {
                            count1      += semList[j].getCreditHours();//indicates any other type of credit that doesnt have a grade and isnt in progress
                            gradedInProg = count1;

                            for (int n = 0; n < semList[j].getCourseList().Count; n++)
                            {
                                for (int m = 0; m < rc.getnonLetterGraded().Count; m++)
                                {
                                    string studName = semList[j].getCourseList()[n].getCourseNum();
                                    string rcName   = rc.getnonLetterGraded()[m];
                                    if (rcName.Contains(studName))
                                    {
                                        gradedInProg = gradedInProg - semList[j].getCourseList()[n].getCreds();
                                    }
                                }
                            }
                        }
                        if (semList[j].getEUnits() == 0)//indicates an in progress writing class
                        {
                            count -= semList[j].getCreditHours();
                        }
                    }
                    stud[i].setGradedCreds(count2);//sets all the respective credits to the student
                    stud[i].setCredsInProgress(count1);
                    stud[i].setTotCred(count);
                    stud[i].setgradedcredsInProgess(gradedInProg);
                }
            }
        public static void checkWriting(Student student, RequiredClasses Object) //This method checks and sets each student's writing courses (if any) with the correct information
                                                                                 //always use the same requiredClasses object when calling these methods
        {
            List <Semester> semest = student.getStudentSemesters();

            for (int i = 0; i < semest.Count; i++)
            {
                if (semest[i].getInProg() && !student.getWritSat().Contains("SATISFIED"))   //if the stud's writing req hasn't been satisfied, check for writing courses in progress
                                                                                            //if it has, don't need to go through this process, hence the '!'
                {
                    for (int j = 0; j < semest[i].getCourseList().Count; j++)
                    {
                        List <Course> temp = semest[i].getCourseList();
                        for (int k = 0; k < Object.writing.Count; k++)
                        {
                            if (Object.writing[k].Contains(temp[j].getCourseNum()))
                            {
                                temp[j].setStatus("IN PROGRESS");                  //set course status and the student's WritSat
                                student.setWritSat("ON TRACK");
                                student.addWriting(temp[j]);                       //add this course to the student's writing course array

                                if (Object.writing[k].Contains("or more credits")) ///////////////////////////if each name in the writing arraylist(string) contains this requirement,
                                {
                                    int    b        = Object.writing[k].Length;
                                    string str      = Object.writing[k];
                                    int    numCreds = -5;
                                    for (int n = 0; n < b; n++)                     //find how many credits are needed,
                                    {
                                        if (str[n].Equals('1') || str[n].Equals('2') || str[n].Equals('3') || str[n].Equals('3') || str[n].Equals('4') || str[n].Equals('5') ||
                                            str[n].Equals('6') || str[n].Equals('7') || str[n].Equals('8') || str[n].Equals('9'))
                                        {
                                            numCreds = n;
                                            break;
                                        }
                                    }
                                    if (temp[j].getCreds() < numCreds)              //determine if student is taking enough credits in that course + set appropriately
                                    {
                                        student.setWritSat("OFF TRACK");
                                        student.addWriting(temp[j]);
                                        temp[j].setStatus("IN PROGRESS");
                                        continue;
                                    }
                                }                                                   ////////////////////////////////
                            }
                        }
                    }
                }
            }
        }
        public static Course[] checkRequiredCourses(Student student, RequiredClasses Object) //This method sets each student's required courses with the correct information
                                                                                             //always use the same requiredClasses object when calling these methods
        {
            Course[] actualcopy = new Course[Object.actual.Length];                          //copy of Actual

            for (int i = 0; i < actualcopy.Length; i++)                                      //make sure each Course object in actual is copied into actualcopy
            {
                actualcopy[i] = Object.actual[i];
            }
            List <Semester> semest = student.getStudentSemesters();  //temporary semester List, easier to understand

            for (int i = 0; i < semest.Count; i++)
            {
                List <Course> temp = semest[i].getCourseList(); //temporary Course List, easier to understand
                for (int k = 0; k < actualcopy.Length; k++)
                {
                    for (int j = 0; j < semest[i].getCourseList().Count; j++)
                    {
                        if (actualcopy[k].getCourseNum().Contains(temp[j].getCourseNum())) //if the student's course on the transcript matches one of the required courses in the list
                        {
                            actualcopy[k] = temp[j];                                       //copy the course + info
                            if (Object.getRequired()[k].Contains(temp[j].getCourseNum()) &&
                                (temp[j].getGrade().Equals("A") || temp[j].getGrade().Equals("A-") ||
                                 temp[j].getGrade().Equals("A+") || temp[j].getGrade().Equals("B") ||
                                 temp[j].getGrade().Equals("B-") || temp[j].getGrade().Equals("B+") ||
                                 temp[j].getGrade().Equals("C") || temp[j].getGrade().Equals("C-") ||
                                 temp[j].getGrade().Equals("C+") || temp[j].getGrade().Equals("D") ||
                                 temp[j].getGrade().Equals("D-") || temp[j].getGrade().Equals("D+") ||
                                 temp[j].getGrade().Equals("TR") || temp[j].Equals("H") ||
                                 temp[j].Equals("P") || temp[j].Equals("LP")))
                            {
                                actualcopy[k].setStatus("SATISFIED");           //if these grade conditions are met, then the student has satisfied this course, set info
                            }
                            if ((temp[j].getGrade().Contains("Progress")))      //modify Status and Track accordingly: means this course is in progress
                            {
                                actualcopy[k].setStatus("ON TRACK");
                                actualcopy[k].setTrack("IN PROGRESS");
                            }
                            break;
                        }
                    }
                }
            }
            student.setreqcourses(actualcopy); //stores copy of required courses Course array in the Student object with modified Status and Track +etc
            return(actualcopy);
        }
Ejemplo n.º 7
0
 public static void setObj(RequiredClasses Object)
 {
     Obj = Object;
 }
Ejemplo n.º 8
0
        public static void createText(string path, List <Student> studentList, RequiredClasses Object)
        {
            string doc = path + "/" + "studReports.txt";

            using (System.IO.StreamWriter file = new System.IO.StreamWriter(doc, false))
            {
                foreach (Student x in studentList)
                {
                    List <String> tempReqCourses = Object.getRequired();
                    file.WriteLine("GWID " + x.getGWid() + "                " + x.getTrack());       // + stud on or off track
                    file.WriteLine();
                    file.WriteLine(x.getStudentName() + '\n');
                    file.WriteLine();
                    file.WriteLine("REQUIRED COURSES" + '\n');
                    file.WriteLine();
                    Course[] c    = new Course[x.getreqcourses().Length];  //creates new array of length [# req courses]
                    Course[] temp = x.getreqcourses();                     //temp array to store student's required courses, whether satisfied or not - contains all course info
                    for (int i = 0; i < c.Length; i++)                     //copies data into empty Course array c
                    {
                        c[i] = temp[i];
                    }
                    for (int i = 0; i < c.Length; i++)                            //below: start writing to text file, loops through each required course
                    {
                        if (c[i].getStatus().Equals(("OFF TRACK")))               //if that course is not completed
                        {
                            if (c[i].getGrade().Equals("not compl. or in prog.")) //if grade is: set grade (in new array) to "not compl. or in prog."
                            {
                                string n = "   " + tempReqCourses[i];             //creates string to concat info
                                file.Write(n);                                    //writes string to text file
                                for (int o = n.Length; o < 30; o++)               //spacing
                                {
                                    file.Write(" ");
                                }
                                file.WriteLine(c[i].getStatus() + "  <= not compl. or in prog."); //writes status (ON or OFF TRACK) and etc
                            }
                            else                                                                  //else, if grade exists/is not previous string, write + its grade
                            {
                                string n = "   " + tempReqCourses[i];                             //creates string to concat info
                                file.Write(n);                                                    //writes string to text file
                                for (int o = n.Length; o < 30; o++)                               //spacing
                                {
                                    file.Write(" ");
                                }
                                file.WriteLine(c[i].getStatus() + "  <= grade is " + c[i].getGrade());
                            }
                        }
                        else if (c[i].getTrack().Equals("IN PROGRESS"))                     //if that course is in progress, do the same thing but..
                        {
                            string n = "   " + tempReqCourses[i];
                            file.Write(n);
                            for (int o = n.Length; o < 30; o++)
                            {
                                file.Write(" ");
                            }
                            file.WriteLine(c[i].getStatus() + "   <= in progress");        //...write this instead, to note 'in progress'
                        }
                        else                                                               //any other case
                        {
                            string n = "   " + tempReqCourses[i];
                            file.Write(n);
                            for (int o = n.Length; o < 30; o++)
                            {
                                file.Write(" ");
                            }
                            file.WriteLine(c[i].getStatus() + "  <= grade is " + c[i].getGrade());
                        }
                    }
                    file.WriteLine("");
                    string totcredtrack;                                                //total credits
                    if (x.getTotCred() >= 84)
                    {
                        totcredtrack = "SATISFIED";
                    }                                                                   //check total credits, set student's total credits SATISFIED if >= 84
                    else if (x.getTotCred() + x.getCredsInProgress() >= 84)
                    {
                        totcredtrack = "ON TRACK";
                    }                                                                   //if total credits + in-progress credits are <= 84, set ON TRACK (not satisfied)
                    else
                    {
                        totcredtrack = "OFF TRACK";
                    }                                                                   //else, off track
                    string gradcredtrack;                                               //graded credits
                    if (!x.getTransferStud())
                    {
                        if (x.getGradedCreds() >= 67)
                        {
                            gradcredtrack = "SATISFIED";
                        }
                        else if (x.getGradedCreds() + x.getCredsInProgress() >= 67)
                        {
                            gradcredtrack = "ON TRACK";
                        }
                        else
                        {
                            gradcredtrack = "OFF TRACK";
                        }
                    }
                    else
                    {
                        if (x.getGradedCreds() >= 48)
                        {
                            gradcredtrack = "SATISFIED";
                        }
                        else if (x.getGradedCreds() + x.getCredsInProgress() >= 48)
                        {
                            gradcredtrack = "ON TRACK";
                        }
                        else
                        {
                            gradcredtrack = "OFF TRACK";
                        }
                    }
                    file.WriteLine("");
                    file.WriteLine('\n' + "TOTAL CREDITS (84)" + '\t' + "{0} <= {1} compl. + {2} pend. = {3} total",
                                   totcredtrack, x.getTotCred(), x.getCredsInProgress(), x.getTotCred() + x.getCredsInProgress());
                    file.WriteLine("");
                    file.WriteLine('\n' + "GRADED CREDITS (67)" + '\t' + "{0} <= {1} graded + {2} pend. = {3} total",
                                   gradcredtrack, x.getGradedCreds(), x.getgradedcredsInProgress(), x.getGradedCreds() + x.getCredsInProgress());
                    file.WriteLine('\n' + "(48 for transfer students)");
                    file.WriteLine("");

                    if (x.getSkillSat().Contains("SATISFIED"))     //prev "REQUIREMENT MET"
                    {
                        file.WriteLine('\n' + "SKILLS REQUIREMENT" + '\t' + "SATISFIED  <= SKILLS REQUIREMENT MET legend");
                    }
                    else if (x.getSkillSat().Contains("OFF TRACK"))
                    {
                        file.WriteLine('\n' + "SKILLS REQUIREMENT" + '\t' + x.getSkillSat() + " <= no legend / no course in prog.");
                    }
                    else
                    {
                        List <Course> skills = x.getAllSkills();
                        foreach (Course skill in skills)
                        {
                            if (skill.getGrade().Equals("In Progress"))
                            {
                                file.WriteLine('\n' + "SKILLS REQUIREMENT" + '\t' + "ON TRACK" + " <= " + "course " + skill.getCourseNum() + " in prog.");
                                break;
                            }
                        }
                    }
                    file.WriteLine("");

                    // writing

                    if (x.getWritSat().Contains("SATISFIED"))
                    {     //prev "REQUIREMENT MET"
                        file.WriteLine('\n' + "WRITING REQUIREMENT" + '\t' + "SATISFIED  <= WRITING REQUIREMENT MET legend");
                    }
                    else if (x.getWritSat().Contains("OFF TRACK"))
                    {
                        file.WriteLine('\n' + "WRITING REQUIREMENT" + '\t' + x.getWritSat() + " <= no legend / no course in prog.");
                    }
                    else
                    {
                        List <Course> skills = x.getAllWriting();
                        foreach (Course skill in skills)
                        {
                            if (skill.getGrade().Equals("In Progress"))
                            {
                                file.WriteLine('\n' + "WRITING REQUIREMENT" + '\t' + "ON TRACK" + " <= " + "course " + skill.getCourseNum() + " in prog.");
                                break;
                            }
                        }
                    }

                    file.WriteLine("");
                    string gpatrack = "OFF TRACK";
                    if (x.getGPA() >= 1.67)
                    {
                        gpatrack = "ON TRACK";
                    }
                    file.WriteLine('\n' + "MINIMUM GPA (1.67)" + '\t' + gpatrack + " <= " + x.getGPA());
                    file.WriteLine("");
                    string enrolltrack = "OFF TRACK";
                    if (x.getPartTime() == true)
                    {
                        if (x.getEnrollUnits() >= 5.9)
                        {
                            enrolltrack = "SATISFIED";
                        }
                    }
                    else if (x.getEnrollUnits() >= 6.0)
                    {
                        enrolltrack = "SATISFIED";
                    }
                    file.WriteLine('\n' + "ENROLLMENT UNITS" + '\t' + enrolltrack + " <= " + x.getEnrollUnits() + '\n');       //needs to check if eu is below minimum
                    file.WriteLine();


                    int             ctr     = 0; //checks to see whether 0 == semester count - 1
                    List <Semester> semList = x.getStudentSemesters();
                    for (int i = 0; i < semList.Count(); i++)
                    {
                        String EUnits = "" + semList[i].getEUnits();
                        if (EUnits.Length == 1)     //formats the enrollment units so that they will all be length 5
                        {
                            EUnits += ".000";
                        }
                        else if (EUnits.Length == 3)
                        {
                            EUnits += "00";
                        }
                        else if (EUnits.Length == 4)
                        {
                            EUnits += "0";
                        }
                        if (semList[i].getEUnits() == 0.0)
                        {
                            continue;
                        }
                        if (ctr == x.getStudentSemesters().Count() - 1)
                        {
                            file.WriteLine('\t' + semList[i].getSemesterName() + '\t' + EUnits + " " + "(" + semList[i].getCreditHours() + " in progress credits)");
                        }
                        string n = semList[i].getSemesterName();
                        if (semList[i].getSemesterName().Contains("NON-GW"))
                        {
                            n = n.Replace("NON-GW ", "");
                        }
                        file.Write(n);
                        for (int o = n.Length; o < 24; o++)
                        {
                            file.Write(" ");
                        }
                        if (semList[i].getSemesterName().Contains("NON-GW"))
                        {
                            file.WriteLine(EUnits + " (" + semList[i].getCreditHours() + " transfer credits)");
                        }
                        else if (!semList[i].getSemesterName().Contains("Fall") &&
                                 !semList[i].getSemesterName().Contains("Spring") &&
                                 !semList[i].getSemesterName().Contains("Summer"))
                        {
                            file.WriteLine(EUnits + " (" + semList[i].getCreditHours() + " transfer credits)");
                        }
                        else if (!semList[i].getInProg() && !semList[i].getHalfInProg())
                        {
                            file.WriteLine(EUnits + " (" + semList[i].getCreditHours() + " compl. credits)");
                        }
                        else if (semList[i].getInProg() && !semList[i].getHalfInProg())
                        {
                            file.WriteLine(EUnits + " (" + semList[i].getCreditHours() + " in prog. credits)");
                        }
                        else
                        {
                            file.WriteLine(EUnits + " (" + semList[i].getHalfComp() + " compl. + " + semList[i].getHalfProg() + " in prog. credits)");
                        }
                    }
                    file.WriteLine("");
                    file.WriteLine("");
                    file.WriteLine();
                    if (x.getnonLawBool() == true)
                    {
                        file.WriteLine("***Non-Law Courses on Transcript***");
                    }
                    file.WriteLine('\f');
                }
            }
            Process.Start(doc);
        }