Merge lp://staging/~kevang/mnemosyne-proj/grade_only_if_showing into lp://staging/~peter-bienstman/mnemosyne-proj/trunk

Proposed by Kilian Evang
Status: Rejected
Rejected by: Peter Bienstman
Proposed branch: lp://staging/~kevang/mnemosyne-proj/grade_only_if_showing
Merge into: lp://staging/~peter-bienstman/mnemosyne-proj/trunk
Diff against target: 17 lines (+4/-3)
1 file modified
mnemosyne/mnemosyne/pyqt_ui/review_wdgt.py (+4/-3)
To merge this branch: bzr merge lp://staging/~kevang/mnemosyne-proj/grade_only_if_showing
Reviewer Review Type Date Requested Status
Kilian Evang (community) Disapprove
Peter Bienstman Pending
Review via email: mp+235605@code.staging.launchpad.net

Description of the change

Despite https://code.launchpad.net/~kevang/mnemosyne-proj/number_keys_show_answer/+merge/234210, I was still having issues with accidentally grading two cards in a row by pressing two number keys at the same time. I found that what happens is this: one of the two buttons will cause grade_answer to be called, which grades the answer and brings up the next card. In this process, the grade buttons are disabled and a further number key press should not lead to grading anymore. However, since the two key presses happened at the same time, PyQT is already processing them, and grade_answer will also be called for the other button, grading the next card.

This simple fix seems to do the trick: grade_answer now only acts if the answer is currently showing, thereby ignoring the second key press.

To post a comment you must log in.
Revision history for this message
Peter Bienstman (peter-bienstman) wrote :

Thanks, I will commit this.

There is still the remaining issue though that if you press and hold down a number key, it will show the answer and immediately grade it...

Peter

> -----Original Message-----
> From: <email address hidden> [mailto:<email address hidden>] On Behalf
> Of Kilian Evang
> Sent: 23 September 2014 12:39
> To: <email address hidden>
> Subject: [Merge] lp:~kevang/mnemosyne-proj/grade_only_if_showing into
> lp:mnemosyne-proj
>
> Kilian Evang has proposed merging lp:~kevang/mnemosyne-
> proj/grade_only_if_showing into lp:mnemosyne-proj.
>
> Requested reviews:
> Peter Bienstman (peter-bienstman)
>
> For more details, see:
> https://code.launchpad.net/~kevang/mnemosyne-
> proj/grade_only_if_showing/+merge/235605
>
> Despite https://code.launchpad.net/~kevang/mnemosyne-
> proj/number_keys_show_answer/+merge/234210, I was still having issues
> with accidentally grading two cards in a row by pressing two number keys at
> the same time. I found that what happens is this: one of the two buttons will
> cause grade_answer to be called, which grades the answer and brings up the
> next card. In this process, the grade buttons are disabled and a further
> number key press should not lead to grading anymore. However, since the
> two key presses happened at the same time, PyQT is already processing
> them, and grade_answer will also be called for the other button, grading the
> next card.
>
> This simple fix seems to do the trick: grade_answer now only acts if the
> answer is currently showing, thereby ignoring the second key press.
> --
> https://code.launchpad.net/~kevang/mnemosyne-
> proj/grade_only_if_showing/+merge/235605
> You are requested to review the proposed merge of
> lp:~kevang/mnemosyne-proj/grade_only_if_showing into lp:mnemosyne-
> proj.

Revision history for this message
Kilian Evang (kevang) wrote :

I found a fix that fixes both issues, "two keys at once" and "hold down one key". See https://code.launchpad.net/~kevang/mnemosyne-proj/grade-shortcuts-improvements/+merge/258885

I rescind the present merge proposal in favor of the new one.

review: Disapprove

Unmerged revisions

1816. By Kilian Evang <email address hidden>

grade_answer now only acts if the answer is showing. This to prevent accidental grading of the next card when hitting two number keys at once.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches