AnsweredAssumed Answered

Unable to add question in quiz using API

Question asked by PJ QA on Nov 24, 2016
Latest reply on Nov 28, 2016 by PJ

I am trying to add question in a quiz using API but every time i am getting the same response. The data i am sending is not getting reflected and in response i am getting default values.

 

below is the details,

 

URL: /api/v1/courses/5/quizzes/348/questions

REQUEST:

{

  "question": {

    "question_name": "Question: 1",

    "question_text": "Question: 1",

    "quiz_group_id": 5,

    "question_type": "multiple_choice_question",

    "position": 1,

    "points_possible": 1,

    "answers": [

      {

        "answer_text": "Option: 1",

        "answer_weight": 100

      },

      {

        "answer_text": "Option: 2",

        "answer_weight": 0

      },

      {

        "answer_text": "Option: 3",

        "answer_weight": 0

      },

      {

        "answer_text": "Option: 4",

        "answer_weight": 0

      }

    ]

  }

}

RESPONSE:

{

  "id": 979,

  "quiz_id": 348,

  "quiz_group_id": null,

  "assessment_question_id": null,

  "position": 13,

  "question_name": "Question",

  "question_type": "text_only_question",

  "question_text": "Question text",

  "points_possible": 0,

  "correct_comments": "",

  "incorrect_comments": "",

  "neutral_comments": "",

  "correct_comments_html": "",

  "incorrect_comments_html": "",

  "neutral_comments_html": "",

  "answers": [],

  "variables": null,

  "formulas": null,

  "answer_tolerance": null,

  "formula_decimal_places": null,

  "matches": null,

  "matching_answer_incorrect_matches": null,

  "assessment_question": null

}

 

Please suggest. Thanks in advance !!

URL: /api/v1/courses/5/quizzes/348/questions

REQUEST:

{

  "question": {

    "question_name": "Question: 1",

    "question_text": "Question: 1",

    "quiz_group_id": 5,

    "question_type": "multiple_choice_question",

    "position": 1,

    "points_possible": 1,

    "answers": [

      {

        "answer_text": "Option: 1",

        "answer_weight": 100

      },

      {

        "answer_text": "Option: 2",

        "answer_weight": 0

      },

      {

        "answer_text": "Option: 3",

        "answer_weight": 0

      },

      {

        "answer_text": "Option: 4",

        "answer_weight": 0

      }

    ]

  }

}

RESPONSE:

{

  "id": 979,

  "quiz_id": 348,

  "quiz_group_id": null,

  "assessment_question_id": null,

  "position": 13,

  "question_name": "Question",

  "question_type": "text_only_question",

  "question_text": "Question text",

  "points_possible": 0,

  "correct_comments": "",

  "incorrect_comments": "",

  "neutral_comments": "",

  "correct_comments_html": "",

  "incorrect_comments_html": "",

  "neutral_comments_html": "",

  "answers": [],

  "variables": null,

  "formulas": null,

  "answer_tolerance": null,

  "formula_decimal_places": null,

  "matches": null,

  "matching_answer_incorrect_matches": null,

  "assessment_question": null

}

Outcomes