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

Getting variables into captivate from parent container

Community Beginner ,
Mar 02, 2018 Mar 02, 2018

I noticed that once my Captivate module is published to my Adobe Connect server it resides inside a container that has the following code:

<title>xxxxx</title>

<script type="text/javascript" src="/common/scripts/s_code.js?ver=9.2.1"></script><script type="text/javascript" src="/common/scripts/OmnitureTracker.js?ver=9.2.1"></script><script type="text/javascript" src="/common/scripts/modalDialog/jquery-1.7.1.js?ver=9.2.1" charset="utf-8"></script><script>

                var isReview = 'false';                    

       

                // Copyright (c) 2001 - 2009 Adobe Systems Inc. and its licensors. All rights reserved.

               

            function isReviewMode()

            {

                    return Boolean(isReview);

            }

           

            function initReviewFrame()

            {

                    var frameDoc = window.frames.ReviewMode;

                    frameDoc.document.open();

                    frameDoc.document.write("<html><body style=\"background-color:rgb(103,103,103);\"><style>.rtop,.rbottom{display:block}.rtop *,.rbottom *{display:block;height: 1px;overflow: hidden}.r1{margin: 0 5px}.r2{margin: 0 3px}.r3{margin: 0 2px}.r4{margin: 0 1px;height: 2px}.rs1{margin: 0 2px}.rs2{margin: 0 1px}#rmMsg {width:400px;position:relative;top:3px;background-color:#DBDBDB;margin:5 5 10 5px;}<\/style><script type=\"text/javascript\" src=\"/common\/scripts/xxxUI.js\"><\/script><script type=\"text/javascript\">window.onload=function(){Rounded(\"div#rmMsg\",\"#676767\",\"#DBDBDB\");}<\/script><center><div id=\"rmMsg\"><table><tr><td style=\"vertical-align:top\"><img src=\"/common/images/icon_review_mode.gif\" height=\"31\" width=\"32\"><\/td><td style=\"font-size:8pt;color:#676767;font-family:arial;padding-left:20px\">You are now in Review Mode. Any choices selected will not be tracked.<\/td><\/tr><\/table></div></center></body></html>");

                    frameDoc.document.close();

            }

           

            function flushContentQueue() {

                    getFlexApp('theFlashObj').FlushBreezeLMSQueue();

            }

           

            function unloadWindow() {

                    if (window.opener!=null) {                        

                           // If the refreshCurriculumTree method exists, then call it.

                           // Otherwise, just reload the page.

               if (window.opener.refreshCurriculumTree) {  

                               window.opener.refreshCurriculumTree();

                           } else {

                                           var URL = unescape(window.opener.location);            

                               window.opener.location.href = URL;                            

                           }                      

            }

            }

            function resizeWin(w,h) {

             if (parseInt(navigator.appVersion)>3 && w > 0 && h > 0) {

             

               sw = screen.width;

               sh = screen.height;

               l = sx = top.screenLeft; if (l == undefined) l = window.screenX;

               t = sy = top.screenTop;  if (t == undefined) t = window.screenY;

               if (w > sw) {

                                 h *= (sw/w);

                                 w = sw;

               }

               if (h > sh) {

                                 w *= (sh/h);

                                 h = sh;

               }

    //           if (l + w > sw)

                 l = (sw - w) / 2;

    //           if (t + h > sh)

                 t = (sh - h) / 2;

               if (l != sx || t != sy)

               {

                                 top.moveTo(l, t);

                   }

           // If in review mode, resize the window by dimenstions of review

           // mode message.

           if (isReview == 'true') {

                h += 60;

                if (w<420) w=420;

           }

               if (navigator.appName=="Netscape") {

                         

                             var hdiff = window.outerHeight - window.innerHeight;

                             var wdiff = window.outerWidth - window.innerWidth;

                               top.resizeTo(w + wdiff, h + hdiff);

               

               } else {

               

                top.resizeTo(w, h);

                if (navigator.appName=="Microsoft Internet Explorer") {

                                        b = document.body;

                           top.resizeBy(w - b.clientWidth, h - b.clientHeight);

                }

               }

             

             }

            }

               

        function changeTitle(newTitle)

        {

                document.title = newTitle;

        }

        // *** below are functions for meeting dashboard. Catching onFocus/onBlur and calling flex app ****

       

        // This function returns the appropriate reference,

        // depending on the browser.

       

        function getFlexApp(appName)

        {

          if (navigator.appName.indexOf ("Microsoft") !=-1)

          {

                return window[appName];

          }

          else

          {

                var appInst = document[appName];

                return document[appName];

          }

        }

       

        function onBlur()

        {

                if(getFlexApp('theFlashObj')!=null && getFlexApp('theFlashObj').setBrowserFocus!=null)

                        getFlexApp('theFlashObj').setBrowserFocus(0);

        }

       

        function onFocus()

        {

                if(getFlexApp('theFlashObj')!=null && getFlexApp('theFlashObj').setBrowserFocus!=null)

                        getFlexApp('theFlashObj').setBrowserFocus(1);

        }

         

       

       

        if (/*@cc_on!@*/false) // check for Internet Explorer

        {

                // do nothing for IE right now .. doesn't work gives script error

                //document.onfocusin = onFocus;

                //document.onfocusout = onBlur;

        }

        else

        {

                window.onfocus = onFocus;

                window.onblur = onBlur;

        }

       

        //*** end of meeting dashboard functionality **

       

               

        function onContentPageLoad()

        {

               

                var contentType = 'content';

               

                        if(contentType && (contentType == 'meeting' || contentType == 'curriculum') )

               

                {

                        return ;        // In case of event containing meeting or curriculum as content, then we will send login event from meeting code or curriculum page.

                                                //For meeting reporting has to be done using event sco. Bug: 2937033.

                                                //For curriculum this had to be done since this page was unloaded very quickly so some redirect requests were not handled for reporting login. Bug: #3200139

                }

               

               

                var reportSuiteId = "";

               

               

                var trackingServer = "";

               

               

                var visitorNamespace = "";

                if(reportSuiteId.length>0)

                {

                        createOmnitureReportingTracker(reportSuiteId,visitorNamespace,trackingServer);

                       

                        var eventSco = "28884035";

                       

                        var scoNameSignature = "";

                       

                        var campaignId = "";

                       

                        var userName = "";

                       

                                userName = "Bob Taylor";

                       

                        var principalId = "";

                       

                                principalId = "488401";

                       

                        pushLoginEvent(scoNameSignature, eventSco, userName, principalId, campaignId);        

                }

        }

       

        onContentPageLoad();                

        </script>

</head>

<frameset onunload="" onload="resizeWin(800, 600)">

<frame src="/xxxx/">

</frameset>

<noframes>

<a href="/xxxx/">

</noframes>

</html>

How can I get the var userName from this container into my Captivate?

I am using:

  1. Adobe Captivate 8
  2. SCORM 1.2
  3. Adobe Connect Server
  4. The published zip has the following:
    1. Captivate.css
    2. Module1.htm (this does not have the code that I've mentioned above)
    3. Module1.swf
    4. standard.js
668
Translate
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 02, 2018 Mar 02, 2018

There is a variable within captivate called "cpQuizInfoStudentName" that's defined as "Student Name from LMS". You can do things such as display a caption with this variable to personalize the course. (Here's an example of someone using it and editing it with Javascript: https://forums.adobe.com/thread/1842797)

Is that the sort of thing you're looking for?

Translate
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 Beginner ,
Mar 02, 2018 Mar 02, 2018

"cpQuizInfoStudentName" is not part of the system variables in my captivate nor "cpQuizInfoStudentID". So I did the following and got "undefined":

1) First slide with On Enter -> Execute JS -> reverseName();

2) On second slide: textbox with $$cpQuizInfoStudentName$$

3) inside Module1.html:

<script>

function reverseName()

{

var cp = document.Captivate;

var getName = cp.cpEIGetValue('m_VarHandle.cpQuizInfoStudentName');

var getName = getName.split(",");

getName.reverse();

var newName = getName[0]+" "+getName[1];

cp.cpEISetValue('m_VarHandle.cpQuizInfoStudentName', newName);

}

</script>

No matter what I try I can't get the studentname or id.


What I'm trying to do is eventually take that studentname or id and send it to an external db via js. Then compare this data in a second module. So this studentname or studentid will be my way to connect both modules by using my external db. But the db GET POST is next step, for now I can't even get the studentname

Translate
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 02, 2018 Mar 02, 2018

Small correction: those two variables are NOT system variables but user varaibles that are automatically created with each new project. They are meant to be used with the internal sever workflow, but most LMS's will populate those variables as well.

Translate
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 Beginner ,
Mar 02, 2018 Mar 02, 2018

Well it seemed to have worked since it did display "undefined" but I guess there is no data in that var.

Translate
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 Beginner ,
Mar 02, 2018 Mar 02, 2018

I used an app called Simwriter and it did manage to pull the student_name using a variable that I had to check as (Assign value from server (if available))

I then created a textfield with [$student_name] and that retrieved the data.

When I published the Simwriter module the html file had this in it: var student_name = doLMSGetValue("cmi.core.student_name");

Not sure why Captivate is giving me issues.

Translate
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 Beginner ,
Mar 03, 2018 Mar 03, 2018

No one knows how to get this done in Captivate?!?

Translate
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 Beginner ,
Mar 08, 2018 Mar 08, 2018

How can I retrieve the userName from this:

if(reportSuiteId.length>0)

                {

                        createOmnitureReportingTracker(reportSuiteId,visitorNamespace,trackingServer);

                       

                        var eventSco = "28884035";

                       

                        var scoNameSignature = "";

                       

                        var campaignId = "";

                       

                        var userName = "";

                       

                                userName = "Bob Taylor";

                       

                        var principalId = "";

                       

                                principalId = "488401";

                       

                        pushLoginEvent(scoNameSignature, eventSco, userName, principalId, campaignId);        

                }

It's on the container page where my module resides once published to my Adobe Connect Server.

Translate
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 Beginner ,
Mar 08, 2018 Mar 08, 2018
LATEST

Nevermind got it to work...

Translate
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