X-Git-Url: https://git.cworth.org/git?p=lmno.games;a=blobdiff_plain;f=empathy%2Fempathy.jsx;h=5782b7879076bdd8812bccffc58a281b63760d5b;hp=0789b463fe5813cb3fc23b8cb4a84610dd32b2a5;hb=5d49d1235592034458ce875b5d73d024ef23355d;hpb=d49e0aa05e9204fcefa2e7e88653dcd5bdc73a06 diff --git a/empathy/empathy.jsx b/empathy/empathy.jsx index 0789b46..5782b78 100644 --- a/empathy/empathy.jsx +++ b/empathy/empathy.jsx @@ -414,7 +414,13 @@ const PromptOptions = React.memo(props => { Select any categories below that you'd like to play. You can choose as many as you'd like.

- {props.prompts.map(p => )} + {props.prompts.map( + prompt => + )} ); }); @@ -462,11 +468,9 @@ class Ambiguities extends React.PureComponent { for (let word of props.words) { const word_canon = canonize(word); - console.log("Canonized " + word + " to " + word_canon); let found_match = false; for (let set of word_sets) { const set_canon = canonize(set.values().next().value); - console.log("Comparing " + word_canon + " to " + set_canon); if (word_canon === set_canon) { set.add(word); found_match = true;; @@ -482,7 +486,8 @@ class Ambiguities extends React.PureComponent { this.state = { word_sets: word_sets, - selected: null + selected: null, + starred: null }; this.submitted = false; @@ -497,7 +502,8 @@ class Ambiguities extends React.PureComponent { const response = await fetch_post_json( `judged/${this.props.prompt.id}`,{ - word_groups: this.state.word_sets.map(set => Array.from(set)) + word_groups: this.state.word_sets.map(set => Array.from(set)), + kudos: Array.from(this.state.starred) } ); @@ -684,6 +690,21 @@ class Ambiguities extends React.PureComponent { ); })} + { + event.stopPropagation(); + this.setState({ + starred: set + }); + }} + > + {this.state.starred === set ? + '★' : '☆' + } + ); })}