If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Aircraft recognition quiz

Dear members,

A couple months ago one of our fellow-forum-members helped me a lot with building this Aircraft Recognition Quiz.
It is already fully operational in my school and I'm very happy with it, but I found some troubles with keeping it up to date because every picture has to be brought in manually. (it's about 1000pictures and it constantly evolves)

The website only consists of javascript, because I have to copy the "webtool" offline with my fellow-students and so I cannot teach everyone how to install a PHP-server. (I guess, I'm totally no pro! )

Now every picture has its adress and its value...
I wanted to know if I could let the browser pick a random picture from a folder and the value should then be the name of the folder. (or a name that I can still type in manually, but I should be great already if I can just drop pictures in a folder and so they will pop up in the quiz automaticly)

Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of the Snowtide Informatics Systems nor the names of its
contributors may be used to endorse or promote products derived from this
software without specific prior written permission.

// returns a function that returns true if a key passed to the returned function
// is in the dict (js object) provided to this function; replaces being able to
// carry around dict.has_key in python...
__isindict: function (dict) {
return function (key) { return dict.hasOwnProperty(key); };
},

Preface: I know nothing about what difflib.js does and don't plan on learning it.

However, if you need a way to select random images from different folders, the following may help.
If you know what images are in which folders and have a description for each image
the following assignments, as in the function getDescription1(), could be made for each different folder.

Okay, and what if I should start using a database?
At first I thought not to do it because the website would not be available online, but maybe it is an option!

I've put a small part of the website online here: www.driesgovaerts.be/heverlee/reco.html
Can anyone help me about how I can make this different categories in the quiz easier to update? Using a random picture from each folder (automaticly) naming it the foldername OR rebuilding it using a database where I can just drop pictures/folders and automaticly having it a value given?
Because as I said, I have to give now each individual picture an adress and I have to give each individual picture a value too... (using javascript, ...) But I have more than 1000pictures and a lot of these pictures have the same value.

I just want to keep the same layout and I'm not very familiar with PHP and databases, but I always want to try it...
Is there anyone that can send me a tutorial or something about how to set up a database and how I should integrate in into my website? Me and my class will be very gratefull...

Another concept you could apply would be to place all your filenames into a text file and read that file
from a server using some ajax code added. This would require an internet connection while the previous
example above could be executed from a local file. Your design choice.

The filenames could be created with a simple UNIX command on the server
Something like: ls -1 > imgFile1.txt and then modified with your answer key to form the formatted arrays.