evalentini / actprep

ACT test prep app
1 stars 0 forks source link

Update the timer when answering a question to change color after exceeding target time. #12

Open evalentini opened 11 years ago

evalentini commented 11 years ago

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.

tonytaudesign commented 10 years ago

May need a little guidance on this one, but it sounds fun to learn.