Timer should go from green background to yellow background to red background dynamically based on amount of time elapsed since starting question. The cutoffs for color change will vary by section. Create a macro variable hash in the answers controller record action for cutoffs by section.
Create some hidden inputs in the view for the answers#record controller action. Create some css classes. .yellow {background-color: yellow;} .red {background-color: red;} and modify the jquery for answers/record to dynamically add/remove the color classes based on elapsed time. You will find the jquery function $(object).addClass("class name as string") and $(object).removeClass("class name as string") to be very helpful here.
Timer should go from green background to yellow background to red background dynamically based on amount of time elapsed since starting question. The cutoffs for color change will vary by section. Create a macro variable hash in the answers controller record action for cutoffs by section.
@cutoffs = {} @cutoffs[:english]={} @cutoffs[:english][:yellow]=50 @cutoffs[:english][:red]=120 @cutoffs[:math]={} @cutoffs[:math][:yellow]=40 ...
Create some hidden inputs in the view for the answers#record controller action. Create some css classes. .yellow {background-color: yellow;} .red {background-color: red;} and modify the jquery for answers/record to dynamically add/remove the color classes based on elapsed time. You will find the jquery function $(object).addClass("class name as string") and $(object).removeClass("class name as string") to be very helpful here.