Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion pretext/project/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -332,15 +332,17 @@ def load_asset_table(self) -> pt.AssetTable:
def generate_asset_table(self) -> pt.AssetTable:
asset_hash_dict: pt.AssetTable = {}
for asset in constants.ASSET_TO_XPATH.keys():
asset_hash_dict[asset] = {}
if asset == "webwork":
# WeBWorK must be regenerated every time *any* of the ww exercises change.
ww = self.source_element().xpath(".//webwork[@*|*]")
assert isinstance(ww, t.List)
if len(ww) == 0:
# Only generate a hash if there are actually ww exercises in the source
continue
asset_hash_dict[asset] = {}
h = hashlib.sha256()
print("still in for loop")
input()
for node in ww:
assert isinstance(node, ET._Element)
h.update(ET.tostring(node).strip())
Expand All @@ -357,6 +359,7 @@ def generate_asset_table(self) -> pt.AssetTable:
continue

# We will have a dictionary of id's that we will get their own hash:
asset_hash_dict[asset] = {}
hash_ids = {}
for node in source_assets:
assert isinstance(node, ET._Element)
Expand Down