Ensure students play course levels in order

This commit is contained in:
Matt Lott 2015-10-07 15:33:52 -07:00
parent bfacbf8add
commit 3292f13bc3

View file

@ -287,13 +287,18 @@ mixin levels-tab
th(data-i18n="courses.concepts")
tbody
if campaign
- var lastLevelCompleted = true;
each level, levelID in campaign.get('levels')
tr
td
button.btn.btn-success.btn-play-level(data-level-slug=level.slug, data-i18n="home.play")
if lastLevelCompleted || adminMode
button.btn.btn-success.btn-play-level(data-level-slug=level.slug, data-i18n="home.play")
td
if userLevelStateMap[me.id]
div= userLevelStateMap[me.id][levelID]
- lastLevelCompleted = userLevelStateMap[me.id][levelID] === 'complete'
else
- lastLevelCompleted = false
td= level.name.replace('Course: ', '')
td
if levelConceptMap[levelID]