New Instructor Quiz Attempt Page Design#2271
Conversation
| @@ -29,6 +29,7 @@ | |||
| @include tutor-breakpoint-down(sm) { | |||
| padding-bottom: $tutor-spacing-16; | |||
| } | |||
| padding-bottom: $tutor-spacing-7; | |||
There was a problem hiding this comment.
already has padding-bottom at line number: 27
| tutor_load_template_from_custom_path( $pagination_template_frontend, $pagination_data ); | ||
| } | ||
| ?> | ||
| $confirm_delete = Button::make()->label( __( "Yes, I'm sure", 'tutor' ) ) |
There was a problem hiding this comment.
I have made a delete confirmation modal component. Please use there here after my PR is merged.
| @@ -0,0 +1,23 @@ | |||
| <?php | |||
There was a problem hiding this comment.
No need this if delete confirmation modal component is used
| @@ -33,7 +33,7 @@ | |||
|
|
|||
| &-header { | |||
| display: grid; | |||
| grid-template-columns: 340px 180px 1.5fr 1fr; | |||
| grid-template-columns: 300px 180px 1.5fr 1fr; | |||
There was a problem hiding this comment.
Double check with the design.
| @use '@Core/scss/tokens' as *; | ||
| @use '@Core/scss/mixins' as *; | ||
|
|
||
| .tutor-quiz-attempts-mobile-heading { |
There was a problem hiding this comment.
use utility classes for this.
| } | ||
| } | ||
|
|
||
| &.mobile-filter { |
There was a problem hiding this comment.
use grid for responsive design instead of using double markup.
| * | ||
| * @return self | ||
| */ | ||
| public function size( string $size ): self { |
There was a problem hiding this comment.
Rename this to trigger_size
| $instructor_name = tutor_utils()->display_name( $author_id ); | ||
| $instructor_url = tutor_utils()->profile_url( $author_id, true ); | ||
| } elseif ( tutor()->lesson_post_type === $post_type ) { | ||
| } else { |
shewa12
left a comment
There was a problem hiding this comment.
Please check the request changes.
| $quiz_id = $quiz_attempt->quiz_id ?? 0; | ||
| $course_id = $quiz_attempt->course_id ?? 0; | ||
|
|
||
| $course_title = get_the_title( $course_id ) ?? ''; |
There was a problem hiding this comment.
Quiz attempts have the course ID, if we take the title too, then we can skip the get_post_title for each quiz attempt.
| * @since 4.0.0 | ||
| */ | ||
|
|
||
| $attempts_count = count( $attempts ); |
There was a problem hiding this comment.
First need to check if the $attempts var is an array then count
| $attempts_count = $attempts_count ?? 0; | ||
| $badge = Badge::make()->label( 'Failed' )->variant( Variant::CANCELLED )->circle(); | ||
| $kebab_button = Button::make() | ||
| ->icon( |
There was a problem hiding this comment.
We can just use the icon name in the following way:
Button::make()
->label( 'Switch to Learner' )
->size( Size::MEDIUM )
->variant( Variant::PRIMARY_SOFT )
->icon( Icon::RELOAD )
->attr( 'data-id', 101 )
->render();
Overview
This pr introduces a UI design overhaul for Quiz Attempts page for Instructor on frontend dashboard. The page has been made dynamic with PHP components that was created.
Changes
format_quiz_attempts()was added inQuizModelclass, this takes the query result of all the quiz attempts and formats it in an array for rendering the quiz attempt list properly.get_quiz_attempts_nav_data()was added inQuiz_Attempt_Listwhich provides the nav links to be used by theNavphp dynamic UI component .array_slice().Popoverphp dynamic UI component.SearchFilter,Sortingcomponents for searching and sorting listDateFiltercomponent and added the following changes to it :Mobile Responsive Design