Documentation for this module may be created at Module:Mentoring stat/doc
--<nowiki> Gives stats about mentoring
local p = {}
function p.main(frame)
-- local args = require("Dev:Arguments").getArgs(frame)
local completed = pagesincat("Completed_requests","all")
-- local on_hold = pagesincat("Completed_requests","all")
local totRequests = pagesincat("Mentoring_requests","all")
local completionRate = round(completed / totRequests, 2 )
return "'''Progress''': " .. (completionRate * 100).. "% of requests done."
end
function pagesincat(cat, prop)
return mw.site.stats.pagesInCategory (cat, prop)
end
function round(num, idp)
return tonumber(string.format("%." .. (idp or 0) .. "f", num))
end
return p