Skip to content

Commit

Permalink
Fixed issue #10886: Export to XML: question type List Radio not exported
Browse files Browse the repository at this point in the history
correctly
  • Loading branch information
olleharstedt committed Apr 21, 2016
1 parent d2faa20 commit fcd576c
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion application/core/plugins/ExportSTATAxml/STATAxmlWriter.php
Expand Up @@ -439,6 +439,17 @@ protected function updateCustomresponsemap()
case "D": //replace in customResponsemap: date/time as string with STATA-timestamp
$response = strtotime($response . ' GMT') * 1000 + 315619200000; // convert seconds since 1970 (UNIX) to milliseconds since 1960 (STATA)
break;
case "L":
// For radio lists, user wants code, not label
// TODO: We could skip this loop if we had answer code
foreach ($this->customFieldmap['answers'][$iQID][$iScaleID] as $answer) {
if ($answer['answer'] == $response)

This comment has been minimized.

Copy link
@olleharstedt

olleharstedt Jul 10, 2023

Author Contributor

This breaks for a customer.

{
$response = $answer['code'];
break;
}
}
break;
}

/* look at each of the responses and determine STATA data type and format of the respective variables
Expand Down Expand Up @@ -701,4 +712,4 @@ public function close()

fclose($this->handle);
}
}
}

0 comments on commit fcd576c

Please sign in to comment.