Kaynağa Gözat

v1 functional, still pending bypass same-origin policy

bernardo 6 yıl önce
ebeveyn
işleme
ad4d6ab692
2 değiştirilmiş dosya ile 12 ekleme ve 13 silme
  1. 8 5
      index.html
  2. 4 8
      js/testFunctions.js

+ 8 - 5
index.html

@@ -99,6 +99,10 @@
       <div data-toggle="collapse" class="pointer" href="#area-autoeval-descript" aria-expanded="false" aria-controls="area-autoeval-descript"><span class="octicon octicon-info"></span> Entenda o funcionamento do testador de iMA</div>
       <div id="area-autoeval-descript" class="collapse">
         <p>Descrição do funcionamento do Ambiente de testes para iMA</p>
+        <p>
+          para utilizar este arcabouço no ubuntu você terá que desabilitar a proteção de Cross Origin, para usuários de chrome utilize o comando
+          "google-chrome --disable-web-security --user-data-dir='caminho para a pasta do seu iMA'"
+        </p>
       </div>
     </div>
     <div class="container example-large-div">
@@ -108,18 +112,17 @@
 
       <!-- caminho para iMA-->
       <label> Caminho para o seu iMA: </label>
-      <input type="file" placeholder="../meu_iMA/iMA.html" size="30" id="iLMsrcField" onchange="updateIMA();" required>
-      <button type="button" class="btn btn-primary" onclick="updateIMA()">
-        <span class="octicon octicon-sync"></span></button>
+      <input type="text" size="30" id="iLMsrcField" value="./ivprogh/index.html" required>
+      <button type="button" class="btn btn-primary" onclick="updateIMA()"><span class="octicon octicon-sync"></span></button>
 
       <form>
         Autoria<input type="radio" name="sendAnswer" value="true" onclick="authorMode=true;">
-        Resposta<input type="radio" name="sendAnswer" value="false" checked="authorMode=false;">
+        Resposta<input type="radio" name="sendAnswer" value="false" checked onclick="authorMode=false;">
       </form>
 
       <!-- caminho para atividade-->
       <label> Caminho para a atividade: </label>
-      <input type="file" placeholder="../iVProg/atividades/atv1.ivph" size="30" id="activitySrc" onchange="updateActivity" required>
+      <input type="text" size="30" id="activitySrc" value="./ex_pt/exerc/exemplo_1_ler_e_imprimir_inteiro.ivph" required>
       <button type="button" onclick="updateActivity()" class="btn btn-primary">
         <span class="octicon octicon-sync"></span>
       </button>

+ 4 - 8
js/testFunctions.js

@@ -1,16 +1,12 @@
 var iLMsrc="", activitysrc="", authorMode=false;
 function updateIMA (){
   iLMsrc = document.getElementById("iLMsrcField").value;
-  document.getElementById("iLM").value = iLMsrc+"?iLM_PARAM_AssignmentURL=true&iLM_PARAM_Assignment="+activitysrc+"&iLM_PARAM_SendAnswer="+authorMode;
-  console.log(iLMsrc+"?iLM_PARAM_AssignmentURL=true&iLM_PARAM_Assignment="+activitysrc+"&iLM_PARAM_SendAnswer="+authorMode);
-  document.getElementById("iLM").contentWindow.location.reload(true);
+  document.getElementById("iLM").src = iLMsrc+"?iLM_PARAM_AssignmentURL=false&iLM_PARAM_Assignment="+activitysrc+"&iLM_PARAM_SendAnswer="+authorMode;
+//  document.getElementById("iLM").contentWindow.location.reload(true);
+
 }
 
 function updateActivity(){
   activitysrc = document.getElementById("activitySrc").value;
-  document.getElementById("iLM").src = iLMsrc+"?iLM_PARAM_AssignmentURL=true&iLM_PARAM_Assignment="+activitysrc+"&iLM_PARAM_SendAnswer="+authorMode;
-  document.getElementById("iLM").contentWindow.location.reload(true);
-}
-function teste(){
-  console.log(teste);
+  document.getElementById("iLM").src = iLMsrc+"?iLM_PARAM_AssignmentURL=false&iLM_PARAM_Assignment="+activitysrc+"&iLM_PARAM_SendAnswer="+authorMode;
 }