Skip to content

Instantly share code, notes, and snippets.

@Iteratix
Created August 20, 2013 01:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Iteratix/6276120 to your computer and use it in GitHub Desktop.
Save Iteratix/6276120 to your computer and use it in GitHub Desktop.
<script type="text/javascript">
{# reset the finished date #}
{% for sel, choice in qdict.choices %}
var finished_{{ choice.pk }} = false;
{% endfor %}
var reset_callbacks = function(event)
{
{% for sel, choice in qdict.choices %}
finished_{{ choice.pk }} = false;
{% endfor %}
}
var time_callback = function(jwtime)
{
{% for sel, choice in qdict.choices %}
var end_time = {{ choice.timecode }} + {{ choice.duration }};
if(!finished_{{ choice.pk }} && jwtime.position > {{ choice.timecode }} && jwtime.position <= end_time)
{
var sel = $('.inputs-list label[for$={{ question.number }}_{{ forloop.counter }}]');
var true_duration = jwtime.position - {{ choice.timecode }} + {{ choice.duration }};
$(sel).effect("highlight", {color: '#0064CD', mode: 'show', easing: 'easeInExpo'}, true_duration * 1000);
finished_{{ choice.pk }} = true;
}
{% endfor %}
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment