+
+
+
Send data to socket.io server
+ console.log(data)
},
toggleInsert() {
+ /**
+ * When toggling the insert, we want to request new information
+ * from the server in case there has been an update since the last
+ * time it was displayed. We only want to do this on appear though,
+ * never on disappear.
+ */
if (!this.visible) {
- // request questions from server
+ // TODO -> request questions from server
console.log(`Fetching questions for team`)
};
this.visible = !this.visible;
@@ -126,13 +151,16 @@ export default {
},
sockets: {
UpdateAnswer(data) {
- /*
- {
- team: 1 | 2,
- answer: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8,
- value: String,
- }
- */
+ /**
+ * Receives the updates for the answer for both teams, updating the
+ * data for the text inputs to be displayed dynamically.
+ *
+ * data -> {
+ * team: 1 | 2,
+ * answer: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8,
+ * value: string
+ * }
+ */
this.answers[`team_${data.team}`][data.answer - 1] = data.value;
}
},