def check_effective(func):
def wrapper(*args, **kwargs):<EOL><INDENT>if ('<STR_LIT>' in kwargs or<EOL>args and '<STR_LIT>' in args[<NUM_LIT:1>].get_identifier_namespace()):<EOL><INDENT>try:<EOL><INDENT>assessment_section_id = kwargs['<STR_LIT>']<EOL><DEDENT>except KeyError:<EOL><INDENT>assessment_section_id = args[<NUM_LIT:1>]<EOL><DEDENT>if (not args[<NUM_LIT:0>].has_assessment_section_begun(assessment_section_id) or<EOL>args[<NUM_LIT:0>].is_assessment_section_over(assessment_section_id)):<EOL><INDENT>raise IllegalState()<EOL><DEDENT><DEDENT>else:<EOL><INDENT>if '<STR_LIT>' in kwargs:<EOL><INDENT>assessment_taken_id = kwargs['<STR_LIT>']<EOL><DEDENT>else:<EOL><INDENT>assessment_taken_id = args[<NUM_LIT:1>]<EOL><DEDENT>assessment_taken = args[<NUM_LIT:0>]._get_assessment_taken(assessment_taken_id)<EOL>if not assessment_taken.has_started() or assessment_taken.has_ended():<EOL><INDENT>raise IllegalState()<EOL><DEDENT><DEDENT>return func(*args, **kwargs)<EOL><DEDENT>return wrapper<EOL>
decorator, tests if an Assessment or Section is effective, raises error if not

    Side benefit: raised NotFound on AssessmentSections and AssessmentTakens