Skip to content

Commit

Permalink
tries fixing step as non async
Browse files Browse the repository at this point in the history
  • Loading branch information
WolfgangFahl committed Jan 28, 2024
1 parent 86d7e1b commit 3bc2851
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
9 changes: 5 additions & 4 deletions dcm/dcm_assessment.py
Original file line number Diff line number Diff line change
Expand Up @@ -329,13 +329,14 @@ async def step_area(self, area_step: int):
new_index += direction

# Notify if no more areas in the direction
ui.notify("Reached the end of the areas in this direction.")
with self.container:
ui.notify("Reached the end of the areas in this direction.")

async def goto(self, index: int):
def goto(self, index: int):
self.achievement_index = index
await self.step(0)
self.step(0)

async def step(self, step: int = 0):
def step(self, step: int = 0):
"""
step with the achievement view
"""
Expand Down
6 changes: 2 additions & 4 deletions dcm/dcm_webserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,10 +383,8 @@ def assess_learner(self, dcm, learner):
with self.left_grid:
with ui.row() as self.assessment_row:
self.assessment = Assessment(self, dcm=dcm, learner=learner)
# we have to await self.assessment.step(0)
# so we trigger it async
ui.timer(0, lambda: self.assessment.step(0), once=True)

self.assessment.step(0)

def new_assess(self):
"""
run a new assessment for a new learner
Expand Down

0 comments on commit 3bc2851

Please sign in to comment.