Tinderbox User-to-User Forum (for formal tech support please email: info@eastgate.com)
http://www.eastgate.com/Tinderbox/forum//YaBB.cgi
Tinderbox Users >> Exporting from Tinderbox >> Export Daily Lesson Plan for Students
http://www.eastgate.com/Tinderbox/forum//YaBB.cgi?num=1374975120

Message started by Steve Scott on Jul 27th, 2013, 9:32pm

Title: Export Daily Lesson Plan for Students
Post by Steve Scott on Jul 27th, 2013, 9:32pm

Hi Tinderbox Community,

I am getting the hang of organizing information within Tinderbox, but I am stuck with getting information out.

Could someone point me in the right direction for getting information out?

I tried the templates from 2002 found here: http://www.eastgate.com/Tinderbox/GetTemplates.html, but I couldn't get them to work.


I have an outline that follows the following structure:

I. Week #1
   II. Class #1
        A. Activity 1.
        B. Activity 2
        C. Homework
             1. Read this
             2. Do that
   II. Class #2
        A. Activity 1.
        B. Activity 2
        C. Homework
             1. Read this
             2. Do that

At a minimum, I would like to export a separate html for each day (level 2) so that students can follow along with the agenda.  

Ideally, all of the days would be linked together.  The "index" page would have links to each class day.  There would also be a page for things like "homework" where all of the assignments are grouped together with point values, PDFs, links, etc.

I'm familiar with html and css, but I don't know how to set this up in Tinderbox.  Any help (links to similar projects, code snippets, directions) would be much appreciated.

Steve




Title: Re: Export Daily Lesson Plan for Students
Post by Mark Anderson on Jul 28th, 2013, 3:15pm

This is one case where, in my experience, early structure works. Prototypes help too. Why? Because you can set nested structure so OnAdd sets the correct prototype type. As you can set the export template in the prototype for all notes needing the same this makes it easy to test/tune and export using several prototypes.

From your scenario, you want to set Week containers to not export but to export their children (see notes' HTML view). This is a good point to note that each not can only export to its outline location. Export a note 2 levels deep? Its exported 2 folders deep in the export location.

Now each week exports a folder but not page for the week note. The container will hold a page per activity/homework.  These can easily link to the next/previous note. I suggest downloading aTbRef's source TBX and looking at the export templates ('5-basic_all' is a good start) for instance you might want to test for a next note that isn't of prototype "Homework", i.e. so only activity notes are linked. If testing next/previous links, don't use map adornments.  Why?  An unindented design side effect  in v5 is these are detected as siblings and but can't be tested. IOW TB sees a sibling but doesn't easily let you strike out adornments - or so I've found in doing some complex export scenarios. TL;DR version - don't mix adornments with this sort of export.

Now the index. Make an agent to find all classes (days) and sort then in original outline order. Export this as the index page. A homework list? Another agent.  Hopefully you can see that prototypes will make the agent queries much easier.

Using prototypes earlier is not inimical to progressive enhancement. You can always add in further structure later. However, in a scenario like this some structure is quite clear early one. In an export context prototypes help with:
  • Setting a common HTML template for whole groups of notes.
  • Easily finding groups on notes in queries.
Does this help?

Title: Re: Export Daily Lesson Plan for Students
Post by Steve Scott on Jul 29th, 2013, 11:59am

Hi Mark,

Thanks for pointing me in the right direction.  I downloaded the TBX file and it would be great to try to adapt it for my use.  I'm having a difficult time following along, but I will try to break it down and figure it out.  I'm sure I'll have further questions.

Thanks!
Steve

Title: Re: Export Daily Lesson Plan for Students
Post by Mark Anderson on Jul 29th, 2013, 12:29pm

Back in office and a chance to flesh this out:

Get the TBX file here (includes specimen - unstyled - HTML output). The 'read me' notes for the TBX are below…

~~~~~~~~~~~~~~~~~~~

The use of prototypes allows for easy mass customisation. A good idea before starting is to add this to the Prototypes' container $OnAdd:
      $IsPrototype=true;$RuleDisabled=true;$DisplayExpressionDisabled=true

The latter two actions ensure the code doesn't fire in the prototype itself - very useful if like here the $Rule renames the note.

The week template renames itself based on sibling order. Re-order the weeks? just drag re-order the week containers and they will update. Items added to week notes automatically are set as 'Class' notes.

Be aware that Homework type notes need to be manually re-assigned the correct prototype but this shows how automation hits some limits.

Class notes use the same method as Week notes to set a class number. If there is a module code this is shown after the note name.  A rule rather than a display expression is used to ensure these position based updates work correctly if an item is moed in order.

Homework items children are assigned the "Homework item" prototypes.

Dates haven't been added in here but could easily be accommodated such that from a term start data all lessons could date them selves accordingly. Skips for holidays, etc., add complexity but can be handled within reason; if too hard your programme is less programmed than perhaps you assume!

The class and homework listings can now leverage this. Each export is an agent - see their queries for how they pull data. Don't overlook the non-default $Sort in the agent which ensures the items list in original outline (thus data order).

Each report uses a slightly different set of templates using a different template cascade. Once set up and with correct prototypes, the list assembles itself.

This is just a small flavour of what can be done!

~~~~~~~~~~~~~~~~~

After writing this file it also occurred to me that depending on the structure of your system, you might also be able to add week notes that add specimen class notes etc - see prototypes & bequeathing children.

It's also worth looking at past threads - search with the keyword 'syllabus'.

Title: Re: Export Daily Lesson Plan for Students
Post by Steve Scott on Jul 29th, 2013, 7:42pm

Thank you so much for your generous help!  It is definitely the direction that I want to go.  Thanks to you I have a solid start.  I don't understand what is happening with the code, but I now have something to study.




Title: Re: Export Daily Lesson Plan for Students
Post by Steve Scott on Jul 30th, 2013, 1:23am

I'm working through the linked file and I have a quick question— don't see "programme" in map view.  Am I missing something?  I can see it in all of the other views.

Thanks,
Steve

Title: Re: Export Daily Lesson Plan for Students
Post by Mark Anderson on Jul 30th, 2013, 3:14am

Maps don't draw separators (as other views don't draw adornments)**. The file wasn't written with map view in mind. But, it's easily fixed - just select 'Programme', open the Rename dialog and un-sick the 'Separator' box. You can put a non-nesting separator above Programme is you so desire. Indeed, if you're in the US you might want to call the latter 'Program'. If you do that, you will need to also edit both the agent queries.

The point of putting all the programme/syllabus in one tree off the root is for easier querying.  It might be you've classes your'e working on that aren't yet ready. Work on them outside the Programme hierarchy and then drop then in the (exerting) part of the document when ready.

Something I forgot to do, was to set the other parts of the document (e.g. back of house stuff) as non-exporting. Essentially rather than select each report and use HTML view to export just that HTML file, you want to set the document up so a whole-doc export only produces the couple of files needed.

When designing export, I'd advise using Outline view, even if for general use you revert to map. Why?  TB export works off the outline-based relationship of notes so it makes sense to have that displayed as you work. It is also why the two reporting agents are placed at outline root level, so they export at that level. Had, for instance, I nested them in 'Programme' they would then have exported into a folder called 'Programme' within the designated export folder.

Don't struggle with the code - by all means ask - and don't forget aTbRef offers an extended reference to action and export code. For detailed discussion of particular codes/techniques please consider starting a new thread so this one can stay on the overall task.

** By original design intent separators didn't allow nesting, but by the time it was discovered that they did allow nesting some people were already using that feature and asked to keep it. Thus the inexact correlation with adornments!

Title: Re: Export Daily Lesson Plan for Students
Post by Steve Scott on Jul 30th, 2013, 9:16am

Unchecking Programme was an easy fix!

I'm currently trying to figure out how to mark something as non-exporting.  It makes sense to only export what I want to be available to students.  I'll post back if I figure it out.

Thanks for your support Mark.


Title: Re: Export Daily Lesson Plan for Students
Post by Mark Anderson on Jul 30th, 2013, 10:10am

Exporting children is controlled by an attribute ($HTMLExportChildren), but starting out the easiest way is to set/check it via HTML view:



The export of children is controlled by the second from top-left box.

If using prototypes, and if export control attributes are likely to want to inherit, don't forget to pen the HTML view for the prototype and not the current content note. If you mess up inheritance, you can reset inheritance.

Title: Re: Export Daily Lesson Plan for Students
Post by Steve Scott on Jul 30th, 2013, 11:59am

I think I'm getting close to having a working system.

1)  Would I put "$HTMLDontExport" as a rule for notes that I don't want to export?  I'm thinking about making personal notes that I don't want to publish. I understand that I can keep it out of "programme," but I would like to have these in context.  I'm thinking that I should make a prototype for notes that I don't want to export.

2) Based on what you have done, it looks like I could have agents generating different reports.  

a.  student reports: the information the students need (class list, homework list)

b. teacher reports (class list, homework list, special notes)

3. What is the best way to accurately publish everything?  In getting ready for class, I will update homework or class information.  The way I am currently exporting is to do the following:

- go to the item I want to export in the outline, open up a new html view, pull down class wrapper and then export.

- go to the next item I wan to export, open up a new html view, etc. .

Ideally I would push a few buttons and everything would update.

4.  Now that I am beginning to understand this, my next step is to figure out a way to have some sort of index.html which would have a links to the different pages.

I'm really beginning to get how deep and complex this program is. . .thanks for guiding me through it!

Title: Re: Export Daily Lesson Plan for Students
Post by Mark Anderson on Jul 30th, 2013, 12:53pm

1. Basically for any non-printing sections (e.g. the whole prototypes tree) select the root note (i.e. "Prototypes"), open it's HTML view, untick the two left boxes. Done! You need never touch those again. For notes amongst content that you don't want to export for any reason, you can either set them to not export via HTML view or via a stamp (code: $HTMLDontExport=true), or use an alternative prototype set at prototype level to not export. the latter means you can then toggle back to an exporting prototype if you want to export.

Bottom line: where possible let prototypes do the heavy lift. The more things you tweak at note level re export/not export the more likely to are to get an unwanted result (we forget things!).

2. Absolutely! This is just how TB can really help. For teacher vs student reports ideally use the same agent but with similar but different templates: same cascade but teacher set likely pulling in extra pages/attribute value data.

Bottom line: very do-able.

3. Set up the exports as per #1 above and then just export everything. To only export a single report, open its HTML view and hit 'Export'. Note that full export doesn't overwrite existing HTML pages unless $Text has changed. If in doubt, just trash the old export before doing a full export. The export from the HTML view always overwrites any existing file. Full export is very fast so if you've got the 'no export' parts correctly fenced off most of the time you can just export everything even if you're only using one page.

Bottom line: depending on what you're doing the choice of full or page only will vary.

4.  Assuming you're only exporting reports, then thse will ba series of root-level agents. You can add a root level note, open its HTML view and set the export filename to 'index'. Set the note to use template "HTML page". In the note's $Text add text that will be the on-screen clickable label text for each report. Make that each label text a TB link to the report in question (i.e its TB note) and on export TB will make the inter-page links for you. If you want lists of student suff vs teacher stuff, just set up the note's $Text accordingly, e.g. two separate bulleted lists etc. Or have 2 index pages - on for each group. Or an index page pointing to per group index pages. Anyway, I hope you get the picture.

Title: Re: Export Daily Lesson Plan for Students
Post by Mark Anderson on Jul 30th, 2013, 1:03pm

I've just update the earlier Zip with a TBX with an index page example.

Title: Re: Export Daily Lesson Plan for Students
Post by Steve Scott on Jul 31st, 2013, 1:14am

I definitely get the picture now!  Wow!  What a powerful program. The zip file was enormously helpful.  Thanks, again.


Title: Re: Export Daily Lesson Plan for Students
Post by Steve Scott on Jul 31st, 2013, 1:51am

I'll keep this question in this thread in case someone else uses the zip file Mark produced.

I have adapted this code from  the Class Prototype.

$ClassNum = $SiblingOrder; $Name = "Class "+$WeekNum(parent) + "-" + $ClassNum + if($ModuleCode) {" (" + $ModuleCode +")";}    

I am trying to add the following code to week:

+ if($StartDate) {" (" + $StartDate +")";}                                                

The code I have adapted results in something like:

Week 2 (8/26/13 10:24 PM)

I would like have the week be labeled:

Week 1 [August 15- August 21]

I don't know how to add the end date into the equation.  In addition,I don't want the time to be in the title.

Thanks for any help or links.

Steve



   
                                               

Title: Re: Export Daily Lesson Plan for Students
Post by Mark Anderson on Jul 31st, 2013, 4:31am


Quote:
The code I have adapted results in something like: Week 2 (8/26/13 10:24 PM)

For date formatting, Date.format() is your friend. If $StartDate date time is 08:40 on 31 July 2013, then on my (UK) system:

$StartDate.format("l") --> 31/07/2013

The 'l' date format (lowercase L) is the short local date. This is locale dependent. It is 31/07/2013 in UK, in the US it will be 07/31/2013 (possibly 07/31/13), etc. The locale used is that of your Mac OS account and isn't controlled by Tinderbox. If you're wanting Chilean date formats on a Mac with a Swedish OS locale then you may need to use the full date format syntax and construct the desired date from its constituent parts.


Quote:
I would like have the week be labeled: Week 1 [August 15 - August 21]

Assuming $StartDate and $EndDate have the correct dates, try :

… +"["+$StartDate.format("MM d")+" - "+$EndDate.format("MM d")+"]"

Rather then set $EndDate by hand you can simply use a date() call:

$EndDate = date($StartDate+"7 days");

See date() for more (I just updated the aTbRef page to give more examples).


Quote:
In addition, I don't want the time to be in the title.

Just use Date.format() to format the date as desired, in the manner discussed above.

~~~~~~~~~~~~~~~

Performance Aspects
Don't worry at this point, but i should make the point that complex rules don't always scale well from 'how-do-I?" tests to a large real document because everything is constantly re-setting itself. In other words, what's crisp in a small test may be less so in a big document. In such a case, consider moving all/most of the $Rule code to agent(s) as the latter can be turned off when not needed thus stopping repeating action code execution.

For Display Expressions, specifically, avoid putting a lot of calculation in the expression. So, instead of a complex $DisplayExpression like:

$Name + $WeekNum(parent) + "-" + $ClassNum + if($ModuleCode) {" (" + $ModuleCode +")";}  

Cache the results as a plain string and then use the latter for display:

$MyString = $Name + $WeekNum(parent) + "-" + $ClassNum + if($ModuleCode) {" (" + $ModuleCode +")";};

Then, the $DisplayExpression is simply:

$MyString

It transpires, in v5.x anyway, that expression evaluation in rules/agents in much more efficient than in a Display Expression (same may be true for Hover & Table Expressions). If in doubt, experiment - at worst you need one extra String-type attribute.

When starting out, don't get too hung up on performance, but do be aware that you may need to adjust as your TBX. Still, as TB allows easy incremental enhancement this isn't the issue it might be in a formal database, for instance.

Title: Re: Export Daily Lesson Plan for Students
Post by Steve Scott on Jul 31st, 2013, 10:53am

Awesome.  Thanks for the tip on the date formatting. Your answers are always so thorough and helpful.

I'm going to burrow down now and get some work done, but before doing so, I have one final question.

I teach two subjects.  My initial intent was to have a tbx file for each class.  However, the system will share many common protypes, attributes, and templates.  Because I am just building all of this, I know things will change.  Would it makes sense to put two subjects into one system.  Programme could be changed to Course #1 and at the same root I could add Course #2.  

The other advantage is I could bounce from course to course making changes and then have 1 export.

Before proceeding, could you let me know if that makes sense or would you keep two separate files.

Thanks, so much!  Steve

Title: Re: Export Daily Lesson Plan for Students
Post by Mark Anderson on Jul 31st, 2013, 11:13am

I'd say yes to using one file for now. I'd still keep all the 'content' under one root, for ease of all-course searching**, then have separate courses under that. Amend any agents accordingly. For key nodes like the root container of each discrete course do ensure the names are unique so you can easily filters them: e.g. via descendedFrom("Course A") for Course A, etc.

** more to the point having any easy means to ignore 'non-content' notes. That's not a rule - feel free to do differently!

It makes sense to use one file as that way all courses get the upside of any changes. Keep an eye on performance (see upthread and aTbRef) and be prepared to start throttling always-on updating via agent priorities.

If you find an all-in-one file cumbersome or you're hitting issues over duplicate names causing collisions, then you can split the file latter - especially if the 'structure' of the doc has matured. An easy split might simply be to dupe the TBX and delete one course from each file (and any root level reports for said course). Also a split is easier than a merge, where you've lots of prototypes (why is a subject for a different thread isf needs be - aTbRef explains this in part).

Title: Re: Export Daily Lesson Plan for Students
Post by Steve Scott on Aug 4th, 2013, 6:46pm

If anyone is following along, I ended up using this as the rule for the "Week" Prototype


$EndDate = date($StartDate+"4 days"); $Name = "Week "+$WeekNum + if($StartDate) {" [" + $StartDate.format("MM d") +"-" +$EndDate.format("MM d")+"]";}    


It formats like this:  Week 02 [August 26-August 30]

Thanks for all of the help Mark!



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.