Example #1
0
    def __init__(self, parent, idevice):
        """
        Pre-create our field ids
        """
        Block.__init__(self, parent, idevice)
        
       
        # to compensate for the strange unpickling timing when objects are 
        # loaded from an elp, ensure that proper idevices are set:
        if idevice.instructionsForLearners.idevice is None: 
            idevice.instructionsForLearners.idevice = idevice
        if idevice.content.idevice is None: 
            idevice.content.idevice = idevice
        if idevice.feedback.idevice is None: 
            idevice.feedback.idevice = idevice
            
        dT = common.getExportDocType()
        sectionTag = "div"
        if dT == "HTML5":
            sectionTag = "section"
            
        idevice.instructionsForLearners.htmlTag = sectionTag
        idevice.instructionsForLearners.class_ = "block instructions"
        idevice.feedback.htmlTag = sectionTag            

        self.instructionElement = TextAreaElement(idevice.instructionsForLearners)
        self.instructionElement.field.content_w_resourcePaths = c_(self.instructionElement.field.content_w_resourcePaths)
        self.listaElement = ListaElement(idevice.content)
        self.feedbackElement = \
            TextAreaElement(idevice.feedback)
        self.previewing        = False # In view or preview render
        if not hasattr(self.idevice,'undo'): 
            self.idevice.undo = True
Example #2
0
 def __init__(self, parent, idevice):
     """
     Initialize
     """
     Block.__init__(self, parent, idevice)
     self.articleElement = TextAreaElement(idevice.article)
     self.articleElement.height = 300
 def __init__(self, parent, idevice):
     Block.__init__(self, parent, idevice)
     self.mainElements = idevice.mainFieldSet.makeElementDict()
     self.memoryMatchElements = []
     for memoryMatchField in idevice.matchPairFields:
         memoryMatchElement = MemoryMatchPairElement(memoryMatchField)
         self.memoryMatchElements.append(memoryMatchElement)
 def __init__(self, parent, idevice):
     Block.__init__(self, parent, idevice)
     self.elements = []
     for field in self.idevice:
         self.elements.append(g_elementFactory.createElement(field))
     if not hasattr(self.idevice,'undo'): 
         self.idevice.undo = True
Example #5
0
 def __init__(self, parent, idevice):
     """
     Initialize
     """
     Block.__init__(self, parent, idevice)
     self.imageMagnifierElement = MagnifierElement(idevice.imageMagnifier)
     self.textElement  = TextAreaElement(idevice.text)
    def __init__(self, parent, idevice):
        """
        Initialize a new Block object
        """
        Block.__init__(self, parent, idevice)
        self.idevice           = idevice
        self.questionElements  = []

        # to compensate for the strange unpickling timing when objects are 
        # loaded from an elp, ensure that proper idevices are set:
        if idevice.storyTextArea.idevice is None: 
            idevice.storyTextArea.idevice = idevice

        self.storyElement      = TextAreaElement(idevice.storyTextArea)

        self.questionInstruc   = idevice.questionInstruc
        self.storyInstruc      = idevice.storyInstruc
        self.feedbackInstruc   = idevice.feedbackInstruc
        self.previewing        = False # In view or preview render 

        if not hasattr(self.idevice,'undo'): 
            self.idevice.undo = True

        i = 0
        
        for question in idevice.questions:
            self.questionElements.append(QuestionElement(i, idevice, question))
            i += 1
Example #7
0
 def __init__(self, parent, idevice):
     """
     Initialize
     """
     Block.__init__(self, parent, idevice)
     self.mediaElement = MultimediaElement(idevice.media)
     self.textElement  = TextAreaElement(idevice.text)
    def __init__(self, parent, idevice):
        """
        Pre-create our field ids
        """
        Block.__init__(self, parent, idevice)
        
       
        # to compensate for the strange unpickling timing when objects are 
        # loaded from an elp, ensure that proper idevices are set:
        if idevice.instructionsForLearners.idevice is None: 
            idevice.instructionsForLearners.idevice = idevice
        if idevice.content.idevice is None: 
            idevice.content.idevice = idevice
        if idevice.feedback.idevice is None: 
            idevice.feedback.idevice = idevice
            
        dT = common.getExportDocType()
        sectionTag = "div"
        if dT == "HTML5":
            sectionTag = "section"
            
        idevice.instructionsForLearners.htmlTag = sectionTag
        idevice.instructionsForLearners.class_ = "block instructions"
        idevice.feedback.htmlTag = sectionTag            

        self.instructionElement = TextAreaElement(idevice.instructionsForLearners)
        self.instructionElement.field.content_w_resourcePaths = c_(self.instructionElement.field.content_w_resourcePaths)
        self.listaElement = ListaElement(idevice.content)
        self.feedbackElement = \
            TextAreaElement(idevice.feedback)
        self.previewing        = False # In view or preview render
        if not hasattr(self.idevice,'undo'): 
            self.idevice.undo = True
    def __init__(self, parent, idevice):
        """
        Initialize a new Block object
        """
        Block.__init__(self, parent, idevice)
        self.idevice           = idevice
        self.questionElements  = []

        # to compensate for the strange unpickling timing when objects are 
        # loaded from an elp, ensure that proper idevices are set:
        if idevice.storyTextArea.idevice is None: 
            idevice.storyTextArea.idevice = idevice

        self.storyElement      = TextAreaElement(idevice.storyTextArea)

        self.questionInstruc   = idevice.questionInstruc
        self.storyInstruc      = idevice.storyInstruc
        self.feedbackInstruc   = idevice.feedbackInstruc
        self.previewing        = False # In view or preview render 

        if not hasattr(self.idevice,'undo'): 
            self.idevice.undo = True

        i = 0
        
        for question in idevice.questions:
            self.questionElements.append(QuestionElement(i, idevice, question))
            i += 1
Example #10
0
 def __init__(self, parent, idevice):
     """
     Initialize
     """
     Block.__init__(self, parent, idevice)
     if not hasattr(self.idevice,'undo'): 
         self.idevice.undo = True
Example #11
0
 def __init__(self, parent, idevice):
     """
     'parent' is our parent 'Renderable' instance
     """
     Block.__init__(self, parent, idevice)
     if not hasattr(self.idevice,'undo'):
         self.idevice.undo = True
Example #12
0
 def __init__(self, parent, idevice):
     Block.__init__(self, parent, idevice)
     self.mainElements = idevice.mainFieldSet.makeElementDict()
     self.memoryMatchElements = []
     for memoryMatchField in idevice.matchPairFields:
         memoryMatchElement = MemoryMatchPairElement(memoryMatchField)
         self.memoryMatchElements.append(memoryMatchElement)
Example #13
0
    def __init__(self, parent, idevice):
        """
        Initialize a new Block object
        """
        Block.__init__(self, parent, idevice)
        self.idevice = idevice
        self.questionElements = []
        self.questionInstruc = idevice.questionInstruc
        self.keyInstruc = idevice.keyInstruc
        self.feedbackInstruc = idevice.feedbackInstruc
        self.hintInstruc = idevice.hintInstruc

        # to compensate for the strange unpickling timing when objects are
        # loaded from an elp, ensure that proper idevices are set:
        if idevice.instructionsForLearners.idevice is None:
            idevice.instructionsForLearners.idevice = idevice
        self.instructionElement = \
            TextAreaElement(idevice.instructionsForLearners)

        if not hasattr(self.idevice, 'undo'):
            self.idevice.undo = True

        i = 0
        for question in idevice.questions:
            self.questionElements.append(TrueFalseElement(
                i, idevice, question))
            i += 1
Example #14
0
 def __init__(self, parent, idevice):
     """
     Initialize
     """
     Block.__init__(self, parent, idevice)
     self.flashMovieElement = FlashMovieElement(idevice.flash)
     self.textElement  = TextAreaElement(idevice.text)
Example #15
0
    def __init__(self, parent, idevice):
        """
        Initialize a new Block object
        """
        Block.__init__(self, parent, idevice)
        self.idevice         = idevice
        self.questionElements  = []
        self.questionInstruc = idevice.questionInstruc
        self.keyInstruc      = idevice.keyInstruc
        self.feedbackInstruc = idevice.feedbackInstruc
        self.hintInstruc     = idevice.hintInstruc 

        # to compensate for the strange unpickling timing when objects are 
        # loaded from an elp, ensure that proper idevices are set:
        if idevice.instructionsForLearners.idevice is None: 
            idevice.instructionsForLearners.idevice = idevice
        self.instructionElement = \
            TextAreaElement(idevice.instructionsForLearners)

        if not hasattr(self.idevice,'undo'):
            self.idevice.undo = True
        
        i = 0
        for question in idevice.questions:
            self.questionElements.append(OpinionElement(i, idevice, 
                                                           question))
            i += 1
Example #16
0
 def __init__(self, parent, idevice):
     """
     Pre-create our field ids
     """
     Block.__init__(self, parent, idevice)
     self.instructionElement = TextAreaElement(idevice.instructionsForLearners)
     self.clozeElement = ClozeElement(idevice.content)
     self.feedbackElement = TextAreaElement(idevice.feedback)
Example #17
0
 def __init__(self, parent, idevice):
     Block.__init__(self, parent, idevice)
     if idevice.content.idevice is None: 
         idevice.content.idevice = idevice
     self.contentElement = TextAreaElement(idevice.content)
     self.contentElement.height = 250
     if not hasattr(self.idevice,'undo'): 
         self.idevice.undo = True
Example #18
0
 def __init__(self, parent, idevice):
     """
     Initialize a new Block object
     """
     Block.__init__(self, parent, idevice)
     self.forumElement = ForumElement(idevice)
     self.discussionElement = DiscussionElement(idevice)
     self.message = self.idevice.message
Example #19
0
    def __init__(self, parent, idevice):
        """
        'parent' is our parent 'Renderable' instance
        """
        Block.__init__(self, parent, idevice)

        if not hasattr(self.idevice,'undo'):
            self.idevice.undo = True
Example #20
0
    def __init__(self, parent, idevice):
        Block.__init__(self, parent, idevice)
        self.mainElements = idevice.mainFieldSet.makeElementDict()

        self.sortableItemElements = []
        for sortableField in idevice.itemsToSort:
            newSortableElement = TextAreaElement(sortableField)
            self.sortableItemElements.append(newSortableElement)
Example #21
0
 def __init__(self, parent, idevice):
     """
     Initialize
     """
     Block.__init__(self, parent, idevice) 
     if idevice.descriptionTextArea.idevice is None: 
         idevice.descriptionTextArea.idevice = idevice
     self.descriptionElement = TextAreaElement(idevice.descriptionTextArea)
    def __init__(self, parent, idevice):
        """
        Initialize
        """
        Block.__init__(self, parent, idevice)

        if not hasattr(self.idevice,'undo'): 
            self.idevice.undo = True
 def __init__(self, parent, idevice):
     Block.__init__(self, parent, idevice)
     self.mainElements = idevice.mainFieldSet.makeElementDict()
     
     self.map_area_elements = []
     
     for area_field in self.idevice.map_areas:
         self.map_area_elements.append(ImageMapAreaElement(area_field, self))
Example #24
0
    def __init__(self, parent, idevice):
        Block.__init__(self, parent, idevice)
        self.mainElements = idevice.mainFieldSet.makeElementDict()

        self.sortableItemElements = []
        for sortableField in idevice.itemsToSort:
            newSortableElement = TextAreaElement(sortableField)
            self.sortableItemElements.append(newSortableElement)
Example #25
0
 def __init__(self, parent, idevice):
     """
     Initialize
     """
     Block.__init__(self, parent, idevice)
     self.flashElement = FlashElement(idevice.flash)
     if idevice.text.idevice is None: 
         idevice.text.idevice = idevice
     self.textElement  = TextAreaElement(idevice.text)
Example #26
0
 def __init__(self, parent, idevice):
     """
     Initialize a new Block object
     """
     Block.__init__(self, parent, idevice)
     self.activity        = idevice.activity 
     self.answer          = idevice.answer
     self.activityInstruc = idevice.activityInstruc
     self.answerInstruc   = idevice.answerInstruc
Example #27
0
 def __init__(self, parent, idevice):
     Block.__init__(self, parent, idevice)
     self.fileAttachmentElements = []
     for fileField in self.idevice.fileAttachmentFields:
         fileElement = FileElement(fileField, False)
         self.fileAttachmentElements.append(fileElement)
     
     self.showDescBlock = ChoiceElement(idevice.showDesc)
     self.introHTMLElement = TextAreaElement(idevice.introHTML)
Example #28
0
 def __init__(self, parent, idevice):
     """
     Initialize a new Block object
     """
     Block.__init__(self, parent, idevice)
     self.idevice           = idevice
     self.questionElements  = []
     for question in idevice.questions:
         self.questionElements.append(SelectquestionElement(question))
Example #29
0
 def __init__(self, parent, idevice):
     """
     Initialize
     """
     Block.__init__(self, parent, idevice)
     if idevice.rss.idevice is None: 
         idevice.rss.idevice = idevice
     self.rssElement = TextAreaElement(idevice.rss)
     self.rssElement.height = 300
 def __init__(self, parent, idevice):
     Block.__init__(self, parent, idevice)
     self.fileAttachmentElements = []
     for fileField in self.idevice.fileAttachmentFields:
         fileElement = FileElement(fileField, False)
         self.fileAttachmentElements.append(fileElement)
     
     self.showDescBlock = ChoiceElement(idevice.showDesc)
     self.introHTMLElement = TextAreaElement(idevice.introHTML)
Example #31
0
    def __init__(self, parent, idevice):
        Block.__init__(self, parent, idevice)
        self.idevice = idevice
        self.termElements = []
        if not hasattr(self.idevice, 'undo'):
            self.idevice.undo = True

        for term in idevice.terms:
            self.termElements.append(TermElement(term))
Example #32
0
    def __init__(self, parent, idevice):
        Block.__init__(self, parent, idevice)
        self.idevice = idevice
        self.termElements = []
        if not hasattr(self.idevice,'undo'): 
            self.idevice.undo = True

        for term in idevice.terms:
            self.termElements.append(TermElement(term))
    def __init__(self, parent, idevice):
        """
        Initialize a new Block object
        """
        Block.__init__(self, parent, idevice)
        self.idevice = idevice
        self.questionElements = []

        for question in idevice.questions:
            self.questionElements.append(ScormSelectquestionElement(question))
Example #34
0
 def __init__(self, parent, idevice):
     """
     Initialize a new Block object
     """
     Block.__init__(self, parent, idevice)
     self.activityInstruc = idevice.activityInstruc
     self.answerInstruc   = idevice.answerInstruc
     self.activityElement  = TextAreaElement(idevice.activityTextArea)
     self.answerElement    = TextAreaElement(idevice.answerTextArea)
     self.previewing        = False # In view or preview render
Example #35
0
 def __init__(self, parent, idevice):
     """
     Initialize
     """
     Block.__init__(self, parent, idevice)
     self.imageMagnifierElement = MagnifierElement(idevice.imageMagnifier)
     if idevice.text.idevice is None: 
         idevice.text.idevice = idevice
     self.textElement  = TextAreaElement(idevice.text)
     if not hasattr(self.idevice,'undo'): 
         self.idevice.undo = True
Example #36
0
 def __init__(self, parent, idevice):
     """
     Initialize a new Block object
     """
     Block.__init__(self, parent, idevice)
     self.idevice           = idevice
     self.questionElements  = []
     if not hasattr(self.idevice,'undo'):
         self.idevice.undo = True
     for question in idevice.questions:
         self.questionElements.append(SelectquestionElement(question))
Example #37
0
 def __init__(self, parent, idevice):
     """
     Initialize
     """
     Block.__init__(self, parent, idevice)
     if idevice.rss.idevice is None: 
         idevice.rss.idevice = idevice
     self.rssElement = TextAreaElement(idevice.rss)
     self.rssElement.height = 300
     if not hasattr(self.idevice,'undo'): 
         self.idevice.undo = True
Example #38
0
    def __init__(self, parent, idevice):
        Block.__init__(self, parent, idevice)
        if idevice.content.idevice is None: 
            # due to the loading process's timing, idevice wasn't yet set; 
            # set it here for the TextAreaElement's tinyMCE editor 
            idevice.content.idevice = idevice

        self.contentElement = TextAreaElement(idevice.content)
        self.contentElement.height = 250
        if not hasattr(self.idevice,'undo'): 
            self.idevice.undo = True
Example #39
0
    def __init__(self, parent, idevice):
        Block.__init__(self, parent, idevice)
        if idevice.content.idevice is None:
            # due to the loading process's timing, idevice wasn't yet set;
            # set it here for the TextAreaElement's tinyMCE editor
            idevice.content.idevice = idevice

        self.contentElement = TextAreaElement(idevice.content)
        self.contentElement.height = 250
        if not hasattr(self.idevice, 'undo'):
            self.idevice.undo = True
Example #40
0
    def __init__(self, parent, idevice):
        """
        Initialize a new Block object
        """
        Block.__init__(self, parent, idevice)
        self.idevice           = idevice
        self.questionElements  = []
        if not hasattr(self.idevice,'undo'):
            self.idevice.undo = True

        for question in idevice.questions:
            self.questionElements.append(SelectquestionElement(question))
Example #41
0
    def __init__(self, parent, idevice):
        """
        Initialize
        """
        Block.__init__(self, parent, idevice)
        self.flashMovieElement = FlashMovieElement(idevice.flash)

        # to compensate for the strange unpickling timing when objects are 
        # loaded from an elp, ensure that proper idevices are set:
        # (only applies to the image-embeddable ones, not FlashMovieElement)
        if idevice.text.idevice is None: 
            idevice.text.idevice = idevice
        self.textElement  = TextAreaElement(idevice.text)
Example #42
0
 def __init__(self, parent, idevice):
     """
     Initialize a new Block object
     """
     Block.__init__(self, parent, idevice)
     self.idevice           = idevice
     self.questionElements  = []
     self.message = False
     i = 0
     for question in idevice.questions:
         self.questionElements.append(TestquestionElement(i, idevice, 
                                                          question))
         i += 1
Example #43
0
    def __init__(self, parent, idevice):
        """
        Initialize
        """

        Block.__init__(self, parent, idevice)

        # to compensate for the strange unpickling timing when objects are
        # loaded from an elp, ensure that proper idevices are set:
        if idevice.descriptionTextArea.idevice is None:
            idevice.descriptionTextArea.idevice = idevice

        self.descriptionElement = TextAreaElement(idevice.descriptionTextArea)
Example #44
0
    def __init__(self, parent, idevice):
        """
        Initialize
        """
        Block.__init__(self, parent, idevice)
        self.flashElement = FlashElement(idevice.flash)

        # to compensate for the strange unpickling timing when objects are
        # loaded from an elp, ensure that proper idevices are set:
        # (only applies to the image-embeddable ones, not FlashElement)
        if idevice.text.idevice is None:
            idevice.text.idevice = idevice
        self.textElement = TextAreaElement(idevice.text)
Example #45
0
    def __init__(self, parent, idevice):
        """
        Initialize
        """
        Block.__init__(self, parent, idevice)

        # to compensate for the strange unpickling timing when objects are
        # loaded from an elp, ensure that proper idevices are set:
        if idevice.article.idevice is None:
            idevice.article.idevice = idevice
        self.articleElement = TextAreaElement(idevice.article)
        self.articleElement.height = 300
        if not hasattr(self.idevice, 'undo'):
            self.idevice.undo = True
Example #46
0
    def __init__(self, parent, idevice):
        """
        Initialize a new Block object
        """
        Block.__init__(self, parent, idevice)
        self.idevice = idevice
        self.questionElements = []
        self.message = False
        if not hasattr(self.idevice, 'undo'):
            self.idevice.undo = True

        i = 0
        for question in idevice.questions:
            self.questionElements.append(
                TestquestionElement(i, idevice, question))
            i += 1
Example #47
0
    def __init__(self, parent, idevice):
        """
        Initialize
        """
        Block.__init__(self, parent, idevice)
        self.imageMagnifierElement = MagnifierElement(idevice.imageMagnifier)

        # to compensate for the strange unpickling timing when objects are
        # loaded from an elp, ensure that proper idevices are set:
        # (only applies to the image-embeddable ones, not MagnifierElement)
        if idevice.text.idevice is None:
            idevice.text.idevice = idevice
        self.textElement = TextAreaElement(idevice.text)

        if not hasattr(self.idevice, 'undo'):
            self.idevice.undo = True
Example #48
0
    def __init__(self, parent, idevice):
        """
        Initialize a new Block object
        """
        Block.__init__(self, parent, idevice)
        self.commentInstruc = idevice.commentInstruc

        if idevice.commentTextArea.idevice is None:
            idevice.commentTextArea.idevice = idevice

        self.commentElement = TextAreaElement(idevice.commentTextArea)

        self.previewing = False  # In view or preview render

        if not hasattr(self.idevice, 'undo'):
            self.idevice.undo = True
Example #49
0
    def __init__(self, parent, idevice):
        Block.__init__(self, parent, idevice)
        self.titleElement = TextElement(idevice.titleField)
        self.contentElement = TextAreaElement(idevice.content)
        self.contentElement.height = 250
        self.chanceImageElements = []

        #go through all image fields in the list and create an image element linked to that field
        for chanceImageField in idevice.chanceImageFields:
            newImgElement = ImageElement(chanceImageField)
            self.chanceImageElements.append(newImgElement)

        self.wordElements = []
        self.hintElements = []
        #go through all of the word fields and hint fields and create an
        for wordIndex, word in enumerate(idevice.wordTextFields):
            newWordElement = TextElement(word)
            self.wordElements.append(newWordElement)
            newHintElement = TextElement(idevice.hintTextFields[wordIndex])
            self.hintElements.append(newHintElement)

        #make an element for the alphabet
        self.alphabetElement = TextElement(idevice.alphabet)

        #element for the messages that are shown to the player
        self.wrongGuessTextElement = TextAreaElement(
            self.idevice.wrongGuessMessageField)
        self.lostLevelTextElement = TextAreaElement(
            self.idevice.lostLevelMessageField)
        self.levelPassedTextElement = TextAreaElement(
            self.idevice.levelPasssedMessageField)
        self.gameWonTextElement = TextAreaElement(
            self.idevice.gameWonMessageField)

        self.letterButtonStyleElement = TextElement(
            self.idevice.letterButtonStyle)
        self.wrongLetterButtonStyleElement = TextElement(
            self.idevice.wrongLetterButtonStyle)
        self.rightLetterButtonStyleElement = TextElement(
            self.idevice.rightLetterButtonStyle)

        self.hintFieldStyleElement = TextElement(self.idevice.hintFieldStyle)
        self.wordAreaStyleElement = TextElement(self.idevice.wordAreaStyle)

        self.resetButtonTextElement = TextElement(self.idevice.resetButtonText)
        self.resetButtonStyleElement = TextElement(
            self.idevice.resetButtonStyle)
Example #50
0
    def __init__(self, parent, idevice):
        """
        Initialize a new Block object
        """
        Block.__init__(self, parent, idevice)
        self.activityInstruc = idevice.activityInstruc

        # to compensate for the strange unpickling timing when objects are
        # loaded from an elp, ensure that proper idevices are set:
        if idevice.activityTextArea.idevice is None:
            idevice.activityTextArea.idevice = idevice

        self.activityElement = TextAreaElement(idevice.activityTextArea)

        self.previewing = False  # In view or preview render

        if not hasattr(self.idevice, 'undo'):
            self.idevice.undo = True
    def __init__(self, parent, idevice):
        """
        Initialize a new Block object
        """
        Block.__init__(self, parent, idevice)
        self.idevice         = idevice
        self.questionElements  = []
        self.questionInstruc = idevice.questionInstruc
        self.keyInstruc      = idevice.keyInstruc
        self.answerInstruc   = idevice.answerInstruc
        self.feedbackInstruc = idevice.feedbackInstruc
      #  self.hint            = idevice.hint
        self.hintInstruc     = idevice.hintInstruc

        if not hasattr(self.idevice,'undo'):
            self.idevice.undo = True

        for question in idevice.questions:
            self.questionElements.append(QuizQuestionElement(question))
    def __init__(self, parent, idevice):
        Block.__init__(self, parent, idevice)
        self.contentElement = TextAreaElement(idevice.content)
        self.contentElement.height = 250
        self.titleElement = TextElement(idevice.titleField)

        self.mainAreaElement = TextAreaElement(idevice.mainArea)
        self.mainAreaElement.height = 200
        
        self.placableObjectElements = []
        for placableObjectField in idevice.objectsToPlace:
            newPlacableElement = PlacableObjectElement(placableObjectField)
            self.placableObjectElements.append(newPlacableElement)

        self.positiveResponseElement = TextAreaElement(idevice.positiveResponseArea)
        self.negativeResponseElement = TextAreaElement(idevice.negativeResponseArea)
        self.clickToStartElement = TextAreaElement(idevice.clickToStartGameArea)
        self.gameTimeLimit = TextElement(idevice.gameTimeLimit)
        self.gameTimerShown = TextElement(idevice.gameTimerShown)
        self.partbinNumCols = TextElement(idevice.partbinNumCols)
Example #53
0
    def __init__(self, parent, idevice):
        Block.__init__(self, parent, idevice)
        self.mainTextAreaElements = {}
        self.mainTextElements = {}
        self.clickableAreaElements = []
        self.questionOrderChoiceElement = ChoiceElement(
            idevice.questionOrderChoiceField)
        self.timerChoiceElement = ChoiceElement(idevice.timerChoiceField)
        self.titleElement = TextElement(idevice.titleField)

        for textAreaFieldName, textAreaFieldVals in idevice.textAreaFieldNames.iteritems(
        ):
            self.mainTextAreaElements[textAreaFieldName] = TextAreaElement(
                idevice.textAreaFields[textAreaFieldName])

        for textFieldName, textFieldVals in idevice.textFieldNames.iteritems():
            self.mainTextElements[textFieldName] = TextElement(
                idevice.textFields[textFieldName])

        for clickableAreaField in idevice.clickableAreaFields:
            newClickableElement = ClickInOrderClickableAreaElement(
                clickableAreaField)
            self.clickableAreaElements.append(newClickableElement)
Example #54
0
    def __init__(self, parent, idevice):
        """
        Pre-create our field ids
        """
        Block.__init__(self, parent, idevice)

        # to compensate for the strange unpickling timing when objects are
        # loaded from an elp, ensure that proper idevices are set:
        if idevice.instructionsForLearners.idevice is None:
            idevice.instructionsForLearners.idevice = idevice
        if idevice.content.idevice is None:
            idevice.content.idevice = idevice
        if idevice.feedback.idevice is None:
            idevice.feedback.idevice = idevice

        self.instructionElement = \
            TextAreaElement(idevice.instructionsForLearners)
        self.clozeElement = ClozeElement(idevice.content)
        self.feedbackElement = \
            TextAreaElement(idevice.feedback)
        self.previewing = False  # In view or preview render
        if not hasattr(self.idevice, 'undo'):
            self.idevice.undo = True
Example #55
0
 def __init__(self, parent, idevice):
     Block.__init__(self, parent, idevice)
     self.elements = []
Example #56
0
 def __init__(self, parent, idevice):
     Block.__init__(self, parent, idevice)
     self.contentElement = MathElement(idevice.content)
     self.contentElement.height = 250