Skip to content

Commit

Permalink
fixes test_mode change when assessment is active
Browse files Browse the repository at this point in the history
  • Loading branch information
WolfgangFahl committed Jan 19, 2024
1 parent 8ad231a commit 0789e7c
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions dcm/dcm_webserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,13 +220,16 @@ async def render(self, _click_args=None):
item = DynamicCompetenceMap.from_definition_string(
name, definition, content_class=content_class, markup=markup
)
if isinstance(item, DynamicCompetenceMap):
self.render_dcm(item)
else:
self.learner = item
self.assess(item)
self.render_item(item)
except Exception as ex:
self.handle_exception(ex, self.do_trace)

def render_item(self,item):
if isinstance(item, DynamicCompetenceMap):
self.render_dcm(item)
else:
self.learner = item
self.assess(item)

def render_dcm(
self,
Expand Down Expand Up @@ -376,7 +379,10 @@ async def on_text_mode_change(self, args):
new_text_mode = args.value
if new_text_mode != self.text_mode:
self.text_mode = new_text_mode
await self.render()
if self.learner:
self.render_item(self.learner)
else:
self.render_item(self.dcm)

def configure_run(self):
"""
Expand Down

0 comments on commit 0789e7c

Please sign in to comment.