|
|
"""Determine if the slide can be marked as (un)completed.
We can't mark a slide with questions as completed manually because we need to
complete the quiz first. But we can mark as uncompleted a slide with questions,
and the answers will be reset, the karma removed, etc (see mark_uncompleted).
"""
for slide in self:
slide.can_self_mark_uncompleted = slide.website_published and slide.channel_id.is_member
slide.can_self_mark_completed = (
slide.website_published
and slide.channel_id.is_member
and slide.slide_category != 'quiz'
and not slide.question_ids
)
|
|