NAME

Grades::Types - MooseX::Type checks for homework, classwork and exams data

SYNOPSIS

        use Grades;
        use Grades::Types qw/Beancans Card/;

        has 'beancanseries' => (is => 'ro', isa => Beancans, lazy_build => 1);
        method _build_beancanseries {
                my $series = $self->series;
                my $league = $self->league->id;
                +{ map { $_ => $self->inspect( "$league/$_/beancans.yaml" ) }
                        @$series };
        }

        method card (Num $week) {
                my $card = $self->data->{$week};
                croak "Week $week card probably has undefined or non-numeric Merit, Absence, Tardy scores, or possibly illegal beancan."
                    unless is_Card( $card );
                return $card;
        }

DESCRIPTION

MooseX::Types extension of Moose::Util::TypeConstraint checking of user input.

TYPES

PlayerName

A string, where the first letter is upper case, there are some letters or spaces or hyphens, and there is an optional digit at the end to disambiguate same-named players.

PlayerNames

An array ref of PlayerName.

AbsenteeNames

A possibly undefined PlayerNames list type.

PlayerId

A string of digits or underscore, with possibly a letter in front.

Member

A hashref with name and id keys.

Members

A possibly undefined list of Member.

Results

A number or the string 'transfer' for each playerId.

HomeworkResult

A number or the string 'transfer'.

Cutpoints

'one', 'two' cutpoints with the numerical value

HomeworkPoints

A number or undef.

HomeworkWork

'letters' and 'questions' and the number of each. But letters might be undef.

HomeworkWorks

HomeworkWork of all players.

HomeworkRound

A hashref of PlayerId keys and HomeworkResult values.

RoundsResults

A hashref of the homework grades keyed on the round (an Int.) For each round, the keys are PlayerId, and the values are scores, or Num.

Beancans

A hashref of teams and their constituents, where the keys are the sessions (Str) and the keys for each session are teams, or beancans (ie Str) and the corresponding value is PlayerNames.

Card

A hashref of classwork results for the lesson, where the keys are beancan names (Str) and for each beancan there are 'merits', 'absences', and 'tardies' keys, with Int values for each key.

TortCard

A hashref of classwork results for the lesson, where the keys are beancan names (Str) and for each beancan there are 'merits', and 'absent' keys, with an Int value for the first and AbsenteeNames for the second key.

Exam

A hashref of the results for one exam, with PlayerId keys and Num values.

Weights

A hashref of weights for the components making up the grade, where the keys are 'classwork', 'homework', and 'exams', and the corresponding Num value is the weight accorded the component in the grade.

AUTHOR

Dr Bean, <drbean, followed by the at mark (@), cpan, then a dot, and finally, org>

BUGS

Please report any bugs or feature requests to bug-grades at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Grades. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT

You can find documentation for this module with the perldoc command.

    perldoc Grades::Types

You can also look for information at:

COPYRIGHT & LICENSE

Copyright 2006 Dr Bean, all rights reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.