forked from oleoneto/TQF
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathQuiz.h
executable file
·138 lines (109 loc) · 4.62 KB
/
Quiz.h
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
// Info.h
// The Q Factor
// Created by Leo N. on 11/28/16.
// Copyright © 2016 Leo Neto. All rights reserved.
#ifndef Quiz_h
#define Quiz_h
#include "Libraries.h"
#include "Player.h"
class Quiz{
private:
int QuizTotalQuestions;
std::string QuizTopic, QuizLanguage;
public:
Quiz(){
QuizTopic = "No topic";
QuizLanguage = "No languague";
QuizTotalQuestions = 0;
}//constructor
~Quiz(){
}//destructor
// Super setter for Quiz object. This sets the topic,
// the language, and total number of question for the quiz.
void SetQuizInfo(std::string input){
int length;
std::string storage;
std::stringstream QuestionInfo, temporary;
QuestionInfo << input;
// Language, Topic, and Length...
getline(QuestionInfo, storage, ',');
//Questions::QuestionLanguage = storage;
setQuizLanguage(storage);
getline(QuestionInfo, storage, ',');
//Questions::QuestionTopic = storage;
setQuizTopic(storage);
getline(QuestionInfo, storage);
temporary << storage;
temporary >> length;
setQuizTotalQuestions(length);
}//end SetQuizInfo
//*************************************************
//*************************************************
//*************************************************
//*************************************************
//*************************************************
//*************************************************
//***** Set Methods
void setQuizTopic(std::string topic){
Quiz::QuizTopic = topic;
}
void setQuizLanguage(std::string lang){
Quiz::QuizLanguage = lang;
}
void setQuizTotalQuestions(int num){
Quiz::QuizTotalQuestions = num;
}
//*************************************************
//*************************************************
//*************************************************
//*************************************************
//*************************************************
//*************************************************
//***** Get Methods..
std::string getQuizTopic(){
return QuizTopic;
}
std::string getQuizLanguage(){
return QuizLanguage;
}
int getQuizTotalQuestions(){
return QuizTotalQuestions;
}
//*************************************************
//*************************************************
//*************************************************
//*************************************************
//*************************************************
//*************************************************
//***** Other Methods..
void PrintQuizInfo(){
std::cout<<""<<std::endl;
std::cout<<"Language: "<<QuizLanguage<<std::endl;
std::cout<<"Subject: "<<QuizTopic<<std::endl;
std::cout<<"Total Questions: "<<QuizTotalQuestions<<std::endl;
std::cout<<""<<std::endl;
}
void Help(){
std::cout<<""<<std::endl;
std::cout<<"***** Help menu ******"<<std::endl;
std::cout<<"You can answer most questions by simply typing Yes or No."<<std::endl;
std::cout<<"For most interactions, you can type the first letter of your desired option as answer."<<std::endl;
std::cout<<"i.e P for Player, M for Manager... Q for Quit, L for Load, R for Run..."<<std::endl;
std::cout<<"--------"<<std::endl;
std::cout<<"During a quiz, type either of the letters a, b, c, or d to answer a question."<<std::endl;
std::cout<<"If during a quiz you feel like quitting, you may do so by pressing Q."<<std::endl;
std::cout<<"Your game will be saved and you may be able to reload from it next time the program runs."<<std::endl;
std::cout<<"--------"<<std::endl;
std::cout<<"If you are managing a quiz, you will be able to create a program report after each quiz."<<std::endl;
std::cout<<"This will help you see all the answers in context as well the percentage of wrong and correct answers."<<std::endl;
std::cout<<"***** End *****"<<std::endl;
std::cout<<""<<std::endl;
}
//*************************************************
//*************************************************
//*************************************************
//*************************************************
//*************************************************
//*************************************************
};
#endif /* Quiz_h */