Module:Higher education task force/sandbox: Difference between revisions

Content deleted Content added
No edit summary
 
(7 intermediate revisions by one other user not shown)
Line 335:
if article or args.QUALITY_CRITERIA=='custom' then -- no fallbacks for articles or projects with custom quality scales
return class
else -- check fallbacks for non-article classes
local new_class = class
local category_exists = function(class)
local cat = mw.title.new(cfg.quality.assessment_category:format(class, category .. ' ' .. (article and 'articles' or 'pages')))
return cat.exists and #cat:getContent()>0
end
if class=='FM' and not category_exists('FM') then
new_class = 'File' -- fall back to File-class if FM category does not exist
end
if not category_exists(new_class) then
new_class = 'NA' -- use NA for non-article pages if category does not exist
end
return new_class
end
end
local check_defallbacks = function(class, category)
if article or args.QUALITY_CRITERIA=='custom' then -- no fallbacks for articles or projects with custom quality scales
return class .. category
else -- check fallbacks for non-article classes
local new_class = class
Line 392 ⟶ 410:
if article_class then -- banner shell exists
if class=='' then -- local class is blank
class = "Afart" -- check_fallbacks(article_class, assessment_cat)
check_redundant()
elseif class==article_class then -- local class matches article class
Line 914 ⟶ 932:
local raw_args = args_module.getArgs(frame, {frameOnly = true, removeBlanks = false})
local i=initialise(args, raw_args)
-- local a=p.printargs(frame)
return i
end