Module:OfficialRating

local ofc = {}

function t1( x ) -- Conventional ToNumber with 1 as default return tonumber ( x ) or 1 end

function tn( x ) -- Conventional ToNumber return tonumber ( x ) or 0 end

function tt( x ) -- Conventional Empty String Filler return x or "" end

function head -- Header return '{| class="article-table" style="width:100%; font-size:90%;"\n|-\n! style=width:15%|Category\n! style=width:46%|Comment\n! style=width:20%|Score (out of 10)\n! style=width:19%|Total (out of 10)\n' end

function body (args) -- Main arguments local total, weight, totalweight, organ = 0, 1, 0, "" local skeleton = { [1] = function (m) organ = organ .. "|-\n" .. tt(m) end [2] = function (m) weight, totalweight = t1(m), totalweight + t1(m) end [3] = function (m) organ = organ .. "|" .. tt(m) end [0] = function (m) total = total + tn(m) * weight end }      for a, b in ipairs(args) do        skeletion[a % 4](b) end organ = organ .. "|-\n!Additional Comments\n|" .. tt( args[comment] ) .. "\n!\n!\n|-!Signature\n|" .. tt( args[sig] ) end

function ofc.build( frame ) -- Whole build function local human = head .. body(frame:getParent.args) return frame:preprocess(human) end return ofc