fix(lemma_meaning_activity_generator): filter out empty strings as eligible distractors (#2004)
* filter out empty strings as elible distractors * generated --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This commit is contained in:
parent
5b99c935a8
commit
90faab6068
2 changed files with 7 additions and 4 deletions
|
|
@ -1,6 +1,6 @@
|
|||
import 'package:fluffychat/pangea/bot/utils/bot_name.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:fluffychat/pangea/bot/utils/bot_name.dart';
|
||||
import 'package:fluffychat/pangea/user/models/profile_model.dart';
|
||||
import 'package:fluffychat/widgets/matrix.dart';
|
||||
|
||||
|
|
@ -39,7 +39,7 @@ class LevelDisplayNameState extends State<LevelDisplayName> {
|
|||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
if(widget.userId == BotName.byEnvironment){
|
||||
if (widget.userId == BotName.byEnvironment) {
|
||||
return const SizedBox();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -70,8 +70,11 @@ class LemmaMeaningActivityGenerator {
|
|||
.constructList(type: ConstructTypeEnum.vocab)
|
||||
.where(
|
||||
(c) =>
|
||||
c.lemma.toLowerCase() != lemma.toLowerCase() &&
|
||||
c.category.toLowerCase() == pos.toLowerCase(),
|
||||
c.lemma.isNotEmpty && // must not be empty strings
|
||||
c.lemma.toLowerCase() !=
|
||||
lemma.toLowerCase() && // must not be the lemma itself
|
||||
c.category.toLowerCase() ==
|
||||
pos.toLowerCase(), // must be same part of speech
|
||||
)
|
||||
.toList();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue