GettingStarted

Timer Lesson Quiz Answers

From Xojo Documentation

This page contains the answers to the Timer Lesson quiz. Correct answers are marked in bold.

Quiz Answers

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?

  • Xojo.Core.Timer
  • Timer
  • WebTimer

Question 1.2: What Timer class would you use in a Web project, from the Server side?

  • Xojo.Core.Timer
  • WebTimer
  • Timer

Question 1.3: Can a Timer can update the user interface controls?

  • Yes
  • No

Question 1.4: Can a Timer add its own execution thread?

  • Yes
  • No

Question 1.5: Can a Timer code execution lock the user interface events?

  • Yes
  • No

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.
  • Yes

Question 2.3: Can I modify a Timer instance added from the Library?

  • Yes
  • No
  • It depends on the type of timer.

Question 2.4: In what class are the Timers from the Library based?

  • WebTimer
  • Xojo.Core.Timer
  • Timer
  • 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?

  • ConsoleTimer
  • Timer -- you always drop it in the Navigator.
  • Xojo.Core.Timer

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?

  • Yes
  • No

Question 3.2: How many parameters can we pass along the Xojo.Core.TimerCallLater method?

  • As many as we want!
  • One
  • None
  • 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…?

  • Microseconds
  • Seconds
  • Milliseconds
  • It depends of the Target

Question 4.2: Do you have to set the Mode property to activate the Timer?

  • Yes
  • No
  • 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?

  • Yes
  • No

Quiz 5

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?

  • No
  • 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?

  • Yes
  • No
  • 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?

  • Yes
  • 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?

  • TimerActionObserver
  • TimerActionReceiver
  • ActionNotificationReceiver
  • ActionNotificationTimer
  • NotificationReceiver

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.
  • No