def upgradeToVersion7(self): """ Upgrades to v0.13 """ # Upgrade old style reading activity's feedback field if self.class_ == "reading": # Upgrade the feedback field for i, field in enumerate(self.fields): if ( isinstance(field, TextAreaField) and hasattr(field, "name") and field.name in (_(u"Feedback"), u"Feedback") ): newField = FeedbackField(field.name, field.instruc) Field.nextId -= 1 newField._id = field._id newField.feedback = field.content newField.idevice = self self.fields[i] = newField # Upgrade the title if self.title == _(u"Reading Activity 0.11"): # If created in non-english, upgrade in non-english self.title = x_(u"Reading Activity") if self.title == u"Reading Activity 0.11": # If created in english, upgrade in english self.title = u"Reading Activity"
def upgradeToVersion7(self): """ Upgrades to v0.13 """ if self.class_ == "reading": for i, field in enumerate(self.fields): if isinstance(field, TextAreaField) and field.name in (_(u"Feedback"), u"Feedback"): newField = FeedbackField(field.name, field.instruc) Field.nextId -= 1 newField._id = field._id newField.feedback = field.content newField.idevice = self self.fields[i] = newField if self.title == _(u"Reading Activity 0.11"): self.title = x_(u"Reading Activity") if self.title == u"Reading Activity 0.11": self.title = u"Reading Activity"
def upgradeToVersion7(self): """ Upgrades to v0.13 """ if self.class_ == 'reading': for i, field in enumerate(self.fields): if isinstance(field, TextAreaField) \ and hasattr(field, 'name') \ and field.name in (_(u'Feedback'), u'Feedback'): newField = FeedbackField(field.name, field.instruc) Field.nextId -= 1 newField._id = field._id newField.feedback = field.content newField.idevice = self self.fields[i] = newField if self.title == _(u'Reading Activity 0.11'): self.title = x_(u'Reading Activity') if self.title == u'Reading Activity 0.11': self.title = u'Reading Activity'
def upgradeToVersion7(self): """ Upgrades to v0.13 """ # Upgrade old style reading activity's feedback field if self.class_ == 'reading': # Upgrade the feedback field for i, field in enumerate(self.fields): if isinstance(field, TextAreaField) \ and hasattr(field, 'name') \ and field.name in (_(u'Feedback'), u'Feedback'): newField = FeedbackField(field.name, field.instruc) Field.nextId -= 1 newField._id = field._id newField.feedback = field.content newField.idevice = self self.fields[i] = newField # Upgrade the title if self.title == _(u'Reading Activity 0.11'): # If created in non-english, upgrade in non-english self.title = x_(u'Reading Activity') if self.title == u'Reading Activity 0.11': # If created in english, upgrade in english self.title = u'Reading Activity'
def __createReading011(self): """ Create the Reading Activity 0.11 We do this only once when the user first runs eXe 0.11 """ from exe.engine.genericidevice import GenericIdevice readingAct = GenericIdevice(_(u"Reading Activity 0.11"), u"reading", _(u"University of Auckland"), x_(u"""<p>The reading activity, as the name suggests, should ask the learner to perform some form of activity. This activity should be directly related to the text the learner has been asked to read. Feedback to the activity where appropriate, can provide the learner with some reflective guidance.</p>"""), x_(u"Teachers should keep the following " "in mind when using this iDevice: " "<ol>" "<li>" "Think about the number of " "different types of activity " "planned for your resource that " "will be visually signalled in the " "content. Avoid using too many " "different types or classification " "of activities otherwise learner " "may become confused. Usually three " "or four different types are more " "than adequate for a teaching " "resource." "</li>" "<li>" "From a visual design " "perspective, avoid having two " "iDevices immediately following " "each other without any text in " "between. If this is required, " "rather collapse two questions or " "events into one iDevice. " "</li>" "<li>" "Think " "about activities where the " "perceived benefit of doing the " "activity outweighs the time and " "effort it will take to complete " "the activity. " "</li>" "</ol>")) readingAct.emphasis = Idevice.SomeEmphasis readingAct.addField(TextAreaField(_(u"What to read"), _(u"""Enter the details of the reading including reference details. The referencing style used will depend on the preference of your faculty or department."""))) readingAct.addField(TextAreaField(_(u"Activity"), _(u"""Describe the tasks related to the reading learners should undertake. This helps demonstrate relevance for learners."""))) readingAct.addField(FeedbackField(_(u"Feedback"), _(u"""Use feedback to provide a summary of the points covered in the reading, or as a starting point for further analysis of the reading by posing a question or providing a statement to begin a debate."""))) objectives = GenericIdevice(_(u"Objectives"), u"objectives", _(u"University of Auckland"), _(u"""Objectives describe the expected outcomes of the learning and should define what the learners will be able to do when they have completed the learning tasks."""), u"") objectives.emphasis = Idevice.SomeEmphasis objectives.addField(TextAreaField(_(u"Objectives"), _(u"""Type the learning objectives for this resource."""))) self.generic.append(objectives) preknowledge = GenericIdevice(_(u"Preknowledge"), u"preknowledge", "", _(u"""Prerequisite knowledge refers to the knowledge learners should already have in order to be able to effectively complete the learning. Examples of pre-knowledge can be: <ul> <li> Learners must have level 4 English </li> <li> Learners must be able to assemble standard power tools </li></ul> """), u"") preknowledge.emphasis = Idevice.SomeEmphasis preknowledge.addField(TextAreaField(_(u"Preknowledge"), _(u"""Describe the prerequisite knowledge learners should have to effectively complete this learning."""))) self.generic.append(preknowledge) activity = GenericIdevice(_(u"Activity"), u"activity", _(u"University of Auckland"), _(u"""An activity can be defined as a task or set of tasks a learner must complete. Provide a clear statement of the task and consider any conditions that may help or hinder the learner in the performance of the task."""), u"") activity.emphasis = Idevice.SomeEmphasis activity.addField(TextAreaField(_(u"Activity"), _(u"""Describe the tasks the learners should complete."""))) self.generic.append(activity)
def __createGeneric(self): """ Create the Generic iDevices which you get for free (not created using the iDevice editor, but could have been) Called when we can't find 'generic.data', generates an initial set of free/builtin idevices and writes the new 'generic.data' file JRJ: Modifico este método para que acepte otro parámetro que será la lista en la que añadimos los idevices genéricos (Modify this method so it accepts a new parameter, the list to which we add the generic iDevices) """ idevices = [] from exe.engine.genericidevice import GenericIdevice readingAct = GenericIdevice(x_(u"Reading Activity"), u"reading", x_(u"University of Auckland"), x_(u"""<p>The Reading Activity will primarily be used to check a learner's comprehension of a given text. This can be done by asking the learner to reflect on the reading and respond to questions about the reading, or by having them complete some other possibly more physical task based on the reading.</p>"""), x_(u"<p>Teachers should keep the following " "in mind when using this iDevice: </p>" "<ol>" "<li>" "Think about the number of " "different types of activity " "planned for your resource that " "will be visually signalled in the " "content. Avoid using too many " "different types or classification " "of activities otherwise learner " "may become confused. Usually three " "or four different types are more " "than adequate for a teaching " "resource." "</li>" "<li>" "From a visual design " "perspective, avoid having two " "iDevices immediately following " "each other without any text in " "between. If this is required, " "rather collapse two questions or " "events into one iDevice. " "</li>" "<li>" "Think " "about activities where the " "perceived benefit of doing the " "activity outweighs the time and " "effort it will take to complete " "the activity. " "</li>" "</ol>")) readingAct.emphasis = Idevice.SomeEmphasis readingAct.addField(TextAreaField(x_(u"What to read"), x_(u"""Enter the details of the reading including reference details. The referencing style used will depend on the preference of your faculty or department."""))) readingAct.addField(TextAreaField(x_(u"Activity"), x_(u"""Describe the tasks related to the reading learners should undertake. This helps demonstrate relevance for learners."""))) readingAct.addField(FeedbackField(x_(u"Feedback"), x_(u"""Use feedback to provide a summary of the points covered in the reading, or as a starting point for further analysis of the reading by posing a question or providing a statement to begin a debate."""))) idevices.append(readingAct) objectives = GenericIdevice(x_(u"Objectives"), u"objectives", x_(u"University of Auckland"), x_(u"""Objectives describe the expected outcomes of the learning and should define what the learners will be able to do when they have completed the learning tasks."""), u"") objectives.emphasis = Idevice.SomeEmphasis objectives.addField(TextAreaField(x_(u"Objectives"), x_(u"""Type the learning objectives for this resource."""))) idevices.append(objectives) preknowledge = GenericIdevice(x_(u"Preknowledge"), u"preknowledge", "", x_(u"""Prerequisite knowledge refers to the knowledge learners should already have in order to be able to effectively complete the learning. Examples of pre-knowledge can be: <ul> <li> Learners must have level 4 English </li> <li> Learners must be able to assemble standard power tools </li></ul> """), u"") preknowledge.emphasis = Idevice.SomeEmphasis preknowledge.addField(TextAreaField(x_(u"Preknowledge"), x_(u"""Describe the prerequisite knowledge learners should have to effectively complete this learning."""))) idevices.append(preknowledge) activity = GenericIdevice(x_(u"Activity"), u"activity", x_(u"University of Auckland"), x_(u"""An activity can be defined as a task or set of tasks a learner must complete. Provide a clear statement of the task and consider any conditions that may help or hinder the learner in the performance of the task."""), u"") activity.emphasis = Idevice.SomeEmphasis activity.addField(TextAreaField(x_(u"Activity"), x_(u"""Describe the tasks the learners should complete."""))) idevices.append(activity) #self.save() return idevices
def process(self, request, status): """ Process """ log.debug("process " + repr(request.args)) self.message = "" if status == "old": for element in self.elements: element.process(request) if "title" in request.args: self.idevice.title = unicode(request.args["title"][0], 'utf8') if "tip" in request.args: self.idevice.tip = unicode(request.args["tip"][0], 'utf8') if "emphasis" in request.args: self.idevice.emphasis = int(request.args["emphasis"][0]) if self.idevice.emphasis == 0: self.idevice.icon = "" if "addText" in request.args: field = TextField(_(u"Enter the label here"), _(u"Enter instructions for completion here")) field.setIDevice(self.idevice) self.idevice.addField(field) self.idevice.edit = True if "addTextArea" in request.args: field = TextAreaField( _(u"Enter the label here"), _(u"Enter the instructions for completion here")) field.setIDevice(self.idevice) self.idevice.addField(field) self.idevice.edit = True if "addFeedback" in request.args: field = FeedbackField( _(u"Enter the label here"), _(u"""Feedback button will not appear if no data is entered into this field.""")) field.setIDevice(self.idevice) self.idevice.addField(field) self.idevice.edit = True #if "addFlash" in request.args: #print "add a flash" #field = FlashField(_(u"Enter the label here"), #_(u"Enter the instructions for completion here")) #field.setIDevice(self.idevice) #self.idevice.addField(field) if "addMP3" in request.args: field = MultimediaField( _(u"Enter the label here"), _(u"Enter the instructions for completion here")) field.setIDevice(self.idevice) self.idevice.addField(field) if not 'xspf_player.swf' in self.idevice.systemResources: self.idevice.systemResources += ['xspf_player.swf'] self.idevice.edit = True if "addAttachment" in request.args: field = AttachmentField( _(u"Enter the label here"), _(u"Enter the instructions for completion here")) field.setIDevice(self.idevice) self.idevice.addField(field) self.idevice.edit = True if ("action" in request.args and request.args["action"][0] == "selectIcon"): self.idevice.icon = request.args["object"][0] if "preview" in request.args: if self.idevice.title == "": self.message = _("Please enter<br />an idevice name.") else: self.idevice.edit = False if "edit" in request.args: self.idevice.edit = True if "cancel" in request.args: ideviceId = self.idevice.id self.idevice = self.originalIdevice.clone() self.idevice.id = ideviceId self.parent.showHide = False if ("action" in request.args and request.args["action"][0] == "changeStyle"): self.style = self.styles[int(request.args["object"][0])] self.__buildElements()