Richard Foley > QNA > Question

Download:
QNA_0.5.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  0
Report a bug
Source  

NAME ^

Question - Container for question 'n' answer.

SYNOPSIS ^

        Designed to be used within L<Quiz> module.
new
        Object creator:
        
        my $q = Question->new('2 + 2', '4');
question
        my $qstn = $q->question;
answer
        my $ans = $q->answer;
ask
        Prompt for the question:
        
        print $q->ask('What is..: ');           
guess
        Sets guessed time, and inputs guess into question.
        
        my $guess = $q->guess('4');
correct
        Returns status of answer (correct or incorrect).
        
        print "yeeha!\n" if $q->correct;
results
        Simple print out of stats for question.
        
        print $q->results;
compare
        Compare given guess with correct answer.
        
        my $result = $q->compare(4);