Difference between revisions of "ConvertRating"

From Sega Retro

 
(21 intermediate revisions by the same user not shown)
Line 1: Line 1:
<includeonly>{{#vardefine:system|{{{1|}}}}}{{#vardefine:value|{{{2|}}}}}
+
<includeonly>{{#vardefine:displayRating|}}{{#vardefine:score|}}
{{#if:{{#pos:{{#var:system}}|,}}|{{ConvertRating/Multiple|{{{1|}}}|{{{2|}}}}}|
+
{{#switch:{{{1|}}}
{{#switch:{{#var:system}}
+
| ag
|0-4s={{#vardefine:displayRating|{{StarRating|{{#var:value}}|4}}}}{{#vardefine:score|{{#expr:{{#var:value}}*25}}}}
+
| actiongames
 
+
| gamepro
|1-4s={{#vardefine:displayRating|{{StarRating|{{#var:value}}|4}}}}{{#vardefine:score|{{#expr:({{#var:value}}-1)*(100/3)}}}}
+
| megaforce
 
+
| megaforcees
|0-5s={{#vardefine:displayRating|{{StarRating|{{#var:value}}|5}}}}{{#vardefine:score|{{#expr:{{#var:value}}*20}}}}
+
| megaforcept={{ConvertRating/Multiple|{{{1|}}}|{{{2|}}}|date={{{date|}}}{{{issue|}}}}}
 
+
| microkids={{ConvertRating/MicroKidsMultimedia|{{{2|}}}}}
|1-5s={{#vardefine:displayRating|{{StarRating|{{#var:value}}|5}}}}{{#vardefine:score|{{#expr:({{#var:value}}-1)*25}}}}
+
| egm={{ConvertRating/EGM|{{{2|}}}}}
 
+
| computergamer={{ConvertRating/ComputerGamer|{{{2|}}}}}
|0-10s={{#vardefine:displayRating|{{StarRating|{{#var:value}}|10}}}}{{#vardefine:score|{{#expr:{{#var:value}}*10}}}}
+
| progames={{ConvertRating/ProGames|{{{2|}}}}}
 
+
| #default={{#if:{{#pos:{{{1|}}}|,}}
|1-10s={{#vardefine:displayRating|{{StarRating|{{#var:value}}|10}}}}{{#vardefine:score|{{#expr:({{#var:value}}-1)*(100/9)}}}}
+
|{{ConvertRating/Multiple|{{{1|}}}|{{{2|}}}|date={{{date|}}}}}
 
+
|{{ConvertRating/Single|{{{1|}}}|{{{2|}}}|date={{{date|}}}}}
|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|}}
 
 
}}
 
}}
 
}}
 
}}
Line 105: Line 28:
  
 
TODO:
 
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".
 
added text. e.g. later issues of the UK Official Dreamcast magazine, 7 = "good".
  
Line 186: Line 107:
 
|A||{{#var:displayRating}}||{{#var:score}}
 
|A||{{#var:displayRating}}||{{#var:score}}
 
|-
 
|-
{{ConvertRating|A-F|B}}
+
{{ConvertRating|A-F|B+}}
|B||{{#var:displayRating}}||{{#var:score}}
+
|B+||{{#var:displayRating}}||{{#var:score}}
 
|-
 
|-
 
{{ConvertRating|A-F|C}}
 
{{ConvertRating|A-F|C}}
 
|C||{{#var:displayRating}}||{{#var:score}}
 
|C||{{#var:displayRating}}||{{#var:score}}
 
|-
 
|-
{{ConvertRating|A-F|D}}
+
{{ConvertRating|A-F|D-}}
|D||{{#var:displayRating}}||{{#var:score}}
+
|D-||{{#var:displayRating}}||{{#var:score}}
 
|-
 
|-
 
{{ConvertRating|A-F|F}}
 
{{ConvertRating|A-F|F}}
Line 212: Line 133:
 
|}
 
|}
  
 +
===1-6+===
 +
{| class="prettytable" style="width:auto;"
 +
!Input
 +
!Display
 +
!Score
 +
|-
 +
{{ConvertRating|1-6+|6+}}
 +
|6+||{{#var:displayRating}}||{{#var:score}}
 +
|-
 +
{{ConvertRating|1-6+|6}}
 +
|6||{{#var:displayRating}}||{{#var:score}}
 +
|-
 +
{{ConvertRating|1-6+|4-}}
 +
|4-||{{#var:displayRating}}||{{#var:score}}
 +
|-
 +
{{ConvertRating|1-6+|1}}
 +
|1||{{#var:displayRating}}||{{#var:score}}
 +
|}
 +
 +
===0-10+===
 +
{| class="prettytable" style="width:auto;"
 +
!Input
 +
!Display
 +
!Score
 +
|-
 +
{{ConvertRating|0-10+|0}}
 +
|0||{{#var:displayRating}}||{{#var:score}}
 +
|-
 +
{{ConvertRating|0-10+|0+}}
 +
|0+||{{#var:displayRating}}||{{#var:score}}
 +
|-
 +
{{ConvertRating|0-10+|1-}}
 +
|1-||{{#var:displayRating}}||{{#var:score}}
 +
|-
 +
{{ConvertRating|0-10+|1}}
 +
|1||{{#var:displayRating}}||{{#var:score}}
 +
|-
 +
{{ConvertRating|0-10+|1+}}
 +
|1+||{{#var:displayRating}}||{{#var:score}}
 +
|-
 +
{{ConvertRating|0-10+|2-}}
 +
|2-||{{#var:displayRating}}||{{#var:score}}
 +
|-
 +
{{ConvertRating|0-10+|2}}
 +
|2||{{#var:displayRating}}||{{#var:score}}
 +
|-
 +
{{ConvertRating|0-10+|2+}}
 +
|2+||{{#var:displayRating}}||{{#var:score}}
 +
|-
 +
{{ConvertRating|0-10+|3-}}
 +
|3-||{{#var:displayRating}}||{{#var:score}}
 +
|-
 +
{{ConvertRating|0-10+|3}}
 +
|3||{{#var:displayRating}}||{{#var:score}}
 +
|-
 +
{{ConvertRating|0-10+|3+}}
 +
|3+||{{#var:displayRating}}||{{#var:score}}
 +
|-
 +
{{ConvertRating|0-10+|4-}}
 +
|4-||{{#var:displayRating}}||{{#var:score}}
 +
|-
 +
{{ConvertRating|0-10+|4}}
 +
|4||{{#var:displayRating}}||{{#var:score}}
 +
|-
 +
{{ConvertRating|0-10+|4+}}
 +
|4+||{{#var:displayRating}}||{{#var:score}}
 +
|-
 +
{{ConvertRating|0-10+|5-}}
 +
|5-||{{#var:displayRating}}||{{#var:score}}
 +
|-
 +
{{ConvertRating|0-10+|5}}
 +
|5||{{#var:displayRating}}||{{#var:score}}
 +
|-
 +
{{ConvertRating|0-10+|5+}}
 +
|5+||{{#var:displayRating}}||{{#var:score}}
 +
|-
 +
{{ConvertRating|0-10+|6-}}
 +
|6-||{{#var:displayRating}}||{{#var:score}}
 +
|-
 +
{{ConvertRating|0-10+|6}}
 +
|6||{{#var:displayRating}}||{{#var:score}}
 +
|-
 +
{{ConvertRating|0-10+|6+}}
 +
|6+||{{#var:displayRating}}||{{#var:score}}
 +
|-
 +
{{ConvertRating|0-10+|7-}}
 +
|7-||{{#var:displayRating}}||{{#var:score}}
 +
|-
 +
{{ConvertRating|0-10+|7}}
 +
|7||{{#var:displayRating}}||{{#var:score}}
 +
|-
 +
{{ConvertRating|0-10+|7+}}
 +
|7+||{{#var:displayRating}}||{{#var:score}}
 +
|-
 +
{{ConvertRating|0-10+|8-}}
 +
|8-||{{#var:displayRating}}||{{#var:score}}
 +
|-
 +
{{ConvertRating|0-10+|8}}
 +
|8||{{#var:displayRating}}||{{#var:score}}
 +
|-
 +
{{ConvertRating|0-10+|8+}}
 +
|8+||{{#var:displayRating}}||{{#var:score}}
 +
|-
 +
{{ConvertRating|0-10+|9-}}
 +
|9-||{{#var:displayRating}}||{{#var:score}}
 +
|-
 +
{{ConvertRating|0-10+|9}}
 +
|9||{{#var:displayRating}}||{{#var:score}}
 +
|-
 +
{{ConvertRating|0-10+|9+}}
 +
|9+||{{#var:displayRating}}||{{#var:score}}
 +
|-
 +
{{ConvertRating|0-10+|10-}}
 +
|10-||{{#var:displayRating}}||{{#var:score}}
 +
|-
 +
{{ConvertRating|0-10+|10}}
 +
|10||{{#var:displayRating}}||{{#var:score}}
 +
|}
  
[[Category:Sega Retro templates]]</noinclude>
+
[[Category:Templates]]</noinclude>

Latest revision as of 07:43, 11 January 2024

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: added text. e.g. later issues of the UK Official Dreamcast magazine, 7 = "good".

Working values

0-4s

Input Display Score
0 RatingStar Empty.svgRatingStar Empty.svgRatingStar Empty.svgRatingStar Empty.svg 0
1 RatingStar Full.svgRatingStar Empty.svgRatingStar Empty.svgRatingStar Empty.svg 25
2 RatingStar Full.svgRatingStar Full.svgRatingStar Empty.svgRatingStar Empty.svg 50
3 RatingStar Full.svgRatingStar Full.svgRatingStar Full.svgRatingStar Empty.svg 75
4 RatingStar Full.svgRatingStar Full.svgRatingStar Full.svgRatingStar Full.svg 100

1-5s

Input Display Score
1 RatingStar Full.svgRatingStar Empty.svgRatingStar Empty.svgRatingStar Empty.svgRatingStar Empty.svg 0
2.5 RatingStar Full.svgRatingStar Full.svgRatingStar Half.svgRatingStar Empty.svgRatingStar Empty.svg 37.5
3 RatingStar Full.svgRatingStar Full.svgRatingStar Full.svgRatingStar Empty.svgRatingStar Empty.svg 50
4.5 RatingStar Full.svgRatingStar Full.svgRatingStar Full.svgRatingStar Full.svgRatingStar Half.svg 87.5
5 RatingStar Full.svgRatingStar Full.svgRatingStar Full.svgRatingStar Full.svgRatingStar Full.svg 100

1-10

Input Display Score
1 1/10 0
2.5 2.5/10 16.666666666667
4 4/10 33.333333333333
7.5 7.5/10 72.222222222222
10 10/10 100

A-F

Input Display Score
A A 100
B+ B+ 83
C C 50
D- D- 16
F F 0

GamePro

Input Display Score
1,2,3,4,5
Graphics: 1 Sound: 2 Gameplay: 3 FunFactor: 4 Challenge: 5
||60
1,2,3,4,adj
Graphics: 1 Sound: 2 Gameplay: 3 FunFactor: 4
||50

1-6+

Input Display Score
6+ 6+ 100
6 6 93.333333333333
4- 4- 46.666666666667
1 1 0

0-10+

Input Display Score
0 0 0
0+ 0+ 3.3333333333333
1- 1- 6.6666666666667
1 1 10
1+ 1+ 13.333333333333
2- 2- 16.666666666667
2 2 20
2+ 2+ 23.333333333333
3- 3- 26.666666666667
3 3 30
3+ 3+ 33.333333333333
4- 4- 36.666666666667
4 4 40
4+ 4+ 43.333333333333
5- 5- 46.666666666667
5 5 50
5+ 5+ 53.333333333333
6- 6- 56.666666666667
6 6 60
6+ 6+ 63.333333333333
7- 7- 66.666666666667
7 7 70
7+ 7+ 73.333333333333
8- 8- 76.666666666667
8 8 80
8+ 8+ 83.333333333333
9- 9- 86.666666666667
9 9 90
9+ 9+ 93.333333333333
10- 10- 96.666666666667
10 10 100