Skip to content

Instantly share code, notes, and snippets.

@bappi-d-great
Last active July 6, 2018 07:56
Show Gist options
  • Save bappi-d-great/0a98bcefa443eb756b39f68bc5605cc1 to your computer and use it in GitHub Desktop.
Save bappi-d-great/0a98bcefa443eb756b39f68bc5605cc1 to your computer and use it in GitHub Desktop.
Method: update_quiz()
<?php
$results = array(
array(
"title" => "Van",
"order" => 0,
"slug" => "Van",
"image" => "http://localhost/forminator/wp-content/uploads/2018/01/10719770_hi-222x300.jpeg",
"description" => "You better buy a VAN"
),
array(
"title" => "Sport",
"order" => 1,
"slug" => "Sport",
"image" => "http://localhost/forminator/wp-content/uploads/2018/01/10719770_hi-222x300.jpeg",
"description" => "You better get a sports car!"
),
array(
"title" => "Small car",
"order" => 2,
"slug" => "Small car",
"image" => "http://localhost/forminator/wp-content/uploads/2017/11/2-1024x576.jpg",
"description" => "You better drive a small car!"
),
);
$questions = array(
array(
"answers" => array(
array(
"title" => "Yes",
"result" => "Van",
"image" => "http://localhost/forminator/wp-content/uploads/2018/02/10776250_hi-3-222x300.jpeg"
),
array(
"title" => "No",
"result" => "Sport",
"image" => "http://localhost/forminator/wp-content/uploads/2018/02/10776250_hi-3-222x300.jpeg"
)
),
"title" => "Do you like big cars?",
"type" => "nowrong",
"slug" => "5ae18887bcd0c"
),
array(
"answers" => array(
array(
"title" => "Yes",
"result" => "Sport",
"image" => "http://localhost/forminator/wp-content/uploads/2018/02/10776250_hi-3-222x300.jpeg"
),
array(
"title" => "No",
"result" => "Small",
"image" => "http://localhost/forminator/wp-content/uploads/2018/02/10776250_hi-3-222x300.jpeg"
)
),
"title" => "Do you like fast cars?",
"type" => "nowrong",
"slug" => "5ae18887bcd22"
)
);
$settings = array(
"quiz_title" => "What's the best car for you?",
"results-behav" => "after",
"quiz_feat_image" => "http://localhost/forminator/wp-content/uploads/2017/11/2-1024x576.jpg"
);
$id = Forminator_API::update_quiz( 352, $questions, $results, $settings );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment