From 38219912a884dcd15a6fdfafd68b04749342ef32 Mon Sep 17 00:00:00 2001 From: jasonqiu212 Date: Mon, 20 Mar 2023 13:59:50 +0800 Subject: [PATCH 1/3] Modify question headers in instructor edit sessions page --- .../question-edit-form.component.spec.ts.snap | 29 ++-- .../question-edit-form.component.html | 22 +-- .../question-edit-form.component.scss | 5 + .../visibility-panel.component.html | 2 +- ...r-session-edit-page.component.spec.ts.snap | 139 +++++++++++------- 5 files changed, 124 insertions(+), 73 deletions(-) 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..de4cc46e924 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..a41b52ccdf5 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-details { + font-size: 0.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 b70c62d8fd4..514455113e2 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 @@ -1225,8 +1225,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 + +
-
+
Date: Mon, 20 Mar 2023 15:15:28 +0800 Subject: [PATCH 2/3] Fix tests --- .../question-edit-form.component.spec.ts.snap | 8 +++---- .../question-edit-form.component.html | 8 +++---- .../question-edit-form.component.scss | 4 ++-- ...r-session-edit-page.component.spec.ts.snap | 24 +++++++------------ 4 files changed, 18 insertions(+), 26 deletions(-) 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 de4cc46e924..28b29136543 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 @@ -49,14 +49,14 @@ exports[`QuestionEditFormComponent should snap with default view 1`] = `

Question

- + Essay question
diff --git a/src/web/app/components/question-edit-form/question-edit-form.component.html b/src/web/app/components/question-edit-form/question-edit-form.component.html index bf7e6ae3ee5..76fc4954580 100644 --- a/src/web/app/components/question-edit-form/question-edit-form.component.html +++ b/src/web/app/components/question-edit-form/question-edit-form.component.html @@ -3,17 +3,17 @@
-
+
-

Question {{ model.questionNumber }}  +

Question {{ model.questionNumber }} 

- {{ model.questionType | questionTypeName }} + {{ model.questionType | questionTypeName }}
-
{{ model.questionBrief }}
+
{{ model.questionBrief }}
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 a41b52ccdf5..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,8 +6,8 @@ margin-right: 5px; } -.question-details { - font-size: 0.875rem; +.question-number { + font-size: .875rem; margin-bottom: 0; } 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 514455113e2..1b1f7938c03 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 @@ -1242,14 +1242,14 @@ exports[`InstructorSessionEditPageComponent should snap with feedback session qu

Question

- + Essay question
@@ -1961,14 +1959,14 @@ exports[`InstructorSessionEditPageComponent should snap with feedback session qu

Question

- + Essay question
@@ -3802,14 +3798,14 @@ exports[`InstructorSessionEditPageComponent should snap with new question added

Question

- + Essay question
From 9d38b07db070d92e3a4eefc2246184fca33f994d Mon Sep 17 00:00:00 2001 From: jasonqiu212 Date: Thu, 23 Mar 2023 22:42:05 +0800 Subject: [PATCH 3/3] Fix e2e tests --- .../InstructorFeedbackEditPage.java | 3 +-- .../question-edit-form.component.spec.ts.snap | 8 +++++--- .../question-edit-form.component.html | 4 ++-- ...or-session-edit-page.component.spec.ts.snap | 18 ++++++++++++------ 4 files changed, 20 insertions(+), 13 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 28b29136543..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 @@ -56,16 +56,18 @@ exports[`QuestionEditFormComponent should snap with default view 1`] = ` class="d-flex flex-sm-row flex-column align-items-sm-center align-items-start" >

Question - 0  + 0

- + Essay question
diff --git a/src/web/app/components/question-edit-form/question-edit-form.component.html b/src/web/app/components/question-edit-form/question-edit-form.component.html index 76fc4954580..0f1e5e2e8c6 100644 --- a/src/web/app/components/question-edit-form/question-edit-form.component.html +++ b/src/web/app/components/question-edit-form/question-edit-form.component.html @@ -5,12 +5,12 @@
-

Question {{ model.questionNumber }}  +

Question {{ model.questionNumber }}

- {{ model.questionType | questionTypeName }} + {{ model.questionType | questionTypeName }}
{{ model.questionBrief }}
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 1b1f7938c03..0125cd02c30 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 @@ -1249,7 +1249,7 @@ exports[`InstructorSessionEditPageComponent should snap with feedback session qu class="d-flex flex-sm-row flex-column align-items-sm-center align-items-start" >

Question

- + Essay question
@@ -1966,7 +1968,7 @@ exports[`InstructorSessionEditPageComponent should snap with feedback session qu class="d-flex flex-sm-row flex-column align-items-sm-center align-items-start" >

Question

- + Essay question
@@ -3805,7 +3809,7 @@ exports[`InstructorSessionEditPageComponent should snap with new question added class="d-flex flex-sm-row flex-column align-items-sm-center align-items-start" >

Question

- + Essay question