Allow the user to see the correct solution if he is stuck

Closes #4
This commit is contained in:
2020-09-03 14:46:59 +02:00
parent 8a578e44ed
commit fc7f630001
3 changed files with 73 additions and 9 deletions

View File

@ -21,7 +21,11 @@
</div>
<template v-for="(elem, row) in solution">
<div class="row">
<div v-for="(idx, column) in elem.idx" class="card" v-bind:class="{incorrect: column == store.section && incorrects[row]}">
<div
v-for="(idx, column) in elem.idx"
class="card"
v-bind:class="{incorrect: column == store.section && incorrects[row], revealed: column == store.section && elem.got_revealed}"
>
<span>{{ solution_text(elem, column) }}</span>
<svg width=20 height=20 v-if="column == store.section && !solution_correct" v-on:click="remove_solution(row)">
<path d="M2 2L18 18M18 2L2 18" stroke="#f00" stroke-width="2px" />
@ -40,8 +44,9 @@
</div>
<div class="description">
<div class="helptext" v-if="!all_inserted || correction_visible">{{ helptext }}</div>
<button v-if="revealing_text != null" v-on:click="reveal_solution">{{ revealing_text }}</button>
<button v-if="revealing_text != null" v-on:click="show_correction">{{ revealing_text }}</button>
<button v-if="next_column_text != null" v-on:click="open_next_column">{{ next_column_text }}</button>
<button v-if="correction_visible && !solution_correct && !solution_revealed" v-on:click="reveal_solution">Lösung aufdecken</button>
</div>
<div class="close_button" v-on:click="is_open = false">
<svg width="30" height="30">