-
Notifications
You must be signed in to change notification settings - Fork 82
New Instructor Quiz Attempt Page Design #2271
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
base: 4.0.0-dev
Are you sure you want to change the base?
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use utility classes for this.
| } | ||
| } | ||
|
|
||
| &.mobile-filter { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use grid for responsive design instead of using double markup.
components/DateFilter.php
Outdated
| * | ||
| * @return self | ||
| */ | ||
| public function size( string $size ): self { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rename this to trigger_size
components/PreviewTrigger.php
Outdated
| $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 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why?
shewa12
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please check the request changes.
models/QuizModel.php
Outdated
| $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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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