Skip to content

Commit

Permalink
concept practice limit
Browse files Browse the repository at this point in the history
  • Loading branch information
dmaahs2017 committed Jan 5, 2022
1 parent c5be8b4 commit c2e06ff
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 65 deletions.
8 changes: 8 additions & 0 deletions bin/clean_topics_vs_practices.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@ def main():
practice_exercise['practices'].extend((topic for topic in practice_exercise['topics'] if topic in concepts))
practice_exercise['topics'] = [topic for topic in practice_exercise['topics'] if topic not in concepts]

for concept in concepts:
count = 0
for practice_exercise in config['exercises']['practice']:
if concept in practice_exercise['practices']:
count += 1
if count > 10:
practice_exercise['practices'].remove(concept)

with open("config.json", 'w', encoding="utf-8") as f:
json.dump(config, f, indent=2, ensure_ascii=False)
f.write('\n')
Expand Down
87 changes: 22 additions & 65 deletions config.json
Original file line number Diff line number Diff line change
Expand Up @@ -776,9 +776,7 @@
"slug": "pig-latin",
"name": "Pig Latin",
"uuid": "c21c379b-fb23-449b-809a-3c6ef1c31221",
"practices": [
"strings"
],
"practices": [],
"prerequisites": [],
"difficulty": 4,
"topics": [
Expand All @@ -805,7 +803,6 @@
"name": "Rna Transcription",
"uuid": "9a219d87-cd32-4e12-a879-bfb5747c2369",
"practices": [
"strings",
"structs"
],
"prerequisites": [],
Expand All @@ -821,8 +818,7 @@
"name": "Run Length Encoding",
"uuid": "4dc9b165-792a-4438-be80-df9aab6f6a9c",
"practices": [
"loops",
"strings"
"loops"
],
"prerequisites": [],
"difficulty": 4,
Expand All @@ -847,9 +843,7 @@
"slug": "say",
"name": "Say",
"uuid": "4ba35adb-230b-49a6-adc9-2d3cd9a4c538",
"practices": [
"strings"
],
"practices": [],
"prerequisites": [],
"difficulty": 4,
"topics": [
Expand Down Expand Up @@ -913,8 +907,7 @@
"name": "Tournament",
"uuid": "9a2406cc-5037-4761-b820-bb25b1d397c8",
"practices": [
"enums",
"structs"
"enums"
],
"prerequisites": [],
"difficulty": 4,
Expand All @@ -927,9 +920,7 @@
"slug": "triangle",
"name": "Triangle",
"uuid": "c0bc2af6-d7af-401f-9ed8-bbe31977666c",
"practices": [
"structs"
],
"practices": [],
"prerequisites": [],
"difficulty": 4,
"topics": []
Expand Down Expand Up @@ -979,8 +970,7 @@
"name": "Robot Name",
"uuid": "ec7f66c2-749e-4d00-9c11-fa9d106632e4",
"practices": [
"mutability",
"structs"
"mutability"
],
"prerequisites": [],
"difficulty": 4,
Expand All @@ -994,9 +984,7 @@
"slug": "protein-translation",
"name": "Protein Translation",
"uuid": "4e01efbc-51ce-4d20-b093-b3d44c4be5e8",
"practices": [
"structs"
],
"practices": [],
"prerequisites": [],
"difficulty": 7,
"topics": [
Expand Down Expand Up @@ -1035,9 +1023,7 @@
"slug": "wordy",
"name": "Wordy",
"uuid": "620b55bb-058e-4c6f-a966-ced3b41736db",
"practices": [
"strings"
],
"practices": [],
"prerequisites": [],
"difficulty": 4,
"topics": [
Expand All @@ -1050,9 +1036,7 @@
"slug": "custom-set",
"name": "Custom Set",
"uuid": "9d652e63-6654-4dec-a99f-97e6bc8cf772",
"practices": [
"structs"
],
"practices": [],
"prerequisites": [],
"difficulty": 4,
"topics": [
Expand All @@ -1078,8 +1062,7 @@
"name": "Rectangles",
"uuid": "cc4ccd99-1c97-4ee7-890c-d629b4e1e46d",
"practices": [
"enums",
"structs"
"enums"
],
"prerequisites": [],
"difficulty": 10,
Expand Down Expand Up @@ -1115,9 +1098,7 @@
"slug": "series",
"name": "Series",
"uuid": "9de405e1-3a05-43cb-8eb3-00b81a2968e9",
"practices": [
"strings"
],
"practices": [],
"prerequisites": [],
"difficulty": 1,
"topics": [
Expand All @@ -1141,9 +1122,7 @@
"slug": "affine-cipher",
"name": "Affine Cipher",
"uuid": "2a1dcf38-ec05-4b24-a2e2-2e5b3595f3f0",
"practices": [
"strings"
],
"practices": [],
"prerequisites": [],
"difficulty": 4,
"topics": [
Expand All @@ -1158,9 +1137,7 @@
"slug": "atbash-cipher",
"name": "Atbash Cipher",
"uuid": "53298a14-76a9-4bb9-943a-57c5e79d9cf7",
"practices": [
"strings"
],
"practices": [],
"prerequisites": [],
"difficulty": 4,
"topics": [
Expand All @@ -1175,9 +1152,7 @@
"slug": "crypto-square",
"name": "Crypto Square",
"uuid": "0cc485e9-43ba-4d97-a622-ee4cb8b9f1f7",
"practices": [
"strings"
],
"practices": [],
"prerequisites": [],
"difficulty": 4,
"topics": [
Expand All @@ -1194,9 +1169,7 @@
"slug": "diamond",
"name": "Diamond",
"uuid": "c6878b91-70dd-49a0-b7c1-06364fa3d80b",
"practices": [
"strings"
],
"practices": [],
"prerequisites": [],
"difficulty": 4,
"topics": [
Expand Down Expand Up @@ -1266,9 +1239,7 @@
"slug": "rail-fence-cipher",
"name": "Rail Fence Cipher",
"uuid": "9a8bae4f-2c0b-4e9e-aab2-b92f82dd3b87",
"practices": [
"strings"
],
"practices": [],
"prerequisites": [],
"difficulty": 4,
"topics": [
Expand All @@ -1282,7 +1253,6 @@
"uuid": "498be645-734a-49b7-aba7-aae1e051e1f0",
"practices": [
"loops",
"structs",
"mutability"
],
"prerequisites": [],
Expand All @@ -1296,9 +1266,7 @@
"slug": "rotational-cipher",
"name": "Rotational Cipher",
"uuid": "5dbecc83-2c8d-467d-be05-f28a08f7abcf",
"practices": [
"strings"
],
"practices": [],
"prerequisites": [],
"difficulty": 4,
"topics": [
Expand All @@ -1313,9 +1281,7 @@
"slug": "simple-cipher",
"name": "Simple Cipher",
"uuid": "3aba9330-da46-48ee-bb9d-7e8f6c1ae7eb",
"practices": [
"strings"
],
"practices": [],
"prerequisites": [],
"difficulty": 4,
"topics": [
Expand All @@ -1328,9 +1294,7 @@
"slug": "word-count",
"name": "Word Count",
"uuid": "6c5c0dc3-4f5b-4f83-bf67-a45bf4ea6be4",
"practices": [
"strings"
],
"practices": [],
"prerequisites": [],
"difficulty": 4,
"topics": [
Expand Down Expand Up @@ -1394,10 +1358,7 @@
"slug": "decimal",
"name": "Decimal",
"uuid": "7cefed7c-37f4-46c5-9a45-68fe4d0fb326",
"practices": [
"strings",
"structs"
],
"practices": [],
"prerequisites": [],
"difficulty": 7,
"topics": [
Expand All @@ -1411,9 +1372,7 @@
"slug": "grep",
"name": "Grep",
"uuid": "1bce70ca-db1a-46c8-a314-07d3fda921c2",
"practices": [
"strings"
],
"practices": [],
"prerequisites": [],
"difficulty": 7,
"topics": [
Expand Down Expand Up @@ -1490,9 +1449,7 @@
"slug": "two-fer",
"name": "Two Fer",
"uuid": "585e963b-366c-48bc-b523-29b6be4175c8",
"practices": [
"strings"
],
"practices": [],
"prerequisites": [],
"difficulty": 1,
"topics": [
Expand Down

0 comments on commit c2e06ff

Please sign in to comment.