Hello all

I have similar code that is working but in this field the values are not being calculated. Do you see any errors?

$test = array (
'Yes' => 1,
'No' => 2,
'N/A' => -1,
);

$q1 = $test[$node->field_question1[0]['value']];
$q2 = $test[$node->field_question2[0]['value']];
$q3 = $test[$node->field_question3[0]['value']];
$q4 = $test[$node->field_question4[0]['value']];

$result = $q1 + $q2 + $q3 + $q4 / 4 * 100;
$node_field[0]['value'] = $result

Using the devel module i see :

field_result_total (Array, 1 element)
+
0 (Array, 1 element)
#
value (String, 0 characters )

Thanks

l

Comments

linuxpimp’s picture

Bump....