// mydatalib.js > // ---------------------------------------- > // Hello, > // > // Look for comments > // marked as follows: > // > // ---------------------------------------- > // ** DIRECTIONS > // (something, something, something...) > // ---------------------------------------- > // > // - where "something" is a description > // of what you must do to make the > // quiz work. > // ---------------------------------------- > function reportjavalib() { if (test) { alert('Loaded ' + javalibfilename) } } // ------------------------------------------- javalibfilename = "mydatalib.js" reportjavalib() // ---------------------------------------- > // ** DIRECTIONS > // Best to leave the rest of this > // file unchanged for testing purposes. > // Then you should have a running > // system. > // (The content is meaningless.) > // You can put in your own data at a > // later time. > // > // ---------------------------------------- > function iq(aa,bb) { qlib_addq ( aa, bb ) } function doiq(aa,bb) { iq ( aa, bb ) } // ---------------------------------------- > // ** DIRECTIONS > // Now to the difficult part. Or > // the fun part. The data. > // > // You may define the data as below. > // The statement > // doiq("a","Puff The Magic Dragon") > // specifies that './yourqimg/a.gif' > // is the question, and "Puff The > // Magic Dragon" is the answer. > // > // (That's one way. Another follows.) > // > // Calls to doiq() are put inside > // special functions that are called > // when you press a button to load > // the data. > // > // mydatalib_choice_a() is a simple level in > // this example quiz, mydatalib_choice_all > // is the expert level, comprising > // all questions. > // > // > // ---------------------------------------- > function mydatalib_choice ( thechoice ) { qlib_reset ( ) if (false) { } else if ( thechoice == "a" ) { mydatalib_choice_a() } else if ( thechoice == "k" ) { mydatalib_choice_ka ( ) } else if ( thechoice == "all" ) { mydatalib_choice_all ( ) } else { } return true } function mydatalib_choice_all () { mydatalib_choice_a() mydatalib_choice_ka() mydatalib_choice_sa() mydatalib_choice_ma() choicelist = "all" return true } function mydatalib_choice_a () { choicelist = "a" doiq("a","this one is called 'a'") doiq("i","this one is called 'i'") doiq("u","this one is called 'u'") doiq("e","this one is called 'e'") doiq("o","this one is called 'o'") return true } function mydatalib_choice_ka () { choicelist = "ka" doiq("ka","this one is called 'ka'") doiq("ki","this one is called 'ki'") doiq("ku","this one is called 'ku'") doiq("ke","this one is called 'ke'") doiq("ko","this one is called 'ko'") return true } function mydatalib_choice_sa () { choicelist = "sa" doiq("sa","this one is called 'sa'") doiq("si","this one is called 's(h)i'") doiq("su","this one is called 'su'") doiq("se","this one is called 'se'") doiq("so","this one is called 'so'") doiq("ta","this one is called 'ta'") doiq("ti","this one is called 'chi'") doiq("tu","this one is called 'tsu'") doiq("te","this one is called 'te'") doiq("to","this one is called 'to'") return true } function mydatalib_choice_ma () { choicelist = "ma" doiq("ma","this one is called 'ma'") doiq("mi","this one is called 'mi'") doiq("mu","this one is called 'mu'") doiq("me","this one is called 'me'") doiq("mo","this one is called 'mo'") doiq("na","this one is called 'na'") doiq("ni","this one is called 'ni'") doiq("nu","this one is called 'nu'") doiq("ne","this one is called 'ne'") doiq("no","this one is called 'no'") return true } // ---------------------------------------- > // ** DIRECTIONS > // That's it -- you are ready. > // > // ---------------------------------------- >