123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170 |
- <!doctype html>
- <html lang="en">
- <head>
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
- <title>iVProgH - LInE (free educational software and contents)</title>
- <link href="../css/bootstrap.min.css" rel="stylesheet">
- <link href="../css/style.css" rel="stylesheet">
- </head>
- <!--
- -------------------------------------------------------------------------------
- JavaScript code: starting point
- This JavaScript code could be inserted in any LMS to get the iLM content and send it to the server.
- In this example it use a single "applet" instance, here from iHanoi.
- -->
- <script Language="JavaScript">
- //<![CDATA[
- var strAnswer = '';
- var evaluationResult = '';
- var comment = '';
- function submit_iMA_Answer () {
- // alert('./ex_pt/index.html: window.frames=' + window.frames);
- // alert('./ex_pt/index.html: window.frames.iLM=' + window.frames.iLM);
- /* DEBUG
- var strFrames = "";
- var arrFrames = parent.document.getElementsByTagName("IFRAME");
- for (var i=0; i<arrFrames.length; i++) {
- strFrames += ', ' + arrFrames[i].name; // if (arrFrames[i].contentWindow === window) alert("yay!");
- } // acho 'window.frames' de nome 'iLM'!!!
- alert('./ex_pt/index.html: window.frames=' + strFrames);
- */
- window.frames.iLM.getEvaluation(); // ../ivprogh/js/iassign-integration-functions.js
- // window.frames.iLM.runCodeAssessment();
- var strAnswer = window.frames.iLM.getAnswer();
- alert('./ex_pt/index.html: getAnswer()=' + strAnswer);
- /*
- var docForm = document.formEnvio;
- // Prepared to be used with more than 1 "applet'
- var exercise_answer = new Array(3); // answer: to get the learner answer
- var exercise_value = new Array(3); // value from the iLM automatic evaluator
- // var doc = document.formEnvio; // ----------------------------------------------------------
- // var doc = javascript:window.jsAnalyseAnswer();
- try {
- alert('submit_iMA_Answer(): evaluationResult=' + evaluationResult);
- exercise_answer[0] = doc.getAnswer(); // answer: it must be first (usually the iLM first get the answer to compute the evaluation grade)
- exercise_value[0] = doc.getEvaluation(); // value from the iLM automatic evaluator
- } catch (Exception) { alert("Error!"); }
- docForm.iLM_POST_Archive_0.value = exercise_answer[0]; // Content coming from the iLM
- docForm.iLM_POST_Value_0.value = exercise_value[0]; // The activity evaluation coming from the iLM
- // This is used to help the developer to debug his iLM
- // It presents the file content that will be registered.
- alert('The file activity value is: ' + exercise_value[0] + '\nThe activity content is:\n' + exercise_answer[0]);
- //uncomment_this docForm.submit(); // envia de fato o formulario
- //uncomment_this return true;
- */
- }
- function getEvaluationCallback (evaluation) {
- console.log(evaluation);
- evaluationResult = evaluation;
- strAnswer = window.frames.iLM.getAnswer();
- alert('getEvaluationCallback(...)' + evaluation + ', strAnswer=' + strAnswer);
- comment = document.formEnvio.submission_comment.value;
- //leo
- if ((strAnswer==null || strAnswer=='' || strAnswer==-1) && (comment==null || comment=='')) { // undefined
- alert('Activity sent without content.'); // 'Activity sent without content.'
- return false; // error...
- }
- else {
- //leo alert('getEvaluationCallback: enviando evaluationResult=' + evaluation + ', strAnswer=' + strAnswer);
- document.formEnvio.iLM_PARAM_ArchiveContent.value = strAnswer;
- document.formEnvio.iLM_PARAM_ActivityEvaluation.value = evaluationResult;
- document.formEnvio.submit();
- return true; // success
- }
- }
- //]]>
- </script>
- <!--
- JavaScript code: final -------------------------------------------------------------------------------
- -->
- <body>
- <nav class="navbar navbar-expand-md navbar-dark fixed-top" style="background-color: #03396c;">
- <b><a class="navbar-brand" href="#">iVProgH</a></b>
- <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarsExampleDefault" aria-controls="navbarsExampleDefault" aria-expanded="false" aria-label="Toggle navigation">
- <span class="navbar-toggler-icon"></span>
- </button>
- <div class="collapse navbar-collapse" id="navbarsExampleDefault">
- <ul class="navbar-nav mr-auto">
- <li class="nav-item active">
- <a class="nav-link" href="#">Home</a>
- </li>
- <li class="nav-item">
- <a class="nav-link" href="#">Conheça</a>
- </li>
- <li class="nav-item">
- <a class="nav-link" href="#">Exemplos</a>
- </li>
- <li class="nav-item">
- <a class="nav-link" href="#">Download</a>
- </li>
- <li class="nav-item">
- <a class="nav-link" href="#">LInE</a>
- </li>
- <li class="nav-item">
- <a class="nav-link" href="#">Ajuda</a>
- </li>
- </ul>
- <div class="form-inline my-2 my-lg-0">
- <img src="../img/img_flag_brazil.png">
- <img src="../img/img_flag_usa.png">
- </div>
- </div>
- </nav>
- <main role="main">
- <div class="jumbotron ivprogh-desc">
- <div class="container">
- <h1>iVProgH</h1>
- <p class="text-reduced">
- <!--
- O <b>iVProg</b> (<i>Programação Visual interativa na Internet</i>) é um dos sistemas educacionais de código livre do
- <a href="http://line.ime.usp.br" title="pagina LInE no IME-USP">LInE</a>, sendo destinado ao ensino e à aprendizagem
- de <b>algoritmos</b> e <b>programação</b>.
- -->
- Exemplo de exercício com <i>avaliação automática</i> no <i>iVProg</i>.
- </p>
-
- <p class="text-reduced">
- <b>Fazer um programa que solicite do usuário um valor inteiro, depois imprima o valor por ele digitado.
- </p>
- <a class="btn btn-primary" href="manual_pt/index.html" role="button" title="manual iVProgH">Saiba mais »</a>
- </div>
- </div>
- <div class="container ivprog-container">
- <form name='formEnvio' id='formEnvio' method='post' \
- action='#'\
- enctype='multipart/form-data'>
- <div class="embed-responsive embed-responsive-16by9"> <!-- 4by3 -->
- <iframe name="iLM" id="iLM" class="embed-responsive-item"
- src="../ivprogh/index.html?iLM_PARAM_AssignmentURL=true&iLM_PARAM_Assignment=../ex_pt/exerc/exerc_1_1_ler_imprimir_novo.ivph&iLM_PARAM_SendAnswer=false&lang=pt"
- allowfullscreen></iframe><br/>
- </div>
- <div class="embed-responsive embed-responsive"> <!-- 4by3 -->
- <center>
- <input type='button' name='Submit' value='Enviar resposta'
- title='clique aqui para vesualizar seu codigo'
- onclick='javascript:window.submit_iMA_Answer();' /><!-- chama funcao iMA-->
- </center>
- </div>
- </form>
- </div>
- </main>
- <footer class="container text-center">
- <a href="http://www.ime.usp.br/line">iVProgH</a> |
- <a href="http://www.ime.usp.br/line">LInE</a> |
- <a href="http://www.matematica.br">iMática</a>
- </footer>
- <script src="../js/jquery.min.js"></script>
- <script src="../js/bootstrap.bundle.min.js"></script>
- </body>
- </html>
|