Tinderbox User-to-User Forum (for formal tech support please email: info@eastgate.com)
http://www.eastgate.com/Tinderbox/forum//YaBB.cgi
Tinderbox Users >> Questions and Answers >> How to Question: Export Attributes to text, html
http://www.eastgate.com/Tinderbox/forum//YaBB.cgi?num=1186288901

Message started by R. Jolly on Aug 5th, 2007, 12:41am

Title: How to Question: Export Attributes to text, html
Post by R. Jolly on Aug 5th, 2007, 12:41am

Thanks for starting the forum. I have a zillion questions... Here's one.

How do you export attribute values to text or html (csv would be nice)?

To give an example.

I have a bunch of student homework assignments that have been emailed to me. I import them to TB. My grading criterion is based on wordcount. So, let's say I create an attribute for Name and WordCount, and values of 500, 440, and 200 and so on are returned for each note. I have also created a blank user attribute called Grade. I make an agent that will perform the following action: if wordcount is greater than 450, assign A to attribute Grade, if the wordcount is between 449 and 400 assign B, if less than 400 assign C. (Action if(WordCount>450) Grade=A...  Is this syntax correct?)

Now, I have a bunch of notes with Grades assigned. I want to export these new Grade values (with student names) back to my Gradebook spreadsheet. What should I do? How do you export attributes to text or htlm? Is it possible to export as csv...? Or do I have to record each new grade manually back into the spreadsheet?








Title: Re: How to Question: Export Attributes to text, ht
Post by Mark Anderson on Aug 5th, 2007, 10:29am

Go to http://homepage.mac.com/mwra/FileSharing1.html, and download the bottom-right demo "Create tab-delim text export". I think it should help sort you out. If not, lask back here.

[Post-edit]If not self-evident, in the template, simply change the tabs to commas. Either way, Excel's pretty happy taking either format.

Title: Re: How to Question: Export Attributes to text, ht
Post by Mark Bernstein on Aug 5th, 2007, 10:52am

Action if(WordCount>450) Grade=A...  Is this syntax correct?

You need curly braces {} around the action:

   if (WordCount>450) { Grade="A"}

-----

With regard to export, you will want to make an export template for each note, showing what gets exported and how.  For example:

    ^get(Name)   ,   ^get(WordCount)   ,   get(Grade)   <return>

The container would then export ^justChildren(gradeTemplate).  Notice how easily you can move from CSV to XML to some other export format, just by modifying the template.  An XML template might be

    <name>^get(Name)^</name>
    <grade>^get(Grade)^</grade>

or, for a different scheme,

    <examResult name="^get(Name)^" grade="Get(grade)^"  />


Title: Re: How to Question: Export Attributes to text
Post by R. Jolly on Aug 5th, 2007, 7:07pm

To Mark A.

The demo works perfectly. I can modify and use. Thanks very much.

To Mark B.

Thank you for the syntax correction. And the very helpful advice on export templates.


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.