Extensions:Criteria Rewards

From Lorekeeper Wiki
Jump to navigation Jump to search
Reward Criteria
Description Adds Ability to calculate rewards based on criteria specified by users
Author(s) moif
Status beta
Github AW0005/lorekeeper-extensions/extension/criteria-rewards
LK Version 2.0.0
Contains a Migration

This extension is built to help make calculating rated rewards (like giving a higher reward to colored art vs sketches) easier on both admin and users. It allows admin to specify their own calculation rules, that are then applied based on input from the user on prompt or gallery submission. Calculator selections can be modified by the admin on submission approval to adjust the reward. [See Pictures farther down]

This extension does completely replace the existing configurable rewards for galleries, so do keep that in mind when you decide to use this.


1. php artisan migrate 2. php artisan optimize

conflicts will largely be in prompt and gallery blades if any of your other extensions have touched those features.


There are two main parts to configuring this extension.

Create Criteria

The most common ones are going to be one for art and one for writing.

Making a criterion usually involves:

  1. Deciding on if it should have a base value
  2. Deciding on steps - each step is a question a user has to answer and the order matters for calculating the final result
  3. calculation type of the step - this determines whether the value derived from the step is added or multiplied to the running total.
  4. Type of steps:
    1. Number Input - this type allows an additional calculation of the input'd number against a set number you choose
    2. Boolean - this applies a calculation if it's turned on, and skips the step if turned off
    3. Select From Options - this presents users with a dropdown of options, and each option has a separate value assigned to it. Ordering of options matters for minimum requirements (more detail later).

Assigning Criteria to Prompts and Galleries

In order to allow users to use the Criteria you will have to assign them on a per-prompt and per-gallery basis. This also allows you the opportunity to set minimum requirements for each prompt and gallery separately. Minimum requirements will limit what a user can choose on submission. If a boolean toggle is turned on, it will be set to on and disabled for a user. If an input has a value set, that will be the minimum value that a user can input. And finally if a value is selected for an options step, it will hide any options that are lower-ranked for that step.


- An additional site setting has been added for whether rewards added on gallery submission should be divided among collaborators by default or not. - If you turn on the guide for a criterion, it will be linked automatically from it's display name and when being used on prompts and galleries. It can also be found at the url "/criteria/guide/{id}"


See Also

Feel free to ping moif in the LK discord if you have questions!