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

readfile

From MoodleDocs
Revision as of 18:56, 16 June 2009 by Marc Grober (talk | contribs)

Introduction

Readfile.php is a simple script found here developed by the Project Gutenberg webmaster for paginating PG texts. It will provide constant absolute pagination as long as yur 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


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. (fk_files is the primary key of the files table in the PG catalog database and the files table contains all files' path, last changed date, size, checksums etc.)

File: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.