模組:Scoring
外观
第十六屆動員令開始後使用此模板,過去計分方式紀錄於此
使用方法:{{#invoke:scoring|calculate|cat=<> |length=<> |rank=<> |isnew=<>}}
需要给入的要素:
- cat (Category,类别)
- 表示条目属于动员令的种类:
- 大动员令用“1”表示,中动员令用“2”表示,小动员令用“3”表示。
- length (长度)
- 表示条目的长度,单位为字节,
- 请直接输入数字。
- rank (等级)
- 表示条目的等级,分为典范条目,典范列表,优良条目,达标条目四种
- 典范条目请输入“FA”,典范列表请输入“FL”,优良条目请输入“GA”,达标条目请输入“normal”
- isnew (是新条目)
- 表示条目为新撰写的条目
- 如果是请输入“1”,如果不是(即改善条目)请输入“0”.
使用示例:
- 一个改善的长度为40,000字节的中动员令下属优良条目,应使用{{#invoke:scoring|calculate|cat=2 |length=40000 |rank=GA |isnew=0}}。
- 显示结果为45。
local final_assessment = {}
function final_assessment.calculate()
local args = mw.getCurrentFrame().args
local score = 0
local length = tonumber(args.length, 10)
if args.rank == 'FA' then
if length <= 25000 then
score = 50
else
score = 50 + 1 * (length - 25000) / 1000
end
elseif args.rank == 'GA' then
if length <= 20000 then
score = 30
else
score = 30 + 0.75 * (length - 20000) / 1000
end
elseif args.rank == 'normal' then
if length <= 100000 then
score = -0.0025 * (length / 1000) ^ 2 + 0.52 * (length / 1000) + 1
else
score = 28
end
end
if args.isnew == '0' then
--如果不是新条目
score = score * 0.5
end
--大中小动员令加成
score = score * tonumber(args.cat, 10)
--如果长度不合标准则归零
if length <= 3500 then
score = 0
end
return score
end
return final_assessment