当前位置: 首页>>代码示例>>C++>>正文


C++ Question::getQuestion方法代码示例

本文整理汇总了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();
}
开发者ID:SuRaMoN,项目名称:lale,代码行数:7,代码来源:question.cpp

示例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;
}
开发者ID:farrutapps,项目名称:AFZApp,代码行数:58,代码来源:import.cpp

示例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);
}
开发者ID:SuRaMoN,项目名称:lale,代码行数:9,代码来源:mainwindow.cpp

示例4: openNewQuestion

void OpenQuestionSet::openNewQuestion()
{
    Question q = allQuestionSet->getNewQuestioin();
    if (q.getQuestion().empty())
    {
        sizeOfOpenQuestion--;
    }
    else
    {
        openQuestion.push_back(q);
    }

}
开发者ID:GrzegorzDuraj,项目名称:questionTEST,代码行数:13,代码来源:OpenQuestionSet.cpp

示例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;
}
开发者ID:harel9123,项目名称:Trivia-,代码行数:27,代码来源:Game.cpp


注:本文中的Question::getQuestion方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。