Archive for July 7, 2007

osCommerce: Mask credit card numbers for old orders

I recently discovered that osCommerce does not automatically remove credit card information for old orders. Here is a little script that I dropped into admin/orders.php that silently masks credit card numbers for orders older than 14 days. One day, I will learn how to create a legitimate module.

$cc_numbers_query = tep_db_query("select orders_id, cc_number from " . TABLE_ORDERS . " where orders_status=3 AND last_modified < (DATE_ADD(NOW(), INTERVAL -14 DAY))");
while ($cc_num = tep_db_fetch_array($cc_numbers_query)) {
$fullcc = $cc_num['cc_number'];
if ($fullcc && (!strstr($fullcc, 'x'))) { // hasn't previously been processed
$newcc='';
for ($a=0;$a<(strlen($fullcc)-4);$a++) {
$newcc .= 'x';
}
$newcc .= substr($fullcc,-4);
$editcc_query = tep_db_query("update " . TABLE_ORDERS . " set cc_number = '" . $newcc . "' where orders_id = " . $cc_num['orders_id']);
}
}

Intranet Design Update

I updated our insideCatlin design layout over the past few weeks to use the new school publication colors and improve legibility. This is in line with trends among web 2.0 tools to increase font size and simplify page layout. I had used the old design for five years between two schools!

I started by applying the Aberdeen theme to Drupal and adjusting the colors to the Catlin web palette. Then I applied the Chameleon theme to Moodle and adjusted the font and color settings to very nearly match the Drupal theme. Finally, I adjusted the HTML template that our custom Perl and PHP scripts use.

Comments welcome.

Old design

old

New design

new

New Moodle features, or have I just not been paying attention?

Working with a teacher today, I came across the following Moodle features, some of which are probably new to version 1.7 or 1.8 and some of which were probably there all along, and I just didn’t notice them!

Complete activity reports

Click on any student icon -> Activity Report -> Complete Report, and you can actually see all of the individual pieces of work a student has submitted. This satisfies a request that two teachers specifically brought to my attention and probably many more have wanted for some time.

complete activity report

Media filters

I turned on media filters just for fun while attempting to implement Speex, and presto, Moodle automatically inserts a Flash player when I upload a MP3 file! This will make audio work so much easier, especially in language classes.

audio player

Assignment type: upload multiple files

English teachers invariably follow a writing process model, which requires submission and review of multiple drafts of each written work. Moodle now provides an assignment type that permits both the student and the teacher to upload multiple files. In this way, they may exchange multiple revisions and commented versions until the paper is complete.

drafts

Inline assignment commenting

I had known about this before, but it dovetails nicely with the previous feature. If students are comfortable writing directly into Moodle (tough for three-page essays), then the teacher may insert comments in a different color directly into the text. Sure, it’s not “track changes,” but most teachers want to provide advice rather than directly edit the student’s text.

Bravo, Moodle! You have developed a strong capacity to provide features that teachers rely on and respond to their continued needs.

Fix resources in Moodle 1.6 -> 1.8 upgrade

Since we upgraded Moodle to 1.8, I have been bothered by how the web and file resources displayed after the conversion. A new, intermediate screen appeared asking the user to click to open the requested resource, a bother if you were used to clicking on the link and seeing the page immediately open.

screenshot

I discovered today that Moodle 1.8 (or was it 1.7?) eliminated the “display in a frame” option for resources, which had been the default option in 1.6. We were getting this new screen for any resource that had the frame option selected. I’m not sure whether this was an intentional omission from the Moodle upgrade scripts or not. It’s worth mentioning that all other aspects of the Moodle upgrade went extremely smoothly!

How could we update all of the resources with this problem at once? I looked into the database and developed the following query to do the trick.

update `resource` set `options`='' where `options`='frame';

This changes all resources that used to open within a frame so that they will open in the same window.

Please note that tinkering directly with the database of any application is only recommended if you have first thoroughly tested the change and have a solid backup of your data! One way to test is to run the query on individual records within a test course before applying it to real courses. I certainly feel a lot better about making global changes in this manner during the summer when the site is inactive.

Twitter and School Communities

Over the past couple of months, I have been skeptical about the usefulness of Twitter. Bloggers seemed wildly enthusiastic about the new technology, but many suggested that they hadn’t found a useful purpose for it yet. Thank you to Dave Warlick for shedding some light on this mystery. Dave suggests that Twitter tells him “where my friends brains are at.” I think he is saying that microblogging deepens the blogging environment. If blogging allows me to read a message from a person in my network a few times a week, microblogging technologies such as Twitter allow me to touch these individuals several times a day. I find great value in my online network of colleagues in the constant inputs I receive that help inform my work. Microblogging could draw this network of far-flung individuals a little closer together. Perhaps that is why it has taken off so quickly. Twitter makes the quality of contact with the individuals in your network richer and more frequent.

This reminds me of a comment that Hoover Chan made last year, that the new social web technologies are all new forms of the same old social networking concept popularized through MOOs and MUDs. People continue to search for and develop new online environments that allow the richest possible interactions between individuals who are temporally and geographically widely dispersed. Though the technologies have changed from all-text environments to client-based applications (email, chat) to web-based tools (blogging, social networking tools), the goal has remain unchanged throughout. Perhaps we may understand Second Life in the same way. People seem strongly attracted to the 3D, visual nature of this virtual environment, even though I read that there is an amazing tendency to recreate traditional learning (and shopping) interactions in Second Life. If you find value in the visually rich online interactions, then perhaps you will get something out of Second Life. I haven’t yet tried it.

In a subsequent post, Warlick considers the potential of Twitter as a teaching and learning tool. He wonders whether students engaging in a reading activity during class would find value in sharing their thoughts on the text as they read. Each student would gain an instant snapshot into the thoughts of the others at the same time — an interesting possibility. I find that other social networking tools have value in schools in the same way they have value to adults in the blogging community. They bring the entire community closer together by enriching dialogue throughout the school — in classes, clubs, and in fact anywhere and anytime that students get online. School communities that might otherwise fracture into cliques based on social status and age are drawn closer together. In San Francisco four years ago, I found that students who would ordinarily never speak with each other (say, a senior girl and a freshman boy) were engaging in rich conversations in our online forums.

If we consider microblogging an extension of other social networking tools, then perhaps we will find that it has the greatest educational value by simply making it available to teachers and students and seeing how they use it. In the era of web-based social networking, I have had the most success with discussion forums, Moodle, and photo galleries. Each time, I have found that teachers and students adopt the tools in a great variety of manners, much more than I imagined or suggested that people should. I can already see students using Twitter in the same manner they already use texting — to stay in touch and share ideas throughout the busy school day. Teachers might gain a new appreciation for the challenges facing students in a traditional school schedule if they followed students’ Twitter feeds for a day!

My challenge with Twitter is twofold: will the individuals in my blogging network adopt Twitter? I have already had little success persuading the tech director colleagues I most respect to go online with their thoughts. At the same time, I have found new colleagues across the country through blogging. Will they Twitter? I can only give it a try and see. Hopefully, I’ll start this week, though my feed will be a lot more interesting once the school year has started again.