• Resolved allincreative

    (@allincreative)


    Hi,

    We have created a business analysis survey where clients answer a bunch of questions (with scoring). The end result is with each ‘section’ of questions, a score is given based on their answers. We were hoping to then import these into excel and chart the results to show what areas they scored highly in and what areas need work.

    Any help would be great!

    Thanks.

    The page I need help with: [log in to see the link]

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Doeke Norg

    (@doekenorg)

    Hi @allincreative,

    This plugin is first and foremost a tool to export data to xlsx instead of csv, and without the help of 3rd-party services.

    There are loads of possibilities to customize the output of the excel, but adding things like graphs and such isn’t one of them. Not sure if that is what you’re asking, but this would take way more memory and processor power than most hosts have available. Also it is highly specific to a user, so to make this part of the plugin would be next to impossible.

    I do some freelancing for questions like these, so if you are interested in that you are more than welcome to send a detailed email to [email protected]. Perhaps we can find a solution to your question then.

    If you feel like you only need the output of your excel file to be more precise, please send an export of the form (.json file, so not the entries) to [email protected], and an example what you would like the output to be. Perhaps we can go from there to see what is possible.

    Hope this helps you out.

    Kind regards,

    Doeke

    Thread Starter allincreative

    (@allincreative)

    Hi Doeke,

    No wasn’t expecting yours to graph etc.

    At the moment the export is showing the answers like ‘agree/disagree’ when I am needing it to send me the scores instead for those answers.

    Is there a way to have it export the scores rather than the labels?

    Sorry I wasn’t more clear!

    Sam

    Plugin Author Doeke Norg

    (@doekenorg)

    Ah yes. Sorry that makes more sense to me, thank you. You can change the value by using the available hooks.
    please check out gfexcel.com.

    I’ll see if I can post a more specific example tomorrow.

    Plugin Author Doeke Norg

    (@doekenorg)

    Hi @allincreative,

    Sorry for the delay. This was way harder then I imagined. Mostly because the survey field only wants to export as text. So I hacked something together for you. I’ve also added an issue / feature to my backlog to make this way easier.

    Hope this helps you out. Just add it to your functions.php. Please let me know how this works out. And happy holidays!

    add_filter('gfexcel_export_field_value_likert', function ($value, $form_id, $input_id, $entry) {
        $field = \GFAPI::get_field($form_id, $input_id);
        if (!$field instanceof \GF_Field_Likert) {
            return $value;
        }
    
        [$row, $column] = explode(':', $entry[$input_id] ?? ':');
    
        foreach ($field->choices as $choice) {
            if (($choice['value'] ?? '') === $column) {
                return $choice['score'];
            }
        }
    
        return 0; // choice not found, so value is 0
    }, 10, 4);
    Thread Starter allincreative

    (@allincreative)

    Thank you @doekenorg !!!

    This worked wonders. The only issue we have now (very small considering), is that it is adding all results in a single cell for each topic and not supplying a total score for each subject. This only means we need to manually type in and add up the scores for each before graphing. If this is too tricky to change, I am more than happy with the result so far and really appreciate you taking the time to come up with this code!

    Thank you so much.
    Hope you had a great holiday break!

    Plugin Author Doeke Norg

    (@doekenorg)

    HI @allincreative,

    Good to hear this worked out for you. Unfortunately I don’t have a solution currently for adding those values together. To make the plugin light on memory consumption any formula’s are turned off by default. Adding an extra row is possible by hooking into gfexcel_output_rows, but I don’t have the time to build this for you. So perhaps you can figure this out yourself.

    It should be possible to use that hook, figure out what columns in the row are the correct ones and keep a tally. Then after the loop you add on another row that has those totals. It will be programmatically and not actual formulas, but at least you’d have your results. Hope this helps you out.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Survey Scores Per Entry’ is closed to new replies.