{"id":193,"date":"2024-08-21T12:52:47","date_gmt":"2024-08-21T11:52:47","guid":{"rendered":"https:\/\/ogbomoso.ng\/engage\/?page_id=193"},"modified":"2025-01-31T06:12:14","modified_gmt":"2025-01-31T06:12:14","slug":"insight","status":"publish","type":"page","link":"https:\/\/ogbomoso.ng\/engage\/insight\/","title":{"rendered":"Digital Ogbomoso  insight survey"},"content":{"rendered":"<h3>Digital Ogbomoso &#8211; insight survey<\/h3>\n<p>To develop a successful strategy to make Ogbomoso a technology and innovation hub, we need to collect a wide range of data. This data will help us assess current state, identify gaps and develop targeted strategies to support planning and implementation of digital initiatives.<\/p>\n<p>Please provide responses to the questions below to help us with our objective. It should take you no more than 16.5 minutes to complete the entire survey.<\/p>\n<p>Thank you.<\/p>\n        <div class=\"wp-sjs-plugin\" id=\"surveyContainer-2\">\r\n            <div id=\"surveyElement-2\">Survey is loading...<\/div>\r\n            <div id=\"surveyResult-2\"><\/div>\r\n        <\/div>\r\n        <script>\r\n            jQuery.ajax({\r\n                url:  \"https:\/\/ogbomoso.ng\/engage\/wp-admin\/admin-ajax.php?action=SurveyJS_GetSurveyJson\",\r\n                type: \"POST\",\r\n                data: { Id: 2, _wpnonce: '81ebca0a52' },\r\n                success: function (data) {\r\n                    var json = {}\r\n                    let theme;\r\n                    if (data.json) {\r\n                        json = JSON.parse(data.json.replace(\/\\\\\\\"\/g, \"\\\"\").replace(\/\\\\\\\\\/g, \"\\\\\").replace(\/\\\\'\/g, \"'\"));\r\n                    }\r\n                    if (data.theme) {\r\n                        theme = JSON.parse(data.theme.replace(\/\\\\\\\"\/g, \"\\\"\").replace(\/\\\\\\\\\/g, \"\\\\\").replace(\/\\\\'\/g, \"'\"));\r\n                    } else {\r\n                        theme = null\r\n                    }\r\n                    jQuery(document).ready(()=>{\r\n                        initSurvey2(json, theme);\r\n                    });\r\n                }\r\n            });\r\n\r\n            function initSurvey2(json, theme) {\r\n                const survey2 = new Survey.Model(json);\r\n                if (!!theme) {\r\n                    survey2.applyTheme(theme);\r\n                }\r\n                window.survey2 = survey2;               \r\n                survey2                    .onComplete\r\n                    .add(function (sender, options) {\r\n                        options.showSaveInProgress();\r\n                        jQuery.ajax({\r\n                            url:  \"https:\/\/ogbomoso.ng\/engage\/wp-admin\/admin-ajax.php?action=SurveyJS_SaveResult\",\r\n                            type: \"POST\",\r\n                    data: { SurveyId: '2', Json : JSON.stringify(sender.data), _wpnonce: '9e1ff1694f' },\r\n                            success: function (data) {options.showSaveSuccess();},\r\n                            error: function (xhr) {options.showSaveError(xhr.responseText);}\r\n                        });\r\n                        \/\/document\r\n                        \/\/    .querySelector(\"#surveyResult-2\")\r\n                        \/\/    .innerHTML = \"result: \" + JSON.stringify(sender.data);\r\n                    });\r\n\r\n                survey2.onUploadFiles.add((_, options) => {\r\n                    const formData = new FormData();\r\n                    options.files.forEach((file) => {\r\n                        formData.append(file.name, file);\r\n                    });\r\n                formData.append(\"_wpnonce\", \"95cbe91917\");\r\n\r\n                    fetch(\"https:\/\/ogbomoso.ng\/engage\/wp-admin\/admin-ajax.php?action=SurveyJS_UploadFiles\", {\r\n                        method: \"POST\",\r\n                        body: formData\r\n                    })\r\n                        .then((response) => response.json())\r\n                        .then((data) => {\r\n                            options.callback(\r\n                                options.files.map((file) => {\r\n                                    return {\r\n                                        file: file,\r\n                                        content: data[file.name]\r\n                                    };\r\n                                })\r\n                            );\r\n                        })\r\n                        .catch((error) => {\r\n                            console.error(\"Error: \", error);\r\n                            options.callback([], [ 'An error occurred during file upload.' ]);\r\n                        });\r\n                });\r\n\r\n                function deleteFile(fileURL, options) {\r\n                    try {\r\n                        const deleteFileBaseUrl = \"https:\/\/ogbomoso.ng\/engage\/wp-admin\/admin-ajax.php?action=SurveyJS_DeleteFile&#038;_wpnonce=9ccf26f7fa\";\r\n                        const apiUrl = `${deleteFileBaseUrl}&name=${encodeURIComponent(fileURL)}`;\r\n                        fetch(apiUrl);\r\n                    } catch (error) {\r\n                        options.callback(\"error\");\r\n                    }\r\n                }\r\n\r\n                survey2.onClearFiles.add((_, options) => {\r\n                    if (!options.value || options.value.length === 0) {\r\n                        options.callback(\"success\");\r\n                        return;\r\n                    }\r\n\r\n                    if (!options.fileName && !!options.value) {\r\n                        for (const item of options.value) {\r\n                            deleteFile(item.content, options);\r\n                        }\r\n                    } else {\r\n                        const fileToRemove = options.value.find(\r\n                            (item) => item.name === options.fileName\r\n                        );\r\n                        if (fileToRemove) {\r\n                            deleteFile(fileToRemove.content, options);\r\n                        } else {\r\n                            console.error(`File with name ${options.fileName} is not found`);\r\n                        }\r\n                    }\r\n                    options.callback(\"success\");\r\n                });\r\n\r\n                jQuery(\"#surveyElement-2\").Survey({model: survey2\/*, css: customCss*\/});\r\n            }\r\n        <\/script>        \r\n        \n","protected":false},"excerpt":{"rendered":"<p>Digital Ogbomoso &#8211; insight survey To develop a successful strategy to make Ogbomoso a technology and innovation hub, we need to collect a wide range of data. This data will help us assess current state, identify gaps and develop targeted strategies to support planning and implementation of digital initiatives. Please provide responses to the questions &#8230; <a title=\"Digital Ogbomoso  insight survey\" class=\"read-more\" href=\"https:\/\/ogbomoso.ng\/engage\/insight\/\" aria-label=\"Read more about Digital Ogbomoso  insight survey\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":211,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"open","template":"","meta":{"footnotes":""},"class_list":["post-193","page","type-page","status-publish","has-post-thumbnail"],"_links":{"self":[{"href":"https:\/\/ogbomoso.ng\/engage\/wp-json\/wp\/v2\/pages\/193","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ogbomoso.ng\/engage\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/ogbomoso.ng\/engage\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/ogbomoso.ng\/engage\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ogbomoso.ng\/engage\/wp-json\/wp\/v2\/comments?post=193"}],"version-history":[{"count":8,"href":"https:\/\/ogbomoso.ng\/engage\/wp-json\/wp\/v2\/pages\/193\/revisions"}],"predecessor-version":[{"id":328,"href":"https:\/\/ogbomoso.ng\/engage\/wp-json\/wp\/v2\/pages\/193\/revisions\/328"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ogbomoso.ng\/engage\/wp-json\/wp\/v2\/media\/211"}],"wp:attachment":[{"href":"https:\/\/ogbomoso.ng\/engage\/wp-json\/wp\/v2\/media?parent=193"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}