#include "Student.h"
#include "Instructor.h"
#include "Exam.h"
#include "course.h"
#include <iostream>
#include <Windows.h>
#include <ctime>
#include<fstream>
using namespace std;
void main(){
//Variables Used
srand(time(0));
int tempKids[2][4][16][100];
int tempE[100];
int temp;
int tempA[100][2];
int tempB[100][2];
int tempC[100][2];
int tempD[100][2];
int tests[4]={0,0,0,0};
//Creates Classes
Students kids[2][4][16];
Exam A[4];
//Gets key for each test
A[0].getKey(tempA);
A[1].getKey(tempB);
A[2].getKey(tempC);
A[3].getKey(tempD);
//writes Exams to txt
for(int i=0;i<4;i++)
A[i].writeExam(i);
//gets Versions of the test and sets the Key for each student
for(int x=0; x<2; x++)
for(int y=0;y<4;y++)
for(int z=0;z<16;z++)
{
temp = x+y+z;
kids[x][y][z].getVersion(temp);
}
//Checks the answers for all the kids
for(int x=0;x<2;x++){
for(int y=0;y<4;y++){
for(int z=0;z<16;z++)
{
if(kids[x][y][z].getSN()==0){
kids[x][y][z].checkAnswers(tempA);
kids[x][y][z].getCorrect(tempE);
A[0].findCorrect(tempE);
kids[x][y][z].checkGrade();
if(x=0)
A[0].correctSecOne(tempE);
if(x=1)
A[0].correctSecTwo(tempE);
for(int g=0;g<100;g++)
tempKids[x][y][z][g]=tempE[g];
}
if(kids[x][y][z].getSN()==1){
kids[x][y][z].checkAnswers(tempB);
kids[x][y][z].getCorrect(tempE);
A[1].findCorrect(tempE);
kids[x][y][z].checkGrade();
if(x=0)
A[1].correctSecOne(tempE);
if(x=1)
A[1].correctSecTwo(tempE);
for(int g=0;g<100;g++)
tempKids[x][y][z][g]=tempE[g];
}
if(kids[x][y][z].getSN()==2){
kids[x][y][z].checkAnswers(tempC);
kids[x][y][z].getCorrect(tempE);
A[2].findCorrect(tempE);
kids[x][y][z].checkGrade();
if(x=0)
A[2].correctSecOne(tempE);
if(x=1)
A[2].correctSecTwo(tempE);
for(int g=0;g<100;g++)
tempKids[x][y][z][g]=tempE[g];
}
if(kids[x][y][z].getSN()==3){
kids[x][y][z].checkAnswers(tempD);
kids[x][y][z].getCorrect(tempE);
A[3].findCorrect(tempE);
kids[x][y][z].checkGrade();
if(x=0)
A[3].correctSecOne(tempE);
if(x=1)
A[3].correctSecTwo(tempE);
for(int g=0;g<100;g++)
tempKids[x][y][z][g]=tempE[g];
}
}
}
}
//finds the statistics of answers for all and per section for exam class
/*for(int x=0;x<2; x++)
for(int y=0;y<4;y++)
for(int z=0;z<16;z++)
for(int i=0; i<4; i++)
{
kids[x][y][z].getCorrect(tempE);
A[i].findCorrect(tempE);
A[i].correctSec(tempE);
kids[x][y][z].checkGrade();
//gets all the correct and incorrects
for(int i=0;i<100;i++)
tempKids[x][y][z][i]=tempE[i];
//kids[x][y][z].getCorrect(tempE);
kids[x][y][z].StudentWrite(i);
}*/
//Checks grades for students
Instructor Kim;
Kim.LoadData(tempKids);
for(int i=0; i<4; i++)
A[i].WriteResults(i);
//Write Reports
//for(int i=0;i<4;i++)
//kids[2][4][i].StudentWrite(i);
course Kiwi(tests);
Kiwi.courseWrite();
Kim.writeReportIn();
for(int x=0;x<2;x++)
for(int y=0;y<4;y++)
for(int z=0;z<16;z++)
kids[x][y][z].StudentWrite();
}