Commit d9c7ddc4 authored by Jared Sexton's avatar Jared Sexton

maxLevel

parent fb14e9c3
......@@ -145,6 +145,7 @@ bool Questions::addSubQuestion(int level) {
return false;
}
bool Questions::wordQuestion(int level) {
cout << "Question type not configured.";
return false;
......
......@@ -23,6 +23,12 @@ class Questions {
// Asks a question, returns true if the kid was right, false if they were wrong.
bool wordQuestion(int level);
// Accessor
int getMaxLevel() { return maxLevel; }
private:
int maxLevel = 10;
};
#endif //QUESTIONS_H
\ No newline at end of file
......@@ -49,10 +49,7 @@ void Student::displayMenu(){
case 2: // Log Out
cout << "Goodbye." << endl;
studentMenuActive =0;
break; /* Can you have something here that will cause the program to exit the menu when they choose logout?
This can be done with a boolean return type for this function (returns true until they choose to logout, then it returns false)
Or with a separate function like Andrew did in Teacher (you can check his code for a template).
The idea is that as much of the process of each menu is contained within the menu function, (ecapsulation). */
break;
default:
cout << "Invalid choice.\n";
break;
......@@ -80,16 +77,24 @@ void Student::practice(){
do{
cout << "Would you like to test out? (Y)es/(N)o ";
cin >> choice;
if(choice == 'Y'){ //testing stage
testingStage();
testing = true;
break;
}else if(choice == 'N'){ //reset values for count
count=0;
break;
}else{
cout << "Invalid input." <<endl;
continue;
if(cin) {
if(choice == 'Y'){ //testing stage
testingStage();
testing = true;
break;
}else if(choice == 'N'){ //reset values for count
count=0;
break;
}else{
cin.clear();
cin.ignore(100,'\n');
cerr << "Invalid choice." <<endl;
continue;
}
} else {
cin.clear();
cin.ignore(100,'\n');
cerr << "Invalid choice.\n";
}
}while(true);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment