Skip to content

Commit f7cf2fe

Browse files
authored
Merge pull request #2653 from themeum/bivas-v4
2 parents 7564378 + 30beff1 commit f7cf2fe

8 files changed

Lines changed: 218 additions & 134 deletions

File tree

assets/src/scss/frontend/components/_quiz-attempt-details.scss

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
display: grid;
5151
grid-template-columns: 300px 1fr;
5252
gap: 128px;
53+
padding-bottom: calc( var(--tutor-quiz-summary-footer-height) + #{$tutor-spacing-4} );
5354

5455
@include tutor-breakpoint-down(sm) {
5556
grid-template-columns: 1fr;
@@ -149,8 +150,10 @@
149150
background-color: $tutor-surface-base;
150151
border-top: 1px solid $tutor-border-idle;
151152
box-shadow: 0px -4px 13px -2px #1018280f;
152-
position: sticky;
153+
position: fixed;
153154
bottom: 0;
155+
left: 0;
156+
right: 0;
154157

155158
.tutor-quiz-summary-footer-inner {
156159
max-width: 1220px;

assets/src/scss/frontend/components/_quiz-attempts.scss

Lines changed: 42 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,23 @@
4141

4242
&:hover {
4343
background-color: $tutor-surface-l1-hover;
44+
.tutor-quiz-attempts-item {
45+
.tutor-quiz-item-info {
46+
.tutor-quiz-attempts-expand-btn {
47+
@include tutor-flex(row, center);
48+
}
49+
}
50+
}
51+
}
52+
53+
&.tutor-quiz-previous-attempts {
54+
.tutor-quiz-attempts-item {
55+
.tutor-quiz-item-info {
56+
.tutor-quiz-attempts-expand-btn {
57+
@include tutor-flex(row, center);
58+
}
59+
}
60+
}
4461
}
4562

4663
&.tutor-quiz-previous-attempts {
@@ -87,9 +104,14 @@
87104
.tutor-quiz-item-info {
88105
grid-area: info;
89106

107+
&-expanded {
108+
@include tutor-flex(row, center);
109+
gap: $tutor-spacing-4;
110+
text-align: center;
111+
}
112+
90113
&-title {
91114
@include tutor-typography(medium, semibold);
92-
margin-bottom: $tutor-spacing-2;
93115

94116
@include tutor-breakpoint-down(sm) {
95117
font-size: $tutor-font-size-small;
@@ -117,8 +139,8 @@
117139
}
118140

119141
.tutor-quiz-attempts-expand-btn {
142+
display: none;
120143
@include tutor-button-reset();
121-
@include tutor-flex(row, center);
122144
gap: $tutor-spacing-2;
123145
@include tutor-typography(small, medium, brand);
124146
cursor: pointer;
@@ -209,7 +231,7 @@
209231

210232
.tutor-quiz-item-result {
211233
grid-area: result;
212-
@include tutor-flex(column, center, center);
234+
@include tutor-flex(column, left, center);
213235

214236
@include tutor-breakpoint-down(sm) {
215237
height: 100%;
@@ -254,6 +276,12 @@
254276
}
255277
}
256278

279+
&:hover {
280+
.tutor-quiz-item-info-title{
281+
color: $tutor-brand-700;
282+
}
283+
}
284+
257285
&:hover:has(.tutor-quiz-item-result-more) {
258286
.tutor-quiz-item-result {
259287
.tutor-badge {
@@ -298,7 +326,7 @@
298326
}
299327

300328
&:hover {
301-
background-color: $tutor-surface-base;
329+
background-color: $tutor-surface-l1-hover;
302330
}
303331

304332
&:not(:last-child) {
@@ -339,6 +367,16 @@
339367
border-radius: $tutor-radius-2xl;
340368
}
341369
}
370+
371+
.tutor-quiz-students-attempts {
372+
&-filter-item {
373+
&:first-child {
374+
button {
375+
padding: 0;
376+
}
377+
}
378+
}
379+
}
342380
}
343381

344382
.tutor-quiz-item-actions {

assets/src/scss/frontend/components/_quiz-summary.scss

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,4 +129,18 @@
129129
}
130130
}
131131
}
132+
133+
.tutor-empty-quiz-details{
134+
@include tutor-flex(row,center,center);
135+
padding: $tutor-spacing-6;
136+
background-color: $tutor-surface-critical;
137+
border: 1px solid $tutor-border-error-tertiary;
138+
border-radius: $tutor-radius-lg;
139+
gap: $tutor-spacing-4;
140+
margin-top: $tutor-spacing-6;
141+
.error-message{
142+
@include tutor-typography(small,regular);
143+
color: $tutor-text-critical;
144+
}
145+
}
132146
}

classes/Quiz_Attempts_List.php

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
use Tutor\Components\Button;
2121
use Tutor\Components\Constants\Size;
2222
use Tutor\Components\Constants\Positions;
23+
use Tutor\Components\Constants\Variant;
2324
use Tutor\Components\Popover;
2425
use Tutor\Helpers\UrlHelper;
2526
use Tutor\Models\QuizModel;
@@ -468,7 +469,7 @@ public function render_retry_button( $course_id = 0, $quiz_id = 0, $attempt = ar
468469
*/
469470
private function get_kebab_button() {
470471
$kebab_button = Button::make()
471-
->icon( Icon::THREE_DOTS_VERTICAL )
472+
->icon( Icon::ELLIPSES )
472473
->attr( 'x-ref', 'trigger' )
473474
->attr( '@click', 'toggle()' )
474475
->attr( 'class', 'tutor-quiz-item-result-more' )
@@ -526,6 +527,25 @@ public function render_student_attempt_popover( $attempt = array(), $attempts_co
526527
return;
527528
}
528529

530+
if ( $is_learning_area && ! $is_quiz_details_hidden ) {
531+
532+
$query_param = array( 'action' => 'view_details' );
533+
534+
$url = $this->get_review_url( $attempt, $query_param );
535+
536+
$button_html = Button::make()
537+
->tag( 'a' )
538+
->label( __( 'Details', 'tutor' ) )
539+
->size( Size::X_SMALL )
540+
->variant( Variant::PRIMARY )
541+
->attr( 'href', $url )
542+
->attr( 'class', 'tutor-quiz-item-result-more tutor-quiz-details-btn' )
543+
->get();
544+
545+
echo '<div class="tutor-flex">' . wp_kses_post( $button_html ) . '</div>';
546+
return;
547+
}
548+
529549
$popover = Popover::make()
530550
->trigger( $this->get_kebab_button() )
531551
->placement( 'bottom' )

0 commit comments

Comments
 (0)