evaluate1.php 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234
  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. <?php include 'submitdatabaseinfo1.php';?>
  10. <body>
  11. <ul>
  12. <li><a id="home" href="index1.php">Home</a></li>
  13. <li><a id="original" href="submit1.php">Original Story Submission</a></li>
  14. <li><a id="translation" href="submittranslation1.php">Translated Story Submission</a></li>
  15. <li><a id="stories" href="displaystories1.php">Submitted Stories</a></li>
  16. <li><a id="evaluate" class="active" href="#">Evaluate</a></li>
  17. <li><a id="statistics" href="submissionstatistics1.php">Submissions per Language</a></li>
  18. <li><a id="coordinate" href="coordinator1.php">Coordinator Application</a></li>
  19. <li><a id="contact" href="contact1.php">Contact</a></li>
  20. <li><a id="resources" href="resources1.php">Resources</a></li>
  21. <li><a id="flyers" href="flyers1.php">Flyers</a></li>
  22. <li><a id="faq" href="faq1.php">Frequently Asked Questions</a></li>
  23. <li><a id="privacy" href="privacy1.php">Privacy</a></li>
  24. </ul>
  25. <header>
  26. <h1>Tuvute Pamoja
  27. <a href="https://deeplearningindaba.com">
  28. <img src="images/deeplearningindaba.svg" alt="Deeplearning Indaba" style="height:60px">
  29. </a></h1>
  30. </header>
  31. <h1 id="title">An African Language Short Story Competition</h1>
  32. <section>
  33. <h3 id="descriptiontitle">Story Evaluation</h3>
  34. <div>
  35. <p id="descriptiontext1">
  36. If you have made a submission of an original story or a translation, you can evaluate
  37. stories in languages in which you have made a submission. Your evaluation will help
  38. other story writers and translators improve their work. Stories with the highest
  39. scores will win prizes. A prize of $40 will be given to the author of the best
  40. original short story in each language. A prize of $40 will be given to the translator
  41. of the best translated short story in each language. A prize of $40 will be given
  42. to the author of the best translated short story in each language. Please evaluate
  43. stories will based on a 5 point scale (5 excellent, 4 very good, 3 good, 2 average,
  44. 1 improvement needed) on:</p>
  45. <ol type="a">
  46. <li id="descriptiontext2">Grammar and spelling</li><br>
  47. <li id="descriptiontext3">Theme and plot</li><br>
  48. <li id="descriptiontext4">Style</li><br>
  49. <li id="descriptiontext5">Cultural relevance</li><br>
  50. <li id="descriptiontext6">Overall impression</li><br>
  51. </ol>
  52. <p id="descriptiontext7">The average score will be used
  53. to rank stories, in case of a tie, the organizing committee
  54. will randomly choose one story to receive a prize.</p>
  55. </div>
  56. </section>
  57. <section>
  58. <div>
  59. <p>Evaluation is closed</p>
  60. <!--
  61. <label id="votecode" for="votecode">Please enter the voting code you received by email
  62. </label><br>
  63. <input type="votecode" id="votecodeinput" name="votecodeinput" style="width:375px"><br>
  64. <p>
  65. <button id="submitvotecode" name="submitvotecode" onclick="checkvotecode()" >Submit vote code
  66. </button>
  67. </p>
  68. -->
  69. </div>
  70. <div id="story">
  71. </div>
  72. <div>
  73. <h3 id="evaluationscaletitle"> Evaluation scale</h3>
  74. <ol>
  75. <li id="evaluation1">Improvement needed</li><br>
  76. <li id="evaluation2">Average</li><br>
  77. <li id="evaluation3">Good</li><br>
  78. <li id="evaluation4">Very good</li><br>
  79. <li id="evaluation5">Excellent</li><br>
  80. </ol>
  81. </div>
  82. <div id="storyevaluation">
  83. <table id="storiestoevaluate" ></table>
  84. </div>
  85. <div id="submissionresponse">
  86. </div>
  87. </section>
  88. <section>
  89. <div id="keyboarddiv">
  90. <?php// include "softkeyboard.php" ;?>
  91. </div>
  92. </section>
  93. </body>
  94. <?php include 'footer.php';?>
  95. <script>
  96. function evaluatestory(id) {
  97. var comment = document.getElementById(id+"C").value;
  98. var grammarandspelling = document.getElementById(id+"GandS").value;
  99. var themeandplot = document.getElementById(id+"TandP").value;
  100. var style = document.getElementById(id+"S").value;
  101. var culturalrelevance = document.getElementById(id+"CR").value;
  102. var overallimpression = document.getElementById(id+"OI").value;
  103. var voterid = document.getElementById(id+"voterid").value;
  104. if ( (grammarandspelling === "" ) ||
  105. (themeandplot === "" ) ||
  106. (style === "" ) ||
  107. (culturalrelevance === "" ) ||
  108. (overallimpression === "" ) )
  109. {
  110. document.getElementById(id+"evalresult").innerHTML = "Please fill all 5 numeric fields";
  111. }else{
  112. document.getElementById(id+"evalresult").innerHTML = "";
  113. //use ajax to store scores in database
  114. var xmlhttp = new XMLHttpRequest();
  115. xmlhttp.onreadystatechange = function() {
  116. if (this.readyState == 4 && this.status == 200) {
  117. document.getElementById(id+"evalresult").innerHTML = this.responseText;
  118. }
  119. };
  120. xmlhttp.open("POST","submitevaluation.php",true);
  121. xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
  122. xmlhttp.send("comment="+comment+"&grammarandspelling="+grammarandspelling+"&themeandplot="+themeandplot+"&style="+style+"&culturalrelevance="+culturalrelevance+"&overallimpression="+overallimpression+"&id="+id+"&voterid="+voterid);
  123. }
  124. }
  125. </script>
  126. <script>
  127. function checkvotecode() {
  128. var votecode = document.getElementById("votecodeinput").value;
  129. //use ajax to check languages can evaluate stories in
  130. var xmlhttp = new XMLHttpRequest();
  131. xmlhttp.onreadystatechange = function() {
  132. if (this.readyState == 4 && this.status == 200) {
  133. document.getElementById("storiestoevaluate").innerHTML = this.responseText;
  134. }
  135. };
  136. xmlhttp.open("POST","votecode1.php",true);
  137. xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
  138. xmlhttp.send("code="+votecode);
  139. }
  140. </script>
  141. <script>
  142. function addcharacter(id)
  143. {
  144. var charin = document.getElementById(id).value;
  145. //var id = event.srcElement.id;
  146. console.log(id);
  147. console.log(charin);
  148. var text = document.getElementById("draftcomment").value;
  149. var input = document.getElementById("draftcomment");
  150. var cursorpos = input.selectionStart;
  151. // A slow but reliable entry method
  152. var start = text.substring(0,cursorpos);
  153. var end = text.substring(cursorpos,text.length);
  154. if (charin==="")
  155. {
  156. var character="";
  157. }else if (id==="Backspace") {
  158. var character="";
  159. var start = start.substring(0,start.length-1);
  160. }else if ((id==="Enter")||(id==="Tab")){
  161. var character = charin;
  162. }else{
  163. var character = String.fromCharCode(charin);
  164. }
  165. document.getElementById("draftcomment").value = start + character + end;
  166. }
  167. function shiftwrap()
  168. {
  169. var value = document.getElementById("keyboardtype").value;
  170. shift(value);
  171. }
  172. function changecasewrap()
  173. {
  174. var value = document.getElementById("keyboardtype").value;
  175. changecase(value);
  176. }
  177. function altgrwrap()
  178. {
  179. var value = document.getElementById("keyboardtype").value;
  180. altgr(value);
  181. }
  182. function keyboardwrap()
  183. {
  184. var value = document.getElementById("keyboardtype").value;
  185. keyboard(value);
  186. if(value==="ara") {
  187. document.getElementById("draftcomment").dir="rtl";
  188. }else{
  189. document.getElementById("draftcomment").dir="ltr";
  190. }
  191. }
  192. function getstory(storyid) {
  193. //use ajax to get story from database
  194. var xmlhttp = new XMLHttpRequest();
  195. xmlhttp.onreadystatechange = function() {
  196. if (this.readyState == 4 && this.status == 200) {
  197. document.getElementById("story").innerHTML = this.responseText;
  198. }
  199. };
  200. xmlhttp.open("GET","getstory1.php?primarykey="+storyid,true);
  201. xmlhttp.send();
  202. }
  203. </script>
  204. <script type="text/javascript" src="js/afrikaanskeys.js"></script>
  205. <script type="text/javascript" src="js/akankeys.js"></script>
  206. <script type="text/javascript" src="js/amharickeys.js"></script>
  207. <script type="text/javascript" src="js/arabickeys.js"></script>
  208. <script type="text/javascript" src="js/bembakeys.js"></script>
  209. <script type="text/javascript" src="js/camerooniankeys.js"></script>
  210. <script type="text/javascript" src="js/dagbanikeys.js"></script>
  211. <script type="text/javascript" src="js/englishkeys.js"></script>
  212. <script type="text/javascript" src="js/ewekeys.js"></script>
  213. <script type="text/javascript" src="js/gakeys.js"></script>
  214. <script type="text/javascript" src="js/hausakeys.js"></script>
  215. <script type="text/javascript" src="js/igbokeys.js"></script>
  216. <script type="text/javascript" src="js/kikuyukeys.js"></script>
  217. <script type="text/javascript" src="js/lingalakeys.js"></script>
  218. <script type="text/javascript" src="js/lugandakeys.js"></script>
  219. <script type="text/javascript" src="js/malikeys.js"></script>
  220. <script type="text/javascript" src="js/sesothokeys.js"></script>
  221. <script type="text/javascript" src="js/togokeys.js"></script>
  222. <script type="text/javascript" src="js/wolofkeys.js"></script>
  223. <script type="text/javascript" src="js/yorubakeys.js"></script>
  224. <script type="text/javascript" src="js/keyboard.js"></script>
  225. </html>