HOME ➔ SUPPORT ➔ Community ➔ General CourseLab issues ... Programming the contents of a thought bubble
Programming the contents of a thought bubble
  View type:
Hi Folks,

I want to have a talking head with a thought bubble next to it.

Then I want users to be able to either click on objects on the screen that represent topics for discussion, or drag those objects on to the head. It's not critical whether it ends up as clicking or dragging at this time.

As an example imagine text labels each with a different word on them e.g. Introduction, Confidentiality, Home, Education etc.

The student clicks on "Introduction" and the phrase "His name is Mr Jones" appears in the thought bubble.
Next the student clicks on "Confidentiality" and the thought bubble now contains "He won't tell anyone. His Name is Mr Jones"

So each time you click a label, the related phrase is added to the thought bubble until there are 7 short phrases. On the eight time the last phrase is deleted from the list so that there is never more than 7 phrases in the thought bubble.

I figure to achieve this I need variables 1 to 7 so that on clicking I can move 6 into 7, 5 into 6, etc, then write the new phrase into 1, then finally write the contents of 1 through 7 into the thought bubble.

Any pointers would be helpful as to how I can write to the thought bubble and how I can set up the variables within courselab.

Kind regards

Johnathan
 
Fast and dirty would be seven hidden text boxes. Click on the object and reveal the text in the bubble. You'd probably want to sequence these, see later for the general idea.

Using actions .. concenation is the word here if two variables have a value of 1 then Var1+var2 will make 2 (hopefully!!)
If var 1 = "hello " and var 2 = "world " then var1+var2 will make hello world .
If the triggers are sequential then you could add words into a single variable and display that. The controlling the sequence again used variables.
That is maybe being a little complicated though.
If the text is added to linearly in the form of "hello", "hello world", "hello world xxx" then you get away with a simpler idea. Have each target assign the text at that point to a variable. In this case you might not need to worry so much about the sequencing to prevent each target triggering out of sequence.
If you do want to enforce a sequence then the general idea would be:
Target 1 has actions to set a variable for display to the text value you want and assigns a value to a variable eg prior_done to 1.
Target 2 has to check prior_done has been set to 1 and then it concenates the next text to the variable for display. If prior_done isn't 1 it does nothingIt also sets prior_done to 2.
Target 3 checks prior_done = 2 ammends the text and sets prior_done to 3.
You could tie the two together if you're happy with actions.
Probably the fast and dirty idea with sequence control would be a little easier to implement [;)]
 
 
LOL I did ignore the 7 variables at any one time part as I couldn't figure an easy way to work in a first in first out loop that was relatively simple.
Subject:
Message options
No additional options