gfse: Translation Quiz integration
Also moved the translation quiz from demos/TransQuiz to src/www/TransQuiz so that it will be installed by 'cabal install' along with the other files that are installed for use by gf -server mode.
This commit is contained in:
1 parent
c1c1a73dc3
commit
6f42f58f71
15 files changed
+24
-2
No files matched your search
+1
-1
@@ -19,7 +19,7 @@ Phrasebook</a>
|
|||||||
|
|
||||||
<p><a href="http://www.grammaticalframework.org:41297/syllogism/syllogism.html">Online syllogism solver</a>
|
<p><a href="http://www.grammaticalframework.org:41297/syllogism/syllogism.html">Online syllogism solver</a>
|
||||||
|
|
||||||
<p><a href="TransQuiz/">Translation Quiz</a>
|
<p><a href="../src/www/TransQuiz/translation_quiz.html">Translation Quiz</a>
|
||||||
|
|
||||||
<P><a href="minibar/minibar.html">Minibar
|
<P><a href="minibar/minibar.html">Minibar
|
||||||
online</A>
|
online</A>
|
||||||
|
|||||||
@@ -23,6 +23,10 @@ data-files: www/index.html
|
|||||||
www/minibar/*.css
|
www/minibar/*.css
|
||||||
www/minibar/*.js
|
www/minibar/*.js
|
||||||
www/minibar/*.png
|
www/minibar/*.png
|
||||||
|
www/TransQuiz/*.html
|
||||||
|
www/TransQuiz/*.css
|
||||||
|
www/TransQuiz/*.js
|
||||||
|
www/TransQuiz/*.png
|
||||||
|
|
||||||
source-repository head
|
source-repository head
|
||||||
type: darcs
|
type: darcs
|
||||||
|
|||||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
+18
-1
@@ -148,6 +148,7 @@ function draw_namebar(g,files) {
|
|||||||
return div_class("namebar",
|
return div_class("namebar",
|
||||||
[table([tr([td(draw_name(g)),
|
[table([tr([td(draw_name(g)),
|
||||||
td_right([minibar_button(g,files),
|
td_right([minibar_button(g,files),
|
||||||
|
quiz_button(g),
|
||||||
compile_button(g),
|
compile_button(g),
|
||||||
draw_plainbutton(g,files),
|
draw_plainbutton(g,files),
|
||||||
draw_closebutton(g)])])])])
|
draw_closebutton(g)])])])])
|
||||||
@@ -184,7 +185,7 @@ function show_compile_error(res) {
|
|||||||
var dst=compiler_output
|
var dst=compiler_output
|
||||||
if(dst) {
|
if(dst) {
|
||||||
clear(dst);
|
clear(dst);
|
||||||
var minibarlink=a(res.minibar_url,[text("Minibar")])
|
//var minibarlink=a(res.minibar_url,[text("Minibar")])
|
||||||
if(res.errorcode=="OK")
|
if(res.errorcode=="OK")
|
||||||
dst.appendChild(wrap("h3",text("OK")))
|
dst.appendChild(wrap("h3",text("OK")))
|
||||||
else
|
else
|
||||||
@@ -243,6 +244,22 @@ function minibar_button(g,files) {
|
|||||||
return b;
|
return b;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function quiz_button(g) {
|
||||||
|
function goto_quiz(res) {
|
||||||
|
show_compile_error(res);
|
||||||
|
if(res.errorcode=="OK")
|
||||||
|
location.href="../TransQuiz/translation_quiz.html?"+local.get("dir")+"/"
|
||||||
|
}
|
||||||
|
function compile() {
|
||||||
|
replaceInnerHTML(compiler_output,"<h3>Compiling...</h3>");
|
||||||
|
upload(g,goto_quiz);
|
||||||
|
}
|
||||||
|
var b=button("Quiz",compile);
|
||||||
|
b.title="Upload the grammar and go to the translation quiz";
|
||||||
|
return b;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
function lang(code,name) { return { code:code, name:name} }
|
function lang(code,name) { return { code:code, name:name} }
|
||||||
function lang1(name) {
|
function lang1(name) {
|
||||||
var ws=name.split("/");
|
var ws=name.split("/");
|
||||||
|
|||||||
@@ -9,6 +9,7 @@
|
|||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="minibar/minibar.html">Minibar</a>
|
<li><a href="minibar/minibar.html">Minibar</a>
|
||||||
|
<li><a href="TransQuiz/translation_quiz.html">Translation Quiz</a>
|
||||||
<li><a href="gfse/">GF online editor for simple multilingual grammars</a>
|
<li><a href="gfse/">GF online editor for simple multilingual grammars</a>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user