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

[#12508] Give respondents a way to reset a rubric question submission #12569

Closed
Closed
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,6 @@
</div>
</div>
</div>
<button type="reset" class="btn btn-success" (click)="resetRubricQuestion()">
<span>Reset rubric question</span>
</button>
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,26 @@
background-color: #D9EDF7 !important;
}

button.btn {
margin: 20px 0;
}

@media (max-width: 768px) {
.desktop-view {
display: none;
}

.mobile-view {
display: block;
}
}

@media (min-width: 768px) {
.mobile-view {
display: none;
}

.desktop-view {
display: block;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,10 @@ export class RubricQuestionEditAnswerFormComponent extends QuestionEditAnswerFor
getInputId(id: String, row: Number, col: Number, platform: String): String {
return `${id}-row${row}-col${col}-${platform}`;
}

resetRubricQuestion(): void {
let newAnswer: number[] = [];
newAnswer = Array(this.questionDetails.rubricSubQuestions.length).fill(RUBRIC_ANSWER_NOT_CHOSEN);
this.triggerResponseDetailsChange('answer', newAnswer);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2954,6 +2954,14 @@ exports[`SessionSubmissionPageComponent should snap with feedback session questi
</div>
</div>
</div>
<button
class="btn btn-success"
type="reset"
>
<span>
Reset rubric question
</span>
</button>
</tm-rubric-question-edit-answer-form>
</div>
<div
Expand Down Expand Up @@ -5816,6 +5824,14 @@ exports[`SessionSubmissionPageComponent should snap with feedback session questi
</div>
</div>
</div>
<button
class="btn btn-success"
type="reset"
>
<span>
Reset rubric question
</span>
</button>
</tm-rubric-question-edit-answer-form>
</div>
<div
Expand Down
Loading