コード例 #1
0
  @Override
  public void testEditQuestionAction() throws Exception {
    ______TS("NUMSCALE: edit question success");

    feedbackEditPage.clickEditQuestionButton(1);
    feedbackEditPage.fillEditQuestionBox("edited numscale qn text", 1);
    feedbackEditPage.fillEditQuestionDescription("more details", 1);
    feedbackEditPage.fillMinNumScaleBox(3, 1);
    feedbackEditPage.fillMaxNumScaleBox(4, 1);
    feedbackEditPage.fillStepNumScaleBox(0.002, 1);
    assertEquals(
        "[Based on the above settings, acceptable responses are: 3, 3.002, 3.004, ..., 3.996, 3.998, 4]",
        feedbackEditPage.getNumScalePossibleValuesString(1));
    feedbackEditPage.clickSaveExistingQuestionButton(1);
    feedbackEditPage.verifyStatus(Const.StatusMessages.FEEDBACK_QUESTION_EDITED);

    feedbackEditPage.verifyHtmlMainContent("/instructorFeedbackNumScaleQuestionEditSuccess.html");
  }
コード例 #2
0
  @Override
  public void testEditQuestionAction() throws Exception {
    ______TS("RUBRIC: edit question success");

    // Click edit button
    feedbackEditPage.clickEditQuestionButton(1);

    // Check that fields are editable
    feedbackEditPage.verifyHtmlMainContent("/instructorFeedbackRubricQuestionEdit.html");

    feedbackEditPage.fillEditQuestionBox("edited RUBRIC qn text", 1);
    feedbackEditPage.fillEditQuestionDescription("more details", 1);
    feedbackEditPage.clickSaveExistingQuestionButton(1);
    feedbackEditPage.verifyStatus(Const.StatusMessages.FEEDBACK_QUESTION_EDITED);

    // Check question text is updated
    feedbackEditPage.verifyHtmlMainContent("/instructorFeedbackRubricQuestionEditSuccess.html");

    ______TS("RUBRIC: edit sub-questions success");
    feedbackEditPage.clickEditQuestionButton(1);

    // Edit sub-question for row 1
    feedbackEditPage.fillRubricSubQuestionBox("New(0) sub-question text", 1, 0);

    // Add new sub-question
    feedbackEditPage.clickAddRubricRowLink(1);
    feedbackEditPage.fillRubricSubQuestionBox("New(1) sub-question text", 1, 2);

    // Remove existing sub-questions
    feedbackEditPage.clickRemoveRubricRowLinkAndConfirm(1, 0);
    feedbackEditPage.clickRemoveRubricRowLinkAndConfirm(1, 1);

    // Add new sub-question
    feedbackEditPage.clickAddRubricRowLink(1);
    feedbackEditPage.fillRubricSubQuestionBox("New(2) sub-question text", 1, 3);

    // Remove new sub-question
    feedbackEditPage.clickRemoveRubricRowLinkAndConfirm(1, 2);

    // Should end up with 1 question

    feedbackEditPage.clickSaveExistingQuestionButton(1);
    feedbackEditPage.verifyHtmlMainContent(
        "/instructorFeedbackRubricQuestionEditSubQuestionSuccess.html");

    ______TS("RUBRIC: edit choices success");
    feedbackEditPage.clickEditQuestionButton(1);

    // Edit choice for col 1
    feedbackEditPage.fillRubricChoiceBox("New(0) choice", 1, 0);

    // Add new choice
    feedbackEditPage.clickAddRubricColLink(1);
    feedbackEditPage.fillRubricChoiceBox("New(1) choice", 1, 4);

    // Remove existing choice
    feedbackEditPage.clickRemoveRubricColLinkAndConfirm(1, 0);

    // Add new choice
    feedbackEditPage.clickAddRubricColLink(1);
    feedbackEditPage.fillRubricChoiceBox("New(2) choice", 1, 5);

    // Remove new choice
    feedbackEditPage.clickRemoveRubricColLinkAndConfirm(1, 4);

    // Should end up with 4 choices, including (1) and (2)

    feedbackEditPage.clickSaveExistingQuestionButton(1);
    feedbackEditPage.verifyHtmlMainContent(
        "/instructorFeedbackRubricQuestionEditChoiceSuccess.html");

    ______TS("RUBRIC: edit weight success");
    feedbackEditPage.clickEditQuestionButton(1);

    // Edit the weight of the first choice
    feedbackEditPage.clickAssignWeightsCheckbox(1);
    feedbackEditPage.fillRubricWeightBox("2.25", 1, 0);

    feedbackEditPage.clickSaveExistingQuestionButton(1);
    feedbackEditPage.verifyHtmlMainContent(
        "/instructorFeedbackRubricQuestionEditWeightSuccess.html");

    ______TS("RUBRIC: edit descriptions success");
    feedbackEditPage.clickEditQuestionButton(1);

    // Edit description for 0-0
    feedbackEditPage.fillRubricDescriptionBox("New(0) description", 1, 0, 0);

    // Edit description for a new row, to test if the js generated html works.
    feedbackEditPage.clickAddRubricRowLink(1);
    feedbackEditPage.fillRubricSubQuestionBox("New sub-question text", 1, 1);

    feedbackEditPage.fillRubricDescriptionBox("New(1) description", 1, 1, 0);

    // Should end up with 2 rubric descriptions, (0) and (1)

    feedbackEditPage.clickSaveExistingQuestionButton(1);

    feedbackEditPage.verifyHtmlMainContent(
        "/instructorFeedbackRubricQuestionEditDescriptionSuccess.html");
  }