# Path: exe/engine/field.py
# class SelectQuestionField(Field):
#     """
#     A Question is built up of question and Options.
#     Used as part of the Multi-Select iDevice.
#     """
# 
#     persistenceVersion = 1
#     
#     def __init__(self, idevice, name, instruc=""):
#         """
#         Initialize 
#         """
#         Field.__init__(self, name, instruc)
# 
#         self.idevice              = idevice
# 
#         self._questionInstruc      = x_(u"""Enter the question stem. 
# The question should be clear and unambiguous. Avoid negative premises as these 
# can tend to confuse learners.""")
#         self.questionTextArea = TextAreaField(x_(u'Question:'), 
#                                     self.questionInstruc, u'')
#         self.questionTextArea.idevice = idevice
# 
#         self.options              = []
#         self._optionInstruc        = x_(u"""Enter the available choices here. 
# You can add options by clicking the "Add another option" button. Delete options by 
# clicking the red X next to the option.""")
# 
#         self._correctAnswerInstruc = x_(u"""Select as many correct answer 
# options as required by clicking the check box beside the option.""")
# 
#         self.feedbackInstruc       = x_(u"""Type in the feedback you want 
# to provide the learner with.""")
#         self.feedbackTextArea = TextAreaField(x_(u'Feedback:'), 
#                                     self.feedbackInstruc, u'')
#         self.feedbackTextArea.idevice = idevice
#     
#     
#     # Properties
#     questionInstruc      = lateTranslate('questionInstruc')
#     optionInstruc        = lateTranslate('optionInstruc')
#     correctAnswerInstruc = lateTranslate('correctAnswerInstruc')
#     
#     def addOption(self):
#         """
#         Add a new option to this question. 
#         """
#         option = SelectOptionField(self, self.idevice)
#         self.options.append(option)
# 
#     def getResourcesField(self, this_resource):
#         """
#         implement the specific resource finding mechanism for this iDevice:
#         """
#         # be warned that before upgrading, this iDevice field could not exist:
#         if hasattr(self, 'questionTextArea')\
#         and hasattr(self.questionTextArea, 'images'):
#             for this_image in self.questionTextArea.images:
#                 if hasattr(this_image, '_imageResource') \
#                 and this_resource == this_image._imageResource:
#                     return self.questionTextArea
# 
#         # be warned that before upgrading, this iDevice field could not exist:
#         if hasattr(self, 'feedbackTextArea')\
#         and hasattr(self.feedbackTextArea, 'images'):
#             for this_image in self.feedbackTextArea.images:
#                 if hasattr(this_image, '_imageResource') \
#                 and this_resource == this_image._imageResource:
#                     return self.feedbackTextArea
# 
#         for this_option in self.options:
#             this_field = this_option.getResourcesField(this_resource)
#             if this_field is not None:
#                 return this_field
# 
#         return None
# 
#       
#     def getRichTextFields(self):
#         """
#         Like getResourcesField(), a general helper to allow nodes to search 
#         through all of their fields without having to know the specifics of each
#         iDevice type.  
#         """
#         fields_list = []
#         if hasattr(self, 'questionTextArea'):
#             fields_list.append(self.questionTextArea)
#         if hasattr(self, 'feedbackTextArea'):
#             fields_list.append(self.feedbackTextArea)
# 
#         for this_option in self.options:
#             fields_list.extend(this_option.getRichTextFields())
# 
#         return fields_list
#         
#     def upgradeToVersion1(self):
#         """
#         Upgrades to somewhere before version 0.25 (post-v0.24) 
#         to reflect the new TextAreaFields now in use for images.
#         """ 
#         self.questionTextArea = TextAreaField(x_(u'Question:'), 
#                                     self.questionInstruc, self.question)
#         self.questionTextArea.idevice = self.idevice
#         self.feedbackTextArea = TextAreaField(x_(u'Feedback:'), 
#                                     self.feedbackInstruc, self.feedback)
#         self.feedbackTextArea.idevice = self.idevice


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 SelectQuestionField
<ul>
<li> What learning outcomes are the questions testing</li>
<li>    What intellectual skills are being tested</li>
<li> What are the language skills of the audience</li>
<li> Gender and cultural issues</li>
<li> Avoid grammar language and question structures that might provide 
     clues</li>
</ul>
 """), x_(u"""When building an MCQ consider the following: <ul>
<li> Use phrases that learners are familiar with and have 
encountered in their study </li>
<li> Keep responses concise </li>
<li> There should be some consistency between the stem and the responses </li>
<li> Provide enough options to challenge learners to think about their response
</li>
<li> Try to make sure that correct responses are not more detailed than the 
distractors </li>
<li> Distractors should be incorrect but plausible </li>
</ul>
"""), u"question")
        self.emphasis   = Idevice.SomeEmphasis
        self.questions  = []
        self.addQuestion()
        self.systemResources += ["common.js"]
        

    def addQuestion(self):
        """
        Add a new question to this iDevice. 
        """

# Path: exe/engine/field.py
# class SelectQuestionField(Field):
#     """
#     A Question is built up of question and Options.
#     Used as part of the Multi-Select iDevice.
#     """
# 
#     persistenceVersion = 1
#     
#     def __init__(self, idevice, name, instruc=""):
#         """
#         Initialize 
#         """
#         Field.__init__(self, name, instruc)
# 
#         self.idevice              = idevice
# 
#         self._questionInstruc      = x_(u"""Enter the question stem. 
# The question should be clear and unambiguous. Avoid negative premises as these 
# can tend to confuse learners.""")
#         self.questionTextArea = TextAreaField(x_(u'Question:'), 
#                                     self.questionInstruc, u'')
#         self.questionTextArea.idevice = idevice
# 
#         self.options              = []
#         self._optionInstruc        = x_(u"""Enter the available choices here. 
# You can add options by clicking the "Add another option" button. Delete options by 
# clicking the red X next to the option.""")
# 
#         self._correctAnswerInstruc = x_(u"""Select as many correct answer 
# options as required by clicking the check box beside the option.""")
# 
#         self.feedbackInstruc       = x_(u"""Type in the feedback you want 
# to provide the learner with.""")
#         self.feedbackTextArea = TextAreaField(x_(u'Feedback:'), 
#                                     self.feedbackInstruc, u'')
#         self.feedbackTextArea.idevice = idevice
#     
#     
#     # Properties
#     questionInstruc      = lateTranslate('questionInstruc')
#     optionInstruc        = lateTranslate('optionInstruc')
#     correctAnswerInstruc = lateTranslate('correctAnswerInstruc')
#     
#     def addOption(self):
#         """
#         Add a new option to this question. 
#         """
#         option = SelectOptionField(self, self.idevice)
#         self.options.append(option)
# 
#     def getResourcesField(self, this_resource):
#         """
#         implement the specific resource finding mechanism for this iDevice:
#         """
#         # be warned that before upgrading, this iDevice field could not exist:
#         if hasattr(self, 'questionTextArea')\
#         and hasattr(self.questionTextArea, 'images'):
#             for this_image in self.questionTextArea.images:
#                 if hasattr(this_image, '_imageResource') \
#                 and this_resource == this_image._imageResource:
#                     return self.questionTextArea
# 
#         # be warned that before upgrading, this iDevice field could not exist:
#         if hasattr(self, 'feedbackTextArea')\
#         and hasattr(self.feedbackTextArea, 'images'):
#             for this_image in self.feedbackTextArea.images:
#                 if hasattr(this_image, '_imageResource') \
#                 and this_resource == this_image._imageResource:
#                     return self.feedbackTextArea
# 
#         for this_option in self.options:
#             this_field = this_option.getResourcesField(this_resource)
#             if this_field is not None:
#                 return this_field
# 
#         return None
# 
#       
#     def getRichTextFields(self):
#         """
#         Like getResourcesField(), a general helper to allow nodes to search 
#         through all of their fields without having to know the specifics of each
#         iDevice type.  
#         """
#         fields_list = []
#         if hasattr(self, 'questionTextArea'):
#             fields_list.append(self.questionTextArea)
#         if hasattr(self, 'feedbackTextArea'):
#             fields_list.append(self.feedbackTextArea)
# 
#         for this_option in self.options:
#             fields_list.extend(this_option.getRichTextFields())
# 
#         return fields_list
#         
#     def upgradeToVersion1(self):
#         """
#         Upgrades to somewhere before version 0.25 (post-v0.24) 
#         to reflect the new TextAreaFields now in use for images.
#         """ 
#         self.questionTextArea = TextAreaField(x_(u'Question:'), 
#                                     self.questionInstruc, self.question)
#         self.questionTextArea.idevice = self.idevice
#         self.feedbackTextArea = TextAreaField(x_(u'Feedback:'), 
#                                     self.feedbackInstruc, self.feedback)
#         self.feedbackTextArea.idevice = self.idevice


# Path: exe/engine/multiselectidevice.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 SelectQuestionField

<ul>
<li> What learning outcomes are the questions testing</li>
<li>    What intellectual skills are being tested</li>
<li> What are the language skills of the audience</li>
<li> Gender and cultural issues</li>
<li> Avoid grammar language and question structures that might provide 
     clues</li>
</ul>
 """), x_(u"""When building an MCQ consider the following: <ul>
<li> Use phrases that learners are familiar with and have 
encountered in their study </li>
<li> Keep responses concise </li>
<li> There should be some consistency between the stem and the responses </li>
<li> Provide enough options to challenge learners to think about their response
</li>
<li> Try to make sure that correct responses are not more detailed than the 
distractors </li>
<li> Distractors should be incorrect but plausible </li>
</ul>
"""), u"question")
        self.emphasis   = Idevice.SomeEmphasis
        self.questions  = []
        self.addQuestion()
        self.systemResources += ["common.js"]
        

    def addQuestion(self):
        """
        Add a new question to this iDevice. 
        """

        question = SelectQuestionField(self, x_(u'Question'))