- Posts: 112
- Thank you received: 6
Ask the community, share ideas, and connect with other LimeSurvey users!
// Print out the value labels! echo "VALUE LABELS {$field['id']}\n"; $i = 0; foreach ($answers as $answer) { $i++; if ($field['SPSStype'] == "F" && isNumericExtended($answer['code'])) { $str = "{$answer['code']}"; } else { $str = "\"{$answer['code']}\""; } // If multi-choice, use variable label as value label $title = $field['VariableLabel']; preg_match("/\[(.*)\]/", $title , $matches); $valueLabel = $matches[1]; if ($i < count($answers)) { echo ($field['LStype'] == "M" ? " $str \"{$valueLabel}\"\n" : " $str \"{$answer['value']}\"\n"); } else { if ($field['LStype']=="M") { echo ($answer['code'] == 0 ? ".\n" : " $str \"{$valueLabel}\".\n"); } else { echo " $str \"{$answer['value']}\".\n"; } } }
// Untested code foreach ($fields as $field) { if $field['LStype'] == "M" { echo 'replace(' . $field['title'] . '),0,"")'. } }
Still, every update can overwrite this file. So either you won't update anymore or you check before every update if there have been any changes to this file. So there is always this risk. If you update manually, then you can always do this, but I guess it would be probably better if this would be adapted in the LS base, wouldn't it? I assume that this might be interesting for others that use SPSS as well.Looking at previous builds, this particular code seems unchanged since as far back as 2.0 and maybe earlier