March 29, 2020
Random Math Cards in Captivate
Comments
(11)
March 29, 2020
Random Math Cards in Captivate
I've been developing eLearning in a variety of formats since 1983
Master 38 posts
Followers: 69 people
(11)

When I started full-time teaching in 1995, I would teach my students how to create an app that would randomly generate math cards to help participants practice the basics addition, subtraction, multiplication and division. This exercise is an excellent way to learn some coding and logic all the while creating an app that can be used in a variety of places. When I first taught this, we used tools like Authorware, Director, Flash (Animate) and I’ve even made a web version of this app. However, I have not made a Captivate version of this app. So, here is a sample of what it looks like in Captivate. I do use an animation from Adobe Animate to flip the cards over. However, all the work is done inside of Captivate.

Take a look and see what you think.

11 Comments
2020-05-13 09:36:46
2020-05-13 09:36:46

An other great sharing. Thank you!

Like
(1)
(1)
>
farukerdogan
's comment
2020-05-13 15:11:52
2020-05-13 15:11:52
>
farukerdogan
's comment

You’re welcome. It was fun to build.

Like
2020-03-30 14:14:59
2020-03-30 14:14:59

Phil Cowcill love these tutorials of yours. This is on my to do list for things to attempt this week. Appreciate you sharing this with the rest of us.

Like
(2)
(1)
>
jsv1
's comment
2020-03-30 16:35:19
2020-03-30 16:35:19
>
jsv1
's comment

Thank you jsv1 for your comment. I hope it helps with your learning and development skills. All the best to you.

Cheers.

 

Like
2020-03-30 08:35:20
2020-03-30 08:35:20

It is a while ago, but I explained step by step generating a random number with JS in two blog posts:

http://blog.lilybiri.com/playing-with-numbers-part-1

There is a second post as well.

Like
(1)
>
Lieve Weymeis
's comment
2020-03-30 13:07:03
2020-03-30 13:07:03
>
Lieve Weymeis
's comment

Thank you Lieve. I did a post as well on random numbers a while back. It was posted on the Adobe blog as well as in this site. It had to do with using random numbers to generate random feedback. This post is another way to use random numbers within Captivate. It’s a nice looking app that can be addictive.

Like
(1)
2020-03-30 08:29:53
2020-03-30 08:29:53

Hi Paul !… Why did you shave your hair ???…

 

 

 

 

(Just a joke Phil !… Hope you don’t mind… but I can’t help doing it… )

I just finished to look at your videos posted this morning (and didn’t miss the others you already share by the way)… So BIG thank you !!!!… And I hope you will become another “ressource man” in this community !… Especially in Javascript, which I think is laking (don’t worry Greg I didn’t forget you !…) with this program.

But… If I may…

1./ Can you speak a little slowly ?… I’m french… And I assume I’m not the only non-native english speaker here…

2./ It would be nice of you also to share with us, in the text, the Javascript code you use in your demo ?…

Thanks again !…

And stay safe !…

😉

 

 

 

 

Like
(1)
(4)
>
Ludovic Mercier
's comment
2020-03-30 13:04:58
2020-03-30 13:04:58
>
Ludovic Mercier
's comment

Thank you  Ludovic for your comments. I do appreciate the comment about slowing down. I speak one way when I’m teaching and a different way when in conversation. This video was recorded as if I was in a conversation. I will slow down the pace of my talk in my next video.

As for the JavaScript code, here is what I had for the addition.
var ans = 0;

var card1Num = getRandom(randMax, randMin );
var card2Num = getRandom(randMax, randMin );
console.log(“Max = ” + randMax + “, Min = ” + randMin);

// save random value to Captivate variable card1 & card2.
// card1 & card2 are the variables read into the flip card animation

window.cpAPIInterface.setVariableValue(“card1”, card1Num);
window.cpAPIInterface.setVariableValue(“card2”, card2Num);

ans = card1Num + card2Num;
window.cpAPIInterface.setVariableValue(“theAnswer”, ans);

function getRandom(max, min) {
return Math.floor(Math.random() * (max – min) + min);
}
In the Subtraction, here is the code.
var d1 = 0;
var d2 = 0;
var ans = 0;

d1 = window.cpAPIInterface.getVariableValue(“randMax”);
d2 = window.cpAPIInterface.getVariableValue(“randMin”);

var card2Num = getRandom(d1, d2);
var ans = getRandom(d1, d2);

var card1Num = card2Num + ans;

window.cpAPIInterface.setVariableValue(“card1”, card1Num);
window.cpAPIInterface.setVariableValue(“card2”, card2Num);

window.cpAPIInterface.setVariableValue(“theAnswer”, ans);

It’s a little different than the addition because I was doing some experimenting. It does work well though.
 

Like
(1)
>
Phil Cowcill
's comment
2020-03-30 13:59:38
2020-03-30 13:59:38
>
Phil Cowcill
's comment

Another BIG thank you so !…

I try to collect all the coding in Javascript I found here or on the forum… Being myself not an expert on this langage… I used to work in Actionscript (with Flash) but as the Latin, it will soon be a dead one…

Hope to see (and hear) you soon !…

😉

Like
(1)
>
Ludovic Mercier
's comment
2020-03-30 16:28:04
2020-03-30 16:28:04
>
Ludovic Mercier
's comment

I still use Animate (Flash) a fair bit. I use it to create HTML5 animations used in Captivate. I also use it to create mobile apps for iOS and Android. If you optimize your code, it works very well and you can build apps very quickly for both platforms.

Like
>
Ludovic Mercier
's comment
2020-03-30 20:21:25
2020-03-30 20:21:25
>
Ludovic Mercier
's comment

Thanks for the shout out, Ludovic!

Nice Job, Phil.
I admit to feeling a bit inspired to do more walkthru videos of some JavaScript now.

Like
(2)
Add Comment