Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#12081] Modify question headers for instructor #12228

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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":
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ exports[`QuestionEditFormComponent should snap with default view 1`] = `
class="card"
id="question-form-0"
>
<div
class="card-header bg-primary text-white cursor-pointer"
<button
class="card-header bg-primary text-white cursor-pointer border-0"
>
<div
class="collapse-caret"
Expand All @@ -49,17 +49,28 @@ exports[`QuestionEditFormComponent should snap with default view 1`] = `
</tm-panel-chevron>
</div>
<div
class="d-flex flex-column text-start"
id="question-header"
>
<strong>
Question
<div
class="d-flex flex-sm-row flex-column align-items-sm-center align-items-start"
>
<h2
class="question-number fw-bold me-1"
>
Question
<span
id="question-number"
>
0
</span>
</h2>
<span
id="question-number"
id="question-type"
>
0
Essay question
</span>
</strong>
Essay question
</div>
</div>
<div
class="card-header-btn-toolbar"
Expand Down Expand Up @@ -99,7 +110,7 @@ exports[`QuestionEditFormComponent should snap with default view 1`] = `
</button>
</div>
</div>
</div>
</button>
<div
class="ng-trigger ng-trigger-collapseAnim"
style=""
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
<div id="question-form-{{ model.questionNumber }}" class="card">
<div class="card-header bg-primary text-white cursor-pointer" (click)="triggerModelChange('isCollapsed', !model.isCollapsed)">
<button class="card-header bg-primary text-white cursor-pointer border-0" (click)="triggerModelChange('isCollapsed', !model.isCollapsed)">
<div class="collapse-caret">
<tm-panel-chevron [isExpanded]="!model.isCollapsed"></tm-panel-chevron>
</div>
<div id="question-header">
<strong>Question <span id="question-number" *ngIf="!model.isEditable">{{ model.questionNumber }}</span></strong>
<select id="question-number-dropdown" class="form-control form-select question-number-select" [ngModel]="model.questionNumber" (ngModelChange)="triggerModelChange('questionNumber', $event)" *ngIf="model.isEditable" (click)="$event.stopPropagation()">
<option *ngFor="let i of range(numOfQuestions)" [ngValue]="i + 1">{{ i + 1 }}</option>
</select>
{{ model.questionType | questionTypeName }}
<div id="question-header" class="d-flex flex-column text-start">
<div class="d-flex flex-sm-row flex-column align-items-sm-center align-items-start">
<h2 class="question-number fw-bold me-1">Question <span id="question-number" *ngIf="!model.isEditable">{{ model.questionNumber }}</span>
<select id="question-number-dropdown" class="form-control form-select question-number-select" [ngModel]="model.questionNumber" (ngModelChange)="triggerModelChange('questionNumber', $event)" *ngIf="model.isEditable" (click)="$event.stopPropagation()">
<option *ngFor="let i of range(numOfQuestions)" [ngValue]="i + 1">{{ i + 1 }}</option>
</select>
</h2>
<span id="question-type">{{ model.questionType | questionTypeName }}</span>
</div>
<ng-container *ngIf="model.isCollapsed">
<br>
<div class="collapse-qn-description">{{ model.questionBrief }}</div>
</ng-container>
</div>
Expand Down Expand Up @@ -53,7 +55,7 @@
</button>
</div>
</div>
</div>
</button>
<div *ngIf="!model.isCollapsed" @collapseAnim>
<div class="card-body">
<div class="background-color-light-blue">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@
margin-right: 5px;
}

.question-number {
font-size: .875rem;
margin-bottom: 0;
}

.background-color-light-blue {
background-color: #EAEFF5;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div class="margin-top-15px padding-15px" [ngClass]="{ 'background-color-light-green': !model.isQuestionHasResponses, 'alert alert-danger': model.isQuestionHasResponses }">
<div>
<div *ngIf="model.isQuestionHasResponses">
<h5>Changing the visibility after collecting responses is not recommended.</h5>
<p class="fs-6 fw-bold">Changing the visibility after collecting responses is not recommended.</p>
<p>Reason: The existing responses were submitted under the 'promise' of a certain visibility and changing the visibility later 'breaks' that promise.</p>
</div>
<b [ngClass]="{ 'visibility-title': !model.isQuestionHasResponses }">Visibility</b> (Who can see the responses?)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1225,8 +1225,8 @@ exports[`InstructorSessionEditPageComponent should snap with feedback session qu
class="card"
id="question-form-1"
>
<div
class="card-header bg-primary text-white cursor-pointer"
<button
class="card-header bg-primary text-white cursor-pointer border-0"
>
<div
class="collapse-caret"
Expand All @@ -1242,27 +1242,38 @@ exports[`InstructorSessionEditPageComponent should snap with feedback session qu
</tm-panel-chevron>
</div>
<div
class="d-flex flex-column text-start"
id="question-header"
>
<strong>
Question
</strong>
<select
class="form-control form-select question-number-select ng-untouched ng-pristine ng-valid"
id="question-number-dropdown"
<div
class="d-flex flex-sm-row flex-column align-items-sm-center align-items-start"
>
<option
value="0: 1"
<h2
class="question-number fw-bold me-1"
>
1
</option>
<option
value="1: 2"
Question
<select
class="form-control form-select question-number-select ng-untouched ng-pristine ng-valid"
id="question-number-dropdown"
>
<option
value="0: 1"
>
1
</option>
<option
value="1: 2"
>
2
</option>
</select>
</h2>
<span
id="question-type"
>
2
</option>
</select>
Essay question
Essay question
</span>
</div>
</div>
<div
class="card-header-btn-toolbar"
Expand Down Expand Up @@ -1311,7 +1322,7 @@ exports[`InstructorSessionEditPageComponent should snap with feedback session qu
</button>
</div>
</div>
</div>
</button>
<div
class="ng-trigger ng-trigger-collapseAnim ng-animating"
style=""
Expand Down Expand Up @@ -1933,8 +1944,8 @@ exports[`InstructorSessionEditPageComponent should snap with feedback session qu
class="card"
id="question-form-2"
>
<div
class="card-header bg-primary text-white cursor-pointer"
<button
class="card-header bg-primary text-white cursor-pointer border-0"
>
<div
class="collapse-caret"
Expand All @@ -1950,27 +1961,38 @@ exports[`InstructorSessionEditPageComponent should snap with feedback session qu
</tm-panel-chevron>
</div>
<div
class="d-flex flex-column text-start"
id="question-header"
>
<strong>
Question
</strong>
<select
class="form-control form-select question-number-select ng-untouched ng-pristine ng-valid"
id="question-number-dropdown"
<div
class="d-flex flex-sm-row flex-column align-items-sm-center align-items-start"
>
<option
value="0: 1"
<h2
class="question-number fw-bold me-1"
>
1
</option>
<option
value="1: 2"
Question
<select
class="form-control form-select question-number-select ng-untouched ng-pristine ng-valid"
id="question-number-dropdown"
>
<option
value="0: 1"
>
1
</option>
<option
value="1: 2"
>
2
</option>
</select>
</h2>
<span
id="question-type"
>
2
</option>
</select>
Essay question
Essay question
</span>
</div>
</div>
<div
class="card-header-btn-toolbar"
Expand Down Expand Up @@ -2019,7 +2041,7 @@ exports[`InstructorSessionEditPageComponent should snap with feedback session qu
</button>
</div>
</div>
</div>
</button>
<div
class="ng-trigger ng-trigger-collapseAnim ng-animating"
style=""
Expand Down Expand Up @@ -3763,8 +3785,8 @@ exports[`InstructorSessionEditPageComponent should snap with new question added
class="card"
id="question-form-0"
>
<div
class="card-header bg-primary text-white cursor-pointer"
<button
class="card-header bg-primary text-white cursor-pointer border-0"
>
<div
class="collapse-caret"
Expand All @@ -3780,22 +3802,33 @@ exports[`InstructorSessionEditPageComponent should snap with new question added
</tm-panel-chevron>
</div>
<div
class="d-flex flex-column text-start"
id="question-header"
>
<strong>
Question
</strong>
<select
class="form-control form-select question-number-select ng-untouched ng-pristine ng-valid"
id="question-number-dropdown"
<div
class="d-flex flex-sm-row flex-column align-items-sm-center align-items-start"
>
<option
value="0: 1"
<h2
class="question-number fw-bold me-1"
>
1
</option>
</select>
Essay question
Question
<select
class="form-control form-select question-number-select ng-untouched ng-pristine ng-valid"
id="question-number-dropdown"
>
<option
value="0: 1"
>
1
</option>
</select>
</h2>
<span
id="question-type"
>
Essay question
</span>
</div>
</div>
<div
class="card-header-btn-toolbar"
Expand All @@ -3812,7 +3845,7 @@ exports[`InstructorSessionEditPageComponent should snap with new question added
</button>
</div>
</div>
</div>
</button>
<div
class="ng-trigger ng-trigger-collapseAnim ng-animating"
style=""
Expand Down