本文整理汇总了C++中Question::getQuestion方法的典型用法代码示例。如果您正苦于以下问题:C++ Question::getQuestion方法的具体用法?C++ Question::getQuestion怎么用?C++ Question::getQuestion使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Question
的用法示例。
在下文中一共展示了Question::getQuestion方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
bool Question::operator < (const Question & that) const
{
if(this->getQuestion() != that.getQuestion()) {
return this->getQuestion() < that.getQuestion();
}
return this->getAnswer() < that.getAnswer();
}
示例2: datamatrixToQuestions
bool Import::datamatrixToQuestions(){
bool success = false;
cout << "START READING DATA TO QUESTION OBJECTS" << endl;
// fills CSV Data from vector < vector <...> > datamatrix to questiondata objects.
int m = dataMatrix[0].size();
// check dimensions of datamatix
if(m!=questionTypes.size()){
cout << "ERROR: number of survey questions != number of questiontypes" << endl;
QMessageBox msgBox;
msgBox.setText("FEHLER: Der ausgewählte Ausstellungstyp passt nicht zur .CSV Datei.");
msgBox.setInformativeText("Bitte richtigen Ausstellungstyp wählen.");
msgBox.setDefaultButton(QMessageBox::Ok);
int ret = msgBox.exec();
success = false;
return success;
}
int id=0;
for(int i=0; i<m;++i){
if(questionTypes[i].toInt()!=0){
Question *tempQuestion = new Question;
tempQuestion->setQuestiontype(questionTypes[i].toInt());
tempQuestion->setQuestion(QString::fromStdString(dataMatrix[0][i]));
tempQuestion->setSubquestion(QString::fromStdString(dataMatrix[1][i]));
if(tempQuestion->getQuestionType()!=6)
tempQuestion->setDataFromStdStringMatrix(dataMatrix,i);
else
tempQuestion->setTextAnswersFromStdStringMatrix(dataMatrix,i);
if(tempQuestion->getQuestion()!="")
++id;
tempQuestion->write_ID(id); // a question and its subquestions share the same id
questions.push_back(*tempQuestion);
delete tempQuestion;
}
}
success=true;
return success;
}
示例3: changeQuestion
void MainWindow::changeQuestion(Question question)
{
ui->question->setText(question.getQuestion());
currentQuestion = question;
ui->answer->setText("");
ui->right->setHidden(true);
ui->wrong->setHidden(true);
ui->showAnswer->setHidden(false);
}
示例4: openNewQuestion
void OpenQuestionSet::openNewQuestion()
{
Question q = allQuestionSet->getNewQuestioin();
if (q.getQuestion().empty())
{
sizeOfOpenQuestion--;
}
else
{
openQuestion.push_back(q);
}
}
示例5: buildQuestionPacket
/**
*This function builds a packet that presents a question according to the protocol.
*Input: Index of question.
*Output: Question packet as the protocol.
**/
string Game::buildQuestionPacket(int questionNo)
{
Question * q = _questions[questionNo];
int len, i;
string packet, str;
string * answers = q->getAnswers();
packet = to_string(SEND_QUESTION);
str = q->getQuestion();
len = str.size();
packet += Helper::getPaddedNumber(len, 3) + str;
for (i = 0; i < 4; i++)
{
str = answers[i];
len = str.size();
packet += Helper::getPaddedNumber(len, 3) + str;
}
return packet;
}