Reverse detail from Kakelbont MS 1, a fifteenth-century French Psalter. This image is in the public domain. Daniel Paul O'Donnell

Forward to Navigation

Scaffolding and The Zone of Proximal Development

Posted: Jun 29, 2013 13:06;
Last Modified: Jun 29, 2013 13:06

---

Two of the most important terms in a teacher’s repertoire, and two of the most popular teaching ideologies in education right now, scaffolding and the Zone of Proximal Development are simple yet elegant ways to describe how teachers build on a student’s current knowledge so they can ascend to ever higher plateaus. The unessay is nothing if not a product of scaffolding and the ZPD.

Using Wikipedia’s definitions, which are more than adequate for understanding these terms, scaffolding is ” a learning process designed to promote a deeper level of learning. Scaffolding is the support given during the learning process which is tailored to the needs of the student with the intention of helping the student achieve his/her learning goals. Instructional scaffolding is the provision of sufficient support to promote learning when concepts and skills are being first introduced to students. These supports may include the following: resources, a compelling task, modeling a task, providing coaching. These supports are gradually removed as the students develop autonomous learning strategies, thus promoting their own cognitive, affective and psychomotor learning skills and knowledge. Teachers help the students master a task or a concept by providing support.

And the Zone of Proximal Development is ” the difference between what a learner can do without help and what she or he can do with help.” Beginning as a small circle in the middle, signifying what the learner can do unaided, and branching out in concentric circles of increasing size, with each circle further from the center denoting the need for increasingly more aid for the student.”

The terms are so similar they have come to be used almost interchangeably, so for the sake of clarity I will use the ZPD to describe both. Further defined in “Vygotsky, Tutoring, and Learning” we can see the theoretical principles of the unessay at work: “Vygotsky’s definition of the ZPD leaves open to us the task of identifying the nature of the guidance and collaboration that promotes development and a need to specify what gets learned during the course of a given history of tutor/learner interaction” (Wood 5). The nature of guidance in the unessay operates off of an assumption: that university students are capable and proficient writers. The results of the unessay as well as blog assignments have demonstrated this, according to the both Michael and Dan. Michael and Dan assumed that the writing itself was not the issue, rather, it was the form the writing was forced to adhere to which gave student’s difficulties.

The traditional essay is foreign and awkward to many, meaning it is not a part of a student’s ZPD, and if it is part of her ZPD, it is to such slight degree that she is unable to perform adequately without guidance. This is where the unessay comes in, as the bridging device between a student’s ZPD and the plateau the teacher wants her to be at. You don’t go from walking up a hill to scaling Everest, nor do you go from writing rigid five-paragraph essays to the intricate and nuanced essays expected in university. ZPD and scaffolding ” emphasize that learning is a complex process that depends, in large part, on changes that occur in a learner’s strategic knowledge, domain-specific knowledge, and motivation” (Harris 297). Once these skills are fostered and added to the student’s current body of knowledge then the ZPD expands and you can slowly pull off the ‘writing-trainin-wheels,’ so to speak.

Works Referenced

http://en.wikipedia.org/w/index.php?title=Instructional_scaffolding&oldid=548517392

http://en.wikipedia.org/w/index.php?title=Zone_of_proximal_development&oldid=558276245

Harris, Karen R., Steve Graham, and Linda H. Mason. “Improving the Writing, Knowledge, and Motivation of Struggling Young Writers: Effects of Self-Regulated Strategy Development with and Without Peer Support.” American Educational Research Journal 43.2 (2006): 295–340. JSTOR. Web. 26 June 2013

Wood, David, and Heather Wood. “Vygotsky, Tutoring and Learning.” Oxford Review of Education 22.1 (1996): 5–16. JSTOR. Web. 29 June 2013.

----  

Yii Basic Steps

Posted: Apr 06, 2012 16:04;
Last Modified: May 23, 2012 18:05

---

This is just a reminder to myself about setting up a Yii install. There are much more detailed examples on the web.

Build database

Build a database (I use MySql with innodb engine). The innodb engine is important because it allows you to document foreign key associations

Copy yii to top level of webdirectory

If you haven’t already done so, get a copy of the latest version of yii, uncompress it, and install it in a webdirectory immediately below the web root.

In my case, I tend to put it under /var/www/ and call the directory yii.

Use yiic to build initial site

navigate to the root of your web directory. Assuming yii is an immediate child of this directory, use the following to build the initial site of your website, where $site is the directory name you want to use for your site and $path the full path to the current directory:

yii/framework/yiic webapp $site

The response should be: Your application has been created successfully under $path/$site

Prepare for building the scaffolding

change directory to $path/$site/protected/config/

edit main.php:

  1. remove the comments surrounding the section on the gii tool (you’ll want to put these back in production)
  2. make sure you put a password in
  3. (for MySql) remove the comments surrounding the MySql Stanza and modify/supply the required information (usernames, passwords, servers, etc.)
  4. fix the admin email.

Use gii to establish the basic scaffolding

  1. point your webbrowser at the site (e.g. http://localhost/$site/ or http://example.com/$site/)
  2. click on the “home” link in the menubar to get the top URL (it will be something like this: http://$domain/$site/index.php?r=site/index)
  3. in the location bar, replace site/index with gii
  4. enter the database root password

Develop models

Most if not all dbases will have a model in the system.

  1. Select “Model Generator”.
  2. enter * in the “Table name” field to generate models for all tables; otherwise type the table name in the box for a specific table.
  3. click on preview.
  4. if everything is good, click on generate (need to make sure permissions all generation).

Develop CRUD

  1. select “crud generator”
  2. enter Model names for the models for which you want to have specific forms and actions (not all tables will require this: some will be written automatically or through relations)
----  

Adding an attribute for title to a yii widget

Posted: Feb 24, 2012 15:02;
Last Modified: May 23, 2012 18:05

---

The Yii file view.php by default uses the [zii.widgets.CDetailView] to display all examples of a given model. In the standard scaffolding produced by the gii utility, this widget consists of references to attributes of the model without any further information (e.g. attribute names and the like):

<?php $this->widget('zii.widgets.CDetailView', array(
	'data'=>$model,
	'attributes'=>array(
		'editorialInstance_id',
		'journal.shortTitle', // a reference to a relational attribute
		'type',
                'LastNamesFirstName', // a reference to a compound attribute
	),

In this minimalist form, yii will calculate an appropriate label for the attribute on the basis of the attribute name: so, for example, in this case, editorialInstance_id will be appear in the view labelled “Editorial Instance” because Yii understands camelCase naming conventions and knows to strip off _id (it’s that good!).

A problem with this, however, is that we also provide customised label names as part of the attributeLabels() method in our Model controller. Since that method allows arbitrary names, and since CDetailView attempts to calculate labels on the basis of the attribute name, it is highly likely that the labels for different attributes will get out of synch in different places in your site. To give an example: in this particular case, the model for editorialInstance might have defined the label for editorialInstance_id as “ID” rather than “Editorial Instance”: since CDetailView doesn’t check to see what you had on attributeLabels() in the model class, switching from an edit view to an index will mean that the label of the attribute switches.

Ideally what you want to do is keep CDetailView and attributeLabels() in synch automatically. I’m sure there must be a way of doing this. In the meantime, however, here’s how you can set an arbitrary label in the widget (I’ve used it on the first and last):

<?php $this->widget('zii.widgets.CDetailView', array(
	'data'=>$model,
	'attributes'=>array(
                array('value' => 
                      $model->editorialInstance_id, 'label' => 'ID'),
		'journal.shortTitle',
		'type',
		array('value' => $model->person->lastNameFirstNames, 'label' => 'Person'),
	),
----  

Understanding Relation Models in Yii

Posted: Feb 24, 2012 13:02;
Last Modified: May 23, 2012 18:05

---

The core of any database driven website is its ability to handle table relations (if that sentence didn’t mean anything to you, you should first do some reading about relational databases, database design, and normalising data: an introduction aimed at textual editors can be found in my article “What digital editors can learn from
print editorial practice.” Literary and Linguistic Computing 24 (2009): 113-125)

One of the really useful things about the Yii MVC framework is the extent to which it allows you to systematise and automate the process of establishing these relations.

The relations() method

The most important part of this system is in the Yii model classes. When you first scaffold a new website in Yii (see the Yii website for the extremely easy to implement details of how this is done), the gii utility will build a series of standard model classes, each of which corresponds to a table in your database. A core method, included in every one of these models by default, is relations() (note: the following is how an empty relation method looks):

/**
	 * @return array relational rules.
	 */
	public function relations()
	{
		// NOTE: you may need to adjust the relation name and the related
		// class name for the relations automatically generated below.
		return array(
                );
        }

To indicate that the table represented by this model is related to other tables in your database, you construct a number of relation key => value pairs using a series of pre-defined terms (see these sections of the Yii Blog Tutorial and of the Yii documentation for details).

You can do this quite easily by hand. But if your database is designed using an engine that supports explicit information about relations (such as MySQL’s InnoDB engine [but not the default MYISAM]), Yii’s scaffolding utility gii will do much of the work in populating this method automatically.

Here’s an example of a relationset, built for a table in one of my databases (the model is called Journal and describes a table containing information about journals in a publishing workflow):

public function relations()
	{
		// NOTE: you may need to adjust the relation name and the related
		// class name for the relations automatically generated below.
		return array(
			'articles' => array(self::HAS_MANY, 'Article', 'journal_id'),
			'editorialInstances' => array(self::HAS_MANY, 'EditorialInstance', 'journal_id'),
		);
}

In human terms, this is what the method is indicating:

  1. the journal table is directly related to two other tables in my database: article and editorialInstance (in my database, tables are named using camelCase starting with an initial lowercase letter; Yii’s naming convention is that Model Classes [i.e. the models that describe tables] begin with a capital letter: so Article is the model for the database table article).
  2. the relationship between journal and these two tables is
    1. parent to child (journal HAS article and editorialInstance)
    2. one to many (journal HASMANY_ article and editorialInstance
  3. the key names in the relations array article*s* and editorialInstance*s* are themselves arrays of all the possible values in these child tables
  4. both the child tables contain journal_id as a foreign key (FK)

How the relations() method makes your life easier

The great thing about this relations() method is that it turns relations into attributes of the model itself. That is to say, attributes of the related tables can be access directly from the model in which they are declared.

This is easiest to see with the BELONGS_TO (many-to-one child-to-parent) relation, which isn’t instanced above. Here’s an example from the EditorialInstance model, however: i.e. one of the children of Journal in my database:

public function relations()
	{
		// NOTE: you may need to adjust the relation name and the related
		// class name for the relations automatically generated below.
		return array(
			'journal' => array(self::BELONGS_TO, 'Journal', 'journal_id'),
			'person' => array(self::BELONGS_TO, 'Person', 'person_id'),
		);

In this case, you can see tat EditorialInstance is the child of two databases (that is to say it BELONGS_TO them).

When a BELONGS_TO relationship is declared in a model, the attributes of the parent table are treated exactly like the attributes of the child table in the declaring model. I.e. let’s say the editorialInstance table has an attribute called type and we are referencing it like this in an editorialInstanceView: $data->type; we can also access all the attributes of the parent tables as well through this same model using language: so the lastName attribute on person would be referenced in this same context $data->person->lastName

Relational queries

----  

Creating compound attributes in Yii

Posted: Feb 24, 2012 12:02;
Last Modified: May 23, 2012 18:05

---

Let’s say you have a database table called persons with separate attributes (fields) for lastName and firstNames. Elsewhere in your website, you want to refer to the underlying record in this table using the person’s whole name as a single entity (e.g. to provide a link, for example: <a href="http://example.com/index.php?r=Person/view&id=1">Jane Q. Public</a>.

Sometimes, you might be able to refer to the two attributes separately. For example, if you simply wanted to echo the content in a view somewhere you could use code like this:

<?php echo CHtml::encode($data->person->firstNames) . ' ' . CHtml::encode($data->person->lastName); ?>

This is a little inefficient if you are doing it a lot throughout your site, because you need to keep re-entering the same code correctly over and over again (and avoiding this is a main reason for going with an MVC framework like Yii in the first place). But the real trouble comes if you want to use the attributes in a context where the method you are invoking expects a single attribute—as is the case, for example, with the yii linking method CHtml::link.

The way round this is to create a new compound attribute in your model. This means taking the two underlying attributes in your table and combining them into a single attribute already arranged the way you want that you can then invoke in other methods. Or in this case, adding something like this to the Person model:

public function getFirstNamesLastName()
    {
        return $this->firstNames . ' ' . $this->lastName;
    }

Once this function is declared, you can invoke it, in exactly the same way you would have invoked the “original” attributes lastName or [firstNames], using the attribute name FirstNamesLastName: e.g.

<?php 
CHtml::link(CHtml::encode($data->person->FirstNamesLastName),
array('person/view', 'id'=>$data->person->person_id)); ?>

(Note: there is a much more efficient way of encoding this last example using the same principle. See this post).

----  

Yii Ensuring that key terms are always linked

Posted: Feb 24, 2012 11:02;
Last Modified: May 23, 2012 18:05

---

As we are building our workflow manager, we are discovering that we develop a more intuitive interface if some terms are always hyperlinked and point to a standard presentation of the relational information.

One example of this might be names of people associated with the workflow (editors, authors, copyeditors, production assistants). An intuitive internal navigation method seems to be to have the names of these people always hyperlinked with the hyperlink always pointing to the person’s profile page.

One way of doing this in Yii would be to modify the views associated with each table in the site so that every time a name is called, you get a link. This is contrary to spirit of the MVC model, however, since it means you are using a view to present logic about the underlying model. And it is also prone to error, since it means you a) need to find every possible invocation of the name in all you various views and b) not make an error as you enter the same code over an over again in all these different views.

The better approach is to add this functionality to the underlying datamodel that supplies the information to the entire site in the first place—that is, to the model for the database that is providing the name information and the page you want to link to in the end.

Here’s some code for your model that would allow you produce a linked name anywhere in your yii site (for simplicity’s sake in this example, I am wrapping a single attribute from my database in a hyperlink. This post shows you how to use a similar method to first make compound attributes):

public function getLastNameLink()
    {
    return CHtml::link(CHtml::encode($this->lastName),
    array('person/view', 'id'=>$this->person_id));
    }

Here are some underlying premises behind this code:

  1. There is a table in my database called person
  2. I have written a view for this database (either by hand or using the gii utility to build one automatically): person/view is the URL fragment CHtml::link will use to build the link to the profile page for a given person (note: it is tempting to just use view for the URL because we are already in the person model; you should use the “full” yii-path however because you will be invoking this throughout the site from views associated with all sorts of other models)
  3. The table person has an attribute (column) called person_id.

Once this has been added to my Person model, I can call the code (and add a link to the person profile) in any view by just invoking the method: from now on, the LastNameLink functions as an attribute of the Person model and can be used in exactly the same way actual direct, table-based attributes can be invoked. For example, in a different model’s view:

<?php echo $data->person->LastNameLink; ?>

This code will produce a link to index.php?r=person/view&id=n where n is the id number of a given record in the table. If I hadn’t added the above code to the Person model, the code required to do the equivalent would have been:

<?php echo 
CHtml::link(CHtml::encode($data->person->lastNameFirstNames),
array('person/view', 'id'=>$data->person->person_id)); ?>
----  

Back to content

Search my site

Sections

Current teaching

Recent changes to this site

Tags

anglo-saxon studies, caedmon, citation, citation practice, citations, composition, computers, digital humanities, digital pedagogy, exercises, grammar, history, moodle, old english, pedagogy, research, student employees, students, study tips, teaching, tips, tutorials, unessay, universities, university of lethbridge

See all...

Follow me on Twitter

At the dpod blog