Tinderbox User-to-User Forum (for formal tech support please email: info@eastgate.com)
http://www.eastgate.com/Tinderbox/forum//YaBB.cgi
Tinderbox Users >> Moving to Tinderbox 6 >> Using $attribute(parent) in Agent Action
http://www.eastgate.com/Tinderbox/forum//YaBB.cgi?num=1443541894

Message started by BCrane on Sep 29th, 2015, 11:51am

Title: Using $attribute(parent) in Agent Action
Post by BCrane on Sep 29th, 2015, 11:51am

I'm creating a grading rubric and have created an agent so that when a note inside a container is assigned the prototype $p_essay_rubric it will pull its parents attribute values from a couple different attributes to create a value for an attribute I will use during export.

So my agent is querying the correct notes. The action is not working as I expect it to. Right now I have:

$RubricExportFileName=$s_IDNumber(parent)+"--"+$s_LastName(parent)+"-"+$RubricAssignmentName

The two attributes followed by "(parent)" have been selected from the autocomplete list and the parent has a value for them. But the agent is pulling the value for these two bits from the note itself and not the parent. ("0" for the empty student ID and nothing for the empty string.) The dashes, which belong to the action, and the $RubricAssignmentName, which belongs to the note itself, are filling correctly.

Can anyone see what I've done wrong? I'm stumped.

Title: Re: Using $attribute(parent) in Agent Action
Post by Mark Anderson on Sep 29th, 2015, 12:09pm

If you're acting on an alias child of an agent, 'parent' is the parent of the alias, i.e. the agent. Most likely you want to refer to the parent of the aliases' original note. For this use the designator parent(original) rather than just parent. See more.

Title: Re: Using $attribute(parent) in Agent Action
Post by BCrane on Sep 29th, 2015, 5:19pm

That's it.

...it's also exactly the same problem I last asked about on this forum and thought I understood. Alias/original will sink in soon.

Thank you.

***UPDATE***

I spoke too soon. I'm not sure I understand how to place the parentheses. Would the action read:

$RubricExortFileName=$s_IDNumber(parent(original))+"--"+$s_LastName(parent(original))+"-"+$RubricAssignmentName

Based on the examples in and around the linked page, I guess I'm doing something more complex than I realized and don't have the syntax to keep up. ...Before I added the "(original)" to it, the action worked correctly but was reading the agent as the parent. Now it seems to be doing nothing...

So I guess my question would be: What do I write to pull the value of an attribute (e.g. $s_IDNumber) from the parent of the original note if what I have isn't it?


Title: Re: Using $attribute(parent) in Agent Action
Post by BCrane on Sep 29th, 2015, 5:37pm

I had a typo in an attribute name!

So thanks Mark. Your original info fixed the problem. Much appreciated.

Title: Re: Using $attribute(parent) in Agent Action
Post by Mark Anderson on Sep 29th, 2015, 5:45pm

Good. Glad your now fixed.

Tinderbox User-to-User Forum (for formal tech support please email: info@eastgate.com) » Powered by YaBB 2.2.1!
YaBB © 2000-2008. All Rights Reserved.