# Path: mentoring/light_children.py
# class LightChild(Plugin, LightChildrenMixin):
#     """
#     Base class for the light children
#     """
#     entry_point = 'xblock.light_children'
# 
#     def __init__(self, parent):
#         self.parent = parent
#         self.xblock_container = parent.xblock_container
# 
#     @property
#     def runtime(self):
#         return self.parent.runtime
# 
#     @property
#     def xmodule_runtime(self):
#         try:
#             xmodule_runtime = self.parent.xmodule_runtime
#         except AttributeError:
#             # TODO-WORKBENCH-WORKAROUND: To allow to load from the workbench
#             class xmodule_runtime(object):
#                 course_id = 'sample-course'
#                 anonymous_student_id = 'student1'
#             xmodule_runtime = xmodule_runtime()
#         return xmodule_runtime
# 
#     def save(self):
#         pass
# 
# class Scope(object):
#     content = None
#     user_state = None
# 
# class String(LightChildField):
#     def __init__(self, *args, **kwargs):
#         self.value = kwargs.get('default', '') or ''
# 
#     def __str__(self):
#         return self.value
# 
#     def split(self, *args, **kwargs):
#         return self.value.split(*args, **kwargs)
# 
# Path: mentoring/utils.py
# def render_template(template_path, context={}):
#     """
#     Evaluate a template by resource path, applying the provided context
#     """
#     template_str = load_resource(template_path)
#     template = Template(template_str)
#     return template.render(Context(context))


import logging
from xblock.fragment import Fragment
from .light_children import LightChild, Scope, String
from .utils import render_template
# "AGPLv3".  If not, see <http://www.gnu.org/licenses/>.
#

# Imports ###########################################################





# Globals ###########################################################

log = logging.getLogger(__name__)


# Functions #########################################################

def commas_to_list(commas_str):
    """
    Converts a comma-separated string to a list
    """
    if commas_str is None:
        return None # Means default value (which can be non-empty)
    elif commas_str == '':
        return [] # Means empty list
    else:
        return commas_str.split(',')


# Classes ###########################################################


# Path: mentoring/light_children.py
# class LightChild(Plugin, LightChildrenMixin):
#     """
#     Base class for the light children
#     """
#     entry_point = 'xblock.light_children'
# 
#     def __init__(self, parent):
#         self.parent = parent
#         self.xblock_container = parent.xblock_container
# 
#     @property
#     def runtime(self):
#         return self.parent.runtime
# 
#     @property
#     def xmodule_runtime(self):
#         try:
#             xmodule_runtime = self.parent.xmodule_runtime
#         except AttributeError:
#             # TODO-WORKBENCH-WORKAROUND: To allow to load from the workbench
#             class xmodule_runtime(object):
#                 course_id = 'sample-course'
#                 anonymous_student_id = 'student1'
#             xmodule_runtime = xmodule_runtime()
#         return xmodule_runtime
# 
#     def save(self):
#         pass
# 
# class Scope(object):
#     content = None
#     user_state = None
# 
# class String(LightChildField):
#     def __init__(self, *args, **kwargs):
#         self.value = kwargs.get('default', '') or ''
# 
#     def __str__(self):
#         return self.value
# 
#     def split(self, *args, **kwargs):
#         return self.value.split(*args, **kwargs)
# 
# Path: mentoring/utils.py
# def render_template(template_path, context={}):
#     """
#     Evaluate a template by resource path, applying the provided context
#     """
#     template_str = load_resource(template_path)
#     template = Template(template_str)
#     return template.render(Context(context))


# Path: mentoring/quizz.py
import logging
from xblock.fragment import Fragment
from .light_children import LightChild, Scope, String
from .utils import render_template

# "AGPLv3".  If not, see <http://www.gnu.org/licenses/>.
#

# Imports ###########################################################





# Globals ###########################################################

log = logging.getLogger(__name__)


# Functions #########################################################

def commas_to_list(commas_str):
    """
    Converts a comma-separated string to a list
    """
    if commas_str is None:
        return None # Means default value (which can be non-empty)
    elif commas_str == '':
        return [] # Means empty list
    else:
        return commas_str.split(',')


# Classes ###########################################################


class QuizzBlock(LightChild):