From 4bba773a596af41e82920b80c47ecc8c1b9a9cbd Mon Sep 17 00:00:00 2001 From: Jason Qiu Date: Thu, 23 Mar 2023 23:23:19 +0800 Subject: [PATCH] [#12081] Modify question headers for instructor (#12228) * Modify question headers in instructor edit sessions page * Fix tests * Fix e2e tests --- .../InstructorFeedbackEditPage.java | 3 +- .../question-edit-form.component.spec.ts.snap | 29 ++-- .../question-edit-form.component.html | 20 +-- .../question-edit-form.component.scss | 5 + .../visibility-panel.component.html | 2 +- ...r-session-edit-page.component.spec.ts.snap | 139 +++++++++++------- 6 files changed, 124 insertions(+), 74 deletions(-) diff --git a/src/e2e/java/teammates/e2e/pageobjects/InstructorFeedbackEditPage.java b/src/e2e/java/teammates/e2e/pageobjects/InstructorFeedbackEditPage.java index 5761bbe5e39..4ada9f7d5a0 100644 --- a/src/e2e/java/teammates/e2e/pageobjects/InstructorFeedbackEditPage.java +++ b/src/e2e/java/teammates/e2e/pageobjects/InstructorFeedbackEditPage.java @@ -972,8 +972,7 @@ private WebElement getQuestionForm(int questionNum) { } private FeedbackQuestionType getQuestionType(int questionNum) { - String questionDetails = getQuestionForm(questionNum).findElement(By.id("question-header")).getText(); - String questionType = questionDetails.split(" \\d+ ")[1].trim(); + String questionType = getQuestionForm(questionNum).findElement(By.id("question-type")).getText().trim(); switch (questionType) { case "Essay question": diff --git a/src/web/app/components/question-edit-form/__snapshots__/question-edit-form.component.spec.ts.snap b/src/web/app/components/question-edit-form/__snapshots__/question-edit-form.component.spec.ts.snap index 0ea572bda1e..9df6a672596 100644 --- a/src/web/app/components/question-edit-form/__snapshots__/question-edit-form.component.spec.ts.snap +++ b/src/web/app/components/question-edit-form/__snapshots__/question-edit-form.component.spec.ts.snap @@ -32,8 +32,8 @@ exports[`QuestionEditFormComponent should snap with default view 1`] = ` class="card" id="question-form-0" > -
- - Question +
+

+ Question + + 0 + +

- 0 + Essay question -
- Essay question +
- +
-
+
- +
diff --git a/src/web/app/components/question-edit-form/question-edit-form.component.scss b/src/web/app/components/question-edit-form/question-edit-form.component.scss index 86bf5ea0206..297cdb9a467 100644 --- a/src/web/app/components/question-edit-form/question-edit-form.component.scss +++ b/src/web/app/components/question-edit-form/question-edit-form.component.scss @@ -6,6 +6,11 @@ margin-right: 5px; } +.question-number { + font-size: .875rem; + margin-bottom: 0; +} + .background-color-light-blue { background-color: #EAEFF5; } diff --git a/src/web/app/components/visibility-panel/visibility-panel.component.html b/src/web/app/components/visibility-panel/visibility-panel.component.html index da00ba78ae6..507aa2bf6d7 100644 --- a/src/web/app/components/visibility-panel/visibility-panel.component.html +++ b/src/web/app/components/visibility-panel/visibility-panel.component.html @@ -1,7 +1,7 @@
-
Changing the visibility after collecting responses is not recommended.
+

Changing the visibility after collecting responses is not recommended.

Reason: The existing responses were submitted under the 'promise' of a certain visibility and changing the visibility later 'breaks' that promise.

Visibility (Who can see the responses?) diff --git a/src/web/app/pages-instructor/instructor-session-edit-page/__snapshots__/instructor-session-edit-page.component.spec.ts.snap b/src/web/app/pages-instructor/instructor-session-edit-page/__snapshots__/instructor-session-edit-page.component.spec.ts.snap index 2a6f8282d83..570cfed8651 100644 --- a/src/web/app/pages-instructor/instructor-session-edit-page/__snapshots__/instructor-session-edit-page.component.spec.ts.snap +++ b/src/web/app/pages-instructor/instructor-session-edit-page/__snapshots__/instructor-session-edit-page.component.spec.ts.snap @@ -1280,8 +1280,8 @@ exports[`InstructorSessionEditPageComponent should snap with feedback session qu class="card" id="question-form-1" > -
- - Question - - + + - 2 - - - Essay question + Essay question + +
-
+
-
- - Question - - + + - 2 - - - Essay question + Essay question + +
-
+
-
- - Question - - - Essay question + Question + + + + Essay question + +
-
+