ed-api-client 0.1.7__tar.gz → 0.1.8__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {ed_api_client-0.1.7 → ed_api_client-0.1.8}/PKG-INFO +1 -1
- {ed_api_client-0.1.7 → ed_api_client-0.1.8}/ed_api_client/workspaces.py +15 -9
- {ed_api_client-0.1.7 → ed_api_client-0.1.8}/pyproject.toml +1 -1
- {ed_api_client-0.1.7 → ed_api_client-0.1.8}/README.md +0 -0
- {ed_api_client-0.1.7 → ed_api_client-0.1.8}/ed_api_client/__init__.py +0 -0
- {ed_api_client-0.1.7 → ed_api_client-0.1.8}/ed_api_client/assignments.py +0 -0
- {ed_api_client-0.1.7 → ed_api_client-0.1.8}/ed_api_client/canvas.py +0 -0
- {ed_api_client-0.1.7 → ed_api_client-0.1.8}/ed_api_client/challenges.py +0 -0
- {ed_api_client-0.1.7 → ed_api_client-0.1.8}/ed_api_client/client.py +0 -0
- {ed_api_client-0.1.7 → ed_api_client-0.1.8}/ed_api_client/quizzes.py +0 -0
- {ed_api_client-0.1.7 → ed_api_client-0.1.8}/ed_api_client/slides.py +0 -0
- {ed_api_client-0.1.7 → ed_api_client-0.1.8}/ed_api_client/threads.py +0 -0
- {ed_api_client-0.1.7 → ed_api_client-0.1.8}/ed_api_client/users.py +0 -0
- {ed_api_client-0.1.7 → ed_api_client-0.1.8}/ed_api_client/websockets.py +0 -0
|
@@ -473,6 +473,7 @@ class FileSummary(File):
|
|
|
473
473
|
_insert_intervals: List[float] = field(default_factory=list)
|
|
474
474
|
_prev_insert_time: datetime.datetime = None
|
|
475
475
|
_pending_deletion: str = ""
|
|
476
|
+
_insert_frontier: int = 0
|
|
476
477
|
|
|
477
478
|
def from_file(file: File):
|
|
478
479
|
fs = FileSummary(file.id, file.path, file.content)
|
|
@@ -524,7 +525,6 @@ class WorkspaceSummary:
|
|
|
524
525
|
stop_at_first_successful_submission: bool = True,
|
|
525
526
|
max_idle_seconds=30,
|
|
526
527
|
min_suspicious_paste_chars=50,
|
|
527
|
-
max_continuous_typing_seconds=2,
|
|
528
528
|
):
|
|
529
529
|
"""
|
|
530
530
|
Build a WorkspaceSummary by replaying a workspace event log.
|
|
@@ -627,12 +627,8 @@ class WorkspaceSummary:
|
|
|
627
627
|
|
|
628
628
|
pos = 0
|
|
629
629
|
|
|
630
|
-
is_uninterrupted = False
|
|
631
630
|
if file.prev_typing_time is not None:
|
|
632
631
|
elapsed = event.at - file.prev_typing_time
|
|
633
|
-
if elapsed.total_seconds() < max_continuous_typing_seconds:
|
|
634
|
-
is_uninterrupted = True
|
|
635
|
-
|
|
636
632
|
if elapsed.total_seconds() < max_idle_seconds:
|
|
637
633
|
file.typing_time += elapsed
|
|
638
634
|
|
|
@@ -654,6 +650,12 @@ class WorkspaceSummary:
|
|
|
654
650
|
)
|
|
655
651
|
)
|
|
656
652
|
|
|
653
|
+
delete_end = pos + edit.value
|
|
654
|
+
if delete_end <= file._insert_frontier:
|
|
655
|
+
file._insert_frontier -= edit.value
|
|
656
|
+
elif pos < file._insert_frontier:
|
|
657
|
+
file._insert_frontier = pos # deletion overlaps the frontier
|
|
658
|
+
|
|
657
659
|
file.content = file.content[:pos] + file.content[pos + edit.value :]
|
|
658
660
|
file.transcribed_mask = (
|
|
659
661
|
file.transcribed_mask[:pos]
|
|
@@ -673,10 +675,9 @@ class WorkspaceSummary:
|
|
|
673
675
|
)
|
|
674
676
|
)
|
|
675
677
|
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
):
|
|
678
|
+
frontier_tolerance = max(10, len(file.content) // 10)
|
|
679
|
+
at_frontier = pos >= file._insert_frontier - frontier_tolerance
|
|
680
|
+
if at_frontier:
|
|
680
681
|
file.transcribed_mask = (
|
|
681
682
|
file.transcribed_mask[:pos]
|
|
682
683
|
+ get_masked_section(edit.value)
|
|
@@ -688,6 +689,11 @@ class WorkspaceSummary:
|
|
|
688
689
|
+ edit.value
|
|
689
690
|
+ file.transcribed_mask[pos:]
|
|
690
691
|
)
|
|
692
|
+
n = len(edit.value)
|
|
693
|
+
if pos < file._insert_frontier:
|
|
694
|
+
file._insert_frontier += n # inserted before frontier — shift it right
|
|
695
|
+
else:
|
|
696
|
+
file._insert_frontier = pos + n # advance frontier to end of this insert
|
|
691
697
|
|
|
692
698
|
if len(edit.value) > min_suspicious_paste_chars:
|
|
693
699
|
if not selected_content.contains(edit.value):
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|