Get specific question

@param integer $questionId

@return bool
556758
public function getSpecificQuestion($questionId)
    {
        $configuration = $this->getUserConfiguration();
        $questions = $configuration->getQuestions();

        if (!is_null($questionId) &&
            isset($questions[$questionId]) &&
            !is_null($this->getUserConfiguration()->getTimeout())
        ) {
            $this->setQuestion($questionId);

            return true;
        }

        return false;
    }
675941
public function getQuestion() : ?string 
    {
        if ( ! $this->hasQuestion()) {
            $this->setQuestion($this->getDefaultQuestion());
        }
        return $this->question;
    }
650175
public function getQuestionBenchmarkResult($surveyId, $pageId, $questionId, array $filters = [])
	{
		return $this->sendRequest(
			$this->createRequest('GET', sprintf('surveys/%d/pages/%d/questions/%d/benchmark', $surveyId, $pageId, $questionId), [ 
				'query' => $filters 
			])
		);
	}
1017831
public function getNextQuestion()
    {
        $nextQuestionId = $this->getCurrentQuestion() + 1;
        $questions = $this->getUserConfiguration()->getQuestions();

        if (!isset($questions[$nextQuestionId])) {
            return false;
        }

        $this->setQuestion($nextQuestionId);

        return $this->getQuestion();
    }
221813
public function getMissingQuestions($categories, $limit, $questions, $questionsLevel = array())
    {
        $query = $this->createQueryBuilder('q')
            ->addSelect('RAND() as HIDDEN rand, q, c, a')
            ->leftJoin('q.category', 'c')
            ->leftJoin('q.answers', 'a')
            ->where('q.category IN(:category)')
            ->andWhere('q.enabled = 1')
            ->andWhere('q.id NOT IN (:questions)')
            ->setParameter('category', $categories)
            ->setParameter('questions', $questions)
            ->setMaxResults($limit)
            ->orderBy('rand');

        if (!empty($questionsLevel)) {
            $query->andWhere('q.level IN(:level)')
                ->setParameter('level', $questionsLevel);
        }

        $questions = $query->getQuery()->getResult();

        return $questions;
    }
259413
public function setupQuestion($question)
    {
        $user = new User($this->db);
        $post = new Post($this->db);

        $question->img = $user->getGravatar($question->user);
        $question->title = $this->getMD($question->title);
        $question->tags = explode(',', $question->tags);

        $question->question = $post->getPost("questionId = ? AND type = ?", [$question->id, "question"]);
        $question->answers = $post->getAllPosts("questionId = ? AND type = ?", [$question->id, "answer"]);
        $question->answerCount = count($question->answers);


        return $question;
    }
887718
public function getSurveyData($surveyId) {
        $tracker = $this->loader->getTracker();

        $survey = $tracker->getSurvey($surveyId);

        $surveyInfo = $survey->getQuestionInformation($this->locale);

        $filteredSurveyInfo = $surveyInfo;
        foreach ($surveyInfo as $questionCode => $questionInfo) {
            if ($questionInfo['class'] == 'question_sub') {
                $parentCode                                           = $questionInfo['title'];
                $parent                                               = $surveyInfo[$parentCode];
                $filteredSurveyInfo[$questionCode]['question'] = $parent['question'] . ' | ' . $questionInfo['question'];
                if (isset($filteredSurveyInfo[$parentCode])) {
                    unset($filteredSurveyInfo[$parentCode]);
                }
            }
        }

        return $filteredSurveyInfo;
    }
297192
def find_question(self, question_id, question_fetchable=None):
        
        question_fetchable = question_fetchable or self.questions
        for question in question_fetchable:
            if int(question.id) == int(question_id):
                return question
1151126
public function findByIssue($issueId)
    {
        $queryBuilder = $this->getQueryBuilder();
        $queryBuilder->leftJoin('p.issues', 'i');
        $this->addCriteria($queryBuilder, ['i.id' => $issueId]);

        return $queryBuilder->getQuery()->getResult();
    }
357630
public function getAsQuestion()
    {
        $question = new Question($this->getQuestionText(), $this->default);
        $question->setMaxAttempts($this->maxAttempts);
        $question->setValidator(function ($value) {
            if ($this->isEmpty($value) && $this->isRequired()) {
                throw new MissingValueException("'{$this->name}' is required");
            }
            $this->validate($value);

            return $value;
        });
        $question->setAutocompleterValues($this->autoCompleterValues);

        return $question;
    }
825032
public function getEpisodeById($episodeId)
  {
    $response = $this->request('/GetEpisodeById/' . $episodeId);
    if ( $response->response->status == 'false' )
      return null;
    if ($response->response->cached == 'false') {
      $episode  = $response->response;
    } else {
      $episode  = $response->response->results;
    }
    $episode  = $this->formatEpisode($episode);

    return $episode;
  }
590668
public function getCallByRequestId($requestId)
    {
        $call = isset($this->callRequestIndex[$requestId]) ? $this->callRequestIndex[$requestId] : false;

        return $call;
    }
1252169
public function game($gameId)
	{
		if ( ! isset($this->info['games'][$gameId]))
		{
			return null;
		}

		return $this->info['games'][$gameId];
	}
721837
public function get($docId)
    {
        return $this->montage->request(
            'get',
            $this->montage->url('document-detail', $this->schema->name, $docId)
        );
    }
620283
public function GetCount($DiscussionID) {
      $this->FireEvent('BeforeGetCount');
      
      if (!empty($this->_Where)) {
         return FALSE;
      }
      
      return $this->SQL->Select('CommentID', 'count', 'CountComments')
         ->From('Comment')
         ->Where('DiscussionID', $DiscussionID)
         ->Get()
         ->FirstRow()
         ->CountComments;
   }
956538
public function delete_previews($questionid) {
        $previews = $this->db->get_records_sql_menu("
                SELECT DISTINCT quba.id, 1
                FROM {question_usages} quba
                JOIN {question_attempts} qa ON qa.questionusageid = quba.id
                WHERE quba.component = 'core_question_preview' AND
                    qa.questionid = ?", array($questionid));
        if (empty($previews)) {
            return;
        }
        $this->delete_questions_usage_by_activities(new qubaid_list($previews));
    }
179524
protected static function validate_quiz($quizid) {
        global $DB;

        // Request and permission validation.
        $quiz = $DB->get_record('quiz', array('id' => $quizid), '*', MUST_EXIST);
        list($course, $cm) = get_course_and_cm_from_instance($quiz, 'quiz');

        $context = context_module::instance($cm->id);
        self::validate_context($context);

        return array($quiz, $course, $cm, $context);
    }