Skip to content
This repository has been archived by the owner on Nov 24, 2023. It is now read-only.

Change accordion header colors depending on all answers complete #143

Open
goneall opened this issue Mar 18, 2019 · 1 comment
Open

Change accordion header colors depending on all answers complete #143

goneall opened this issue Mar 18, 2019 · 1 comment

Comments

@goneall
Copy link
Collaborator

goneall commented Mar 18, 2019

Currently, the accordion header color in the certification survey changes color from blue to orange when all answers are completed (independent of whether the answers are correct).

It would be helpful to the user to have the color change to green if all answers are correct.

@goneall
Copy link
Collaborator Author

goneall commented Mar 18, 2019

This is a bit involved since the front-end JavaScript doesn't calculate or keep track of the correct answers. The JavaScript code that changes the color is in the file WebContent/resources/certsurvey.js near the end of function updateSectionQuestionCounts(section).

There is enough information returned in the function getSurvey() to accomplish the calculations, but it needs to take into account several factors. It would essentially duplicate code in the Java backend.

A different, perhaps better approach would be to replace the current JavaScript code which looks to see if all questions have been answered with an Ajax call to the backend to check on how many questions are answered and if all questions are correct. The color could be updated in the response for the Ajax call.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant