forked from 2goodAP/QuizmaHeros102
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathQuestionManager.cpp
39 lines (32 loc) · 897 Bytes
/
QuestionManager.cpp
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
#include "QuestionManager.hpp"
namespace Quizma
{
QuestionManager::QuestionManager(std::string category, std::string question, std::string answer[])
{
this->category = category;
quest = question;
decltype(this->ans->size()) i = 0;
for (; i < SIZE_OF_ANS; i++) {
this->ans[i] = answer[i];
}
correct_ans = answer[i];
}
void QuestionManager::setValue(std::string category, std::string question, std::string answer[])
{
this->category = category;
quest = question;
decltype(this->ans->size()) i = 0;
for (; i < SIZE_OF_ANS; i++) {
this->ans[i] = answer[i];
}
correct_ans = answer[i];
}
std::ostream &operator<<(std::ostream &output, const QuestionManager &q)
{
output << q.quest << std::endl;
for (decltype(q.ans->size()) i = 0; i < SIZE_OF_ANS; i++) {
output << q.ans[i] << std::endl;
}
return output;
}
}