Home > Programming, The Lighter Side > Fun with PHP

Fun with PHP

August 12th, 2010

Okay, all of you actual programmers out there, get ready for amateur hour. I have been working to understand programming better for a while now, and have made a teensy bit of progress. I learned HTML and CSS the natural way–I gleaned it bit by bit off of instructional web sites and peeking at other people’s code (a lot of CSS I learned, in fact, came from editing the themes for this blog). But I wanted to get beyond simple scripting and into some actual programming, something I hadn’t done since I took that BASIC programming class back in 1982.

I figured that my best chance would be to take advantage of the online classes from the college where I teach, free to faculty. Intermediate Algebra was a prerequisite, and though I passed it back in the 80’s (one of my few “B” grades in college), I figured it was time to freshen up, considering that (a) it could help in programming, (b) I have a bit of a phobia about anything more complex than basic math, and (c) I hadn’t used any of it since I took the course and remembered pretty much squat. So I took that class, aced it, and went on to take the next class, “Introduction to Computer Programming.” Which it pretty much was–just an intro course. We never got beyond making little C++ command-line programs. Alas, another Math class–Discrete Math–was required before taking any other programming courses, so I bore down and signed up for that. Problem: the text was horrific, requiring about 30 hours a week to get past the atrocious writing so I could spend another 10 hours learning the material. It was just too much on a full-time schedule, so I reluctantly withdrew.

Not wanting to just give up (our local Math professor has kindly agreed to arrange a private independent-study course that might get me the credit for Discrete Math, but not this year), I started studying PHP. I want to re-write my Introduction to Computers web site from the ground up anyway, and I figured that knowing some PHP would help. Well, now that my August break has started, I started diving into it. The result so far: a crude, basic understanding… and a result. I figured out how to add a much-needed feature to my web site. My students crave feedback at every step, and I wanted to add little exercises after each page or two of study. PHP gave me a way to create very slightly interactive quizzes, very simple–choose the answers from drop down menus and check to see if you got things right.

Pleased with my little success, I figured I’d have a bit of fun and add a quiz you might want to take–not on computers, but on some basic political points. Just click the link below, choose what you think are the best answers, and then click “See Results” to find out how many you got right. Since I like my students to figure out correct answers, I don’t give the answers on the results page; you have to go back and try again. Enjoy!

Quizy01

Categories: Programming, The Lighter Side Tags: by
  1. Troy
    August 12th, 2010 at 05:33 | #1

    DHTML might be a better long-term direction for this.

    The latest IE can support modern DHTML pretty well I gather so compatibility issues are a thing of the past.

    Going clientside gives you the ability to do a lot of animation etc.

    However, for real quizzes you don’t want to put the answers in the source!

    Even hidden content injected into the DOM via AJAX can be inspected by savvy web programmers : ) — so you’ll still need a server-side to vend the answer key when needed.

    Exclusively targeting the Firefox client (but silently supporting Safari too) wouldn’t be a bad direction, perhaps, though like I said I think these days IE is good enough too, but I might be wrong on this.

  2. Todd
    August 12th, 2010 at 09:04 | #2

    I recommend checking out the Khan Academy for help with understanding the math courses. He can explain and give examples exceptionally well.

    http://www.khanacademy.org/

  3. Geoff K
    August 12th, 2010 at 09:54 | #3

    I don’t know. The quiz seems to be broken. I’m pretty sure that I answered correctly, but I seem to have gotten nearly every answer wrong…

  4. Luis
    August 12th, 2010 at 11:25 | #4

    Geoff:

    Hmmm… I’ll take a look and see what’s wrong with it. ๐Ÿ˜€

  5. Luis
    August 12th, 2010 at 11:36 | #5

    Todd:

    Thanks! I took a look… but they don’t seem to have anything on the subject I need, Discrete Math. They do have some videos on logical statements and such, but at the Algebra level and not of the type that would help me so much with the course I need to take. Thanks, though, the suggestion is much appreciated. And if you hear of any Discrete Math texts that are well-written, please let me know!

  6. Luis
    August 12th, 2010 at 11:43 | #6

    Troy: Thanks, I think I’ll look at DHTML. The “W3Schools” site seems to have some good stuff on this. And no, this won’t be for an actual test, just for building a more interactive site and including extra features like the self-reviews.

    Nevertheless, I am determined to plunge forward with PHP. At the very least, it will be useful on the web (hell, I might even learn how to make my own blog theme one day) and seems like it might even help to better understand C, as an easier intermediate step.

  7. Todd
    August 12th, 2010 at 12:32 | #7

    This book seems to be well-regarded, especially for those who may be non-math majors, and might not have a strong mathematics background:

    http://www.amazon.com/Discrete-Mathematics-Applications-Susanna-Epp/dp/0534944469

  8. Leszek Cyfer
    August 12th, 2010 at 16:06 | #8

    All nice green correct in first try :)

    It seems I absorbed well your political teachings on this blog ๐Ÿ˜›

Comments are closed.