diff --git a/ui/src/components/CorrectionResponses.svelte b/ui/src/components/CorrectionResponses.svelte index 5f0e694..90ef5e9 100644 --- a/ui/src/components/CorrectionResponses.svelte +++ b/ui/src/components/CorrectionResponses.svelte @@ -32,7 +32,7 @@ let filteredResponses = []; $:{ - filteredResponses = responses.filter((r) => (notCorrected || !r.time_scored) && (!filter || r.value.match(filter))); + filteredResponses = responses.filter((r) => (notCorrected || !r.time_scored) && (!filter || ((filter[0] == '!' && !r.value.match(filter.substring(1))) || r.value.match(filter)))); } export async function applyCorrections() { @@ -42,7 +42,7 @@ for (const tpl of templates) { if (!tpl.regexp && tpl.label) continue; - if (tpl.regexp && r.value.match(tpl.regexp)) { + if (tpl.regexp && (tpl.regexp[0] == '!' && !r.value.match(tpl.regexp.substring(1))) || r.value.match(tpl.regexp)) { my_correction[tpl.id] = true; } else { my_correction[tpl.id] = false;