Converted internalServerReporting from .php to .cfm

I posted this on the general discussion forum but it doesn't seem to be getting any looks....
Hi
I recently converted the internalServerReporting.php file to .cfm, since I'm not yet using a LMS and I just needed to capture quiz results.
I'm writing the results of my Captivate 7 quiz to a .txt file successfully (an insert query too). My Captivate 7 quiz completes and immediately after the user fills out and clicks the Send button in the Post Results dialog box (where they enter their name and email id) I get an Adobe Captivate error message in a dialog box with "Unknown Error" and an OK button.
I think this is a Captivate error and not a Coldfusion error, as my Coldfusion "internalServerReporting.cfm" writes the text file as expected, and the Coldfusion server error logs are empty. Does anyone know how I can turn on/enable any available debugging data in Captivate so that I can trap this error?
For your convenience my .cfm file is pasted below.
Thanks in advance for your help,
Rich
Rich Leach
Interactive Media Developer
Advanced Certified ColdFusion Developer
<cfsavecontent variable="results">
<cfoutput>
Company name: #form.companyname#<br>
Department name: #form.departmentname#<br>
Course name: #form.coursename#<br>
File name: #form.filename#<br>
File data: #form.filedata#<br>
<cfset retXml=#xmlParse(form.filedata)#>
Learner name: #retXml.Course.LearnerName.xmlAttributes["value"]#<br>
Learner email: #retXml.Course.LearnerID.xmlAttributes["value"]#<br>
Lesson name: #retXml.Course.LessonName.xmlAttributes["value"]#<br>
Quiz attempts: #retXml.Course.QuizAttempts.xmlAttributes["value"]#<br>
Total questions: #retXml.Course.TotalQuestions.xmlAttributes["value"]#<br>
Status: #retXml.Course.Result.CoreData.Status.xmlAttributes["value"]#<br>
Location: #retXml.Course.Result.CoreData.Location.xmlAttributes["value"]#<br>
Raw Score: #retXml.Course.Result.CoreData.RawScore.xmlAttributes["value"]#<br>
Max Score: #retXml.Course.Result.CoreData.MaxScore.xmlAttributes["value"]#<br>
Min Score: #retXml.Course.Result.CoreData.MinScore.xmlAttributes["value"]#<br>
Session Time: #retXml.Course.Result.CoreData.SessionTime.xmlAttributes["value"]#<br >
</cfoutput>
</cfsavecontent>
<cffile action="write" file="/Applications/ColdFusion10/internal.timetracker/runtime/work/Ca talina/localhost/tmp/captivateTestResults.txt" output="#results#" nameconflict="overwrite">

Jim
...jeez, what a rookie mistake....
I did some debugging and found this reported error in my browser (Chrome):
XMLHttpRequest cannot load http://127.0.0.1:8503/captivate/internalServerReporting.cfm. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access.
From my years of web development I immediately recognized this error; it's a cross domain issue. But, I'm running everything localhost, what's not in the same dom.... Oh yeah, right after publishing the Captivate movie a dialog box appears "Publish was successful. Do you wish to view the output?" Naturally I clicked yes, which opened the .html file locally in my browser (as in File:Open) and NOT served from the web server (as in http://127.0.0.1/myCaptivateTest/).
As soon as I ran my Captivate test movie from the web server everything ran just fine.
Thanks for your help and patience. This script officially now works, so if anyone needs to record Captivate test/quiz results on a Coldfusion server, feel free to copy the above Coldfusion code into your own "internalServerReporting.cfm" and tell Captivate in your preferences where to expect it on your Coldfusion server.
Rich

Similar Messages

  • Convert from php to java

    Hello all,
    Can someone convert this code from php to java.
    <?php
    function bitbybit_crc32($str,$first_call=false){
    //reflection in 32 bits of crc32 polynomial 0x04C11DB7
    $poly_reflected=0xEDB88320;
    //=0xFFFFFFFF; //keep track of register value after each call
    static $reg=0xFFFFFFFF;
    //initialize register on first call
    if($first_call) $reg=0xFFFFFFFF;
    $n=strlen($str);
    $zeros=$n<4 ? $n : 4;
    //xor first $zeros=min(4,strlen($str)) bytes into the register
    for($i=0;$i<$zeros;$i++)
    $reg^=ord($str{$i})<<$i*8;
    //now for the rest of the string
    for($i=4;$i<$n;$i++){
    $next_char=ord($str{$i});
    for($j=0;$j<8;$j++)
    $reg=(($reg>>1&0x7FFFFFFF)|($next_char>>$j&1)<<0x1F)
    ^($reg&1)*$poly_reflected;
    //put in enough zeros at the end
    for($i=0;$i<$zeros*8;$i++)
    $reg=($reg>>1&0x7FFFFFFF)^($reg&1)*$poly_reflected;
    //xor the register with 0xFFFFFFFF
    return ~$reg;
    $str="123456789"; //whatever
    $blocksize=4; //whatever
    for($i=0;$i<strlen($str);$i+=$blocksize) $crc=bitbybit_crc32(substr($str,$i,$blocksize),!$i);
    ?>

    I am looking someone to help me w/o $.Go away.
    This reminds me of this one time. I had written this dice roller in PHP (still in use, actually) and someone who was using it thought it was nice and wanted a version of it for himself. Only he was running a different game system, some home brewn thing, so it had to be different in certain respects.
    First he just asked me if he could have the dice roller I wrote. I thought about it but eventually agreed. It wasn't much as code. Then he asked me to modify it for him, explaining that he could not do it himself. For some reason I was feeling generous that day, so I did not ask him for his physical address and send him a mail bomb. Instead I said that I would modify it for him if he explained what modifications he needed.
    Then he told me to go read his game system on his web site and figure it out for myself. I must have been in a saintly attitude that day because I actually went and looked at his site - which predictably, was totally disorganized and incomprehensible. I pointed this out and he told me that I would have to read through everything once or twice, and also, it wasn't done yet so I should check back periodically.
    This is a person who I had never met in my life, even online, and with whom my first contact was his request for my dice roller.
    Where do these people COME from?
    Drake

  • From PHP to JSP for a search-responder.php

    I have been asked to use the "search-as-you-type" solution offered up by Google at [http://code.google.com/p/search-as-you-type/|http://code.google.com/p/search-as-you-type/]. The documentation offered by Google is pretty much straight forward but of course the actual piece of code that gets the data is built in PHP and my client needs this to be used on a page serving up JSP.
    I am learning JSP and moving from PHP and ASP and learning quickly but not quick enough to finish the project.
    Would anyone be able and willing to help me convert the functions in the following PHP code into JSP?
    Thanks in advance to anyone who takes the time to help me.
    <?php
    * Copyright (C) 2006 Google Inc.
    * Licensed under the Apache License, Version 2.0 (the "License");
    * you may not use this file except in compliance with the License.
    * You may obtain a copy of the License at
    *      http://www.apache.org/licenses/LICENSE-2.0
    * Unless required by applicable law or agreed to in writing, software
    * distributed under the License is distributed on an "AS IS" BASIS,
    * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    * See the License for the specific language governing permissions and
    * limitations under the License.
    * Search-as-you-type sample Ajax responder
      // Adding a cache control so that browsers won't cache Ajax requests
      header("Cache-Control: no-cache");
      header("Content-Type: text/html; charset=UTF-8");
       * Get the sample data from the text file.
       * @return array Loaded data
      function GetData() {
        $data = array();
        $file = file("test-data.txt");
        foreach($file as $record) {
          $record = explode("|", trim($record));
          if (count($record) == 4) { // Ignore invalid lines
            $data[] = $record;
        return $data;
       * Get the results based on user's query.
       * @param string $query Query
       * @param array $data Sample data
       * @return array Result array
      function GetResults($query, $data) {
        $results = array();
        $queryLength = strlen($query);
        foreach ($data as $record) {
          if (substr(strtolower($record[0]), 0, $queryLength) == $query) {
            $result = array();
            $result['name'] = $record[0];
            $result['type'] = $record[1];
            $result['content'] = $record[2];
            $result['moreDetailsUrl'] = $record[3];
            $result['style'] =
              ($query == strtolower($record[0])) ? 'expanded' : 'normal';
            $results[] = $result;
        return $results;
      // Get the data and the query
      $data = GetData();
      $query = strtolower(ltrim($_GET['query']));
      // Build response
      $response = array();
      $response['query'] = $query;
      $response['results'] = GetResults($query, $data);
      if (count($response['results']) == 1) {
        $response['autocompletedQuery'] = $response['results'][0]['name'];
      // Output response
      echo "searchAsYouType.handleAjaxResponse(";
      echo json_encode($response);
      echo ");";
    ?>

    Thanks for your comment Gimbal2.
    I have already been thoroughly surprised at how different JSP is from PHP. I am finding quite hard to wrap my head around the whole process to be honest.
    I am beginning to see that JSP and PHP work in a totally different way than each other.
    I am not technically trying to translate or convert the PHP file as much as I am trying to build a file in JSP that does the same functions. The main functions of the PHP script are commented by Google and should be easily enough re-written in JSP in order to produce similar results.
    Since the output needs to be in a JSON format when passed to the .js file you'd think this would be better suited as a .jsp file as well or even a JAVA Applet, Servlet or even a bean. Since the whole site is already built in JSP for a multitude of other functions it seems likely that adding on more to read data from a source file and send it back to the .JS would be straight forward, but I could be wrong. But again I am not familiar enough with JAVA or JSP (yet) to make heads or tails of this.
    1. // Adding a cache control so that browsers won't cache Ajax requests
    2. * Get the sample data from the text file. @return array Loaded data
    3. * Get the results based on user's query.
    * @param string $query Query
    * @param array $data Sample data
    * @return array Result array
    4. // Get the data and the query
    5. // Build response
    6. // Output response

  • How to get data from php to java via xmlrpc

    I have been trying to get data from php through apache xmlrpc to java.
    I do get an value as result. The result is "Array". How how do i convert the XMLRPC Object "Array" to Java Object?
    Inside the XMLRPC "Array" Object there is object too of type Array from php.
    See code for java here
    Object result = client.execute( "blogger.getCategories", params1 );
    Code from php here
    function getCategories($appkey, $username, $password)
         global $xmlrpcerruser, $xmlrpcI4, $xmlrpcInt, $xmlrpcBoolean, $xmlrpcDouble, $xmlrpcString, $xmlrpcDateTime, $xmlrpcBase64, $xmlrpcArray, $xmlrpcStruct, $xmlrpcValue;
         $structArray = array();
         $structArray[] = new xmlrpcval(array("one" => "test"));
         return new xmlrpcresp(new xmlrpcval( $structArray , $xmlrpcArray));     
    I do get Standard String and Integer from php to Java through XMLRPC.
    Can someone help me.
    Edited by: Electron32 on Aug 13, 2010 9:44 AM

    That is what is so strange. I return an 'array' through xmlrpcval() and in Java I tried to cast it to ArrayList, Vector,String[] but get an error
    Object[] result = (Object[]) client.execute( "blogger.getCategories", params1 );
    String[] array = (String[]) result;
    Exception in thread "main" java.lang.ClassCastException: [Ljava.lang.Object; cannot be cast to [Ljava.lang.String;
            at com.dirdalit.window.Main.main(Main.java:41)
    Edited by: Electron32 on Aug 13, 2010 12:25 PM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • How to populate DataGird with data returned from php page?

    Hi, I'm new in Flex, I try to populate DataGrid with data from PHP, My code is
    <mx:HTTPService 
    id="personRequest" result="getPerson(event)" url=http://localhost/searchPerson.php useProxy="false" method="POST" showBusyCursor="true" resultFormat="e4x">
    </ mx:HTTPService>
    <mx:DataGrid 
    id="searchResult" dataProvider="{???what to paste here???}" y="30">
    </mx:DataGrid>
    private  
    function getPerson(evt:ResultEvent):void { var res:XMLList = evt.result..dane as XMLList;searchResults =
    new XMLListCollection(res); 
    output from PHP
    <person>
    <dane>
    <name>ABC</name>
    <street>XLXXLX</street>
    </dane>
    <dane>
    <name>DEF</name>
    <street>YAYAYAY</street>
    </dane>
    </person>
    If I set the dataProvider as "searchResults" it doesn't work. I probably have to set as dataprovider any ArrayCollection , but I don't know how to convert my XMLListCollection to it.
    Could anyone help me populate Datagrid with
    name | streer
    ABC, XLXXLX
    DEF, YAYAYAY
    Best Regards,
    Mariusz

    Thanks for your reply, but I'm afraid it doesn't work :-( Could you browse my code and check what I'm doing wrong???
    full mxml code:
    <?xml version="1.0" encoding="utf-8"?><mx:Application 
    xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" applicationComplete="personRequest.send()">
    <mx:Script><![CDATA[
         import mx.rpc.events.ResultEvent; 
         [Bindable]
         public var searchResultsXML:XML;  
         private  function getPerson(evt:ResultEvent):void 
          {          searchResultsXML = (evt.result
    as XML);
              trace(searchResultsXML);     }
    ]]></mx:Script>  
    <mx:HTTPService 
    id="personRequest" result="getPerson(event)" url=http://localhost/searchPerson.php useProxy="false"
    method="POST" showBusyCursor="true" resultFormat="e4x"></mx:HTTPService>
    <mx:DataGrid  id="searchResult" dataProvider="{searchResultsXML.dane}"></mx:DataGrid>
     </mx:Application> 
    trace statement returns:
    <person>
    <dane>
    <id>1</id>
    <nazwisko>Topczewski</nazwisko>
    <imie>Mariusz</imie>
    <imie2/>
    <miejscowosc>Bia?ystok</miejscowosc>
    <ulica>Nowogródzka</ulica>
    <dom>7B</dom>
    <lokal>25</lokal>
    </dane>
    <dane>
    <id>1</id>
    <nazwisko>Topczewski</nazwisko>
    <imie>Mariusz</imie>
    <imie2/>
    <miejscowosc>Bia?ystok</miejscowosc>
    <ulica>Sybiraków</ulica>
    <dom>15</dom>
    <lokal>27</lokal>
    </dane>
    </person>

  • Need to convert  Date from calendar to String in the format dd-mom-yyyy

    Need to convert Date from calendar to String in the format dd-mom-yyyy+..
    This is absolutely necessary... any help plz..
    Rgds
    Arwinder

    Look up the SimpleDateFormat class: http://java.sun.com/j2se/1.4.2/docs/api/java/text/SimpleDateFormat.html
    Arwinder wrote:
    This is absolutely necessary... any help plz..For you maybe, not others. Please refrain from trying to urge others to answer your queries. They'll do it at their own pace ( if at all ).
    People on the forum help others voluntarily, it's not their job.
    Help them help you.
    Learn how to ask questions first: http://faq.javaranch.com/java/HowToAskQuestionsOnJavaRanch
    (Yes I know it's on JavaRanch but I think it applies everywhere)
    ----------------------------------------------------------------

  • How can I convert Pdf from RGB to CMYK, keeping font color 100% K while working in Illustrator?

    How can I convert Pdf from RGB to CMYK, keeping font color 100% K while working in Illustrator?
    When I try to open the document in Illustrator and I convert to CMYK the black font converts to rich black, but to set up for Offset printintg I need the text to be only in Black (100%K).
    The original source of the document is a Microsoft Word file, I have converted the Word file to Pdf in order to setup for OFfset Printing.
    Thanks

    I have tried that way, but the downside is that the fonts are set in gray not in a 100%K, also I have to deal with other fonts that are composites and meant to stay Full Color. I could select text by text and convert to gray but, its a 64 page document and I wouldn't want to make a expensive mistake.

  • Error when starting a converted VM (from vmware server edition)

    Hi, i am trying to start a converted VM from VMWARE SERVER. I think i have followed steps to import an VMWARE machine (using resources >> virtual machines images) and it does not return errors when converting VM but then, when trying to start it, it returns
    failed:<OVSException: no server selected to run vm('/OVS/running_pool/SIR_xxx') memory=512> StackTrace: File "/opt/ovs-agent-2.2/OVSSiteVM.py", line 77, in start_vm raise e
    I have also checked that there is enough memory.
    This is the contect for vm.cfg
    acpi = 1
    apic = 1
    builder = 'hvm'
    device_model = '/usr/lib/xen/bin/qemu-dm'
    disk = ['file:/OVS/running_pool/SIR_xxx/SIR_xxx.img,hda,w',
    'file:/OVS/running_pool/SIR_consulnor/SIR_xxx (2).img,hdb,w',
    ',hdc:cdrom,r',
    kernel = '/usr/lib/xen/boot/hvmloader'
    memory = '512'
    name = 'SIR_xxx'
    on_crash = 'restart'
    on_reboot = 'restart'
    pae = 1
    serial = 'pty'
    timer_mode = '1'
    uuid = 'e23767cc-dc3d-0255-a7ac-65f111b589d7'
    vcpus = 1
    vif = ['bridge=xenbr0,mac=00:16:3E:71:AF:B1,type=ioemu']
    vif_other_config = []
    vnc = 1
    vncconsole = 1
    vnclisten = '0.0.0.0'
    vncpasswd = 'xxx'
    vncunused = 1
    Thanks for your help

    user559432 wrote:
    failed:<OVSException: no server selected to run vm('/OVS/running_pool/SIR_xxx') memory=512> StackTrace: File "/opt/ovs-agent-2.2/OVSSiteVM.py", line 77, in start_vm raise eDo your servers have Hardware/Full Virtualization enabled? You can check on the console and ensure the console says that Hardware Virtualization is enabled. If not, check in your BIOS that the processor hardware virtualization is enabled. If you don't have an option, your PC may not have the Intel VT-x or AMD-v extensions required to support hardware virtualization.
    You can check to see if your processor supports this extension by using:
    Intel processor:
    # cat /proc/cpuinfo | grep vmxAMD processor:
    # cat /proc/cpuinfo | grep svmIf you see a result, it means the processor has that support. You still need to ensure that it is enabled in the BIOS.

  • How to convert date from "yyyymmdd" to "MM/DD/YYYY" format

    1. I have one BLDAT field in my internal table.
       its getting updated from input file.
    2. The value in the input file is like yyyymmdd.
       So the internal table field is filled like this
       "YYYYMMDD".
    3. After this,I have to compare this internal table  
       field with BSAD table.
    4. The BLDAT field in BSAD table is in the format of 
       "MM/DD/YYYY".
    5. the BLDAT field is having diff format in internal  table and BSAD table.So I am unable to check this value.
    How to convert it as like the BSAD table format."MM/DD/YYYY" format.
    Thanks in advance!!

    Using the WRITE statement
      data: gd_date(10).  "field to store output date
    * Converts date from 20020901 to 09.01.2002
      write sy-datum to gd_date mm/dd/yyyy.
    OR u can
    CONCATENATE gd_date+4(2) gd_date+6(2) gd_date+0(4)
    into gd_date seperated by '/' .
    Hope this helps.
    Kindly reward points and close the thread for the
    answer which helped u OR get back with queries.

  • How to I convert data from oracle database into excel sheet

    how to I convert data from oracle database into excel sheet.
    I need to import columns and there datas from oracle database to microsoft excel sheet.
    Please let me know the different ways for doing this.
    Thanks.

    asktom.oracle.com has an excellent article on writing a PL/SQL procedure that dumps data to an Excel spreadsheet-- search for 'Excel' and it'll come up.
    You can also use your favorite connection protocol (ODBC, OLE DB, etc) to connect from Excel to Oracle and pull the data out that way.
    Justin

  • Convert report from SAP to Excel

    Hi All,
    How to convert report from SAP to Excel.Here now taking default text(.txt) format.But we want defualt taking (.xls) format only.
    Regards
    Usha

    hi usha
    u can even export the text in txt format and later right click and open with excel , u wont be able to directly import it into excel as it is not giving u any option to upload in excel directly
    Regards,
    Manish

  • Exporting Text data from PHP to Oracle CLOB data (Carriage return - issue)

    This is my original text content in PHP - Data type - Longtext
    SECTION - 1
    This a test description.This a test description.
    This a test description.This a test description.
    This a test description. This a test description.I exported the above content from PHP as a SQL script file (insert into.. ) - export.sql [ insert into table_name (id, text_content) values (1, '') ]
    while exporting data from PHP table into export file.. it replaced the "Carriage return" with "\r\n\r\n" in the insert statement for text_content column
    When I run this INSERT statement in Oracle (for longtext, I have created a CLOB column in Oracle), the following text_content data is inserted into CLOB column in Oracle.
    SECTION - 2
    This a test description.This a test description.\r\n\r\nThis a test description.This a
    test description.\r\n\r\nThis a test description.This a test description.Now I have created a item named P1_TEXT_CONTENT of type TEXTAREA and try to fetch the CLOB data into this page item.
    BUT textarea displays the entire content including "\r\n\r\n" as mentioned in SECTION - 2
    I want to display the content in textarea (item - P1_TEXT_CONTENT) without "\r\n\r\n" same as the original content with "Carriage return" as mentioned in SECTION - 1
    What are the options we have?
    Thanks,
    Deepak

    DeepakJ wrote:
    I want to display the content in textarea (item - P1_TEXT_CONTENT) without "\r\n\r\n" same as the original content with "Carriage return" as mentioned in SECTION - 1
    What are the options we have?Run an update on the Oracle table following the inserts to replace the escaped CR/LFs with real ones:
    update foo
    set clob_column = replace(clob_column, '\r\n', chr(13) || chr(10));You might want to experiment to see which characters are actually necessary. As an OS X/Linux user I'd probably just use a single LF chr(10).

  • Error while converting schema from oracle to SQL server

    Hello,
    I am getting following error while converting schema from oracle to SQL server using SSMA.
    I get Errors 1-3 while migrating procedures and error 4 while migrating a table.
    1- O2SS0050: Conversion of identifier 'SYSDATE' is not supported.
    2- O2SS0050: Conversion of identifier 'to_date(VARCHAR2, CHAR)' is not supported.
    3- O2SS0050: Conversion of identifier 'regexp_replace(VARCHAR2, CHAR)' is not supported.
    4- O2SS0486: <Primary key name> constraint is disabled in Oracle and cannot be converted because SQL Server does not support disabling of primary or unique constraint.
    Please suggest.
    Thanks.

    The exact statement in oracle side which causing this error (O2SS0050:
    Conversion of identifier 'to_date(VARCHAR2, CHAR)' is not supported.) is below:
    dStartDate:= to_date(sStartDate,'MON-YYYY');
    Statement causing error O2SS0050:
    Conversion of identifier 'regexp_replace(VARCHAR2, CHAR)' is not supported is below.
    nCount2:= length(regexp_replace(sDataRow,'[^,]'));
    So there is no statement which is using to_date(VARCHAR2,
    CHAR) and regexp_replace(VARCHAR2, CHAR) in as such. 'MON-YYYY'  and '[^,]'
    are CHAR values hence SSMA is unable to convert it from varchar2 to char.
    Regarding SYSDATE issue, you mean to put below code in target(SQL) side in SSMA ?
    dDate date := sysdate;
    Thanks.

  • Any idea why my saved documents are unable to be read? "convert file from" box pops up, applications are listed to use but if any are chosen, the file then opens but is in symbols

    When attempting to open saved documents for viewing a box pops up "convert file from" with applications that can be chosen from to use. When any of the options are chosen the document then opens but is in symbols and is unreadable. This is happening with all saved documents.  Can you offer any help with this?

    Hi,
    If you don't find any clue, you can send your file to me (guillaume.rouyreATgcosiDOTcom, replace cap) so I can give a try.
    Hope this helps,
    Guillaume Rouyre, MBA, MCP, MCTS |

  • Can I convert a from from Adobe Forms Central to a PDF Form?

    Can I convert a from from Adobe Forms Central to a PDF Form?

    Yes, you can save a FormsCentral form as a PDF form. In FormsCentral, the menu item when in design view is: File > Save as PDF Form

Maybe you are looking for