             material: material
             tree: tree
 
-    makeRegMaterial: () ->
+    makeRegMaterial: (prefix, all_contests, title, order) ->
         materials = []
-        for year, contests of REGION_CONTESTS
-            parsed = @makeRegYearMaterial(year, contests)
+        for year, contests of all_contests
+            parsed = @makeRegYearMaterial(prefix, year, contests)
             materials.push(parsed)
         materials = await finalizeMaterialsList(materials)
-        title = "Региональные олимпиады"
 
         material = new Material
-            _id: "reg"
-            order: 100
+            _id: prefix
+            order: order
             type: "level"
             indent: 0
             title: title
             content: ""
-            materials: [(await @makeLabelMaterial("reghead", 0, 0, "<h2>#{title}</h2>")).material]
+            materials: [(await @makeLabelMaterial("#{prefix}head", 0, 0, "<h2>#{title}</h2>")).material]
         for m in materials
             mm = clone(m.material)
             delete mm.materials

                continue
            materials.push(@parseSection(section, sectionId))

        materials.push(@makeRegMaterial())

        materials.push(@createTableMaterials())



import logger from '../log'

import {REGION_CONTESTS, ROI_CONTESTS} from './downloadContests'

url = 'https://informatics.mccme.ru/course/view.php?id=1135'

