How to write result of several nested filters into other tiddler?

Hej @all,

did not find a possibility to solve this.
I train building sentences in german language with somebody and for that wrote a wiki with several tiddler like I /you /he /she /it /we and so on (tagged “who?”) and several tiddler with verbs, tagged with “simple verbs”.
Additionally Yes & No and additionally tiddlers for “is it question or statement or command”.
For building very simple sentences like “She cooks.” or “Don’t you eat?”.
Everything gets rated after each sentence and will appear or not appear, depending on a calculation made by the rating.
For that I wrote a filter with coloring by type (yes=green background /No=red background, “who” lightgreen, verb orange) and the result is shown rotated, because he’s sitting across from me:

<div style="display:block;transform: rotate(-180deg);text-align:center;font-size:25px;">

<$vars vv-avgSubfilter="[{!!satzstellung}divide{!!häufigkeit}]">
  <$list filter="[tag[Ja/Nein]sortsub:number<vv-avgSubfilter>limit[1]]">
{{!!background}}
</$list>
</$vars><br>
<$vars vv-avgSubfilter="[{!!übersetzung}add{!!aussprache}add{!!flexion}divide[3]divide{!!häufigkeit}]">
  <$list filter="[tag[Wer?]sortsub:number<vv-avgSubfilter>limit[1]]">
@@background-color:#C0C66E;{{!!title}}@@
  </$list>
</$vars> || <$vars vv-avgSubfilter="[{!!übersetzung}add{!!aussprache}add{!!flexion-verb}divide[3]divide{!!häufigkeit}]">
  <$list filter="[tag[VerbenEinfach]sortsub:number<vv-avgSubfilter>limit[1]]">
@@background-color:#FFAB66;{{!!title}}@@
  </$list>
</$vars>
<$vars vv-avgSubfilter="[{!!satzstellung}divide{!!häufigkeit}]">
  <$list filter="[tag[?.!]sortsub:number<vv-avgSubfilter>limit[1]]">
@@font-size:55px;''{{!!title}}''@@
</$list>
</$vars>
</div>

It looks like this (the top until the first horizontal line):


In the not-rotated part I do my rating (correct +1).
Here the result of the rating-calculation is No + Su madre + Dar + !.

Everything is fine. The only problem: The rotated part shown to him, but also the part for me for the rating, is of course immediately updated to different words, as soon as I rate the words.

So I have been searching for a possibility to write the results of the filters into another tiddler (with the color-formatting), transclude that tiddler and actualize everything with a button when I finished my ratings.
So, in that other tiddler should then be written in this example: <div style="background-color:red;">''No''</div><br>@@background-color:lightgreen;Su madre@@ || @@background-color:orange;Dar@@ @@font-size:35px;''!''@@
But: I cannot find any way to do this with the multiple & nested filters.
And even soon I will need much more complicated ones, because then the sentences will have not only subject + verb, but additional objects and later additional adjectives…

Please help- everything in this training is fine- but nevertheless we cannot use it :woozy_face:
But it should be with only 1 button for actualizing (hopefully!)
Thankyou!!

Is there any chance you can share the wiki itself somewhere publicly?

I’m not quite making sense of the problem; it would probably be easier if I could see it.

Like @Scott_Sauyet, I’m not sure I follow completely. But one quick thought is: instead of writing “results of filters” to another tiddler, why not have each of your evaluation buttons write their values to a temp tiddler, and then have a final “show result” button that brings all those temp values into the tiddler that displays for your student?

Hello @Scott_Sauyet & @Springer ,

the problem (maybe problem? maybe no problem?) is, that most things (for me) are in german language, many things (for my student) are in spanish… But most of you speak english…
But well, here it is (with the example-exercise & 1 vocable-tiddler open): Deutsch lernen
In the exercise-tiddler (which is the one, that my student sees from one table-side and I see it from the other table-side):
The 1. part until the first horizontal line: This is a non-working test with buttons. I just didn’t delete it, so you can see at least 1 not-working-test from me.
The 2. part until the 2. horizontal line is the part for my student. Working fine, but immediately actualizing as soon as I begin to rate his sentence.
The 3. part after the 2. horizontal line is for me: Here I do my rating: What did he do correct =+1, and what did he not good. The rating I do for each vocable-tiddler for several aspects and additionally for the sentence as a whole for several aspects. Also this is working fine, but immediately actualizing as soon as I begin to rate his sentence.

But it should be patient :wink: and “wait” for me with the actualizing.

@Springer : Sorry, maybe your suggestion is for me like my writing is for you :wink: . Reading this leads only into a big knot in my head…
The little bit I maybe understood lead me to the question “but how to bring then all the values from the temp-tiddler into the other tiddlers?”
And- this exercise is just the beginning with a very short & easy sentence. But in the future there’ll come sentences with a lot more elements.

Your displayed code does not show how/where the input rating is stored. But if the various input ratings can be stored in separate temporary tiddlers (e.g $:/german/rating-1, ...-2, etc) and then, when clicking a button, their values are copied over to wherever it is they are currently stored, so to display the intended consequences (the updated different words etc).

I don’t quite understand what you mean with “nested filters” here - I don’t see any such.

Hello @twMat ,
the nested filter (in the linked exercise-tiddler “Simpler Satz”):

<$vars vv-avgSubfilter="[{!!übersetzung}add{!!aussprache}add{!!flexion}divide[3]divide{!!häufigkeit}]">
  <$list filter="[tag[Wer?]sortsub:number<vv-avgSubfilter>limit[1]]">
  </$list>
</$vars>

I am able to write the result of a filter by button-clicking into another tiddler- when the filter is on 1 line. But here it is with a subfilter. And the result of this nested filter (first vv-avgsubfilter with the calculation & sorting, then the main filter) I cannot write by button-clicking into another tiddler. For that I did not find any solution.

The ratings are stored in the fields of the tiddlers, f.e.:
“Su madre”-tiddler has the fields häufigkeit, übersetzung, aussprache, flexion, there the ratings are stored. And the exercise-tiddler also has such fields (similar ones).

If I understand it correct- it seems to me, your suggestion is the same /similar to the one from Springer. How it is done at the end, I don’t mind. Main thing is, that it works. So, if you think, this could be the best solution to bring everything to work, I will be fine with it.
Just: How to??
So, for “Su madre”-tiddler: This is now in the sentence he should say in german. Let’s say, he did everything correct, so all “+1”-buttons get clicked (häufigkeit, übersetzung, aussprache, flexion). In the temp-tiddler, where to write the values there? Also in such fields with the same names?
And how do I then at the end get these values from the temp-tiddler into the “Su madre”-tiddler?
And in this exercise we also have the verb “Dar”. Where would get these values stored? In the same temp-tiddler or another temp?
And how do I get the rate-values at the end for both (“Su madre” & “Dar”) in the correct tiddler-fields?

So you succeed in creating a button which, when clicked, writes the result from a single line filter into a tiddler of your choice. But if the filter is more complex, then if you click the button… what happens?

…and do you succeed in making the “upside down side” read the data from the tiddler that you pushed the result to?

Anyway, I have to side with Scott and propose that you publish the code so we can look at it. You can clean out any sensitive data and put it up on tiddlyhost.com (and make the wiki public).

@twMat From Post #4: Deutschlernen :wink: :wink: . But as I wrote: Most in there is in german…

Exactly. What happened instead: Either the written result was "<<RandomWer>>" or it was the complete filter-code beginning with "<$vars vv-avgSubfilter="[{!!satzstellung}divide{!!häufigkeit}]"> <$list filter="[tag[Ja/Nein]sortsub:nu.....and so on....."

Sorry, this I don’t understand, what are you asking for…

I suspect that the structure of your solution could be much more straightforward, and all of this “getting values into tiddlers” isn’t necessary.

Certainly basic concept tiddlers like “su madre” and “dar” should not be where the student’s results are stored. If you have a tiddler for “dar” then probably the only thing it should be actually holding is the German “geben” (or whatever verb forms in one or both languages that you want available).*

My guess is that whenever you have a quiz-prompt for a particular student, all the info for that one interaction should get its own tiddler. That tiddler might be named with a timestamp (name doesn’t matter, but needs to be unique) and specifies which vocab and grammar is being tested (when, and maybe for whom in case you get more students), and also the ratings.

Perhaps you would initially set a bunch of field values (the granular scores +1 / -1) in a temporary tiddler, and then transfer them all at once into a result tiddler, so that there’s a single moment when evaluation is confirmed and displayed…

  • Even though I would not store student-specific info inside the “su madre” tiddler (etc.), a view template available from a vocabulary tiddler could still display all the interaction-results related to that item. For example, 2024-06-28: student A tried “Her mother — gave — money — to me,” scored +1 for tense, but -1 for word order (or whatever).