Bug 487169 - Available answer buttons do not register the answer.
Summary: Available answer buttons do not register the answer.
Status: REPORTED
Alias: None
Product: minuet
Classification: Applications
Component: user-interface (show other bugs)
Version: 0.4.0.24083
Platform: Flatpak Linux
: NOR normal
Target Milestone: ---
Assignee: Sandro Andrade
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-05-18 04:29 UTC by Ryan
Modified: 2024-11-23 11:26 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ryan 2024-05-18 04:29:09 UTC
SUMMARY
Clicking or tapping on any of the buttons under 'available answers' does not register the answer. 

STEPS TO REPRODUCE
1. Open Minuet and navigate to any of the exercises in the left navigation.
2. Click, tap, or press space to 'Play Question'.
3. Click or tap on any of the available answers.

OBSERVED RESULT
* Hovering over the answer button activates shading and the visualisations on the keyboard and musical staff below
* Answers cannot be focused using the <Tab> key (unlike the `Play Question` `Give Up`, and `Start Test` buttons)
* Clicking or tapping any of the answer buttons fails to register the answer.
* Ouput in the terminal shows this error when the answer button is clicked:
`qrc:/ExerciseView.qml:317: TypeError: Property 'onExited' of object QQuickMouseArea(0x7fd104002830) is not a function`

EXPECTED RESULT
* <Tab> should move focus to the answers, and <Space> to submit, just like the `Play Question`, `Give Up`, and `Start Test` buttons.
* Clicking or tapping should register the answer and allow advancement to the next question.

SOFTWARE/OS VERSIONS
Operating System: openSUSE Tumbleweed 20240509
KDE Plasma Version: 6.0.4
KDE Frameworks Version: 6.1.0
Qt Version: 6.7.0
Kernel Version: 6.8.8-1-default (64-bit)
Graphics Platform: Wayland
Graphics Processor: Mesa Intel® UHD Graphics 620

ADDITIONAL INFORMATION
* The answer buttons worked in the past few weeks before I last updated the operating system. Minuet may have been updated at that time.
* I am also getting intermittent static noises briefly during some mouse interactions, such as moving the Minuet window and even when Minuet is not in focus. This stops when I exit Minuet.
* Graphics could be an issue as I am using the proprietary Nvidia driver in a Plasma Wayland session. However, intel is currently active whereas Nvidia was in use the last time the buttons worked in Minuet.

  Device-1: Intel UHD Graphics 620 vendor: Hewlett-Packard driver: i915
    v: kernel arch: Gen-9.5 process: Intel 14nm built: 2016-20 ports:
    active: DP-1,eDP-1 empty: DP-2,HDMI-A-1 bus-ID: 00:02.0 chip-ID: 8086:5917
    class-ID: 0300
  Device-2: NVIDIA GP108M [GeForce MX150] vendor: Hewlett-Packard
    driver: nvidia v: 550.78 alternate: nouveau,nvidia_drm non-free: 545.xx+
    status: current (as of 2024-04; EOL~2026-12-xx) arch: Maxwell code: GMxxx
    process: TSMC 28nm built: 2014-2019 pcie: gen: 1 speed: 2.5 GT/s lanes: 4
    link-max: gen: 3 speed: 8 GT/s bus-ID: 01:00.0 chip-ID: 10de:1d10
    class-ID: 0302
 Device-3: Suyin HP TrueVision FHD RGB-IR driver: uvcvideo type: USB
    rev: 2.0 speed: 480 Mb/s lanes: 1 mode: 2.0 bus-ID: 1-5:2 chip-ID: 064e:3401
    class-ID: 0e02 serial: HF2066-P98B-OV07-REV0101
  Display: wayland server: X.org v: 1.21.1.12 with: Xwayland v: 23.2.6
    compositor: kwin_wayland driver: X: loaded: modesetting,nvidia
    alternate: intel dri: iris gpu: i915,nvidia d-rect: 4480x2520
    display-ID: 0
  Monitor-1: DP-1 pos: primary,top-left res: 2560x1440 size: N/A modes: N/A
  Monitor-2: eDP-1 pos: bottom-r res: 1920x1080 size: N/A modes: N/A
Comment 1 Ryan 2024-05-19 05:29:31 UTC
Correction: The current video driver is nvidia.
> prime-select get-current
Driver configured: nvidia
NVIDIA modules are loaded
Comment 2 Ryan 2024-06-09 01:07:36 UTC
ExerciseView.qml is the code in question: https://github.com/KDE/minuet/blob/ab3fcedec21096ed1166e6872b9160705538bb84/src/app/qml/ExerciseView.qml#L317

Based on the documentation documentation here https://doc.qt.io/qt-6/qml-qtquick-mousearea.html, here https://doc.qt.io/qt-6/qtqml-syntax-objectattributes.html, and here https://doc.qt.io/qt-6/qtqml-syntax-signals.html#property-change-signal-handlers), my best guesses as a non-developer are these:

(a) Line 317 is missing an object declaration needed to explicitly point to the onExit handler or set a property.
(b) Line 317 should use the `exited()` signal instead of `onExited` handler.
(c)

>313 MouseArea {
>314     anchors.fill: parent
>315     onClicked: {
>316         if (exerciseView.state == "waitingForAnswer" && !animation.running) {
>317             onExited()
>...
>322         }
>323     }

ExerciseView.qml also includes the onExited handler. I think this is irrelevant, because hovering over and exiting the button area work as expected (activate/deactivate shading and the piano animation).

>     onExited: {
>         answerRectangle.color = internal.colors[answerRectangle.index%internal.colors.length]
>         if (currentExercise["playMode"] != "rhythm") {
>             if (parent.parent == answerGrid) {
>                 if (!animation.running)
>                     model.sequence.split(' ').forEach(function(note) {
>                         pianoView.noteUnmark(0, core.exerciseController.chosenRootNote() + parseInt(note), 0)
>                     })
>                 sheetMusicView.model = [core.exerciseController.chosenRootNote()]
>             }
>         }
>         else {
>             var rightAnswers = core.exerciseController.selectedExerciseOptions
>             if (parent.parent == yourAnswersParent && internal.userAnswers[position].name != rightAnswers[position].name) {
>                 parent.border.color = "red"
>                 parent.color = internal.userAnswers[position].color
>                 rhythmImage.source = "exercise-images/" + internal.userAnswers[position].name + ".png"
>             }
>         }
>     }
> }
Comment 3 PabloAB 2024-11-20 05:11:55 UTC
I have this issue with the recently installed from Flatpack 0.4.0.24083 version. By running with `flatpak run org.kde.minuet` I get
```
qrc:/ExerciseView.qml:317: TypeError: Property 'onExited' of object QQuickMouseArea(0x559a079f1770) is not a function
```
every time I click an answer.
Comment 4 Ryan 2024-11-23 11:26:42 UTC
(In reply to PabloAB from comment #3)
> I have this issue with the recently installed from Flatpack 0.4.0.24083
> version. By running with `flatpak run org.kde.minuet` I get
> ```
> qrc:/ExerciseView.qml:317: TypeError: Property 'onExited' of object
> QQuickMouseArea(0x559a079f1770) is not a function
> ```
> every time I click an answer.

Note that you can still generate a new question by clicking "Give up". The answer buttons worked in a previous version, so reverting or comparing the code might be helpful. This seems likely to be an easy fix for someone who knows the language.