Pick up where they left off?

21 views
Skip to first unread message

ian

unread,
Jan 12, 2011, 10:38:41 PM1/12/11
to Google Breadcrumb Developers
Is there a way for someone to pick up where they left off? For
example if I build a huge lesson plan that could potentially take an
hour to go through, someone might want to "Pause" and come back to
it...any idea how I could accomplish this?

Ian

kjohn8888 tds.net

unread,
Jan 13, 2011, 7:40:46 AM1/13/11
to google-brea...@googlegroups.com

Sorry... That doesn't sound like a very good candidate for a mobile platform... If you proceed, I'd use a chapter format or stagger release in chunks. As a learner how would you like to take an hour of training on your phone? Just my thoughts... --kurt

Adam Blinkinsop

unread,
Jan 13, 2011, 10:41:48 AM1/13/11
to google-brea...@googlegroups.com
I agree with Kurt, personally.

...

But if you *must* do something like this, you might work with HTML5's Local
Storage stuff (http://diveintohtml5.org/storage.html). This will only work
across a single device (we are providing no service to hold session state
for you) and browser, but it _should_ work.

The idea is that you store your current page and state in localStorage (a
variable), and reload it when someone starts your story.

In this example story, I store some random text in localStorage['foo'],
which will persist even if you refresh the page. To try it, click one of
the links to store text, and then refresh to see it retrieved.

http://breadcrumb.googlelabs.com/read?id=ag5nbGFiczIwLXBhdmxvdnIOCxIFU3RvcnkYs6q9AQw

Remember that the function go(page) will send the reader to any page in
your story, so if you start each page by storing where you are
(localStorage['page'] = '1', for example), you can start the first page by
returning there (if (localStorage['page']) { go(localStorage['page'] }).

Again, probably not a good deal to have an hour+ long story, but the
general concept of local storage is something I think might be useful to
Breadcrumbers on the list. :) Thanks for pushing the envelope!

MiketheChap

unread,
Feb 18, 2011, 11:31:54 AM2/18/11
to Google Breadcrumb Developers
I tried this code from the previous post

<%= (if (localStorage['foo']) { go(localStorage['foo'] }) %>

on a breadcrumb and it didn't work. This code

<%= localStorage['foo'] %>

does work. What am I doing wrong?

I have gotten it to save to localStorage but just can't get past this.
I am even trying to learn some javascript to get through this.

Any ideas? I am trying to use breadcrumbs to create a small quiz...

On Jan 13, 9:41 am, Adam Blinkinsop <bli...@google.com> wrote:
> I agree with Kurt, personally.
>
> ...
>
> But if you *must* do something like this, you might work with HTML5's Local  
> Storage stuff (http://diveintohtml5.org/storage.html).  This will only work  
> across a single device (we are providing no service to hold session state  
> for you) and browser, but it _should_ work.
>
> The idea is that you store your current page and state in localStorage (a  
> variable), and reload it when someone starts your story.
>
> In this example story, I store some random text in localStorage['foo'],  
> which will persist even if you refresh the page.  To try it, click one of  
> the links to store text, and then refresh to see it retrieved.
>
> http://breadcrumb.googlelabs.com/read?id=ag5nbGFiczIwLXBhdmxvdnIOCxIF...
>
> Remember that the function go(page) will send the reader to any page in  
> your story, so if you start each page by storing where you are  
> (localStorage['page'] = '1', for example), you can start the first page by  
> returning there (if (localStorage['page']) { go(localStorage['page'] }).
>
> Again, probably not a good deal to have an hour+ long story, but the  
> general concept of local storage is something I think might be useful to  
> Breadcrumbers on the list. :)  Thanks for pushing the envelope!
>

Adam Blinkinsop

unread,
Feb 18, 2011, 11:51:55 AM2/18/11
to google-brea...@googlegroups.com
What browser are you viewing it on?

On 8:31 am, MiketheChap <miket...@gmail.com> wrote:
> I tried this code from the previous post

> on a breadcrumb and it didn't work. This code

> does work. What am I doing wrong?


> I have gotten it to save to localStorage but just can't get past this.
> I am even trying to learn some javascript to get through this.
> Any ideas? I am trying to use breadcrumbs to create a small quiz...

>> On Jan 13, 9:41 am, Adam Blinkinsop wrote:
>> > I agree with Kurt, personally.

MiketheChap

unread,
Feb 18, 2011, 3:25:09 PM2/18/11
to Google Breadcrumb Developers
Chrome. version 11.0.672.2 (I'm on one of the dev releases).

On Feb 18, 10:51 am, Adam Blinkinsop <bli...@google.com> wrote:
> What browser are you viewing it on?
>

Adam Blinkinsop

unread,
Feb 18, 2011, 3:42:38 PM2/18/11
to google-brea...@googlegroups.com
Odd. I'm just following [http://diveintohtml5.org/storage.html], and was
using Chrome myself.

I guess my next question would be: what do you need persistence for here?

MiketheChap

unread,
Feb 18, 2011, 4:38:12 PM2/18/11
to Google Breadcrumb Developers
I was using the localStorage to save individual quiz questions
results, then total them up. I know there's other (probably better
ways) to do this, but just experimenting to see if I can do it. This
is where I'm at so far: http://breadcrumb.googleusercontent.com/view?id=ag5nbGFiczIwLXBhdmxvdnIOCxIFU3RvcnkY_o_GAQw

On Feb 18, 2:42 pm, Adam Blinkinsop <bli...@google.com> wrote:
> Odd.  I'm just following [http://diveintohtml5.org/storage.html], and was  
> using Chrome myself.
>
> I guess my next question would be: what do you need persistence for here?
>

Adam Blinkinsop

unread,
Feb 18, 2011, 5:15:09 PM2/18/11
to google-brea...@googlegroups.com
Ah, you can do this *without* local storage, if you expect them to finish
in a single session -- just store amounts in whatever variable you
like: "score = 4" for instance, or perhaps "score = []" at the start (to
create a list of scores), and then "score[3] = 10" if they scored 10 on the
question 4 (programmers start counting at 0).

MiketheChap

unread,
Feb 18, 2011, 5:48:44 PM2/18/11
to Google Breadcrumb Developers
Cool. Something to play with over the weekend! Thanks...

On Feb 18, 4:15 pm, Adam Blinkinsop <bli...@google.com> wrote:
> Ah, you can do this *without* local storage, if you expect them to finish  
> in a single session -- just store amounts in whatever variable you  
> like: "score = 4" for instance, or perhaps "score = []" at the start (to  
> create a list of scores), and then "score[3] = 10" if they scored 10 on the  
> question 4 (programmers start counting at 0).
>
> On 1:38 pm, MiketheChap <mikethec...@gmail.com> wrote:
>
>
>
>
>
>
>
> > I was using the localStorage to save individual quiz questions
> > results, then total them up. I know there's other (probably better
> > ways) to do this, but just experimenting to see if I can do it. This
> > is where I'm at so far:
> >http://breadcrumb.googleusercontent.com/view?id=ag5nbGFiczIwLXBhdmxvd...

MiketheChap

unread,
Feb 18, 2011, 11:37:55 PM2/18/11
to Google Breadcrumb Developers
After what seemed like forever, I got it working. And, I learned a
little bit in the process. Thanks for getting me started.
Reply all
Reply to author
Forward
0 new messages