Question - Container for question 'n' answer.


QNA documentation  | view source Contained in the QNA distribution.

Index


NAME

Top

Question - Container for question 'n' answer.

SYNOPSIS

Top

	Designed to be used within L<Quiz> module.

	Object creator:

	my $q = Question->new('2 + 2', '4');

	my $qstn = $q->question;

	my $ans = $q->answer;

	Prompt for the question:

	print $q->ask('What is..: ');		

	Sets guessed time, and inputs guess into question.

	my $guess = $q->guess('4');

	Returns status of answer (correct or incorrect).

	print "yeeha!\n" if $q->correct;

	Simple print out of stats for question.

	print $q->results;

	Compare given guess with correct answer.

	my $result = $q->compare(4);


QNA documentation  | view source Contained in the QNA distribution.