# 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
                                     self.question._optionInstruc, 
                                     self.answer)
        self.answerTextArea.idevice = self.idevice

# ===========================================================================
class TestQuestion(Persistable):
    """
    A TestQuestion is built up of question and AnswerOptions.
    """
    
    persistenceVersion = 3
    
    def __init__(self, idevice, question=""):
        """
        Initialize 
        """
        self.idevice              = idevice

        self.options              = []
        self.correctAns           = -2
        self.userAns              = -1
        self._questionInstruc      = x_(u"""Enter the question stem. 
The quest should be clear and unambiguous. Avoid negative premises 
as these can tend to be ambiguous.""")
        self._optionInstruc        = x_(u"""Enter an answer option. Provide 
a range of plausible distractors (usually 3-4) as well as the correct answer. 
Click on the &lt;Add another option&gt; button to add another answer.""")
        self._correctAnswerInstruc = x_(u"""To indicate the correct answer, 
click the radio button next to the correct option.""")
    

# 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

                                     self.question._optionInstruc, 
                                     self.answer)
        self.answerTextArea.idevice = self.idevice

# ===========================================================================
class TestQuestion(Persistable):
    """
    A TestQuestion is built up of question and AnswerOptions.
    """
    
    persistenceVersion = 3
    
    def __init__(self, idevice, question=""):
        """
        Initialize 
        """
        self.idevice              = idevice

        self.options              = []
        self.correctAns           = -2
        self.userAns              = -1
        self._questionInstruc      = x_(u"""Enter the question stem. 
The quest should be clear and unambiguous. Avoid negative premises 
as these can tend to be ambiguous.""")
        self._optionInstruc        = x_(u"""Enter an answer option. Provide 
a range of plausible distractors (usually 3-4) as well as the correct answer. 
Click on the &lt;Add another option&gt; button to add another answer.""")
        self._correctAnswerInstruc = x_(u"""To indicate the correct answer, 
click the radio button next to the correct option.""")
    

        self.questionTextArea      = TextAreaField(x_(u'Question:'),