Commit d2c3ec99 authored by Thomas Dennis's avatar Thomas Dennis

Initial "nouns" stuff.

parent 301d2095
......@@ -2,48 +2,44 @@
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" type="text/css" href="default.css">
<script src="conjugate/verb_u.js" type="text/javascript"></script>
<script src="conjugate/verb_eru.js" type="text/javascript"></script>
<script src="conjugate/adjective_i.js" type="text/javascript"></script>
<script src="conjugate/adjective_na.js" type="text/javascript"></script>
<script src="conjugate/main.js" type="text/javascript"></script>
<title>Conjugations</title>
<link rel="stylesheet" href="default.css">
<script src="js/util.js"></script>
<script src="js/verb_u.js"></script>
<script src="js/verb_eru.js"></script>
<script src="js/adjective_i.js"></script>
<script src="js/adjective_na.js"></script>
<script src="js/conjugate.js"></script>
<title>naniJSore - Conjugations</title>
</head>
<body onload="setup()">
<h1>Japanese Conjugations Quiz</h1>
<p>
How much do you know about Japanese verb/adjective conjugation rules?
Try to answer the questions below, then press the <b>Check Results</b>
button to see how well you did. Information about incorrect answers will
be shown underneath each question, and the total score will be displayed
at the bottom of the page.
</p>
<p>
<b>NOTE:</b> Answers should be entered using
<a href="http://en.wiktionary.org/wiki/romaji" target="_blank">romaji</a>
characters.
</p>
<h3>Resources</h3>
<ul>
<li>Learn about <b>verbs</b> on <a href="http://japanese.about.com/library/weekly/aa031101b.htm" target="_blank">about.com</a></li>
<li>Learn about <b>adjectives</b> on <a href="http://japanese.about.com/library/weekly/aa040101b.htm" target="_blank">about.com</a></li>
<li>You can also look up words on <a href="http://www.csse.monash.edu.au/~jwb/cgi-bin/wwwjdic.cgi" target="_blank">WWWJDIC</a></li>
</ul>
<hr>
<div id="quizarea">
<noscript>Javascript is disabled.</noscript>
</div>
<hr>
<p>
<a class="jslink" href="#" onclick="check()"><b>Check Results</b></a>
<a class="jslink" href="#" onclick="reset()">Restart</a>
<span id="score"></span>
</p>
<hr>
<small>
This page is part of the naniJSore project. Get the latest version from
<a href="https://gitorious.org/nanijsore/nanijsore">Gitorious.org</a>.
</small>
<h1>Japanese Conjugations Quiz</h1>
<p>
How much do you know about Japanese verb/adjective conjugation rules?
Try to answer the questions below, then press the <b>Check Results</b>
button to see how well you did. Information about incorrect answers will
be shown underneath each question, and the total score will be displayed
at the bottom of the page.
</p>
<p>
<b>NOTE:</b> Answers should be entered using
<a href="http://en.wiktionary.org/wiki/romaji" target="_blank">romaji</a>
characters.
</p>
<h3>Resources</h3>
<ul>
<li>Learn about <b>verbs</b> on <a href="http://japanese.about.com/library/weekly/aa031101b.htm" target="_blank">about.com</a></li>
<li>Learn about <b>adjectives</b> on <a href="http://japanese.about.com/library/weekly/aa040101b.htm" target="_blank">about.com</a></li>
<li>You can also look up words on <a href="http://www.csse.monash.edu.au/~jwb/cgi-bin/wwwjdic.cgi" target="_blank">WWWJDIC</a></li>
</ul>
<hr>
<div id="quizarea">
<noscript>Javascript is disabled.</noscript>
</div>
<hr>
<p>
<a class="jslink" href="#" onclick="check()"><b>Check Results</b></a>
<a class="jslink" href="#" onclick="reset()">Restart</a>
<span id="score"></span>
</p>
</body>
</html>
Licensing
=========
All images are taken from [Wikimedia Commons](http://commons.wikimedia.org). The
license used for each image varies; see the links below for further details:
+ apple.png - <http://commons.wikimedia.org/wiki/File:Anna_Apple.jpg>
+ banana.png - <http://commons.wikimedia.org/wiki/File:Bananen_Frucht.jpg>
+ orange.png - <http://commons.wikimedia.org/wiki/File:Citrus_sinensis.jpg>
+ peach.png - <http://commons.wikimedia.org/wiki/File:Peach_%281%29.jpg>
+ pear.png - <http://commons.wikimedia.org/wiki/File:PearPhoto.jpg>
+ pineapple.png - <http://commons.wikimedia.org/wiki/File:Ananas~May_2008-1.jpg>
+ strawberry.png - <http://commons.wikimedia.org/wiki/File:FraiseFruitPhoto.jpg>
+ watermelon.png - <http://commons.wikimedia.org/wiki/File:Watermelon.svg>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="default.css">
<title>naniJSore</title>
</head>
<body>
<h1>naniJSore</h1>
<ul>
<li><a href="nouns.htm">Nouns (Multi-lingual)</a></li>
<li><a href="conjugate.htm">Verb Conjugations (Japanese)</a></li>
</ul>
</body>
</html>
......@@ -12,6 +12,9 @@ var QUESTION = [
function setup()
{
// Add the common stuff to the bottom of the page.
addFooter();
// Generate some HTML elements for each question.
var parent = document.getElementById("quizarea");
for (var n = 0; n < QUESTION.length; ++n)
......
"use strict";
var LANGUAGE = {}; // NOTE: The other nouns_xx.js files add stuff to this.
// This defines the question set:
var CATEGORIES = {
"fruit": ["apple", "banana", "orange", "peach", "pear", "pineapple", "strawberry", "watermelon"]
};
// This function translates the USER INTERFACE into another language.
function setLanguage(lang)
{
document.getElementById("page_title").innerHTML = LANGUAGE[lang].title;
document.getElementById("page_intro").innerHTML = LANGUAGE[lang].intro;
for (var category in CATEGORIES)
{
// If multiple translations are available, just use the first one.
document.getElementById(category).innerHTML = LANGUAGE[lang].dictionary[category][0];
}
}
// This function is called when the page first loads.
function setup()
{
// Create a language selection "menu" at the top of the page.
for (var lang in LANGUAGE)
{
document.body.appendChild(document.createTextNode(" "));
var a = document.body.appendChild(document.createElement("a"));
a.innerHTML = lang;
a.href = "#";
a.setAttribute("onclick", "setLanguage('" + lang + "')");
}
// Create the "intro" section at the top of the page.
document.body.appendChild(document.createElement("hr"));
document.body.appendChild(document.createElement("h1")).id = "page_title";
document.body.appendChild(document.createElement("div")).id = "page_intro";
document.body.appendChild(document.createElement("hr"));
// Create the questions.
for (var c in CATEGORIES)
{
document.body.appendChild(document.createElement("h2")).id = c;
var table = document.body.appendChild(document.createElement("table"));
for (var i = 0; i < CATEGORIES[c].length; ++i)
{
var tr = table.appendChild(document.createElement("tr"));
var td_image = tr.appendChild(document.createElement("td"));
var img = td_image.appendChild(document.createElement("img"));
img.alt = "???";
img.src = "image/" + CATEGORIES[c][i] + ".png";
var td_input = tr.appendChild(document.createElement("td"));
td_input.appendChild(document.createElement("input")).id = c + "_" + CATEGORIES[c][i] + "_answer";
var td_about = tr.appendChild(document.createElement("td")).id = c + "_" + CATEGORIES[c][i] + "_info";
}
}
// Create the "answer buttons" at the bottom of the page.
document.body.appendChild(document.createElement("hr"));
for (var lang in LANGUAGE)
{
document.body.appendChild(document.createTextNode(" "));
var a = document.body.appendChild(document.createElement("a"));
a.className = "jslink";
a.innerHTML = lang;
a.href = "#";
a.setAttribute("onclick", "check('" + lang + "')");
}
// Add the standard footer stuff.
addFooter();
// Now that everything is ready, set the default UI language.
setLanguage("English");
}
// This is called when the user clicks on an "answer button" link.
function check(lang)
{
console.log("TODO: Unimplemented.");
}
"use strict";
LANGUAGE["English"] = {
title: "Nouns",
intro: "Enter an answer next to each item below, and then click the relevant button at the bottom of the page",
dictionary: {
"apple": ["apple"],
"banana": ["banana"],
"fruit": ["fruit"],
"orange": ["orange", "tangerine", "satsuma"],
"peach": ["peach", "nectarine"],
"pear": ["pear"],
"pineapple": ["pineapple"],
"strawberry": ["strawberry"],
"watermelon": ["watermelon"]
}
};
"use strict";
LANGUAGE["日本語"] = {
title: "名詞",
intro: "(translation missing)",
dictionary: {
"apple": ["林檎", "りんご", "リンゴ", "ringo"],
"banana": ["甘蕉", "ばなな", "バナナ", "banana"],
"fruit": ["", "", "", "mi"],
"orange": ["(translation missing)"],
"peach": ["(translation missing)"],
"pear": ["(translation missing)"],
"pineapple": ["(translation missing)"],
"strawberry": ["(translation missing)"],
"watermelon": ["(translation missing)"]
}
};
"use strict";
function addFooter()
{
document.body.appendChild(document.createElement("hr"));
document.body.appendChild(document.createElement("small")).innerHTML =
"<a href='index.htm'>&lt;- Main Page</a> | This page is part of the naniJSore project. Get the latest version from <a href='https://gitorious.org/nanijsore/nanijsore'>Gitorious.org</a>.";
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="default.css">
<script src="js/util.js"></script>
<script src="js/nouns.js"></script>
<script src="js/nouns_en.js"></script>
<script src="js/nouns_jp.js"></script>
<title>naniJSore - Nouns</title>
</head>
<body onload="setup()">
<noscript>Javascript is disabled.</noscript>
</body>
</html>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment