mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-09 04:59:31 -06:00
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:
@@ -19,7 +19,7 @@ Phrasebook</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
|
||||
online</A>
|
||||
|
||||
4
gf.cabal
4
gf.cabal
@@ -23,6 +23,10 @@ data-files: www/index.html
|
||||
www/minibar/*.css
|
||||
www/minibar/*.js
|
||||
www/minibar/*.png
|
||||
www/TransQuiz/*.html
|
||||
www/TransQuiz/*.css
|
||||
www/TransQuiz/*.js
|
||||
www/TransQuiz/*.png
|
||||
|
||||
source-repository head
|
||||
type: darcs
|
||||
|
||||
|
Before Width: | Height: | Size: 35 KiB After Width: | Height: | Size: 35 KiB |
@@ -148,6 +148,7 @@ function draw_namebar(g,files) {
|
||||
return div_class("namebar",
|
||||
[table([tr([td(draw_name(g)),
|
||||
td_right([minibar_button(g,files),
|
||||
quiz_button(g),
|
||||
compile_button(g),
|
||||
draw_plainbutton(g,files),
|
||||
draw_closebutton(g)])])])])
|
||||
@@ -184,7 +185,7 @@ function show_compile_error(res) {
|
||||
var dst=compiler_output
|
||||
if(dst) {
|
||||
clear(dst);
|
||||
var minibarlink=a(res.minibar_url,[text("Minibar")])
|
||||
//var minibarlink=a(res.minibar_url,[text("Minibar")])
|
||||
if(res.errorcode=="OK")
|
||||
dst.appendChild(wrap("h3",text("OK")))
|
||||
else
|
||||
@@ -243,6 +244,22 @@ function minibar_button(g,files) {
|
||||
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 lang1(name) {
|
||||
var ws=name.split("/");
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
|
||||
<ul>
|
||||
<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>
|
||||
</ul>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user