Difference between revisions of "ConvertRating"

From Sega Retro

Line 1: Line 1:
 
<includeonly>{{#vardefine:system|{{{1|}}}}}{{#vardefine:value|{{{2|}}}}}{{#vardefine:displayRating|}}{{#vardefine:score|}}
 
<includeonly>{{#vardefine:system|{{{1|}}}}}{{#vardefine:value|{{{2|}}}}}{{#vardefine:displayRating|}}{{#vardefine:score|}}
{{#if:{{#pos:{{#var:system}}|,}}|{{ConvertRating/Multiple|{{{1|}}}|{{{2|}}}}}|
+
{{#if:{{#pos:{{#var:system}}|,}}
{{#switch:{{#var:system}}
+
|{{ConvertRating/Multiple|{{{1|}}}|{{{2|}}}}}
|0-4s={{#vardefine:displayRating|{{StarRating|{{#var:value}}|4}}}}{{#vardefine:score|{{#expr:{{#var:value}}*25}}}}
+
|{{ConvertRating/Single}}
 
 
|1-4s={{#vardefine:displayRating|{{StarRating|{{#var:value}}|4}}}}{{#vardefine:score|{{#expr:({{#var:value}}-1)*(100/3)}}}}
 
 
 
|0-5s={{#vardefine:displayRating|{{StarRating|{{#var:value}}|5}}}}{{#vardefine:score|{{#expr:{{#var:value}}*20}}}}
 
 
 
|1-5s={{#vardefine:displayRating|{{StarRating|{{#var:value}}|5}}}}{{#vardefine:score|{{#expr:({{#var:value}}-1)*25}}}}
 
 
 
|0-10s={{#vardefine:displayRating|{{StarRating|{{#var:value}}|10}}}}{{#vardefine:score|{{#expr:{{#var:value}}*10}}}}
 
 
 
|1-10s={{#vardefine:displayRating|{{StarRating|{{#var:value}}|10}}}}{{#vardefine:score|{{#expr:({{#var:value}}-1)*(100/9)}}}}
 
 
 
|0-4={{#vardefine:displayRating|{{#var:value}}/4}}{{#vardefine:score|{{#expr:{{#var:value}}*25}}}}
 
 
 
|1-4={{#vardefine:displayRating|{{#var:value}}/4}}{{#vardefine:score|{{#expr:({{#var:value}}-1)*(100/3)}}}}
 
 
 
|0-5={{#vardefine:displayRating|{{#var:value}}/5}}{{#vardefine:score|{{#expr:{{#var:value}}*20}}}}
 
 
 
|1-5={{#vardefine:displayRating|{{#var:value}}/5}}{{#vardefine:score|{{#expr:({{#var:value}}-1)*25}}}}
 
 
 
|0-10={{#vardefine:displayRating|{{#var:value}}/10}}{{#vardefine:score|{{#expr:{{#var:value}}*10}}}}
 
 
 
|1-10={{#vardefine:displayRating|{{#var:value}}/10}}{{#vardefine:score|{{#expr:({{#var:value}}-1)*(100/9)}}}}
 
 
 
|0-20={{#vardefine:displayRating|{{#var:value}}/20}}{{#vardefine:score|{{#expr:{{#var:value}}*5}}}}
 
 
 
|1-20={{#vardefine:displayRating|{{#var:value}}/20}}{{#vardefine:score|{{#expr:({{#var:value}}-1)*(100/19)}}}}
 
 
 
|0-100={{#vardefine:displayRating|{{#var:value}}%}}{{#vardefine:score|{{#var:value}}}}
 
 
 
|0-1000={{#vardefine:displayRating|{{#var:value}}}}{{#vardefine:score|{{#expr:{{#var:value}}/10}}}}
 
 
 
|A-F={{#switch:{{#var:value}}
 
|a+
 
|A+={{#vardefine:displayRating|A+}}{{#vardefine:score|100}}
 
|a
 
|A={{#vardefine:displayRating|A}}{{#vardefine:score|100}}
 
|a-
 
|A-={{#vardefine:displayRating|A-}}{{#vardefine:score|91}}
 
|b+
 
|B+={{#vardefine:displayRating|B+}}{{#vardefine:score|83}}
 
|b
 
|B={{#vardefine:displayRating|B}}{{#vardefine:score|75}}
 
|b-
 
|B-={{#vardefine:displayRating|B-}}{{#vardefine:score|67}}
 
|c+
 
|C+={{#vardefine:displayRating|C+}}{{#vardefine:score|58}}
 
|c
 
|C={{#vardefine:displayRating|C}}{{#vardefine:score|50}}
 
|c-
 
|C-={{#vardefine:displayRating|C-}}{{#vardefine:score|42}}
 
|d+
 
|D+={{#vardefine:displayRating|D+}}{{#vardefine:score|33}}
 
|d
 
|D={{#vardefine:displayRating|D}}{{#vardefine:score|25}}
 
|d-
 
|D-={{#vardefine:displayRating|D-}}{{#vardefine:score|16}}
 
|f+
 
|F+={{#vardefine:displayRating|F+}}{{#vardefine:score|8}}
 
|f
 
|F={{#vardefine:displayRating|F}}{{#vardefine:score|0}}
 
|f-
 
|F-={{#vardefine:displayRating|F-}}{{#vardefine:score|0}}
 
|#default={{#vardefine:displayRating|Unknown value!}}{{#vardefine:score|}}
 
}}
 
 
 
|gamepro={{ConvertRating/GamePro|{{#var:value}}}}
 
 
 
|german={{#switch:{{#var:value}}
 
|1+={{#vardefine:displayRating|1+}}{{#vardefine:score|100}}
 
|1={{#vardefine:displayRating|1}}{{#vardefine:score|{{#expr:(14/15) * 100}}}}
 
|1-={{#vardefine:displayRating|1-}}{{#vardefine:score|{{#expr:(13/15) * 100}}}}
 
|2+={{#vardefine:displayRating|2+}}{{#vardefine:score|80}}
 
|2={{#vardefine:displayRating|2}}{{#vardefine:score|{{#expr:(11/15) * 100}}}}
 
|2-={{#vardefine:displayRating|2-}}{{#vardefine:score|{{#expr:(10/15) * 100}}}}
 
|3+={{#vardefine:displayRating|3+}}{{#vardefine:score|60}}
 
|3={{#vardefine:displayRating|3}}{{#vardefine:score|{{#expr:(8/15) * 100}}}}
 
|3-={{#vardefine:displayRating|3-}}{{#vardefine:score|{{#expr:(7/15) * 100}}}}
 
|4+={{#vardefine:displayRating|4+}}{{#vardefine:score|40}}
 
|4={{#vardefine:displayRating|4}}{{#vardefine:score|{{#expr:(5/15) * 100}}}}
 
|4-={{#vardefine:displayRating|4-}}{{#vardefine:score|{{#expr:(4/15) * 100}}}}
 
|5+={{#vardefine:displayRating|5+}}{{#vardefine:score|20}}
 
|5={{#vardefine:displayRating|5}}{{#vardefine:score|{{#expr:(2/15) * 100}}}}
 
|5-={{#vardefine:displayRating|5-}}{{#vardefine:score|{{#expr:(1/15) * 100}}}}
 
|6={{#vardefine:displayRating|6}}{{#vardefine:score|0}}
 
|#default={{#vardefine:displayRating|Unknown value!}}{{#vardefine:score|}}
 
}}
 
 
 
|#default={{#vardefine:displayRating|Unknown system! ("{{#var:system}}")}}{{#vardefine:score|}}
 
}}
 
 
}}
 
}}
 
</includeonly><noinclude>{{TODO}}
 
</includeonly><noinclude>{{TODO}}

Revision as of 08:25, 23 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}})

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.


TODO: 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".

Working values

0-4s

Input Display Score
0 Unknown system! ("")
1 Unknown system! ("")
2 Unknown system! ("")
3 Unknown system! ("")
4 Unknown system! ("")

1-5s

Input Display Score
1 Unknown system! ("")
2.5 Unknown system! ("")
3 Unknown system! ("")
4.5 Unknown system! ("")
5 Unknown system! ("")

1-10

Input Display Score
1 Unknown system! ("")
2.5 Unknown system! ("")
4 Unknown system! ("")
7.5 Unknown system! ("")
10 Unknown system! ("")

A-F

Input Display Score
A Unknown system! ("")
B Unknown system! ("")
C Unknown system! ("")
D Unknown system! ("")
F Unknown system! ("")

GamePro

Input Display Score
1,2,3,4,5 Unknown system! ("")
1,2,3,4,adj Unknown system! ("")