+ updateNumbers: function () {
+ var answer = 1;
+ this.view.sortedItemViews().forEach(function (itemView) {
+ itemView.item.setAnswer(answer);
+ answer++;
+ })
+ },
+ shuffleItems: function () {
+ var items = this.wlxmlNode.object.getItems();
+ var currentIndex = items.length, randomIndex;
+ while (0 !== currentIndex) {
+ randomIndex = Math.floor(Math.random() * currentIndex);
+ currentIndex -= 1;
+ items[currentIndex].node.after(items[randomIndex].node);
+ }
+ this.reloadView();
+ },