submittranslation.php 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253
  1. <!DOCTYPE html>
  2. <html>
  3. <meta charset="utf-8">
  4. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  5. <link rel="stylesheet" type="text/css" href="css/style.css">
  6. <head>
  7. <title>An African Language Short Story Competition</title>
  8. </head>
  9. <body>
  10. <ul>
  11. <li><a id="home" href="index.php">Home</a></li>
  12. <li><a id="original" href="submit.php">Original Story Submission</a></li>
  13. <li><a id="translation" class=active href="#">Translated Story Submission</a></li>
  14. <li><a id="stories" href="displaystories.php">Submitted Stories</a></li>
  15. <li><a id="statistics" href="submissionstatistics.php">Submissions per Language</a></li>
  16. <!-- <li><a id="coordinate" href="coordinator.php">Coordinator Application</a></li> -->
  17. <li><a id="contact" href="contact.php">Contact</a></li>
  18. <li><a id="resources" href="resources.php">Resources</a></li>
  19. <li><a id="flyers" href="flyers.php">Flyers</a></li>
  20. <li><a id="faq" href="faq.php">Frequently Asked Questions</a></li>
  21. <li><a id="privacy" href="privacy.php">Privacy</a></li>
  22. </ul>
  23. <header>
  24. <h1>Tuvute Pamoja
  25. <a href="https://deeplearningindaba.com">
  26. <img src="images/deeplearningindaba.svg" alt="Deeplearning Indaba" style="height:60px">
  27. </a></h1>
  28. </header>
  29. <?php include 'submitdatabaseinfo.php';?>
  30. <?php include 'submittranslationsetup.php';?>
  31. <h1 id="title">An African Language Short Story Competition</h1>
  32. <div>
  33. <h3 id="descriptiontitle">General Description</h3>
  34. <p id="descriptiontext1">Thank you for making a submission. Your translation should be suitable for people between the ages of 5 and 12 years old. The original stories draw some inspiration from the traditions and cultures of the group that uses that language, you may find some terms cannot be translated, in which case a short description can be used as well as the original term. Original stories are between 800 and 1200 words, conciseness of languages differ, and explanations of terms may also be needed, so translations should be between 600 and 1600 words. Prizes will be available for translated stories. Stories will be judged by those who have submitted a story or a translation in a language or language group. Stories with the highest scores will win prizes. A prize of $20 will be given to the translator of the best translated short story in each language. Should a story be translated multiple times, the last translator of the story into the language in which the story is judged to be the best will win the $20 prize. A prize of $20 will be given to the author of the best translated short story in each language. Translated stories will be evaluated on a 5 point scale on:</p>
  35. <ol>
  36. <li id="descriptiontext2">Grammar and spelling</li><br>
  37. <li id="descriptiontext3">Theme and plot</li><br>
  38. <li id="descriptiontext4">Style</li><br>
  39. <li id="descriptiontext5">Cultural knowledge gained</li><br>
  40. <li id="descriptiontext6">Overall impression</li><br>
  41. </ol>
  42. <p id="descriptiontext7">The average score will be used to rank stories, in case of a
  43. tie, the organizing committee will randomly choose one story to receive a prize.</p>
  44. </div>
  45. </section>
  46. <section>
  47. <div>
  48. <h3 id="furtherules">Further Rules</h3>
  49. <ol>
  50. <li id="furtherrulestext1">Entries will be evaluated anonymously, authors and translators may advertise the competition, and their entry in it, but should not advertise their authorship or translation of an article until winners are announced.</li><br>
  51. <li id="furtherrulestext2">All entries will be released under a creative commons attribution license that allows others to distribute, remix, adapt and build upon your work, even commercially, as
  52. long as they credit the authors for the original creation and translators for the translation. For more on this license see:</li><br><a href="https://creativecommons.org/licenses/by/4.0/">https://creativecommons.org/licenses/by/4.0/</a><br>
  53. <li id="furtherrulestext3">You may choose to use a pseudonym.</li><br>
  54. <li id="furtherrulestext4">Should you win a prize and not wish to be identified, you may choose to have your earnings given to a charitable organization of your choice.</li><br>
  55. </ol>
  56. </div>
  57. </section>
  58. <section>
  59. <div>
  60. <form method="post" action="">
  61. <p>
  62. <label id="languagefromlabel" for="languagefrom">
  63. Select a language you would like to translate from
  64. </label>
  65. <span class="error">*</span><br>
  66. <span class="error"><?php echo $languagefromErr;?></span><br>
  67. <select class="language" id="languagefrom" name="languagefrom" onchange="getstorytitles()">
  68. <option data-language="" value="<?php echo $languagefrom;?>"><?php echo $originallanguagename;?></option>
  69. <?php include 'languagelist.php';?>
  70. </select>
  71. </p>
  72. <table id="titles" ></table>
  73. <p>You have translated the story:</p>
  74. <p>
  75. <textarea id="originalidstring" type="text" name="originaltitle" maxlength="100" style="width:750px" rows="1" readonly><?php echo $originaltitle;?></textarea><br>
  76. </p>
  77. <input id="originalid" name="originalid" type="hidden" value="<?php echo $originalid;?>"></input>
  78. <label id="languagetolabel" for="languageto">Select the language you have translated to </label>
  79. <span class="error">*</span><br>
  80. <span class="error"><?php echo $languagetoErr;?></span><br>
  81. <select class="language" id="languageto" name="languageto">
  82. <option data-language="" value="<?php echo $languageto;?>"><?php echo $translatedlanguagename;?></option>
  83. <?php include 'languagelist.php';?>
  84. </select>
  85. <p>
  86. <label id="namelabel" for="name">What is your name/pseudonym?</label>
  87. <span class="error">*</span><br>
  88. <span class="error"><?php echo $nameErr;?></span><br>
  89. <input id="name" type="text" name="name" style="width:375px" maxlength="100" value="<?php echo $name;?>"><br>
  90. </p>
  91. <p>
  92. <label id="legalpermissionlabel" for="legalpermission">Are you an adult in the region you live in, if not do you have permission from a parent or legal guardian to participate in this competition?</label>
  93. <span class="error">*</span><br>
  94. <span class="error"><?php echo $legalpermissionErr;?> </span><br>
  95. <select id="legalpermission" name="legalpermission">
  96. <option id="legalpermissionno" value="no">no</option>
  97. <option id="legalpermissionyes" value="yes">yes</option>
  98. </select>
  99. </p>
  100. <p>
  101. <label id="emaillabel" for="email">What is your e-mail address?</label>
  102. <span class="error">*</span><br>
  103. <span class="error"><?php echo $emailErr;?></span><br>
  104. <input type="email" id="email" name="email" style="width:375px" value="<?php echo $email;?>"><br>
  105. </p>
  106. <?php include 'gettelephone.php';?>
  107. <p>
  108. <label id="titlelabel" for="title">What is the title of your translated story</label>
  109. <span class="error">*</span><br>
  110. <span class="error"><?php echo $titleErr;?></span><br>
  111. <textarea id="title" type="text" name="title" maxlength="100" style="width:750px" rows="1"><?php echo $title;?></textarea><br>
  112. </p>
  113. <p>
  114. <label id="translatorlabel" for="translator">Are you the translator of this work, if you are not the translator do you have permission from the translator to submit the work on their behalf?</label>
  115. <span class="error">*</span><br>
  116. <span class="error"><?php echo $translatorErr;?></span><br>
  117. <select id="translator" name="translator">
  118. <option id="translatorno" value="no">no</option>
  119. <option id="translatoryes" value="yes">yes</option>
  120. </select>
  121. </p>
  122. <p>
  123. <label id="storylabel" for="story">Please enter the text for your translation here</label>
  124. <span class="error">*</span><br>
  125. <span class="error"><?php echo $storyErr;?></span><br>
  126. <textarea id="story" type="text" dir="ltr" name="story" size="30000" maxlength="30000" cols="70" rows="25" style="width:750px"><?php echo $story;?></textarea><br>
  127. </p>
  128. <p>
  129. <button id="submit" type="submit" name="submit" value="submit">Submit</button>
  130. </p>
  131. </form>
  132. <p>
  133. <button id="wordcountbutton" onclick="wordcountinfo()">Update word count</button>
  134. </p>
  135. <h4 id="wordsentered">Words Entered:</h4>
  136. <h4 id="wordscounted">0</h4>
  137. </div>
  138. </section>
  139. <section>
  140. <div>
  141. <div id="keyboarddiv">
  142. <?php include "softkeyboard.php" ;?>
  143. </div>
  144. </div>
  145. </section>
  146. <?php include 'getlanguage.php';?>
  147. <?php include 'submittranslationsave.php';?>
  148. </body>
  149. <?php include 'footer.php';?>
  150. <script>
  151. function getstorytitles() {
  152. var lang = document.getElementById("languagefrom").value;
  153. //use ajax to get stories from database in that language
  154. var xmlhttp = new XMLHttpRequest();
  155. xmlhttp.onreadystatechange = function() {
  156. if (this.readyState == 4 && this.status == 200) {
  157. document.getElementById("titles").innerHTML = this.responseText;
  158. }
  159. };
  160. xmlhttp.open("GET","gettitlestotranslate.php?lang="+lang,true);
  161. xmlhttp.send();
  162. }
  163. function showtitle(storyid) {
  164. document.getElementById("originalidstring").innerHTML =
  165. document.getElementById(storyid.toString()).innerHTML;
  166. document.getElementById("originalid").value = storyid;
  167. document.getElementById("originalid").innerHTML = storyid;
  168. }
  169. function addcharacter(id) {
  170. var charin = document.getElementById(id).value;
  171. var character;
  172. var start;
  173. var end;
  174. //console.log(id);
  175. //console.log(charin);
  176. var text = document.getElementById("story").value;
  177. var input = document.getElementById("story");
  178. var cursorpos = input.selectionStart;
  179. // A slow but reliable entry method
  180. start = text.substring(0,cursorpos);
  181. end = text.substring(cursorpos,text.length);
  182. if (charin==="") {
  183. character="";
  184. }else if (id==="Backspace") {
  185. character="";
  186. start = start.substring(0,start.length-1);
  187. }else if ((id==="Enter")||(id==="Tab")){
  188. character = charin;
  189. }else{
  190. character = String.fromCharCode(charin);
  191. }
  192. //console.log(character);
  193. document.getElementById("story").value = start + character + end;
  194. }
  195. function shiftwrap() {
  196. var value = document.getElementById("keyboardtype").value;
  197. shift(value);
  198. }
  199. function changecasewrap() {
  200. var value = document.getElementById("keyboardtype").value;
  201. changecase(value);
  202. }
  203. function altgrwrap() {
  204. var value = document.getElementById("keyboardtype").value;
  205. altgr(value);
  206. }
  207. function keyboardwrap() {
  208. var value = document.getElementById("keyboardtype").value;
  209. keyboard(value);
  210. if(value==="ara") {
  211. document.getElementById("story").dir="rtl";
  212. }else{
  213. document.getElementById("story").dir="ltr";
  214. }
  215. }
  216. </script>
  217. <script type="text/javascript" src="js/afrikaanskeys.js"></script>
  218. <script type="text/javascript" src="js/akankeys.js"></script>
  219. <script type="text/javascript" src="js/amharickeys.js"></script>
  220. <script type="text/javascript" src="js/arabickeys.js"></script>
  221. <script type="text/javascript" src="js/atesokeys.js"></script>
  222. <script type="text/javascript" src="js/bembakeys.js"></script>
  223. <script type="text/javascript" src="js/camerooniankeys.js"></script>
  224. <script type="text/javascript" src="js/dagbanikeys.js"></script>
  225. <script type="text/javascript" src="js/englishkeys.js"></script>
  226. <script type="text/javascript" src="js/ewekeys.js"></script>
  227. <script type="text/javascript" src="js/gakeys.js"></script>
  228. <script type="text/javascript" src="js/hausakeys.js"></script>
  229. <script type="text/javascript" src="js/igbokeys.js"></script>
  230. <script type="text/javascript" src="js/kikuyukeys.js"></script>
  231. <script type="text/javascript" src="js/lingalakeys.js"></script>
  232. <script type="text/javascript" src="js/lugandakeys.js"></script>
  233. <script type="text/javascript" src="js/malikeys.js"></script>
  234. <script type="text/javascript" src="js/sesothokeys.js"></script>
  235. <script type="text/javascript" src="js/togokeys.js"></script>
  236. <script type="text/javascript" src="js/wolofkeys.js"></script>
  237. <script type="text/javascript" src="js/yorubakeys.js"></script>
  238. <script type="text/javascript" src="js/keyboard.js"></script>
  239. <script type="text/javascript" src="js/wordcount.js"></script>
  240. </html>