Ejemplo n.º 1
0
 def __init__(self, field):
     Element.__init__(self, field)
     # there is then field.maincontent, field.width, field.height, field.correctx, field.correcty , etc.
     self.mainContentElement = TextAreaElement(field.mainContentField)
     self.targetXElement = TextElement(field.targetX)
     self.targetYElement = TextElement(field.targetY)
     self.widthElement = TextElement(field.width)
     self.heightElement = TextElement(field.height)
     self.toleranceElement = TextElement(field.tolerance)
Ejemplo n.º 2
0
    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)
Ejemplo n.º 3
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)
Ejemplo n.º 4
0
    def __init__(self, field):
        Element.__init__(self, field)

        self.textElements = {}
        self.textAreaElements = {}

        for textFieldName, textFieldDetails in field.textFieldNames.iteritems(
        ):
            self.textElements[textFieldName] = TextElement(
                field.textFields[textFieldName])

        for textAreaFieldName, textAreaFieldDetails in field.textAreaFieldNames.iteritems(
        ):
            self.textAreaElements[textAreaFieldName] = TextAreaElement(
                field.textAreaFields[textAreaFieldName])
Ejemplo n.º 5
0
def field_engine_build_elements_on_block(fieldInfoDict, fieldDict, idevice):
    fieldCounter = 0
    elementDict = {}
    for fieldInfoKey, fieldInfoArr in fieldInfoDict.items():
        elementTypeName = fieldInfoArr[EXEFIELDINFO_TYPE]

        #check the field - if this is a new one or src code edit etc. then add this field...
        field_engine_check_field(fieldInfoKey, fieldInfoDict, fieldDict,
                                 idevice)
        newElement = ""
        if elementTypeName == 'image':
            newElement = ImageElement(fieldDict[fieldInfoKey])
        elif elementTypeName == 'text':
            newElement = TextElement(fieldDict[fieldInfoKey])
        elif elementTypeName == 'textarea':
            newElement = TextAreaElement(fieldDict[fieldInfoKey])
        elif elementTypeName == 'choice':
            newElement = ChoiceElement(fieldDict[fieldInfoKey])

        if newElement != "":
            elementDict[fieldInfoKey] = newElement

    return elementDict
Ejemplo n.º 6
0
 def __init__(self, field, showDelFileButton=True):
     Element.__init__(self, field)
     self.fileDescriptionElement = TextElement(field.fileDescription)
     self.showDelFile = showDelFileButton
Ejemplo n.º 7
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)