Skip to content Skip to sidebar Skip to footer

How Would I Go About Recording Changes In A Large Text Field?

Let's say I want a user to write a story in 20 minutes. After the user is done I want to play back the story writing process so I can see how the user went about doing it. How woul

Solution 1:

Let's take for granted that you have the capacity to persist this state and just look at the challenge of detecting and displaying the diffs. The most challenging aspect of you problem is going to be defining and subsequently detecting what you call a "large change". If we set that aside for a moment I think there are two ways you can go about this:

1) Operational transform - (http://en.wikipedia.org/wiki/Operational_transformation)

This is what Google Docs(etherpad) uses to synchronize real-time collaborative edits across multiple browsers. With OT you can practically recreate a video of the changes made to a document. You can see this in action on thinklinkr.com revision history (full disclosure - I am one of the founders).

2) Diff-match-path - (http://code.google.com/p/google-diff-match-patch/)

This is actually a set of three algorithms that can be used to effeciently create and resolve differences between text documents. I think this might be a better match for you given your requirement about chunking diffs.


Post a Comment for "How Would I Go About Recording Changes In A Large Text Field?"