# Path: exe/engine/field.py
# class TextAreaField(FieldWithResources):
#     """
#     A Generic iDevice is built up of these fields.  Each field can be
#     rendered as an XHTML element
# 
#     Note that TextAreaFields can now hold any number of image resources,
#     which will typically be inserted by way of tinyMCE.
#     """
#     persistenceVersion = 1
# 
#     # these will be recreated in FieldWithResources' TwistedRePersist:
#     nonpersistant      = ['content', 'content_wo_resourcePaths']
# 
#     def __init__(self, name, instruc="", content=""):
#         """
#         Initialize 
#         """
#         FieldWithResources.__init__(self, name, instruc, content)
# 
#     def upgradeToVersion1(self):
#         """
#         Upgrades to somewhere before version 0.25 (post-v0.24) 
#         to reflect that TextAreaField now inherits from FieldWithResources,
#         and will need its corresponding fields populated from content.
#         """ 
#         self.content_w_resourcePaths = self.content 
#         self.content_wo_resourcePaths = self.content
#         # NOTE: we don't need to actually process any of those contents for 
#         # image paths, either, since this is an upgrade from pre-images!


import logging
import re
from exe.engine.persist   import Persistable
from exe.engine.idevice   import Idevice
from exe.engine.translate import lateTranslate
from exe.engine.field     import TextAreaField
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
# ===========================================================================
"""
A QuizTest Idevice is one built up from TestQuestions
"""


log = logging.getLogger(__name__)


# ===========================================================================
class AnswerOption(Persistable):
    """
    A TestQuestion is built up of question and AnswerOptions.  Each
    answerOption can be rendered as an XHTML element
    """

    def __init__(self, question, idevice, answer="", isCorrect=False):
        """
        Initialize 
        """
        self.question = question
        self.idevice = idevice


# Path: exe/engine/field.py
# class TextAreaField(FieldWithResources):
#     """
#     A Generic iDevice is built up of these fields.  Each field can be
#     rendered as an XHTML element
# 
#     Note that TextAreaFields can now hold any number of image resources,
#     which will typically be inserted by way of tinyMCE.
#     """
#     persistenceVersion = 1
# 
#     # these will be recreated in FieldWithResources' TwistedRePersist:
#     nonpersistant      = ['content', 'content_wo_resourcePaths']
# 
#     def __init__(self, name, instruc="", content=""):
#         """
#         Initialize 
#         """
#         FieldWithResources.__init__(self, name, instruc, content)
# 
#     def upgradeToVersion1(self):
#         """
#         Upgrades to somewhere before version 0.25 (post-v0.24) 
#         to reflect that TextAreaField now inherits from FieldWithResources,
#         and will need its corresponding fields populated from content.
#         """ 
#         self.content_w_resourcePaths = self.content 
#         self.content_wo_resourcePaths = self.content
#         # NOTE: we don't need to actually process any of those contents for 
#         # image paths, either, since this is an upgrade from pre-images!


# Path: exe/engine/quiztestidevice.py
import logging
import re
from exe.engine.persist   import Persistable
from exe.engine.idevice   import Idevice
from exe.engine.translate import lateTranslate
from exe.engine.field     import TextAreaField

# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
# ===========================================================================
"""
A QuizTest Idevice is one built up from TestQuestions
"""


log = logging.getLogger(__name__)


# ===========================================================================
class AnswerOption(Persistable):
    """
    A TestQuestion is built up of question and AnswerOptions.  Each
    answerOption can be rendered as an XHTML element
    """

    def __init__(self, question, idevice, answer="", isCorrect=False):
        """
        Initialize 
        """
        self.question = question
        self.idevice = idevice


        self.answerTextArea  = TextAreaField(x_(u'Option'),