forked from keegandonley/Grading-Tool
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAssignment.cpp
More file actions
50 lines (42 loc) · 1.4 KB
/
Assignment.cpp
File metadata and controls
50 lines (42 loc) · 1.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#include <string>
#include <iostream>
#include <cstdio>
#include "AssignmentMeta.hpp"
#include "Assignment.hpp"
#include "Student.hpp"
#include "colors.h"
Assignment::Assignment(aMeta * data) {
assignmentData = data;
}
void Assignment::printAssignmentInfo() {
assignmentData -> printClassMeta();
}
void Assignment::printStudentInfo() {
for (std::vector<Student *>::iterator it = students.begin(); it != students.end(); ++it)
(*it) -> printStudent(assignmentData);
}
bool Assignment::addStudent(Student * myStudent) {
students.push_back(myStudent);
return true;
}
bool Assignment::readStudents(aMeta * meta) {
keyWord * keys = new keyWord();
keys -> readKeys(meta -> getClassNumber());
std::string fname;
char linit;
std::cout << BLUE << "Enter the student's first name and last initial (quit to end): " << ENDCOLORS;
std::cin >> fname;
while (fname != "quit") {
std::cin >> linit;
Student * myStudent = new Student(fname, linit, meta -> getClassNumber());
myStudent -> runGrading(keys, meta);
addStudent(myStudent);
myStudent -> printStudent(meta);
myStudent -> writeStudentToFile(meta);
// meta -> outPutFinishedMessage();
std::cout << BLUE << "Enter the student's first name and last initial (quit to end): " << ENDCOLORS;
std::cin >> fname;
}
remove("currentClass.txt");
return true;
}