fix issue editing questions in question banks

fixes CNVS-11006

test plan:
  - as a teacher
    - create a question bank with more than 50 questions
    - edit a question
    - it should successfully edit the question without adding a new question
      to the bank
  - do a regression test around creating and editing questions both in and
    outside of question banks

Change-Id: Iba765cf3b5c5b2687a012e44592e47d8e3ec6716
Reviewed-on: https://gerrit.instructure.com/40260
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Josh Simpson <jsimpson@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Product-Review: Derek DeVries <ddevries@instructure.com>
This commit is contained in:
Derek DeVries 2014-08-28 23:44:40 -06:00
parent 26e7d708b7
commit ed6acb3e83
1 changed files with 11 additions and 0 deletions

View File

@ -2841,6 +2841,17 @@ define([
$question.find(".question_points").text(questionData.points_possible);
quiz.updateDisplayQuestion($question.find(".display_question"), questionData, true);
if ($teaser.hasClass('to_edit')) {
// we need to explicity set our quiz variables in the dom
// or this appears to be adding a new question instead of editing
var ques = $question.find(".question");
var link = $question.find("a.update_question_url");
var qId = $question.find(".assessment_question_id")
var href = link.attr('href');
ques.attr("id", "question_" + question_data.id);
link.attr("href", href.replace(/ions\/.*/, "ions/" + question_data.id));
qId.html(question_data.id);
$question.find(".edit_question_link").click();
}
}