mirror of
https://github.com/Garmelon/PFERD.git
synced 2025-07-12 14:12:30 +02:00
fix: Element detection for other universities
Other universities might use other URL schemes for different element types
This commit is contained in:
@ -48,6 +48,10 @@ class IliasPageElement:
|
|||||||
regexes = [
|
regexes = [
|
||||||
r"eid=(?P<id>[0-9a-z\-]+)",
|
r"eid=(?P<id>[0-9a-z\-]+)",
|
||||||
r"file_(?P<id>\d+)",
|
r"file_(?P<id>\d+)",
|
||||||
|
r"copa_(?P<id>\d+)",
|
||||||
|
r"fold_(?P<id>\d+)",
|
||||||
|
r"frm_(?P<id>\d+)",
|
||||||
|
r"exc_(?P<id>\d+)",
|
||||||
r"ref_id=(?P<id>\d+)",
|
r"ref_id=(?P<id>\d+)",
|
||||||
r"target=[a-z]+_(?P<id>\d+)",
|
r"target=[a-z]+_(?P<id>\d+)",
|
||||||
r"mm_(?P<id>\d+)"
|
r"mm_(?P<id>\d+)"
|
||||||
@ -997,6 +1001,19 @@ class IliasPage:
|
|||||||
if "baseClass=ilSAHSPresentationGUI" in parsed_url.query:
|
if "baseClass=ilSAHSPresentationGUI" in parsed_url.query:
|
||||||
return IliasElementType.SCORM_LEARNING_MODULE
|
return IliasElementType.SCORM_LEARNING_MODULE
|
||||||
|
|
||||||
|
# other universities might have content type specified in URL path
|
||||||
|
if "_file_" in parsed_url.path:
|
||||||
|
return IliasElementType.FILE
|
||||||
|
|
||||||
|
if "_fold_" in parsed_url.path or "_copa_" in parsed_url.path:
|
||||||
|
return IliasElementType.FOLDER
|
||||||
|
|
||||||
|
if "_frm_" in parsed_url.path:
|
||||||
|
return IliasElementType.FORUM
|
||||||
|
|
||||||
|
if "_exc_" in parsed_url.path:
|
||||||
|
return IliasElementType.EXERCISE
|
||||||
|
|
||||||
# Booking and Meeting can not be detected based on the link. They do have a ref_id though, so
|
# Booking and Meeting can not be detected based on the link. They do have a ref_id though, so
|
||||||
# try to guess it from the image.
|
# try to guess it from the image.
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user