skip to Main Content

Step 4, Competition Rules is where you define the conditions for awarding points, as well as Start, Stop, Finish, and Finalize the Competition and Contest. See the above example of the rules system in CompetitionLabs.

RULES fields

EXAMPLES

» Points calculation Model

Mandatory

Points calculation can be replaced with Custom points, which is a Ruleset that lets you create more complex competitions. You can add, subtract or multiply points, or use your own adjustment factor.

To add a Ruleset that will calculate differently with different actions, just click on Add Rule Set, enter your Custom points Ruleset, and the Rule sets will work together.

You can read more about Rules at Competitions and Contests -> Rules guide, or here

» Start the contests Model

Mandatory

The Start the contests default is pre-selected as The contests parents are all finalised, i.e. all contests before the one starting have been finalised.

If you are creating the first of a number of contests, or only one contest, then it will start when the competition starts.

» Finish the contests Model

Mandatory

The contest will finish when the contests have been active for exactly or more than the time between the contest start and the competition end time.

The time constant can be entered manually, or you can select a pre-created constant.

» Finalise the contests Model

Mandatory

The contests will finalise when finished, and the finalisation time will be 1 minute.

The time constant for the finalisation time for can only be a number.

APP Example:

Points calculation
Start the contests
Finish the contests
Finalise the contests

API Example:

{"jsonClass": "Contest",
 
     ...
 
     "ruleSets": [
     {
          "jsonClass": "RuleSet",
          "priority": 1,
          "scope": "contest",
          "action": "open.contest",
          "conditions": [
          {
               "jsonClass": "MainConditionSet",
               "matchCondition": "All",
               "mustEvaluateTo": true,
               "rules": [
               {
                    "jsonClass": "MainRule",
                    "fact": "contest.parents.status",
                    "operator": "==",
                    "constant": "$finalised.status"
                    }]
               }]
     },
{
     "jsonClass": "RuleSet",
     "priority": 2,
     "scope": "contest",
     "action": "finish.contest",
     "conditions": [
     {
          "jsonClass": "MainConditionSet",
          "matchCondition": "All",
          "mustEvaluateTo": true,
          "rules": [
          {
               "jsonClass": "MainRule",
               "fact": "contest.active.elapsed",
               "operator": ">=",
               "constant": "$competitions.scheduled.end"
               }]
          }]
     },
     {
     "jsonClass": "RuleSet",
     "priority": 3,
     "scope": "contest",
     "action": "finalise.contest",
     "conditions": [
     {
          "jsonClass": "MainConditionSet",
          "matchCondition": "All",
          "mustEvaluateTo": true,
          "rules": [
          {
               "jsonClass": "MainRule",
               "fact": "contest.finish.elapsed",
               "operator": ">=",
               "constant": "1"
               }]
          }]
     },{
     "jsonClass": "RuleSet",
     "priority": 4,
     "scope": "contest",
     "action": "contests.points.calculated.custom",
     "conditions": [
     {
          "jsonClass": "MainConditionSet",
          "matchCondition": "All",
          "mustEvaluateTo": true,
          "rules": [
          {
               "jsonClass": "MainRule",
               "fact": "event.count",
               "operator": ">=",
               "constant": "1",
               "subConditions": [
               {
                    "jsonClass": "SubConditionSet",
                    "matchCondition": "All",
                    "mustEvaluateTo": true,
                    "subRules": [
                     {
                         "jsonClass": "SubRule",
                         "fact": "event.action.type",
                         "operator": "==",
                         "constant": "bet"
                         }]
                    }]
               }]
          }],
     "onMatchThen": "add",
     "onMatchConstant": "1"
     },
     {
     "jsonClass": "RuleSet",
     "priority": 5,
     "scope": "contest",
     "action": "contests.points.calculated.custom",
     "conditions": [
     {
          "jsonClass": "MainConditionSet",
          "matchCondition": "All",
          "mustEvaluateTo": true,
          "rules": [
          {
               "jsonClass": "MainRule",
               "fact": "event.count",
               "operator": ">=",
               "constant": "1",
               "subConditions": [
               {
                    "jsonClass": "SubConditionSet",
                    "matchCondition": "All",
                    "mustEvaluateTo": true,
                    "subRules": [
                    {
                         "jsonClass": "SubRule",
                         "fact": "event.action.type",
                         "operator": "==",
                         "constant": "win"
                         }]
                    }]
               }]
          }
     ],
     "onMatchThen": "add",
     "onMatchConstant": "3"
     }
    ],
 
...
}

The API example provides only a simplified version of the POST body. A full example of POST Contest can be found in the Contest APP API documentation here

The Rule sets shown are a working example. Edits can influence a contest’s start, finish, finalising or points calculation, so if you make changes, please test before going live with the contest.

You can read more about Rules, and preview some templates and their combinations here.

PREVIOUS – Click Previous and go back to the previous step.

CONTINUE – Click Next and continue to the next step.

Back To Top