Commit 1b8cdcd4 by Victor Shnayder

Add unstyled problem progress per-problem.

needs css
parent 111f7533
...@@ -24,11 +24,17 @@ class @Problem ...@@ -24,11 +24,17 @@ class @Problem
@$('section.action input.save').click @save @$('section.action input.save').click @save
@$('input.math').keyup(@refreshMath).each(@refreshMath) @$('input.math').keyup(@refreshMath).each(@refreshMath)
renderProgressState: () =>
@$(".problem-progress").html(@el.data('progress_detail'))
updateProgress: (response) => updateProgress: (response) =>
if response.progress_changed if response.progress_changed
@el.data('progress_status', response.progress_status) @el.data('progress_status', response.progress_status)
@el.data('progress_detail', response.progress_detail) @el.data('progress_detail', response.progress_detail)
@el.trigger('progressChanged') @el.trigger('progressChanged')
@renderProgressState()
queueing: => queueing: =>
@queued_items = @$(".xqueue") @queued_items = @$(".xqueue")
...@@ -79,6 +85,8 @@ class @Problem ...@@ -79,6 +85,8 @@ class @Problem
@setupInputTypes() @setupInputTypes()
@bind() @bind()
@queueing() @queueing()
@renderProgressState()
# TODO add hooks for problem types here by inspecting response.html and doing # TODO add hooks for problem types here by inspecting response.html and doing
# stuff if a div w a class is found # stuff if a div w a class is found
......
...@@ -6,6 +6,9 @@ ...@@ -6,6 +6,9 @@
% endif % endif
</h2> </h2>
<section class="problem-progress">
</section>
<section class="problem"> <section class="problem">
${ problem['html'] } ${ problem['html'] }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment