URL: /wp-content/process/process-questions-sf.php
e.g. Dev: https://focusforcedev.wpengine.com/wp-content/process/process-questions-sf.php
1.) Create(POST) - create new exam question
2.) Update(PATCH) - update existing exam question
3.) Delete(DELETE) - delete existing exam question
4.) Undelete(PUT) - undelete existing exam question
Note: This response still returns 200 status code.
Valid HTTP Methods: "POST", "PATCH", "DELETE", "PUT"
Response:
{
"type_status": false,
"type_message": "[HTTP METHOD]",
"overall_status": false,
"overall_message": "Invalid HTTP Method: [HTTP METHOD]"
}
URL: /wp-content/process/process-questions-sf.php
e.g. Dev: https://focusforcedev.wpengine.com/wp-content/process/process-questions-sf.php
Method: POST
{
"question": {
"quiz_name": "Data Management - Admin",
"title": "Question: 107",
"question_text": "<span class=\"quiz-question\">G.W. Computing has a global customer base and its Salesforce Org holds over 5,000 Accounts, 15,000 Contacts and more than 20,000 Lead records. There is a persistent complaint from the VP of Sales that the information on Account...",
"question_explanation": "<span class=\"quiz-answer\"><em>D&B Optimizer (Data.com clean's replacement) is an effective way to validate and update the Leads, Accounts, & Contact information. Manually finding the latest information for that many accounts, contacts, and leads would be a very time consuming and cumbersome project. Data Loader is not used for validating data...",
"question_type": "single",
"category_name": "Data Management",
"choice1": "The Salesforce Administrator should find the latest information of every record and update it.TESTING",
"choice2": "The Salesforce Administrator should use Data Loader to validate the information of each record. ANOTHER TEST",
"choice3": "The Salesforce Administrator should validate the information with D&B Optimizer and update every Lead, Account, Contact record with that information.",
"choice4": "This is a cumbersome task and the Salesforce Administrator cannot do anything about it.",
"correctanswer": "3"
}
}
{
"type_status": true,
"type_message": "New",
"quiz_status": true,
"quiz_message": "Quiz with Id 38 found",
"category_status": true,
"category_message": "Category with Id 8 found",
"overall_status": true,
"overall_message": "New Question 107 successfully created with Id 14249"
}
Note: All this responses still returns 200 status code.
1.) Question title already exist: "title"
Response:
{
"type_status": true,
"type_message": "New",
"quiz_status": true,
"quiz_message": "Quiz with Id 38 found",
"overall_status": false,
"overall_message": "New question not created since Question 100 already exists"
}
2.) Invalid category name value or parameter not found: "category_name"
Response:
{
"type_status": true,
"type_message": "New",
"quiz_status": true,
"quiz_message": "Quiz with Id 38 found",
"category_status": false,
"category_message": "Category not found: Data Management Copy",
"overall_status": false,
"overall_message": "New question not created"
}
3.) Invalid quiz name value or parameter not found: "quiz_name"
Response:
{
"type_status": true,
"type_message": "New",
"quiz_status": false,
"quiz_message": "Quiz Id not found",
"category_status": true,
"category_message": "Category with Id 8 found",
"overall_status": false,
"overall_message": "New question not created"
}
4.) Error occured using learndash classes and methods.
Response:
{
"type_status": true,
"type_message": "New",
"quiz_status": true,
"quiz_message": "Quiz with Id 38 found",
"category_status": true,
"category_message": "Category with Id 8 found",
"overall_status": false,
"overall_message": "New question not created, error found on ld classes and methods"
}
URL: /wp-content/process/process-questions-sf.php
e.g. Dev: https://focusforcedev.wpengine.com/wp-content/process/process-questions-sf.php
Method: PATCH
{
"question": {
"quiz_name": "Data Management - Admin",
"title": "Question: 107",
"question_text": "<span class=\"quiz-question\">G.W. Computing has a global customer base and its Salesforce Org holds over 5,000 Accounts, 15,000 Contacts and more than 20,000 Lead records. There is a persistent complaint from the VP of Sales that the information on Account...",
"question_explanation": "<span class=\"quiz-answer\"><em>D&B Optimizer (Data.com clean's replacement) is an effective way to validate and update the Leads, Accounts, & Contact information. Manually finding the latest information for that many accounts, contacts, and leads would be a very time consuming and cumbersome project. Data Loader is not used for validating data...",
"question_type": "single",
"category_name": "Data Management",
"choice1": "The Salesforce Administrator should find the latest information of every record and update it.TESTING",
"choice2": "The Salesforce Administrator should use Data Loader to validate the information of each record. ANOTHER TEST",
"choice3": "The Salesforce Administrator should validate the information with D&B Optimizer and update every Lead, Account, Contact record with that information.",
"choice4": "This is a cumbersome task and the Salesforce Administrator cannot do anything about it.",
"correctanswer": "3"
}
}
{
"type_status": true,
"type_message": "Update",
"quiz_status": true,
"quiz_message": "Quiz with Id 38 found",
"category_status": true,
"category_message": "Category with Id 8 found",
"overall_status": true,
"overall_message": "Question: 100 in Quiz 38 has been updated"
}
Note: All this responses still returns 200 status code.
1.) Invalid quiz name value or parameter not found: "quiz_name"
Response:
{
"type_status": true,
"type_message": "Update",
"quiz_status": false,
"quiz_message": "Quiz Id not found",
"category_status": true,
"category_message": "Category with Id 8 found",
"overall_status": false,
"overall_message": "No updates made to this question in Quiz "
}
2.) Invalid category name value or parameter not found: "category_name"
Response:
{
"type_status": true,
"type_message": "Update",
"quiz_status": false,
"quiz_message": "Quiz Id not found",
"category_status": false,
"category_message": "Category not found: Data Management Copy",
"overall_status": false,
"overall_message": "No updates made to this question in Quiz "
}
3.) Parameter choices not found: "choice1, choice2..."
Response:
{
"type_status": true,
"type_message": "Update",
"quiz_status": true,
"quiz_message": "Quiz with Id 38 found",
"choices_status": false,
"choices_message": "Choices not found",
"category_status": true,
"category_message": "Category with Id 8 found",
"overall_status": false,
"overall_message": "No updates made to this question in Quiz 38"
}
4.) Invalid question type value or parameter not found: "question_type"
Valid question type values: "single" or "multiple"
Response:
{
"type_status": true,
"type_message": "Update",
"quiz_status": true,
"quiz_message": "Quiz with Id 38 found",
"category_status": true,
"category_message": "Category with Id 8 found",
"question_type_status": false,
"question_type_message": "Invalid Question Type",
"overall_status": false,
"overall_message": "No updates made to this question in Quiz 38"
}
URL: /wp-content/process/process-questions-sf.php
e.g. Dev: https://focusforcedev.wpengine.com/wp-content/process/process-questions-sf.php
Method: DELETE
{
"question": {
"quiz_name": "Data Management - Admin",
"title": "Question: 105"
}
}
{
"overall_status": true,
"overall_message": "Question Question: 105 sucessfully deleted"
}
Note: All this responses still returns 200 status code.
1.) Invalid quiz title value or parameter not found: "title"
Response:
{
"overall_status": false,
"overall_message": "Question 900 does not exist"
}
2.) Question is already deleted.
Response:
{
"overall_status": true,
"overall_message": "Question 105 already deleted"
}
3.) Error occured executing the update query.
Response:
{
"overall_status": false,
"overall_message": "Question not deleted, there's an error executing the query"
}
URL: /wp-content/process/process-questions-sf.php
e.g. Dev: https://focusforcedev.wpengine.com/wp-content/process/process-questions-sf.php
Method: PUT
{
"question": {
"is_undelete": 1,
"quiz_name": "Data Management - Admin",
"title": "Question: 105"
}
}
{
"overall_status": true,
"overall_message": "Question 105 sucessfully undeleted"
}
Note: All this responses still returns 200 status code.
1.) Invalid quiz title value or parameter not found: "title"
Response:
{
"overall_status": false,
"overall_message": "Question 900 does not exist"
}
2.) Question is already deleted.
Response:
{
"overall_status": true,
"overall_message": "Question 105 already undeleted"
}
3.) Error occurred executing the update query.
Response:
{
"overall_status": false,
"overall_message": "Question not undeleted, there's an error executing the query"
}