diff --git a/src/addons/mod/quiz/components/index/addon-mod-quiz-index.html b/src/addons/mod/quiz/components/index/addon-mod-quiz-index.html index db9d74c29..a9a4e628c 100644 --- a/src/addons/mod/quiz/components/index/addon-mod-quiz-index.html +++ b/src/addons/mod/quiz/components/index/addon-mod-quiz-index.html @@ -45,11 +45,64 @@ - + @if (quiz && attempts.length) { + {{ 'addon.mod_quiz.summaryofattempts' | translate }} + + @if (quiz && showResults && (gradeResult || gradeOverridden || gradebookFeedback || (quiz.showFeedback && overallFeedback))) { + + @if (overallStats && gradeResult) { + + +
+ @if (moreAttempts) { + {{ gradeMethodReadable }} + {{ gradeResult }} + } @else { + {{ 'addon.mod_quiz.yourfinalgradeis' | translate:{ $a: gradeResult } }} + } +
+ + @if (gradeOverridden) { +

+

+ } +
+
+ } + + @if (gradebookFeedback) { + + +

{{ 'addon.mod_quiz.comment' | translate }}

+

+ +

+
+
+ } + + @if (quiz.showFeedback && overallFeedback) { +
+ + } + + } + @for (attempt of attempts; track attempt.id) { @@ -108,37 +161,7 @@ }
- - - - - - {{ gradeResult }} - - - {{ 'core.course.overriddennotice' | translate }} - - - -

{{ 'addon.mod_quiz.comment' | translate }}

-

- -

-
-
- - -

{{ 'addon.mod_quiz.overallfeedback' | translate }}

-

- -

-
-
-
-
+ } diff --git a/src/addons/mod/quiz/components/index/index.scss b/src/addons/mod/quiz/components/index/index.scss index b7640a4aa..647124ebb 100644 --- a/src/addons/mod/quiz/components/index/index.scss +++ b/src/addons/mod/quiz/components/index/index.scss @@ -2,41 +2,73 @@ :host { - .addon-mod_quiz-attempt-title-info { - text-align: end; - padding-top: 8px; - padding-bottom: 8px; - - p { - margin: 0px; - margin-top: 4px; + .addon-mod_quiz-attempts-summary { + ion-card-header { + border-bottom: 1px solid var(--stroke); } - } - .accordion-expanded .addon-mod_quiz-attempt-title-info, - .accordion-expanding .addon-mod_quiz-attempt-title-info { - visibility: hidden; - } + .addon-mod_quiz-grade-result { + margin-top: var(--mdl-spacing-2); - hr { - background-color: var(--stroke); - height: 1px; - margin: 0px 16px; - } - ion-accordion:nth-child(odd) { - background-color: var(--core-table-odd-cell-background); + .addon-mod_quiz-grade-overridden-notice { + margin-top: var(--mdl-spacing-2); + margin-bottom: 0px; + } - ::ng-deep ion-item { - --background: var(--core-table-odd-cell-background); + .addon-mod_quiz-grade-result-grade { + display: flex; + + span:first-child { + flex-grow: 1; + } + } } - } - ion-accordion:nth-child(even) { - background-color: var(--core-table-even-cell-background); + .addon-mod_quiz-attempt-title-info { + display: flex; + flex-direction: column; + align-items: end; + justify-content: center; + min-height: 60px; + padding-top: var(--mdl-spacing-2); + padding-bottom: var(--mdl-spacing-2); - ::ng-deep ion-item { - --background: var(--core-table-even-cell-background); + p { + margin: 0px; + margin-top: var(--mdl-spacing-2); + } + } + + ion-accordion-group { + border-top: 1px solid var(--stroke); + + .accordion-expanded .addon-mod_quiz-attempt-title-info, + .accordion-expanding .addon-mod_quiz-attempt-title-info { + visibility: hidden; + } + + hr { + background-color: var(--stroke); + height: 1px; + margin: 0px var(-mdl-spacing-4); + } + + ion-accordion:nth-child(odd) { + background-color: var(--core-table-odd-cell-background); + + ::ng-deep ion-item { + --background: var(--core-table-odd-cell-background); + } + } + + ion-accordion:nth-child(even) { + background-color: var(--core-table-even-cell-background); + + ::ng-deep ion-item { + --background: var(--core-table-even-cell-background); + } + } } } diff --git a/src/addons/mod/quiz/components/index/index.ts b/src/addons/mod/quiz/components/index/index.ts index 2271165a0..5c571eb9a 100644 --- a/src/addons/mod/quiz/components/index/index.ts +++ b/src/addons/mod/quiz/components/index/index.ts @@ -348,23 +348,10 @@ export class AddonModQuizIndexComponent extends CoreCourseModuleMainActivityComp gradeToShow = formattedBestGrade; } - if (this.overallStats) { - // Show the quiz grade. The message shown is different if the quiz is finished. - if (this.moreAttempts) { - this.gradeResult = Translate.instant('addon.mod_quiz.gradesofar', { $a: { - method: this.gradeMethodReadable, - mygrade: gradeToShow, - quizgrade: quiz.gradeFormatted, - } }); - } else { - const outOfShort = Translate.instant('addon.mod_quiz.outofshort', { $a: { - grade: gradeToShow, - maxgrade: quiz.gradeFormatted, - } }); - - this.gradeResult = Translate.instant('addon.mod_quiz.yourfinalgradeis', { $a: outOfShort }); - } - } + this.gradeResult = Translate.instant('core.grades.gradelong', { $a: { + grade: gradeToShow, + max: quiz.gradeFormatted, + } }); if (quiz.showFeedback) { // Get the quiz overall feedback.