Asks a user for confirmation.

@param string $question_text
The question to ask to the user.

@return bool
User confirmation.
15996
protected function confirm($question_text) {
    $question_text = "\n $question_text\n ➤ ";
    // If the input is not interactive print the question with default answer.
    if ($this->replace !== NULL) {
      $this->output->writeln($question_text . ($this->replace ? 'Yes' : 'No'));
    }
    $question = new ConfirmationQuestion($question_text, $this->replace !== FALSE);
    /** @var \Symfony\Component\Console\Helper\QuestionHelper $question_helper */
    $question_helper = $this->getHelperSet()->get('question');
    return $question_helper->ask($this->input, $this->output, $question);
  }
846633
public function confirmation($message, $choices = ['y' => true, 'n' => false], $default = false)
    {
        $message = is_array($message) ? call_user_func_array('sprintf', $message) : $message;

        $answers = [];
        foreach ($choices as $answer => $value) {
            $answers[$answer] = $answer;
            if ($value === $default) $answers[$answer] = ucfirst($answer);
        }
        
        $this->send(sprintf('%s [%s]: ', $message, join('/', $answers)), '');
        $answer = $this->readline();
        if ($answer === '') return $default;

        if (array_key_exists($answer, $choices)) {
            return $choices[$answer];
        } else {
            foreach ($choices as $key => $value) {
                if ($answer === substr($key, 0, strlen($answer))) return $value;
            }
            return $default;
        }
    }
559728
protected function readquestions($text) {

        // This converts xml to big nasty data structure,
        // the 0 means keep white space as it is.
        try {
            $xml = xmlize($text, 0, 'UTF-8', true);
        } catch (xml_format_exception $e) {
            $this->error($e->getMessage(), '');
            return false;
        }

        $questions = array();

        $this->process_category($xml, $questions);

        $this->process_tf($xml, $questions);
        $this->process_mc($xml, $questions);
        $this->process_ma($xml, $questions);
        $this->process_fib($xml, $questions);
        $this->process_matching($xml, $questions);
        $this->process_essay($xml, $questions);

        return $questions;
    }
17944
protected function render_question_text($question) {
        global $OUTPUT;

        $text = question_rewrite_question_preview_urls($question->questiontext, $question->id,
                $question->contextid, 'question', 'questiontext', $question->id,
                $this->context->id, 'quiz_statistics');

        return $OUTPUT->box(format_text($text, $question->questiontextformat,
                array('noclean' => true, 'para' => false, 'overflowdiv' => true)),
                'questiontext boxaligncenter generalbox boxwidthnormal mdl-align');
    }
126456
public function confirmTerms()
    {
        $termsConfirmation = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("term");
        if (!$termsConfirmation && $this->isEnabledPrivateSales()) {
            $user = $this->getUser();
            if ($user && !$user->isTermsAccepted()) {
                $termsConfirmation = true;
            }
        }

        return $termsConfirmation;
    }
876668
final protected function askConfirmation(
        InputInterface $input,
        OutputInterface $output,
        $questionText,
        $default,
        $separator
    ) {
        $questionHelper = $this->getQuestionHelper();

        $question = new ConfirmationQuestion($questionHelper->getQuestion(
            $questionText,
            $default,
            $separator
        ), ('no' === $default ? false : true));

        return $questionHelper->ask($input, $output, $question);
    }
952416
public static function confirm( $question, $strict = false ) 
	{
		$question .= ' [yes/no]: ';
		
		if ( $strict ) 
		{
			do 
			{
				$res = strtolower( static::read( $question ) );
			} 
			while ( $res !== 'yes' && $res !== 'no' );
			
			return ( $res == 'yes' ) ? true : false;
		}
		
		do 
		{
			$res = strtolower( static::read( $question ) );
		} 
		while ( empty( $res ) );
		
		$positives = array(
			'yes', 'y', 'ya', 'ye', 'yeah', 'yup',
			'jep', 'jap', 'ja', 
			'si', 'sim',
			'true',
			'hai',
			'oui',
			'no problemo',
		);
		
		return in_array( $res, $positives );
	}
985920
public function confirm($question, $yesScript, $noScript)
    {
        return $this->getConfirm()->confirm($question, $yesScript, $noScript);
    }
196344
public function confirm($name, $question, $required = false)
    {
        if (is_string($question)) {
            output()->write(
                (new Format())
                    ->setString(rtrim(language()->getLine($question), '?') . ' (Y/N) ?')
                    ->setSpace(1)
            );
        } elseif ($question instanceof Format or $question instanceof Text) {
            output()->write($question . '?');
        }

        $standardInput = strtoupper(input()->standard());

        if ($required === true and ! in_array($standardInput, ['Y', 'N'])) {
            $requiredText = (new Format())
                ->setColor((new Color())->setBackground(Color::RED))
                ->setString(' ' . language()->getLine('REQUIRED') . ' ')
                ->setIndent(1)
                ->__toString();

            $this->confirm($name, str_replace($requiredText, '', $question) . $requiredText, $required);

            return;
        }

        $_POST[ $name ] = (bool)($standardInput === 'Y');
    }
532221
protected function validate_question_data($question) {
        $this->validate_text($question->questiontext); // Yes, really no ['text'].

        if (isset($question->generalfeedback['text'])) {
            $this->validate_text($question->generalfeedback['text']);
        } else if (isset($question->generalfeedback)) {
            $this->validate_text($question->generalfeedback); // Because question import is weird.
        }

        foreach ($question->answer as $key => $answer) {
            $this->validate_answer($answer);
            $this->validate_text($question->feedback[$key]['text']);
        }
    }
517822
public function getQuestionConfirm(
        $question,
        $default = 'y',
        array $options = array('y', 'n'),
        $required = true
    ) {
        return $this->getQuestion($question, $default, $options, $required);
    }
839647
def mark_confirmation_as_unclear(self, confirmation_id):
        
        return self._create_put_request(
            resource=CONFIRMATIONS,
            billomat_id=confirmation_id,
            command=UNCLEAR,
        )
1064989
public function ask($question, $isHidden = false, $default = '', $displayDefault = true)
    {
        if ($displayDefault && !empty($default)) {
            $defaultText = $default;
            if (strlen($defaultText) > 30) {
                $defaultText = substr($default, 0, 30) . '...';
            }
            $question .= " [$defaultText]";
        }
        Output::write("$question ");
        return ($isHidden ? $this->askHidden() : trim(fgets(STDIN))) ?: $default;
    }
1369393
public function confirm($question, $yesScript, $noScript)
    {
        $title = $this->getConfirmTitle();
        if(!$noScript)
        {
            return "jaxon.dialogs.bootbox.confirm(" . $question . ",'" .
                $title . "',function(){" . $yesScript . ";})";
        }
        else
        {
            return "jaxon.dialogs.bootbox.confirm(" . $question . ",'" .
                $title . "',function(){" . $yesScript . ";},function(){" . $noScript . ";})";
        }
    }
181578
def ask(question, no_input=False):
    """"""
    if no_input:
        return True
    else:
        input_ = input('%s [Y/n] ' % question)
        input_ = input_.strip().lower()
        if input_ in ('y', 'yes', ''):
            return True
        if input_ in ('n', 'no'):
            return False
        print('Invalid selection')
210049
function askConfirmation(args) {
  let userAnswer = 'no-answer';
  const merged = merge(DEFAULTS.CONFIRMATIONS, args);
  inquirer.prompt([
    {
      type: DEFAULTS.QUESTION_TYPES.CONFIRM,
      name: 'choice',
      message: merged.question,
      default: merged.defaultValue
    }
  ]).then((answer) => {
    userAnswer = answer.choice;
  });
  while (userAnswer === 'no-answer') {
    wait(100);
  }
  return userAnswer;
}
217633
protected function use_question($questionid) {
        if (isset($this->recentlyusedquestions[$questionid])) {
            $this->recentlyusedquestions[$questionid] += 1;
        } else {
            $this->recentlyusedquestions[$questionid] = 1;
        }

        foreach ($this->availablequestionscache as $categorykey => $questionsforcategory) {
            foreach ($questionsforcategory as $numuses => $questionids) {
                if (!isset($questionids[$questionid])) {
                    continue;
                }
                unset($this->availablequestionscache[$categorykey][$numuses][$questionid]);
                if (empty($this->availablequestionscache[$categorykey][$numuses])) {
                    unset($this->availablequestionscache[$categorykey][$numuses]);
                }
            }
        }
    }