Note: This documentation is for Moodle 2.7. For up-to-date documentation see readfile.

readfile

From MoodleDocs

Introduction

Readfile.php is a simple script developed by the Project Gutenberg webmaster for paginating PG texts. I have created a tracker item for the purposes of managing the associated files which can be found here. It will provide constant absolute pagination as long as your text does not change, and of course you can add header and footer links as your heart desires. While there are a number of much more sophisticated applications for accomplishing such tasks now available, this elegant little script may be just what you are looking for. I invite one and all to play with it and post your modifications to the tracker.

Current Usage

Some of the discussion on trying to use etexts with Moodle has already brushed up against Project Gutenberg, but has looked at downloading versions for ePUB, Mobi, etc. While we probably can all agree that we should be able to obtain static pagination no matter where the file resides, my purpose in sharing readfile is to simply demonstrate how it can be used to accomplish this for online texts (making changes to address local versions, or using a local app to parse online texts, is a "next step.)

So I invite those interested to explore the use of readfile.php by viewing one of my favorties, Lysistrata via this link: http://www.gutenberg.org/catalog/world/readfile?pageno=5&fk_files=746769 (an image showing where you can find the link to invoke readfile.php from the Lysistrate record at http://www.gutenberg.org/etext/7700 appears below)

You will notice that we are passing two pieces of data to readfile.php, fk_files and pageno. The first variable, fk_files, is the primary key of the files table in the PG catalog database. The files table contains all files' path, last changed date, size, checksums etc. The second variable is the page number. I selected page 5 to show how the current pagination does not break at the start of the actual document. Of course, one could alter the underlying text to address this, but readfile.php is oblivious as the script paginates by simply reading in x lines via get_one_page ().

Lysistrata.png

Moodle Usage

Of course, the script was intended to target texts in a database, so you can use it to target texts already in PG's database , you can alter to target some other db, or you could modify to target material in moodledata or elsewhere. You could also of course edit the underlying text and the script to provide a wealth of other options such as specific bookmarks, indices, TOC's or what have you, as well as chapter navigation both through using the php to lay out a more complex system of pages, and by adding additional functions.

Formats, Formats, Formats

Of course, one has to ask oneself if working with this script is worthwhile. While some forum discussion has focused on the bugs in some applications for providing a constant reading experience, as noted at http://www.gutenberg.org/wiki/Gutenberg:Help_on_Bibliographic_Record_Page , much of this is new and at least with respect to PG files, experimental.

Only the future will inform us as to whether a set of "free", bugless tools for creating and reading etexts will become universal. In the interim, my personal challenge was to provide colleagues with a way to assign students specific tasks with respect to public domain texts, and readfile can be used as is from any Moodle to direct students to any page of any PG text.

For now, readfile serves as an example of what can be done with text files, and suggests the benefits of an xml approach to texts. Tagging texts with and parsing them via xml can provide marvelous options (even lesson plans and assignments can be included in the xml document) which is indeed, what EPUB is all about (see http://www.hxa.name/articles/content/epub-guide_hxa7241_2007.html for EPUB guide).

The problem, perhaps, for teachers is finding a tool with which texts can be easily marked up. Applications such as OpenOffice could arguably "easily" manage this with appropriate filters, and one might argue that the future of "edtech" may lay in this area.