Skip to content

fix(heuristic): disable submit button until evaluation progress reaches 100%#1879

Open
aaradhychinche-alt wants to merge 3 commits intoruxailab:developfrom
aaradhychinche-alt:fix/heuristic-submit-button-disabled
Open

fix(heuristic): disable submit button until evaluation progress reaches 100%#1879
aaradhychinche-alt wants to merge 3 commits intoruxailab:developfrom
aaradhychinche-alt:fix/heuristic-submit-button-disabled

Conversation

@aaradhychinche-alt
Copy link

Related Issue

Fixes #1873

Problem

During heuristic evaluations, the Submit button is never properly disabled based on the evaluation progress.

The template currently checks:

:disabled="calculateProgress < 100"

However, calculateProgress is a function reference instead of the actual computed progress value. Because of this, the condition does not behave as expected and the submit button can remain enabled even when the evaluation is incomplete.

This can allow users to submit evaluations before all questions are answered.

Root Cause

The template references the progress calculation function instead of the computed progress value.

Solution

Updated the submit button condition to use the correct reactive progress value instead of the function reference.

This ensures:

  • Submit button remains disabled until progress reaches 100%
  • Users cannot submit incomplete heuristic evaluations
  • Progress logic works as intended.

UI Screenshots

Screenshot 2026-03-14 at 4 19 50 AM

Before Fix

Submit button could remain enabled even when evaluation progress was incomplete.

After Fix

Submit button stays disabled until all heuristic questions are answered and progress reaches 100%.

Testing

Tested locally by:

  1. Creating a heuristic study
  2. Adding multiple heuristic questions
  3. Starting the evaluation
  4. Verifying that:
    • Submit button stays disabled when progress < 100%
    • Submit button becomes enabled only after all questions are answered

Notes

This change only updates the progress reference used in the template and does not modify existing evaluation logic.

…es 100%

The FAB submit button used ':disabled="calculateProgress < 100"' where
calculateProgress is a plain function reference. In Vue 3 templates a
function reference is always truthy, so the comparison evaluates to
false unconditionally, leaving the button permanently enabled regardless
of how many questions the evaluator has answered.

Fix: replace with the reactive ref 'calculatedProgress' that is updated
by calculateProgress() after every answer change, restoring the intended
guard that prevents submission before all questions are answered.

Signed-off-by: Aaradhy Chinche
Signed-off-by: Aaradhy Chinche <aaradhychinche@gmail.com>
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes heuristic evaluation submit FAB disabling logic by binding the :disabled condition to the reactive progress ref (calculatedProgress) instead of the calculateProgress function reference, preventing premature submission.

Changes:

  • Update submit button :disabled binding to use calculatedProgress < 100.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

SonarCloud reported 3 maintainability issues (L1046, L1096, L1128)
in HeuristicTestView.vue: caught 'error' variables were not used.
Add console.error() calls in each catch block so the exception is
both handled and surfaced for debugging.

Signed-off-by: Aaradhy Chinche
Signed-off-by: Aaradhy Chinche <aaradhychinche@gmail.com>
Copilot AI review requested due to automatic review settings March 13, 2026 23:11
@sonarqubecloud
Copy link

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes heuristic evaluation UI logic so the Submit FAB is disabled until the reactive progress value reaches 100%, preventing incomplete submissions (issue #1873).

Changes:

  • Update Submit button :disabled binding to use calculatedProgress (reactive value) instead of calculateProgress (function reference).
  • Add console error logging in autoSaveAnswer, manualSaveAnswer, and submitAnswer error paths (currently introduces a syntax error due to duplicate catch blocks).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

}, 1500)
} catch (error) {
console.error('Submit answer failed:', error)
} catch {
Comment on lines +1286 to 1289
} catch (error) {
console.error('Auto-save failed:', error)
} catch {
updateSaveStatus('Failed to save', 'error')
Comment on lines +1338 to 1342
} catch (error) {
console.error('Manual save failed:', error)
} catch {
updateSaveStatus('Save failed', 'error')
showError('HeuristicsTestView.errors.failedToSaveAnswer')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[🐞 BUG]: Heuristic evaluation submit button is never disabled due to incorrect progress reference

2 participants