Highlighted

Javascript change Incorrect message at runtime.

New Here ,
Sep 07, 2020

Copy link to clipboard

Copied

Hi Im using captivate for course authoring. For part of the business we want to be able to customize the feedback messages at runtime. I'm trying to look through the cp object and find where that data is stored. cp is quit large. Anyone have an idea where to find this?

Views

36

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Javascript change Incorrect message at runtime.

New Here ,
Sep 07, 2020

Copy link to clipboard

Copied

Hi Im using captivate for course authoring. For part of the business we want to be able to customize the feedback messages at runtime. I'm trying to look through the cp object and find where that data is stored. cp is quit large. Anyone have an idea where to find this?

Views

37

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Sep 07, 2020 0
New Here ,
Sep 07, 2020

Copy link to clipboard

Copied

Just in case anyone comes across this in the future. The problem is two fold. 

1. Captivate stores this data as Images not text. It then renders this to a canvas. It then puts a div on top of that canvas with text for screen readers / accessability. 

2. The data is not stored in a way that is super distinct from other elements like buttons ect. No unique class name ect.

 

here is what worked for me. Note this is only for changing the default incorrect message to some other message. This assumes you want to change them all and not have unique fail messages for difference slides.

 

I needed to do this because my company wanted to change the message across all of our already published courses and opening / re exporting every single course we have in captivate would have taken days.

 

for (let key in cp.model.data) {
  let value = cp.model.data[key];
  console.log(value.accstr);
if(value.accstr == "Incorrect - Click anywhere to continue. "){
value.ip = "https://companywebsite.com/newIncorrectMessage.png"
value.accstr = "New incorrect message"
}
}

 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Sep 07, 2020 0
Most Valuable Participant ,
Sep 07, 2020

Copy link to clipboard

Copied

Not astonished, but I wanted to leave this question to the JS experts.

 

It is easy to circumvent the first problem.  Often I will replace the text in a feedback caption or shape by a variable, to make it easier to change it by shared or advanced actions. That results in a dynamic text container which never is converted to an image. That may give you an idea of editing quickly many feedback messages. But you would still have to open the raw cptx-files.

 

Was aware of the second problem as well, because the feedback messages are attached to quiz slides, interactive objects. They are no independent items, lack individual IDs like all embedded objects. Same would be the case for many embedded objects on the question slides.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Sep 07, 2020 0
New Here ,
Sep 07, 2020

Copy link to clipboard

Copied

"It is easy to circumvent the first problem"

In your situation perhaps. But not mine. Our courses are authored by many different people. Some workers in my company. Some sub contractors. Getting them to all do that consistently would be impossible. It's easier this way for our situation. 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Sep 07, 2020 0
Most Valuable Participant ,
Sep 07, 2020

Copy link to clipboard

Copied

Replacing the text by a variable, and somewhere define the variable (even with JS)? I don't see why this is such a big problem... Create the proper theme and model project to be used by everyone. Is that so impossible? Just tried to help, but seems not be welcomed. Thanks.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Sep 07, 2020 0
New Here ,
Sep 07, 2020

Copy link to clipboard

Copied

Thanks for trying to help. I appreciate that point. My point is only this. EasyInMySituation != EasyInAllSituation. And yes what you discribr would be almost impossible for my situation. Again thanks for trying to help I appreciate that part. 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Sep 07, 2020 0