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

Display selected answer and status #80

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

aashika-j18
Copy link
Contributor

This PR enhances the quiz page by displaying the answer selected by the user for each question along with the status of whether it's right or wrong.
Fixes #77

Screen.Recording.2024-10-11.155927.mp4

I have tested the code and followed flutter style guidelines.

Please review and let me know if any further changes are required!
@KirolosMFahem @yagnik2411

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉 Boom! Your pull request just flew into the Quiz-Genius HQ. High fives all around! Our team of tech wizards will check it out and get back to you faster than you can say 'code ninja!' Thanks for leveling up the project!

@aashika-j18
Copy link
Contributor Author

I have resolved the merge conflicts.
@yagnik2411 @KirolosMFahem

Copy link
Collaborator

@KirolosMFahem KirolosMFahem left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The error in the GitHub Actions job is due to the dart run dart_style:format --dry-run --set-exit-if-changed . command. The command failed because the code is not properly formatted according to the Dart style guidelines, resulting in a non-zero exit code.

The failure logs indicate that the job failed due to the following error:

dart run dart_style:format --dry-run --set-exit-if-changed .
lib/pages/quiz_page.dart
##[error]Process completed with exit code 1.

This suggests that the Dart formatter found issues in the file lib/pages/quiz_page.dart.

Next steps:

  1. Check the lib/pages/quiz_page.dart file for formatting issues.
  2. Run `dart format lib/pages/quizTo fix this error:
  3. Run dart run dart_style:format . locally to format all the Dart files.
  4. Commit the changes and push them to the repository.

_page.dart` locally to fix any formatting issues.
This should resolve the formatting issues and allow the GitHub Actions job to complete successfully.3. Commit the changes and push them to the repository.

This should resolve the formatting-related error and allow the CI job to pass successfully.

@aashika-j18
Copy link
Contributor Author

Done! Please check now

KirolosMFahem
KirolosMFahem previously approved these changes Oct 12, 2024
Copy link
Collaborator

@KirolosMFahem KirolosMFahem left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The pull request #80 titled "Display selected answer and status," enhances the quiz page by showing the answer selected by the user for each question along with its correctness status. This PR fixes issue #77 and includes 3 commits with a total of 52 additions and 1 deletion across 1 file. The PR is open and has been tested to follow Flutter style guidelines.

Copy link
Collaborator

@KirolosMFahem KirolosMFahem left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The error in the GitHub Actions job stems from issues in two files:

  1. lib/pages/quiz_page.dart:

    • Deprecation warnings for 'ButtonBar'.
    • These can be resolved by replacing 'ButtonBar' with 'OverflowBar'.
  2. lib/utils/profile_image_service.dart:

    • Error: "Target of URI doesn't exist: 'package:flutter/material.dart '"
    • Error: Undefined name 'Colors'

Issues and Fixes:

  1. Deprecation Warnings:

    • Replace ButtonBar with OverflowBar in lib/pages/quiz_page.dart.
  2. URI and Undefined Identifiers:

    • Correct the import statement in lib/utils/profile_image_service.dart to import 'package:flutter/material.dart';.
    • Ensure Colors is correctly imported and used.

Next Steps:

  • Correct the import statement and replace deprecated widgets.
  • Test the changes by re-running the job to ensure the issues are resolved.

Would you like to proceed with making these changes?

@KirolosMFahem KirolosMFahem added enhancement New feature or request gssoc-ext GSSOC contribution level2 GSSOC contribution level hacktoberfest-accepted hacktoberfest contribution PR hacktoberfest hacktoberfest contribution labels Oct 12, 2024
@aashika-j18
Copy link
Contributor Author

The error in the GitHub Actions job stems from issues in two files:

  1. lib/pages/quiz_page.dart:

    • Deprecation warnings for 'ButtonBar'.
    • These can be resolved by replacing 'ButtonBar' with 'OverflowBar'.
  2. lib/utils/profile_image_service.dart:

    • Error: "Target of URI doesn't exist: 'package:flutter/material.dart '"
    • Error: Undefined name 'Colors'

Issues and Fixes:

  1. Deprecation Warnings:

    • Replace ButtonBar with OverflowBar in lib/pages/quiz_page.dart.
  2. URI and Undefined Identifiers:

    • Correct the import statement in lib/utils/profile_image_service.dart to import 'package:flutter/material.dart';.
    • Ensure Colors is correctly imported and used.

Next Steps:

  • Correct the import statement and replace deprecated widgets.
  • Test the changes by re-running the job to ensure the issues are resolved.

Would you like to proceed with making these changes?

yes I am working on these changes.
Thanks for your patience and review!

@aashika-j18
Copy link
Contributor Author

I have fixed the issues and tested the code.

I have a doubt regarding this though.
These errors were not occurring when I checked it my system. Is there any way I can come across these issues beforehand?

@yagnik2411
Copy link
Owner

we have conflicts in quiz_page.dart

@yagnik2411
Copy link
Owner

also in video is not looks good according UX, so change it to snakebar or anything else

@KirolosMFahem
Copy link
Collaborator

The conflict in your pull request is related to a build failure due to an outdated Java version. Here are the steps to resolve it:

  1. Update Java Version:

    • The Android Gradle plugin requires Java 17. Update your local development environment to use Java 17.
    • You can change the IDE settings to point to Java 17.
  2. Update Gradle Plugin Application Method:

    • You are using the deprecated apply script method for Flutter's app_plugin_loader. Migrate to the declarative plugins block.

Here's a guide on how to change the Java version and update the Gradle plugin application method:

Updating Java Version

  1. Download and install Java 17 from the official Oracle website.
  2. Update your JAVA_HOME environment variable to point to the Java 17 installation directory.

Updating Gradle Plugin Application Method

In your android/app/build.gradle file, replace the apply script method with the plugins block. For example:

plugins {
    id 'com.android.application'
    id 'kotlin-android' // If you are using Kotlin
    // Add other plugins as needed
}

After making these changes, try running the build again. If you need further assistance, feel free to ask.

KirolosMFahem
KirolosMFahem previously approved these changes Oct 15, 2024
Copy link
Collaborator

@KirolosMFahem KirolosMFahem left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.

@aashika-j18
Copy link
Contributor Author

also in video is not looks good according UX, so change it to snakebar or anything else

https://github.com/user-attachments/assets/c290dea8-e925-4423-8449-5049f1dd5aae
I have added the snackbar. I agree about the UX aspect!

I have resolved conflicts as well.

@aashika-j18
Copy link
Contributor Author

Updating Gradle Plugin Application Method

In your android/app/build.gradle file, replace the apply script method with the plugins block. For example:

plugins {
    id 'com.android.application'
    id 'kotlin-android' // If you are using Kotlin
    // Add other plugins as needed
}

After making these changes, try running the build again. If you need further assistance, feel free to ask.

Thank you @KirolosMFahem for these instructions!

But i am using Java 21 version which I believe is compatible.
And this is how my android/app/build.gradle file looks like
image

Copy link
Collaborator

@KirolosMFahem KirolosMFahem left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.

Copy link
Collaborator

@KirolosMFahem KirolosMFahem left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary of Pull Request

Files Changed:

  • lib/pages/home_page.dart
  • lib/pages/quiz_page.dart
  • lib/utils/extensions.dart

What Got Fixed:

  • Removed unnecessary whitespace in home_page.dart.
  • Fixed incorrect method property references from MaterialStateProperty to WidgetStateProperty in quiz_page.dart.

What Got Added:

  • Added a new import statement for velocity_x in home_page.dart.
  • Added comments and a new method _showSnackbar in quiz_page.dart for better user feedback.
  • Added new lists _userAnswer and _correctAnswer to track user interactions and correct answers in quiz_page.dart.

Considerations:

  • Ensure that the changes to button styles in quiz_page.dart are correct and do not cause visual regressions.
  • Verify that the new methods and properties added in quiz_page.dart work as expected during user interactions.

Summary of Changes and Related Files

1. lib/pages/home_page.dart:

  • Added import for velocity_x.
  • Removed unnecessary whitespace.

2. lib/pages/quiz_page.dart:

  • Added lists _userAnswer and _correctAnswer.
  • Added _showSnackbar method to provide feedback on user answers.
  • Replaced ButtonBar with OverflowBar.
  • Fixed button style property references.

3. lib/utils/extensions.dart:

  • Formatted capitalizeFirstOfEach method for better readability.

For more details, you can view the files changed in this PR.

@KirolosMFahem
Copy link
Collaborator

@yagnik2411

@yagnik2411
Copy link
Owner

I will look at this brfore EOD today.

@KirolosMFahem
Copy link
Collaborator

@aashika-j18 please resolve the conflicts so we do the final test and merge

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request gssoc-ext GSSOC contribution hacktoberfest hacktoberfest contribution hacktoberfest-accepted hacktoberfest contribution PR level2 GSSOC contribution level
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Improvement] Display Selected Answer and Correct Answer on Quiz Page
3 participants