index.html 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502
  1. <!doctype html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
  6. <title>iVProgH - LInE (free educational software and contents)</title>
  7. <link href="../css/bootstrap.min.css" rel="stylesheet">
  8. <link href="../css/style.css" rel="stylesheet">
  9. </head>
  10. <!--
  11. -------------------------------------------------------------------------------
  12. JavaScript code: starting point
  13. This JavaScript code could be inserted in any LMS to get the iLM content and send it to the server.
  14. In this example it use a single "applet" instance, here from iHanoi.
  15. -->
  16. <script Language="JavaScript">
  17. //<![CDATA[
  18. var strAnswer = '';
  19. var evaluationResult = '';
  20. var comment = '';
  21. function submit_iMA_Answer (index) {
  22. // alert('./ex_pt/index.html: window.frames=' + window.frames);
  23. // alert('./ex_pt/index.html: window.frames.iLM=' + window.frames.iLM);
  24. var name = 'iLM[' + index + ']'; // alert('name='+name);
  25. window.frames[name].getEvaluation();
  26. var strAnswer = window.frames[name].getAnswer();
  27. alert('Copy the following ivph code (to use it with iVProgH): ' + strAnswer);
  28. //DEBUG
  29. //D var strFrames = "";
  30. //D var arrFrames = parent.document.getElementsByTagName("IFRAME");
  31. //D for (var i=0; i<arrFrames.length; i++) {
  32. //D strFrames += ', ' + arrFrames[i].name; // if (arrFrames[i].contentWindow === window) alert("yay!");
  33. //D } // acho 'window.frames' de nome 'iLM'!!!
  34. //D if (index<10)
  35. //D alert('./ex_pt/index.html: window.frames=' + strFrames);
  36. // alert('window.frames.iLM=' + window.frames.iLM); // undefined
  37. //D var docForm = document.formEnvio;
  38. //D // Prepared to be used with more than 1 "applet'
  39. //D var exercise_answer = new Array(3); // answer: to get the learner answer
  40. //D var exercise_value = new Array(3); // value from the iLM automatic evaluator
  41. //D // var doc = document.formEnvio; // ----------------------------------------------------------
  42. //D // var doc = javascript:window.jsAnalyseAnswer();
  43. //D try {
  44. //D alert('submit_iMA_Answer(): evaluationResult=' + evaluationResult);
  45. //D exercise_answer[0] = doc.getAnswer(); // answer: it must be first (usually the iLM first get the answer to compute the evaluation grade)
  46. //D exercise_value[0] = doc.getEvaluation(); // value from the iLM automatic evaluator
  47. //D } catch (Exception) { alert("Error!"); }
  48. //D docForm.iLM_POST_Archive_0.value = exercise_answer[0]; // Content coming from the iLM
  49. //D docForm.iLM_POST_Value_0.value = exercise_value[0]; // The activity evaluation coming from the iLM
  50. //D // This is used to help the developer to debug his iLM
  51. //D // It presents the file content that will be registered.
  52. //D alert('The file activity value is: ' + exercise_value[0] + '\nThe activity content is:\n' + exercise_answer[0]);
  53. //D //uncomment_this docForm.submit(); // envia de fato o formulario
  54. //D //uncomment_this return true;
  55. }
  56. function getEvaluationCallback (evaluation) {
  57. evaluationResult = evaluation;
  58. strAnswer = window.frames.iLM[index].getAnswer();
  59. alert('getEvaluationCallback(...)' + evaluation + ', strAnswer=' + strAnswer);
  60. comment = document.formEnvio.submission_comment.value;
  61. //leo
  62. if ((strAnswer==null || strAnswer=='' || strAnswer==-1) && (comment==null || comment=='')) { // undefined
  63. alert('Activity sent without content.'); // 'Activity sent without content.'
  64. return false; // error...
  65. }
  66. else {
  67. //leo alert('getEvaluationCallback: enviando evaluationResult=' + evaluation + ', strAnswer=' + strAnswer);
  68. document.formEnvio.iLM_PARAM_ArchiveContent.value = strAnswer;
  69. document.formEnvio.iLM_PARAM_ActivityEvaluation.value = evaluationResult;
  70. document.formEnvio.submit();
  71. return true; // success
  72. }
  73. }
  74. function openSolution (url_file, el_button) {
  75. $(el_button).parent().find('iframe').attr('src', '../ivprogh/index.html?iLM_PARAM_AssignmentURL=true&iLM_PARAM_Assignment=' + url_file + '&iLM_PARAM_SendAnswer=false&lang=en');
  76. }
  77. //]]>
  78. </script>
  79. <!--
  80. JavaScript code: final -------------------------------------------------------------------------------
  81. -->
  82. <body>
  83. <nav class="navbar navbar-expand-md navbar-dark fixed-top" style="background-color: #03396c;">
  84. <b><a class="navbar-brand" href="../">iVProgH</a></b>
  85. <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarsExampleDefault" aria-controls="navbarsExampleDefault" aria-expanded="false" aria-label="Toggle navigation">
  86. <span class="navbar-toggler-icon"></span>
  87. </button>
  88. <div class="collapse navbar-collapse" id="navbarsExampleDefault">
  89. <ul class="navbar-nav mr-auto">
  90. <li class="nav-item">
  91. <a class="nav-link" href="../"
  92. title="Navigate to iVProgH homepage.">Home</a>
  93. </li>
  94. <li class="nav-item">
  95. <a class="nav-link" href="../sobre_ivprog.html"
  96. title="Know what iVProgH is and what iVProgH is for.">About</a>
  97. </li>
  98. <li class="nav-item active">
  99. <a class="nav-link" href="../ex_en/index.html"
  100. title="See some examples and test iVProgH online.">Examples</a>
  101. </li>
  102. <li class="nav-item">
  103. <a class="nav-link" href="../download.html"
  104. title="Download a copy of iVProgH for your computer.">Download</a>
  105. </li>
  106. <li class="nav-item">
  107. <a class="nav-link" href="../manual_en/index.html"
  108. title="Access online iVProgH manual and learn about all the features.">Help</a>
  109. </li>
  110. <li class="nav-item">
  111. <a class="nav-link" href="../bugs/report.html"
  112. title="Send a message to the iVProgH team.">Contact</a>
  113. </li>
  114. <li class="nav-item">
  115. <a class="nav-link" href="//www.usp.br/line/"
  116. title="Meet the Laboratory of Informatics in Education of the Institute of Mathematics and Statistics of USP.">LInE</a>
  117. </li>
  118. <li class="nav-item">
  119. <a class="nav-link" href="../docs/"
  120. title="Get access to all iVProgH documentation.">Developers</a>
  121. </li>
  122. <li class="nav-item">
  123. <a class="nav-link" href="../publicacoes.html"
  124. title="Read the team publications about iVProgH.">Publications</a>
  125. </li>
  126. </ul>
  127. <div class="form-inline my-2 my-lg-0">
  128. <a href="../../index.html"><img src="../img/img_flag_brazil.png"/></a>
  129. <a href="../index.html"><img src="../img/img_flag_usa.png"/></a>
  130. </div>
  131. </div>
  132. </nav>
  133. <main role="main">
  134. <div class="jumbotron ivprogh-desc">
  135. <div class="container">
  136. <h1>Examples</h1>
  137. </div>
  138. </div>
  139. <div class="container example-large-div autoeval-descript">
  140. <div data-toggle="collapse" class="pointer" href="#area-autoeval-descript" aria-expanded="false" aria-controls="area-autoeval-descript"><span class="octicon octicon-info"></span>
  141. Understand the operation of the automatic valuer</div>
  142. <div id="area-autoeval-descript" class="collapse">
  143. <p>IVProg allows automatic exercises to be made available directly on Web pages. If the teacher has an installation of the Moodle manager with the <a href="www.matematica.br/ia">iTarefa</a> package, then the activity performed by the student will be recorded, as well as the grade assigned to the student's solution.</p>
  144. <p>The automatic evaluation in the iVProg is made from a template, which must have been prepared by the teacher, providing data inputs and their respective outputs. When the student "click" on the button to evaluate their solution, iVProg uses the first list as inputs to the student's problem, comparing each generated output with those of the list of outputs.</p>
  145. <p>To better understand the process, let's use an example algorithm that must sum separately all the numbers positive and negative signals entered by the user.</p>
  146. <p><span class="octicon octicon-pin"></span><b>Problem:</b></p>
  147. <p>Make an algorithm that prompts the user to enter integer values, finalizing their execution when typed the value zero. At the end, your program should print the sum of all positive integers that were typed and then print the sum of all negative integers.</p>
  148. <p><span class="octicon octicon-light-bulb"></span> <b> How can I prepare a exercise template with automatic evaluation in iVProg</b></p>
  149. <p>The teacher can prepare any number of lists of entries and exits, for the above problem, we will use only 3 lists, shown in the table below. The first column has the number of the "input/output" pair, the second shows the list of inputs (separated by white space), in the third column are the expected outputs (for those inputs) and the last column has a short explanation about the pair.
  150. <table class="table about-auto-eval">
  151. <thead class="thead-light">
  152. <tr>
  153. <th scope="col">#</th>
  154. <th scope="col">Inputs</th>
  155. <th scope="col">Outputs</th>
  156. <th scope="col">Comments</th>
  157. </tr>
  158. </thead>
  159. <tbody>
  160. <tr>
  161. <th scope="row">1</th>
  162. <td>0</td>
  163. <td>0 0</td>
  164. <td>This is a tricky test, because if the first entry is zero, nothing will be added (then 0 and 0 should be printed)</td>
  165. </tr>
  166. <tr>
  167. <th scope="row">2</th>
  168. <td>1 -1 1 0</td>
  169. <td> 2 -1 </td>
  170. <td>It presents 2 positive and 1 negative values, with sums respectively 2 and -1</td>
  171. </tr>
  172. <tr>
  173. <th scope="row">3</th>
  174. <td>-1 -1 3 1 0</td>
  175. <td>4 -2</td>
  176. <td>It presents 2 positive and 2 negative values, with sums respectively 4 and -2</td>
  177. </tr>
  178. </tbody>
  179. </table>
  180. <p>IVProg has a special interface for the teacher to enter each list of inputs and outputs.</p>
  181. <p><span class="octicon octicon-light-bulb"></span> <b> How does iVProg automatically evaluate a student solution?</b></p>
  182. <p>Assuming that the student has built an algorithm, when he "click" the button to evaluate your solution, iVProg:</p>
  183. <ol>
  184. <li>It takes the first input from the first list and submits it to the first reading in the student code (error if it does not exist), then the second input and so on until the last one.</li>
  185. <li>The first output (print command) generated by the student code is compared to the first expected output if it matches a hit is recorded, if not an error.</li>
  186. <li>Repeat steps 1 and 2 for each of the other lists of inputs/outputs and at the end an average of hits and errors is generated. <p>For example, if the student algorithm is wrong in 2 of the 6 outputs, its grade will be 1/3.</p></li>
  187. </ol>
  188. </div>
  189. </div>
  190. <div class="container example-large-div autoeval-descript">
  191. <div aria-expanded="false" aria-controls="area-autoeval-descript">
  192. Try the exercises listed below, from example 1 through example 8. Example 9 illustrates how to construct a template for an exercise with automatic evaluation in <i>iVProgH</i>.<br/>To open the example, click on its title. You can hide it again by clicking on the same title.
  193. </div>
  194. </div>
  195. <!-- Para cada exemplo, copiar toda a DIV abaixo e não alterar as classes dos elementos :) -->
  196. <div class="container example-large-div">
  197. <div class="text-count-example" data-toggle="collapse" href="#area-exemplo-1" aria-expanded="false" aria-controls="area-exemplo-1"><span class="octicon octicon-rocket"></span>
  198. Example 1: Input and Output</div>
  199. <div class="example-content collapse" id="area-exemplo-1">
  200. <button type="button" class="btn btn-primary show-solution" onclick="openSolution('../ex_pt/exerc/exemplo_1_ler_e_imprimir_inteiro_solucao.ivph', this)">See solution</button>
  201. <p class="text-reduced">
  202. Exercise example with <i>automatic evaluation</i> in <i>iVProg</i>.
  203. </p>
  204. <p class="text-reduced">
  205. <b>Make a program that prompts the user for an integer value, then print the value typed by the user.</b>
  206. </p>
  207. <div class="container text-center">
  208. <form name='formEnvio' id='formEnvio' method='post' action='#' \
  209. enctype='multipart/form-data'>
  210. <div class="embed-responsive embed-responsive-16by9"> <!-- 4by3 -->
  211. <iframe name="iLM[1]" id="iLM[1]" class="embed-responsive-item"
  212. src="../ivprogh/index.html?iLM_PARAM_AssignmentURL=true&iLM_PARAM_Assignment=../ex_pt/exerc/exemplo_1_ler_e_imprimir_inteiro.ivph&iLM_PARAM_SendAnswer=false&lang=en"
  213. allowfullscreen></iframe><br/>
  214. </div>
  215. <input type='button' name='Submit' value='Send reply' class="btn btn-warning"
  216. title='Click here to see your code.'
  217. onclick='javascript:window.submit_iMA_Answer(1);' /><!-- chama funcao iMA-->
  218. </form>
  219. </div>
  220. </div>
  221. </div> <!-- Este é o final da DIV que deve ser copiada para cada exemplo -->
  222. <!-- Para cada exemplo, copiar toda a DIV abaixo e não alterar as classes dos elementos :) -->
  223. <div class="container example-large-div">
  224. <div class="text-count-example" data-toggle="collapse" href="#area-exemplo-2" aria-expanded="false" aria-controls="area-exemplo-2"><span class="octicon octicon-rocket"></span>
  225. Example 2: Print the square of a number (integer)</div>
  226. <div class="example-content collapse" id="area-exemplo-2">
  227. <button type="button" class="btn btn-primary show-solution" onclick="openSolution('../ex_pt/exerc/exemplo_2_imprimir_quadrado_solucao.ivph', this)">See solution</button>
  228. <p class="text-reduced">
  229. Exercise example with <i>automatic evaluation</i> in <i>iVProg</i>.
  230. </p>
  231. <p class="text-reduced">
  232. <b>Construct an algorithm that prompts the user to enter a number (integer) and prints the square of that value.</b>
  233. </p>
  234. <div class="container text-center">
  235. <form name='formEnvio' id='formEnvio' method='post' action='#' \
  236. enctype='multipart/form-data'>
  237. <div class="embed-responsive embed-responsive-16by9"> <!-- 4by3 -->
  238. <iframe name="iLM[2]" id="iLM[2]" class="embed-responsive-item"
  239. src="../ivprogh/index.html?iLM_PARAM_AssignmentURL=true&iLM_PARAM_Assignment=../ex_pt/exerc/exemplo_2_imprimir_quadrado.ivph&iLM_PARAM_SendAnswer=false&lang=en"
  240. allowfullscreen></iframe><br/>
  241. </div>
  242. <input type='button' name='Submit' value='Send reply' class="btn btn-warning"
  243. title='Click here to see your code.'
  244. onclick='javascript:window.submit_iMA_Answer(2);' /><!-- chama funcao iMA-->
  245. </form>
  246. </div>
  247. </div>
  248. </div> <!-- Este é o final da DIV que deve ser copiada para cada exemplo -->
  249. <!-- Para cada exemplo, copiar toda a DIV abaixo e não alterar as classes dos elementos :) -->
  250. <div class="container example-large-div">
  251. <div class="text-count-example" data-toggle="collapse" href="#area-exemplo-3" aria-expanded="false" aria-controls="area-exemplo-3"><span class="octicon octicon-rocket"></span>
  252. Example 3: Sum of two values</div>
  253. <div class="example-content collapse" id="area-exemplo-3">
  254. <button type="button" class="btn btn-primary show-solution" onclick="openSolution('../ex_pt/exerc/exemplo_3_soma_dois_valores_solucao.ivph', this)">See solution</button>
  255. <p class="text-reduced">
  256. Exercise example with <i>automatic evaluation</i> in <i>iVProg</i>.
  257. </p>
  258. <p class="text-reduced">
  259. <b>Construct an algorithm that receives two integers and prints the sum of these values.</b>
  260. </p>
  261. <div class="container text-center">
  262. <form name='formEnvio' id='formEnvio' method='post' action='#' \
  263. enctype='multipart/form-data'>
  264. <div class="embed-responsive embed-responsive-16by9"> <!-- 4by3 -->
  265. <iframe name="iLM[3]" id="iLM[3]" class="embed-responsive-item"
  266. src="../ivprogh/index.html?iLM_PARAM_AssignmentURL=true&iLM_PARAM_Assignment=../ex_pt/exerc/exemplo_3_soma_dois_valores.ivph&iLM_PARAM_SendAnswer=false&lang=en"
  267. allowfullscreen></iframe><br/>
  268. </div>
  269. <input type='button' name='Submit' value='Send reply' class="btn btn-warning"
  270. title='Click here to see your code.'
  271. onclick='javascript:window.submit_iMA_Answer(3);' /><!-- chama funcao iMA-->
  272. </form>
  273. </div>
  274. </div>
  275. </div> <!-- Este é o final da DIV que deve ser copiada para cada exemplo -->
  276. <!-- Para cada exemplo, copiar toda a DIV abaixo e não alterar as classes dos elementos :) -->
  277. <div class="container example-large-div">
  278. <div class="text-count-example" data-toggle="collapse" href="#area-exemplo-4" aria-expanded="false" aria-controls="area-exemplo-4"><span class="octicon octicon-rocket"></span>
  279. Example 4: Arithmetic mean</div>
  280. <div class="example-content collapse" id="area-exemplo-4">
  281. <button type="button" class="btn btn-primary show-solution" onclick="openSolution('../ex_pt/exerc/exemplo_4_media_aritmetica_solucao.ivph', this)">See solution</button>
  282. <p class="text-reduced">
  283. Exercise example with <i>automatic evaluation</i> in <i>iVProg</i>.
  284. </p>
  285. <p class="text-reduced">
  286. <b>Construct an algorithm that receives two integers from the input, calculates the arithmetic mean of those numbers, and prints it.</b>
  287. </p>
  288. <div class="container text-center">
  289. <form name='formEnvio' id='formEnvio' method='post' action='#' \
  290. enctype='multipart/form-data'>
  291. <div class="embed-responsive embed-responsive-16by9"> <!-- 4by3 -->
  292. <iframe name="iLM[4]" id="iLM[4]" class="embed-responsive-item"
  293. src="../ivprogh/index.html?iLM_PARAM_AssignmentURL=true&iLM_PARAM_Assignment=../ex_pt/exerc/exemplo_4_media_aritmetica.ivph&iLM_PARAM_SendAnswer=false&lang=en"
  294. allowfullscreen></iframe><br/>
  295. </div>
  296. <input type='button' name='Submit' value='Send reply' class="btn btn-warning"
  297. title='Click here to see your code.'
  298. onclick='javascript:window.submit_iMA_Answer(4);' /><!-- chama funcao iMA-->
  299. </form>
  300. </div>
  301. </div>
  302. </div> <!-- Este é o final da DIV que deve ser copiada para cada exemplo -->
  303. <!-- Para cada exemplo, copiar toda a DIV abaixo e não alterar as classes dos elementos :) -->
  304. <div class="container example-large-div">
  305. <div class="text-count-example" data-toggle="collapse" href="#area-exemplo-5" aria-expanded="false" aria-controls="area-exemplo-5"><span class="octicon octicon-rocket"></span>
  306. Example 5: Higher value</div>
  307. <div class="example-content collapse" id="area-exemplo-5">
  308. <button type="button" class="btn btn-primary show-solution" onclick="openSolution('../ex_pt/exerc/exemplo_5_maior_valor_solucao.ivph', this)">See solution</button>
  309. <p class="text-reduced">
  310. Exercise example with <i>automatic evaluation</i> in <i>iVProg</i>.
  311. </p>
  312. <p class="text-reduced">
  313. <b>Construct an algorithm that receives two integers from the input and prints the higher of the two numbers.</b>
  314. </p>
  315. <div class="container text-center">
  316. <form name='formEnvio' id='formEnvio' method='post' action='#' \
  317. enctype='multipart/form-data'>
  318. <div class="embed-responsive embed-responsive-16by9"> <!-- 4by3 -->
  319. <iframe name="iLM[5]" id="iLM[5]" class="embed-responsive-item"
  320. src="../ivprogh/index.html?iLM_PARAM_AssignmentURL=true&iLM_PARAM_Assignment=../ex_pt/exerc/exemplo_5_maior_valor.ivph&iLM_PARAM_SendAnswer=false&lang=en"
  321. allowfullscreen></iframe><br/>
  322. </div>
  323. <input type='button' name='Submit' value='Send reply' class="btn btn-warning"
  324. title='Click here to see your code.'
  325. onclick='javascript:window.submit_iMA_Answer(5);' /><!-- chama funcao iMA-->
  326. </form>
  327. </div>
  328. </div>
  329. </div> <!-- Este é o final da DIV que deve ser copiada para cada exemplo -->
  330. <!-- Para cada exemplo, copiar toda a DIV abaixo e não alterar as classes dos elementos :) -->
  331. <div class="container example-large-div">
  332. <div class="text-count-example" data-toggle="collapse" href="#area-exemplo-6" aria-expanded="false" aria-controls="area-exemplo-6"><span class="octicon octicon-rocket"></span>
  333. Example 6: Sequence</div>
  334. <div class="example-content collapse" id="area-exemplo-6">
  335. <button type="button" class="btn btn-primary show-solution" onclick="openSolution('../ex_pt/exerc/exemplo_6_imprimir_de_1_a_10_solucao.ivph', this)">See solution</button>
  336. <p class="text-reduced">
  337. Exercise example with <i>automatic evaluation</i> in <i>iVProg</i>.
  338. </p>
  339. <p class="text-reduced">
  340. <b>Make an algorithm that prints the sequence of integers from 1 to 10.</b>
  341. </p>
  342. <div class="container text-center">
  343. <form name='formEnvio' id='formEnvio' method='post' action='#' \
  344. enctype='multipart/form-data'>
  345. <div class="embed-responsive embed-responsive-16by9"> <!-- 4by3 -->
  346. <iframe name="iLM[6]" id="iLM[6]" class="embed-responsive-item"
  347. src="../ivprogh/index.html?iLM_PARAM_AssignmentURL=true&iLM_PARAM_Assignment=../ex_pt/exerc/exemplo_6_imprimir_de_1_a_10.ivph&iLM_PARAM_SendAnswer=false&lang=en"
  348. allowfullscreen></iframe><br/>
  349. </div>
  350. <input type='button' name='Submit' value='Send reply' class="btn btn-warning"
  351. title='Click here to see your code.'
  352. onclick='javascript:window.submit_iMA_Answer(6);' /><!-- chama funcao iMA-->
  353. </form>
  354. </div>
  355. </div>
  356. </div> <!-- Este é o final da DIV que deve ser copiada para cada exemplo -->
  357. <!-- Para cada exemplo, copiar toda a DIV abaixo e não alterar as classes dos elementos :) -->
  358. <div class="container example-large-div">
  359. <div class="text-count-example" data-toggle="collapse" href="#area-exemplo-7" aria-expanded="false" aria-controls="area-exemplo-7"><span class="octicon octicon-rocket"></span>
  360. Example 7: Print text</div>
  361. <div class="example-content collapse" id="area-exemplo-7">
  362. <button type="button" class="btn btn-primary show-solution" onclick="openSolution('../ex_pt/exerc/exemplo_7_imprimir_ivprogh_10_vezes_solucao.ivph', this)">See solution</button>
  363. <p class="text-reduced">
  364. Exercise example with <i>automatic evaluation</i> in <i>iVProg</i>.
  365. </p>
  366. <p class="text-reduced">
  367. <b>Build an algorithm that prints the word iVProgH 10 times.</b>
  368. </p>
  369. <div class="container text-center">
  370. <form name='formEnvio' id='formEnvio' method='post' action='#' \
  371. enctype='multipart/form-data'>
  372. <div class="embed-responsive embed-responsive-16by9"> <!-- 4by3 -->
  373. <iframe name="iLM[7]" id="iLM[7]" class="embed-responsive-item"
  374. src="../ivprogh/index.html?iLM_PARAM_AssignmentURL=true&iLM_PARAM_Assignment=../ex_pt/exerc/exemplo_7_imprimir_ivprogh_10_vezes.ivph&iLM_PARAM_SendAnswer=false&lang=en"
  375. allowfullscreen></iframe><br/>
  376. </div>
  377. <input type='button' name='Submit' value='Send reply' class="btn btn-warning"
  378. title='Click here to see your code.'
  379. onclick='javascript:window.submit_iMA_Answer(7);' /><!-- chama funcao iMA-->
  380. </form>
  381. </div>
  382. </div>
  383. </div> <!-- Este é o final da DIV que deve ser copiada para cada exemplo -->
  384. <!-- Para cada exemplo, copiar toda a DIV abaixo e não alterar as classes dos elementos :) -->
  385. <div class="container example-large-div">
  386. <div class="text-count-example" data-toggle="collapse" href="#area-exemplo-8" aria-expanded="false" aria-controls="area-exemplo-8"><span class="octicon octicon-rocket"></span>
  387. Example 8: Add n values</div>
  388. <div class="example-content collapse" id="area-exemplo-8">
  389. <button type="button" class="btn btn-primary show-solution" onclick="openSolution('../ex_pt/exerc/exemplo_8_somar_valores_ate_digitar_0_solucao.ivph', this)">See solution</button>
  390. <p class="text-reduced">
  391. Exercise example with <i>automatic evaluation</i> in <i>iVProg</i>.
  392. </p>
  393. <p class="text-reduced">
  394. <b>Make an algorithm that reads a sequence of integers, adding them until a value of zero is entered, at which point you must print the value of the sum and stop.</b>
  395. </p>
  396. <div class="container text-center">
  397. <form name='formEnvio' id='formEnvio' method='post' action='#'\ \
  398. enctype='multipart/form-data'>
  399. <div class="embed-responsive embed-responsive-16by9"> <!-- 4by3 -->
  400. <iframe name="iLM[8]" id="iLM[8]" class="embed-responsive-item"
  401. src="../ivprogh/index.html?iLM_PARAM_AssignmentURL=true&iLM_PARAM_Assignment=../ex_pt/exerc/exemplo_8_somar_valores_ate_digitar_0.ivph&iLM_PARAM_SendAnswer=false&lang=en"
  402. allowfullscreen></iframe><br/>
  403. </div>
  404. <input type='button' name='Submit' value='Send reply' class="btn btn-warning"
  405. title='Click here to see your code.'
  406. onclick='javascript:window.submit_iMA_Answer(8);' /><!-- chama funcao iMA-->
  407. </form>
  408. </div>
  409. </div>
  410. </div> <!-- Este é o final da DIV que deve ser copiada para cada exemplo -->
  411. <!-- Para cada exemplo, copiar toda a DIV abaixo e não alterar as classes dos elementos :) -->
  412. <div class="container example-large-div">
  413. <div class="text-count-example" data-toggle="collapse" href="#area-exemplo-9" aria-expanded="false" aria-controls="area-exemplo-9"><span class="octicon octicon-rocket"></span> Template: Building an Activity</div>
  414. <div class="example-content collapse" id="area-exemplo-9">
  415. <p class="text-reduced">
  416. <b>In this example, construct an activity, inserting the test cases that will be used to evaluate the algorithm and configure the resources that will be made available to the student in iVProgH.</b>
  417. </p>
  418. <div class="container text-center">
  419. <form name='formEnvio' id='formEnvio' method='post' action='#'\ \
  420. enctype='multipart/form-data'>
  421. <div class="embed-responsive embed-responsive-16by9"> <!-- 4by3 -->
  422. <iframe name="iLM[9]" id="iLM[9]" class="embed-responsive-item"
  423. src="../ivprogh/index.html?iLM_PARAM_AssignmentURL=true&iLM_PARAM_SendAnswer=true&lang=en"
  424. allowfullscreen></iframe><br/>
  425. </div>
  426. <input type='button' name='Submit' value='Send reply' class="btn btn-warning"
  427. title='Click here to see your code.'
  428. onclick='javascript:window.submit_iMA_Answer(9);' /><!-- chama funcao iMA-->
  429. </form>
  430. </div>
  431. </div>
  432. </div> <!-- Este é o final da DIV que deve ser copiada para cada exemplo -->
  433. </main>
  434. <footer class="container text-center">
  435. <a href="http://www.ime.usp.br/line">iVProgH</a> |
  436. <a href="http://www.ime.usp.br/line">LInE</a> |
  437. <a href="http://www.matematica.br">iM&aacute;tica</a>
  438. </footer>
  439. <script src="../js/jquery.min.js"></script>
  440. <script src="../js/bootstrap.bundle.min.js"></script>
  441. <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/octicons/3.5.0/octicons.min.css">
  442. <script type="text/javascript">
  443. $('.example-content').on('shown.bs.collapse', function () {
  444. this.parentNode.scrollIntoView();
  445. });
  446. </script>
  447. </body>
  448. </html>