This site is the archived OWASP Foundation Wiki and is no longer accepting Account Requests.
To view the new OWASP Foundation website, please visit https://owasp.org

Template:OWASP Points Calculator

From OWASP
Revision as of 22:24, 7 January 2011 by Mark.bristow (talk | contribs)

Jump to: navigation, search

Usage

{{OWASP Points Calculator|activity={{{activity}}}|year={{{year}}}}}

Help

This template is used for the actual calculating OWASP Points. It requires 2 parameters:

  • activity = The activity identifier (the code here actually does the translation, see OWASP Points for human readable detail)
  • year = The year that the points were earned

Formula

The function uses the activity code to do a look-up of the full point value of the activity. If the difference between the current year and the year the points were earned is 0 or 1 (earned same year or earned last year), the full point value is passed. If the points were earned 2 years ago, half the point value is passed.


The template also calls the OWASP Points Calculator template

Code

{{#expr: {{#switch: {{{activity}}} | b1 = 200 | b2 = 100 | c1 = 150 | c2 = 100 | c3 = 40 | c4 = 10 }} div {{#ifexpr:{{#expr: {{#time: Y }} - {{{year}}}}} <= 1| 1 | 2}} }}