Difference between revisions of "ConvertRating"

From Sega Retro

(there may be better ways)
Line 1: Line 1:
<includeonly></includeonly><noinclude>{{TODO}}
+
<includeonly>{{#vardefine:system|{{{1|}}}}}{{#vardefine:value|{{{2|}}}}}
 +
{{#switch:{{#var:system}}
 +
|0-4s={{#switch:{{#var:value}}
 +
|0={{#vardefine:displayRating|☆☆☆☆}}{{#vardefine:score|0}}
 +
|1={{#vardefine:displayRating|★☆☆☆}}{{#vardefine:score|25}}
 +
|2={{#vardefine:displayRating|★★☆☆}}{{#vardefine:score|50}}
 +
|3={{#vardefine:displayRating|★★★☆}}{{#vardefine:score|75}}
 +
|4={{#vardefine:displayRating|★★★★}}{{#vardefine:score|100}}
 +
|#default={{#vardefine:displayRating|Unknown value!}}{{#vardefine:score|}}
 +
}}
 +
 
 +
|1-4s={{#switch:{{#var:value}}
 +
|#default={{#vardefine:displayRating|Unknown value!}}{{#vardefine:score|}}
 +
}}
 +
 
 +
|0-5s={{#switch:{{#var:value}}
 +
|0={{#vardefine:displayRating|☆☆☆☆☆}}{{#vardefine:score|0}}
 +
|1={{#vardefine:displayRating|★☆☆☆☆}}{{#vardefine:score|20}}
 +
|2={{#vardefine:displayRating|★★☆☆☆}}{{#vardefine:score|40}}
 +
|3={{#vardefine:displayRating|★★★☆☆}}{{#vardefine:score|60}}
 +
|4={{#vardefine:displayRating|★★★★☆}}{{#vardefine:score|80}}
 +
|5={{#vardefine:displayRating|★★★★★}}{{#vardefine:score|100}}
 +
|#default={{#vardefine:displayRating|Unknown value!}}{{#vardefine:score|}}
 +
}}
 +
 
 +
|1-5s={{#switch:{{#var:value}}
 +
|#default={{#vardefine:displayRating|Unknown value!}}{{#vardefine:score|}}
 +
}}
 +
 
 +
|0-10s={{#switch:{{#var:value}}
 +
|#default={{#vardefine:displayRating|Unknown value!}}{{#vardefine:score|}}
 +
}}
 +
 
 +
|1-10s={{#switch:{{#var:value}}
 +
|#default={{#vardefine:displayRating|Unknown value!}}{{#vardefine:score|}}
 +
}}
 +
 
 +
|0-4={{#switch:{{#var:value}}
 +
|#default={{#vardefine:displayRating|Unknown value!}}{{#vardefine:score|}}
 +
}}
 +
 
 +
|1-4={{#switch:{{#var:value}}
 +
|#default={{#vardefine:displayRating|Unknown value!}}{{#vardefine:score|}}
 +
}}
 +
 
 +
|0-5={{#switch:{{#var:value}}
 +
|#default={{#vardefine:displayRating|Unknown value!}}{{#vardefine:score|}}
 +
}}
 +
 
 +
|1-5={{#switch:{{#var:value}}
 +
|#default={{#vardefine:displayRating|Unknown value!}}{{#vardefine:score|}}
 +
}}
 +
 
 +
|0-0={{#switch:{{#var:value}}
 +
|#default={{#vardefine:displayRating|Unknown value!}}{{#vardefine:score|}}
 +
}}
 +
 
 +
|1-10={{#switch:{{#var:value}}
 +
|#default={{#vardefine:displayRating|Unknown value!}}{{#vardefine:score|}}
 +
}}
 +
 
 +
|0-20={{#switch:{{#var:value}}
 +
|#default={{#vardefine:displayRating|Unknown value!}}{{#vardefine:score|}}
 +
}}
 +
 
 +
|1-20={{#switch:{{#var:value}}
 +
|#default={{#vardefine:displayRating|Unknown value!}}{{#vardefine:score|}}
 +
}}
 +
 
 +
|0-100={{#switch:{{#var:value}}
 +
|#default={{#vardefine:displayRating|Unknown value!}}{{#vardefine:score|}}
 +
}}
 +
 
 +
|0-1000={{#switch:{{#var:value}}
 +
|#default={{#vardefine:displayRating|Unknown value!}}{{#vardefine:score|}}
 +
}}
 +
 
 +
|A-F={{#switch:{{#var:value}}
 +
|#default={{#vardefine:displayRating|Unknown value!}}{{#vardefine:score|}}
 +
}}
 +
 
 +
|#default={{#vardefine:displayRating|Unknown system!}}{{#vardefine:score|}}
 +
}}
 +
</includeonly><noinclude>{{TODO}}
 
A template for converting a rating, as printed in a magazine into:
 
A template for converting a rating, as printed in a magazine into:
 
*something nice to display (<nowiki>{{#var:displayRating}}</nowiki>)
 
*something nice to display (<nowiki>{{#var:displayRating}}</nowiki>)
Line 15: Line 98:
  
 
The user should not be expected to calculate anything.
 
The user should not be expected to calculate anything.
 +
 +
 +
==Working values==
 +
===0-4s===
 +
{| class="prettytable" style="width:auto;"
 +
|{{ConvertRating|0-4s|0}}{{#var:displayRating}}
 +
|{{#var:score}}
 +
|-
 +
|{{ConvertRating|0-4s|1}}{{#var:displayRating}}
 +
|{{#var:score}}
 +
|-
 +
|{{ConvertRating|0-4s|2}}{{#var:displayRating}}
 +
|{{#var:score}}
 +
|-
 +
|{{ConvertRating|0-4s|3}}{{#var:displayRating}}
 +
|{{#var:score}}
 +
|-
 +
|{{ConvertRating|0-4s|4}}{{#var:displayRating}}
 +
|{{#var:score}}
 +
|-
 +
|}
 +
  
  
 
[[Category:Sega Retro templates]]</noinclude>
 
[[Category:Sega Retro templates]]</noinclude>

Revision as of 03:33, 20 April 2020

Clock.svg
This task is unfinished
This is a wiki task that requires more thought or peer review. An important issue that needs to be solved, which will appear at the top of Sega Retro:Todo until this message is removed.

A template for converting a rating, as printed in a magazine into:

  • something nice to display ({{#var:displayRating}})
  • a value out of 100 for use in Sega Retro averages ({{#var:score}})

Magazine pages should use Template:RatingSystemDefine to define which systems are in use.


multiple instances of the above (e.g. support "1,2,3,4" for EGM)

added text. e.g. later issues of the UK Official Dreamcast magazine, 7 = "good".


it should be able to detect if a given value is invalid. Some magazines could be using multiple systems depending on context.

The user should not be expected to calculate anything.


Working values

0-4s

☆☆☆☆

0

★☆☆☆

25

★★☆☆

50

★★★☆

75

★★★★

100