• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

CP9 - Any way to list all variables/defaults and Javascript?

Engaged ,
Mar 05, 2018 Mar 05, 2018

Copy link to clipboard

Copied

Hello,

My Questions:

1) Is there a way to export a list of variables with their defaults and if the they are in use.

2) Is there a way to export the Javascript and where it is used.

Why I want to do this:

I have been given 40 projects created by someone else, but with no documentation explaining how they work.

I need to go through these projects and look at the variables and javascript and compare them across all the projects.

The only way I know of looking at variables is to use the Project,Variables menu. However, I then have to scroll scroll through a long list of variables, and click on each one, to identify if there is a default value set.

The only way I know of looking at Javascript is to look a Advanced Actions and select any item with Javascript and look at it.

Both of the above work fine for occasional use, but for trying to look through a huge amount of files, and compare the variables/defaults/javascript across projects is a real pain in the neck.

Any help appreciated.

Thank you

Peter

Views

410

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
community guidelines

correct answers 1 Correct answer

Community Expert , Mar 05, 2018 Mar 05, 2018

I know of no way to achieve what you want to do here except by using the Variables dialog.

For Advanced Actions there is the option in the Advanced Actions dialog to Preview a selected Advanced Action or Conditional Action.  But that will only help you see where variables might be used in those more complex actions, not for simple actions that do not appear in that dialog.

Votes

Translate

Translate
Community Expert ,
Mar 05, 2018 Mar 05, 2018

Copy link to clipboard

Copied

I know of no way to achieve what you want to do here except by using the Variables dialog.

For Advanced Actions there is the option in the Advanced Actions dialog to Preview a selected Advanced Action or Conditional Action.  But that will only help you see where variables might be used in those more complex actions, not for simple actions that do not appear in that dialog.

Votes

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
community guidelines
Engaged ,
Mar 05, 2018 Mar 05, 2018

Copy link to clipboard

Copied

Rod & Lilybiri,

Thank you for the quick response, and if you two don't know of a way, then I am quite sure it cannot be done.

The files I have been given were created by someone else, and all the java is in each file.

The user created different variable names for the same thing, such as 'pass_mark', 'passmark', 'Passmark', throughout the various projects, and hard coded the mark as a default.

I am trying to move all the Java to an external library, and need to standardise the variables etc.

Oh how I wish Adobe programmers had just taken a few minutes to think about what people may have wanted in the future.

Thank you both.

Peter

Votes

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
community guidelines
Community Expert ,
Mar 05, 2018 Mar 05, 2018

Copy link to clipboard

Copied

Peter, only a small miinority of Captivate users are ezxtending its functionality using JavaScript. Most of them are die hard programmers, and as you are probably aware of, forget to ducment the programming. I don't want to defend the Adobe Captivate developing team (they are very responsive to requests, be sure of that) but it is logical that they want to give priority to requests logged by the majority of users. BTW did you log any feature request to have an easier way to link to external JS files in Captivate and/or to improve the API and the small JS window?

Votes

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
community guidelines
Engaged ,
Mar 05, 2018 Mar 05, 2018

Copy link to clipboard

Copied

LATEST

I think I found rough solutions.

Open the CPM.js file.

All java appears to be on lines tarting with oca:

oca: 'cp.runJavascript(\'//my java stuff\\nalert("Hello");\',\'_self\');

All variables are listed beginning at cp.initVariables

cp.initVariables = function() {

        cp.cv('CaptivateVersion', '9.0.0', 1, 1000, 0);

        cp.cv('cpCmndCC', 0, 1, 15, 0);

        cp.cv('cpCmndExit', 0, 1, 15, 0);

        cp.cv('cpCmndMute', 0, 1, 15, 0);

       .........

        cp.cv('cpQuizInfoTotalQuestionsPerProject', 0, 1, 15, 0);

        cp.cv('cpQuizInfoTotalQuizPoints', 0, 1, 1000, 0);

        cp.cv('cpQuizInfoTotalUnansweredQuestions', 0, 1, 15, 0);

        cp.cv('cpInfoPrevFrame', 0, 1, 15, 0);

        cp.cv('varTest', 'Hello', 0, 50, 0);

        cp.cv('cpQuizInfoStudentID', '', 0, 15, 0);

        cp.cv('cpQuizInfoStudentName', '', 0, 15, 0);

    };

    cp.ReportingVariables = "varTest,";

Peter

Votes

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
community guidelines
Community Expert ,
Mar 05, 2018 Mar 05, 2018

Copy link to clipboard

Copied

One of the reasons I love shared actions is the fact that they appear in the Library, with all the functionality of other assets. Too bad, that is not the case for Advanced actions, nor Variables. Moreover the descriptions of both shared action and parameters help a lot to understand the goal of the action, something that is also lacking for AA and Vars.

I have published a descriptive table which explains and gives the default value of the exposed system variables. It will not help a lot I'm afraid:

System variables in Captivate 8/9 and 2017 - Captivate blog

Votes

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
community guidelines
Resources
Help resources