Module:Sandbox/SD0001/QPQ

local p = {}

function p.numQpqsRequired(username) local backlogModeText = mw.title.new('Template:Did you know/Backlog mode?'):getContent local isInBacklogMode = backlogModeText ~= nil and backlogModeText:find('^true') ~= nil local nomsCountData = mw.loadJsonData('User:SDZeroBot/DYK nomination counts.json') local numPriorNoms = nomsCountData[username] or -1 local qpqsRequired = (isInBacklogMode and numPriorNoms >= 20 and 2) or (numPriorNoms >= 5 and 1) or 0 -- return string.format("%s,%s", qpqsRequired, numPriorNoms) return qpqsRequired, numPriorNoms end

return p