Open luwen-huang opened 7 years ago
can we have the dropdown search for outcomes search by not-necessarily contiguous words? only if it's a quick patch.
something like this (from https://github.com/wombats-writing-code/fbw-instructor/blob/master/web/src/reducers/utilities.js#L4):
export const matches = (needle, haystack) => { let parts = needle.split(' '); let partQ = ''; for (let i=0; i<parts.length; i++) { if (i==0) { partQ = '(?=.*\\b' + parts[i] + ')'; } else { partQ = partQ + '(?=.*\\b' + parts[i] + ')'; } } let re = new RegExp(partQ, 'gi'); let matching = re.test(haystack); return matching; }
can we have the dropdown search for outcomes search by not-necessarily contiguous words? only if it's a quick patch.
something like this (from https://github.com/wombats-writing-code/fbw-instructor/blob/master/web/src/reducers/utilities.js#L4):