index_v0.html 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. <!DOCTYPE html>
  2. <html ng-app="ivprog">
  3. <head>
  4. <title>iVProgH5 : Visual Programming (LInE-IME-USP)</title>
  5. <meta charset="utf-8" />
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  7. <link href="css/bootstrap.min.css" rel="stylesheet" media="screen" />
  8. <link href="css/font-awesome.css" rel="stylesheet" media="screen" />
  9. <link href="css/bootstrap-editable.css" rel="stylesheet" media="screen" />
  10. <link href="css/ivprog.css" rel="stylesheet" media="screen" />
  11. </head>
  12. <body>
  13. <div class="header">
  14. <h1><img src="img/logo_ivprog.png" title="iVProg" /></h1>
  15. </div>
  16. <h2>&nbsp;iVProg : Visual Programming (LInE-IME-USP)</h2>
  17. <a href="http://www.usp.br/line" title="Uma das paginas do LInE">LInE</a>.
  18. <a href="https://github.com/LInE-IME-USP" title="LInE no GitHub">Software educacional livre</a>.
  19. <a href="http://www.usp.br/line/wp" title="Prototipo ambiente LInE">Interatividade na Internet para aprendizagem</a>.
  20. <script type='text/javascript'>
  21. //<![CDATA[
  22. var strAnswer = '';
  23. var evaluationResult = '';
  24. var comment = '';
  25. function resp () {
  26. // 'getEvaluation()' calls 'js/services.js : endTest function(index)' that calls 'getEvaluationCallback(apro/100);'
  27. window.frames.iLM.getEvaluation(); // in './mod/iassign/ilm/ivprog-html/js/services.js'; './mod/iassign/ilm/ivprog-html/main.html'
  28. // var comment = document.formEnvio.submission_comment.value;
  29. // iVProgH5 will call function 'getEvaluationCallback(...)': /var/www/html/ivprogh5/js/services.js
  30. }
  31. function getEvaluationCallback (evaluation) { // ./mod/iassign/ilm/ivprog-html/js/services.js : call this to define the variable 'evaluationResult'
  32. evaluationResult = evaluation;
  33. strAnswer = window.frames.iLM.getAnswer();
  34. comment = document.formEnvio.submission_comment.value;
  35. if ((strAnswer==null || strAnswer=='' || strAnswer==-1) && (comment==null || comment=='')) { // undefined
  36. alert('Atividade enviada sem conteúdo.');
  37. return false; // error...
  38. } else {
  39. alert('getEvaluationCallback: enviando evaluationResult=' + evaluation + ', strAnswer=' + strAnswer);
  40. document.formEnvio.iLM_PARAM_ArchiveContent.value = strAnswer;
  41. document.formEnvio.iLM_PARAM_ActivityEvaluation.value = evaluationResult;
  42. document.formEnvio.submit();
  43. return true; // success
  44. }
  45. }
  46. //]]>
  47. </script>
  48. <div class="bloco">
  49. Para adicionar <i>vari&aacute;veis</i> clique no bot&atilde;o <i>Vari&aacute;veis</i>.
  50. Para comandos no bot&atilde;o <i>Instru&ccedil;&atilde;o</i>. Para interpretar seu c&oacute;digo, clique no bot&atilde;o <img src="img/botao_rodar.png">
  51. (abaixo, ao lado do bot&atilde;o "Limpar console").<br/>
  52. Para examinar um c&oacute;digo pronto
  53. <a href="?MA_PARAM_PropositionURL=true&MA_PARAM_Proposition=./exerc/exemplo_n_primeiros_fibonacci.ivph#/create/" title="Listar os n primeiros termos da sequencia de Fibonacci">clique aqui</a>.
  54. <br/>
  55. Para examinar um c&oacute;digo simples
  56. <a href="?MA_PARAM_PropositionURL=true&MA_PARAM_Proposition=./exerc/exemplo_imprima.ivph#/create/" title="Listar os n primeiros termos da sequencia de Fibonacci">clique aqui</a>.
  57. </div>
  58. <div>
  59. <div class="bloco_ivprog">
  60. <div ng-view></div>
  61. </div>
  62. <span ng-controller="CommCtrl" id="commCtrl"></span>
  63. <script src="js/jquery.1.8.3.js"></script>
  64. <script src="js/jsdeferred.jquery.js"></script>
  65. <script src="js/bootstrap.min.js"></script>
  66. <script src="js/angular.js"></script>
  67. <script src="js/app.js"></script>
  68. <!--script src="js/app-i18n.js"></script-->
  69. <script src="js/controllers.js"></script>
  70. <script src="js/services.js"></script>
  71. <script src="js/angular-resource.js"></script>
  72. <script src="js/jquery.ui.js"></script>
  73. <script src="js/angular.ui.min.js"></script>
  74. </div>
  75. <script>
  76. function getParameterByName (name) {
  77. var match = RegExp('[?&]' + name + '=([^&]*)').exec(window.location.search);
  78. return match ? decodeURIComponent(match[1].replace(/\+/g, ' ')) : null;
  79. }
  80. function getAnswer () {
  81. return angular.element("#commCtrl").scope().getSource()
  82. }
  83. function getEvaluation () {
  84. return angular.element("#commCtrl").scope().getEvaluation();
  85. //return "getEvaluation will return some value in future";
  86. }
  87. function getEvaluationCallback(nota){
  88. parent.getEvaluationCallback(nota);
  89. }
  90. var ilaParams = {
  91. MA_PARAM_PropositionURL: getParameterByName("MA_PARAM_PropositionURL"),
  92. MA_PARAM_notSEND: getParameterByName("MA_PARAM_notSEND"),
  93. MA_PARAM_addresPOST: getParameterByName("MA_PARAM_addresPOST"),
  94. MA_PARAM_PropositionURL: getParameterByName("MA_PARAM_PropositionURL"),
  95. MA_PARAM_Proposition: getParameterByName("MA_PARAM_Proposition"),
  96. };
  97. function trackAction(action){
  98. if (ilaParams.MA_PARAM_addresPOST!=null){
  99. $.post(ilaParams.MA_PARAM_addresPOST+"&track=1", { trackingData: "html=1;"+action }, function(d){});
  100. }
  101. }
  102. </script>
  103. </div>
  104. <form name='formEnvio' id='formEnvio' method='post' action='gravar.php' enctype='multipart/form-data'>
  105. <input type='hidden' name='iLM_PARAM_ArchiveContent' />
  106. <input type='hidden' name='iLM_PARAM_ActivityEvaluation' />
  107. <center>
  108. <p><textarea rows='2' cols='60' name='submission_comment'></textarea></p>
  109. <input type=button value='Enviar resposta' onclick = 'javascript:window.resp();' title='clique aqui para enviar sua resposta' />
  110. </center>
  111. </form>
  112. <div class="foot"><center>
  113. <a href="http://www.ime.usp.br/line">LInE</a> |
  114. <a href="http://www.matematica.br">iM&aacute;tica</a> |
  115. <a href="http://www.usp.br/line/mooc">MOOC</a>
  116. </center></div>
  117. </body>
  118. </html>