Combination Gravity forms + Quiz add-on.
Desired operation:
- start Quiz;
- process different scores combined in PHP in the meantime;
- store these intermediate scores in different hidden fields;
- return the different individual calculated results {:<field_id>};
- …
What doesn’t work (example ID):
$_POST[“input_26”] does not return the score value but a kind of hash.
Example code:
In order to calculate interim scores, I try to lend the results of different radio buttons in PHP, for example:
add_filter(“gform_pre_submission_4”, “wmd_evaluate_results”);
function wmd_evaluate_results($form)
{
$total = 0;
// add the values of selected results
$total += $_POST["input_26"];
$total += $_POST["input_65"];
$total += $_POST["input_64"];
// set the value of the hidden field
$_POST["input_67"] = $total;
}
Instead of a score value I get a hash as result, for expample: gquiz261fcfa040
Help…?