<<

NAME

MT::Scorable - An interface for any MT::Object that wishes to rated.

SYNOPSIS

    use MT::Entry;
    my $entry = MT::Entry->load($id);
    $entry->set_score('key', $app->user, 100, $overwrite);

METHODS

get_score($plugin_key, $user)

Return the score of the object, scored by the user specified. This is not for total score of an object. This is to get a score specified by a user to an object.

set_score($plugin_key, $user, $score, $overwrite)

Set specified score to the object by the user. If $overwrite argument is false and the user has already scored the object before, error results.

score_for($plugin_key)

Return the total score of the object.

vote_for($plugin_key)

Return how many users scored to the object.

score_high($plugin_key)

Return the highest score to the object.

score_low($plugin_key)

Return the lowest score to the object.

score_avg($plugin_key)

Return the average score of the object.

rank_for($plugin_key, $max)

Return the rank of the object based on its score among other objects of the same type. The smaller the number is, the higher the object's rank is.

AUTHOR & COPYRIGHT

Please see "AUTHOR & COPYRIGHT" in MT.

<<