+ // TODO: obsolete:
+// // Propagate "show problem" event to parent component (my-variant)
+// bubbleUp: function(problem) {
+// this.$emit('show-problem', JSON.stringify(problem));
+// },
+ toggleShowSolution: function() {
+ let problemSolution = document.getElementById("problem-solution");
+ problemSolution.style.display =
+ !problemSolution.style.display || problemSolution.style.display == "none"
+ ? "block"
+ : "none";
+ },
+ showPreviousProblem: function() {
+ if (this.curIdx == 0)
+ this.fetchProblems("backward");
+ else
+ this.curIdx--;
+ },
+ showNextProblem: function() {
+ if (this.curIdx == this.problems.length - 1)
+ this.fetchProblems("forward");
+ else
+ this.curIdx++;
+ },
+ // TODO: modal "no more problems"