Skip to main content
Participant
January 8, 2023
Question

Captivate variables causing odd Moodle behaviour

  • January 8, 2023
  • 1 reply
  • 132 views

Hello

 

I've used a variable in Captivate to solve the issues of blurred text. In Moodle, everything looks ok initially, but on refresh Moodle adds an extra character to the end of every sentence. I've attached a screengrab to illustrate the issue. You'll notice where a "0" is added.

 

Anyone else experienced this? How to solve?

    This topic has been closed for replies.

    1 reply

    Lilybiri
    Legend
    January 8, 2023

    I can guess why this happens. For Captivate a user variable can have both numeric and string values, there is no direct way to define that the user variable which you inserted after the sentence is a string variable which is empty. For Captivate 0 and empty are the same. That is the reason I wrote this blog post about checking the content of a Text Entry Box:

    https://blog.lilybiri.com/where-is-null-in-cp2017

    Apparently Moodle sees this variable as being numeric and hence the display of 0.

    Workaround? For the first sentence I would give a value : to the variable, which can never be a number.

    More complicated for the second appearance, but you get the idea. Insert a real character in the variable.

     

    Another possible workaround using the object style and can be used in this situation: edit the color of the variable and set it to the background color. Of course, that is not possible if you have something else than a solid color as background. It would have the advantage that you can use the same variable twice for this example. Avoid a break before the variable in all circumstances.