diff --git a/src/app.vue b/src/app.vue
index cc8d1e9..2035ce8 100644
--- a/src/app.vue
+++ b/src/app.vue
@@ -19,7 +19,7 @@
@keypress.enter="broadcastName"
>
+
+
+
+ {{ foreignInstanceAnswerStatus[generateKey(cat, letter)].answered }}
+
+
+
+ {{ foreignInstanceAnswerStatus[generateKey(cat, letter)].skipped }}
+
+
+
+ {{ foreignInstanceAnswerStatus[generateKey(cat, letter)].thinking }}
+
+
this.now.getTime() - e[1].lastActive < instanceTimeout))
},
- answersGiven(): Object {
+ answerKeys(): string[] {
const keys: string[] = []
for (const cat of this.gameState.categories) {
for (const letter of this.gameState.letters) {
@@ -154,13 +168,38 @@ export default defineComponent({
}
}
- return Object.fromEntries(keys.map(key => [
+ return keys
+ },
+
+ answersGiven(): Object {
+ return Object.fromEntries(this.answerKeys.map(key => [
key, Object.keys(this.activeInstances).map(instId => ({
answer: this.activeInstances[instId].answers[key],
name: this.activeInstances[instId].name,
})),
]))
},
+
+ foreignInstanceAnswerStatus(): any {
+ const foreignInstances = Object.entries(this.activeInstances)
+ .filter(e => e[0] !== this.instance)
+ .map(e => e[1])
+
+ return Object.fromEntries(this.answerKeys
+ .map((key: string) => [
+ key, {
+ answered: foreignInstances
+ .filter((instance: any) => instance.answers[key])
+ .length,
+ skipped: foreignInstances
+ .filter((instance: any) => instance.answers[key] === '')
+ .length,
+ thinking: foreignInstances
+ .filter((instance: any) => instance.answers[key] === undefined)
+ .length,
+ },
+ ]))
+ },
},
created(): void {