Timer Lesson Quiz Answers
From Xojo Documentation
This page contains the answers to the Timer Lesson quiz. Correct answers are marked in bold.
Quiz 1: Introduction to Timers
Use this Quiz to check what you have learned about the available Timer classes and other initial considerations.
Question 1.1: What Timer class would you use in an iOS project?
Question 1.2: What Timer class would you use in a Web project, from the Server side?
Question 1.3: Can a Timer can update the user interface controls?
Question 1.4: Can a Timer add its own execution thread?
Question 1.5: Can a Timer code execution lock the user interface events?
Quiz 2: Creating Timer Instances
This quiz lets you review what you have learned about timer instantiation, in relation with every kind of project, and the available options at your disposal.
Question 2.1: Generally speaking, what are the main steps involved in making a Timer functional?
- Create a instance.
- The Timer has to be part of the object.
- The instance has to maintain its Scope along the execution.
- The Timer has to be always linked to a Window.
Question 2.2: Do you have to create all the Timer from code?
- No, you can add a Timer to a Layout from the Library.
Question 2.3: Can I modify a Timer instance added from the Library?
- It depends on the type of timer.
Question 2.4: In what class are the Timers from the Library based?
- It depends on the type of project
Question 2.5: For a Console project, what class is a Timer added form the Library based upon?
- Timer -- you always drop it in the Navigator.
Quiz 3: Using Timers without previous instantiation
Put in practice the knowledge acquired in this lesson, specifically about using Timers without previous instantiation.
Question 3.1: It is possible to run a Timer without instantiation when using the classic framework?
Question 3.2: How many parameters can we pass along the Xojo.Core.TimerCallLater method?
- As many as we want!
- None or One
Question 3.3: Can we use Xojo.Core.Timer.CallLater in the frontend side of a Web app?
- Of course! In fact this is the recommended option!
- Just if we want to update the user interface controls.
- No, this Timer only is used from the server side.
Quiz 4: Period, Mode and Activation
Put in practice the knowledge acquired in this lesson, specifically Timers Modes and the way we can set the firing time period.
Question 4.1: The Timer period is set in…?
- It depends of the Target
Question 4.2: Do you have to set the Mode property to activate the Timer?
- It depends of the Event we have used to set the Timer
Question 4.3: Can the Timers set on the front end of a web app be fired just once?
There is no quiz for lesson 5.
Quiz 6: AddHandler
This quiz lets you review what you have learned about the use of AddHandler in order to substitute the default Action event.
Question 6.1: Does AddHandler allows passing an object as argument?
- Yes, but it should be a Delegate.
- No, it has to be a Method with Delegate signature.
Question 6.2: Can you use AddHandler to substitute the Action Event just one time for every Timer instance?
- No. We can re-assign the method as many times we need.
- We can re-assign just between timer action events.
- Yes, but we need to create a new instance in first place.
Question 6.3: The method signature we assign as Action substitute has parameters?
- It depends, we choose!
- Always, using a Timer or Xojo.Core.Timer type
- Always, using a Timer, Xojo.Core.Timer or WebTimer type.
Quiz 7: Class Interface
Verify what you have learned about the use of the Class Interface that allows the Timers sending notifications to other objects
Question 7.1: With the notifications use, do we achieve that several objects can run their respective code for each Timer interval?
- It is optional, we can register just one object.
- No, we can register just one object.
- Yes, but they need to be different kind of objects, running the all the same code!
Question 7.2: What Class Interface do we have to implement in the objects?
Question 7.3: Can we use this Class Interface in combination with Xojo.Core.Timer?
- Of course! In fact, this is the recommended way.
- Always, they are the only kind of Timers used along the app or a particular Module Scope.