-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Amrita Lab not working #173
Comments
@porduna, please let me know when you have a chance to have a look at this issue. Thanks! |
I'll check today in graasp-desktop. Just in case, in a super-fast view, the following links do work, right? Download link:
|
Thanks for your response @porduna. The second download link you sent is working. The link that is being called for download is the following: I think this matches the first link you sent. However, the file that is downloaded from the link above is the following: <html>
<head>
<title="Widget default of http://amrita.olabs.edu.in/olab/html5/?sub=BIO&cat=PHL&exp=Study_of_Plasmolysis&tempId=olab_ot_rt">
<meta name="check-url" value="http://amrita.olabs.edu.in/olab/html5/?sub=BIO&cat=PHL&exp=Study_of_Plasmolysis&tempId=olab_ot_rt"/>
<meta name="download" language="en" value="https://gateway.golabz.eu/rlms/amrita/id/http://amrita.olabs.edu.in/olab/html5/%3Fsub%3DBIO%26cat%3DPHL%26exp%3DStudy_of_Plasmolysis%26tempId%3Dolab_ot_rt"/>
<meta name='golab-i18n-autoload' value='true'>
<link href="https://gateway.golabz.eu/static/bootstrap/css/bootstrap.css" rel="stylesheet">
<style>
#final_widget_iframe {
width: 98.9%;
}
</style>
<script type="text/javascript" src="https://gateway.golabz.eu/static/jquery-1.8.3.min.js"></script>
<script type="text/javascript" src="https://gateway.golabz.eu/static/iframeResizer.min.js"></script>
<script type="text/javascript" src="https://composer.golabz.eu/static/js/translations-jquery-1.0.js"></script>
<script type="text/javascript">
// The LAB_ID identifies the current labmanager and laboratory. It must also include the institution since the url_for function would not work otherwise.
var CURRENT_HOST_HTTP = 'http://gateway.golabz.eu';
var CURRENT_HOST_HTTPS = 'https://gateway.golabz.eu';
var LAB_ID = 'https://gateway.golabz.eu/os/pub/amrita/http%25253A%25252F%25252Famrita.olabs.edu.in%25252Folab%25252Fhtml5%25252F%25253Fsub%25253DBIO%252526cat%25253DPHL%252526exp%25253DStudy_of_Plasmolysis%252526tempId%25253Dolab_ot_rt/w_default.html';
var AUTOLOAD = true;
var GOLAB_BOOKING = false;
function getReservationUrl(localeString) {
var token = "null";
// Laboratory config provided in the request
var lab_config = "";
var ils_config = "";
if (ils_student_url || ils_teacher_url)
ils_config = "&ils_student_url=" + ils_student_url + "&ils_teacher_url=" + ils_teacher_url;
return 'https://gateway.golabz.eu/os/public/reservations/new/amrita/http%25253A%25252F%25252Famrita.olabs.edu.in%25252Folab%25252Fhtml5%25252F%25253Fsub%25253DBIO%252526cat%25253DPHL%252526exp%25253DStudy_of_Plasmolysis%252526tempId%25253Dolab_ot_rt.json?st=' + token + ils_config + lab_config + '&locale=' + localeString;
}
var STATS_ADDRESS = "https://gateway.golabz.eu/embed/stats?url=https%3A%2F%2Fgateway.golabz.eu%2Fos%2Fpub%2Famrita%2Fhttp%2525253A%2525252F%2525252Famrita.olabs.edu.in%2525252Folab%2525252Fhtml5%2525252F%2525253Fsub%2525253DBIO%25252526cat%2525253DPHL%25252526exp%2525253DStudy_of_Plasmolysis%25252526tempId%2525253Dolab_ot_rt%2Fw_default.html";
</script>
<script type="text/javascript" src="/static/opensocial/smartgateway-simple.js"></script>
<script type="text/javascript" src="/static/opensocial/storage-simple.js"></script>
<script type="text/javaScript">
function getParameterByName(name) {
var url = window.location.hash;
name = name.replace(/[\[\]]/g, '\\$&');
var regex = new RegExp('' + name + '(=([^&#]*)|&|#|$)'),
results = regex.exec(url);
if (!results) return null;
if (!results[2]) return '';
return decodeURIComponent(results[2].replace(/\+/g, ' '));
}
var ils_student_url = "";
var ils_teacher_url = "";
var sg;
function adjustIframeHeight() {
var target = "";
var resourceId = "";
if (window.location.hash) {
resourceId = getParameterByName("resourceId") || "";
target = getParameterByName("target") || "";
}
if (target && resourceId) {
var height = $("body").prop("scrollHeight")
var message = JSON.stringify({
'event': 'resize',
'resourceId': resourceId,
'height': '' + (height + 20) + 'px'
});
parent.postMessage(message, target);
console.log("Requesting to resize: ", message, " on ", target);
}
}
function init() {
$("#legend").text("".replace("{0}", "http://amrita.olabs.edu.in/olab/html5/?sub=BIO&cat=PHL&exp=Study_of_Plasmolysis&tempId=olab_ot_rt"));
// Create SmartGateway
console.log("Initializing SmartGateway...");
sg = new SmartGateway($('#container'), $('#buttondiv'), $('#reserve_button'));
console.log("SmartGateway initialized.");
// Register a callback: whenever a widget has a reservationId, this method is called
sg.registerOnLoad( function(reservationId, g4lSessionId) {
var url = 'https://gateway.golabz.eu/os/public/reservations/existing/amrita/http%25253A%25252F%25252Famrita.olabs.edu.in%25252Folab%25252Fhtml5%25252F%25253Fsub%25253DBIO%252526cat%25253DPHL%252526exp%25253DStudy_of_Plasmolysis%252526tempId%25253Dolab_ot_rt/default/?reservation_id=' + reservationId + '&locale=' + sg.localeString;
$("#container").html("");
// Now show it
var contents = $("<div style='width: 100%; overflow: hidden'><iframe frameborder='no' id='final_widget_iframe' src='" + url + "' height='600px' scrolling='no'></div>");
console.log("I'm going to set as innerHTML: ");
console.log(contents);
$("#container").append(contents);
adjustIframeHeight();
// We set three timeouts to make sure the apps are loaded to do proper resizing
// if it take long time, it will be resized when mouse is moved above the app
// setTimeout(adjustIframeHeight,1000);
// 3 seconds
setTimeout(adjustIframeHeight,3000);
// 10 seconds
setTimeout(adjustIframeHeight,10000);
var supportsResizer = true;
if (reservationId != null && reservationId != undefined) {
if (reservationId.indexOf("virtualbiologylab.org") >= 0)
supportsResizer = false;
}
if (supportsResizer) {
iFrameResize({
log : false,
enablePublicMethods : true,
enableInPageLinks : true,
checkOrigin: false,
resizedCallback : function(messageData){ // Callback fn when resize is received
adjustIframeHeight();
}
}, "#final_widget_iframe");
}
reportStarted("default widget of http://amrita.olabs.edu.in/olab/html5/?sub=BIO\u0026cat=PHL\u0026exp=Study_of_Plasmolysis\u0026tempId=olab_ot_rt", LAB_ID, g4lSessionId);
});
console.log("Callback registered.");
function showError(errorMessage) {
$("#reserve_button_area").hide();
$("#error_area").show();
$("#error_message").html(errorMessage);
}
adjustIframeHeight();
if (AUTOLOAD)
sg.startReservation();
}
$(document).ready(init);
</script>
</head>
<body>
<div id="buttondiv" style="display: none">
<div class="span8 offset1" style="border-radius: 25px; border: 2px solid #bbb; padding: 20px;">
<div>
<legend id="legend" class=""></legend>
</div>
<div id="reserve_button_area" style="width: 100%; text-align: center">
<button id='reserve_button' class='btn btn-primary'></button>
<br><br>
</div>
<div id="error_area" style="display: none" class="alert alert-error">
<p id="error_message"></p>
<br><br>
</div>
<div id="waiting_area" style="display: none" class="alert alert-info">
<p>Checking booking sessions...</p>
<br><br>
</div>
<hr>
<div style="width: 100%; text-align: center">
<a href="http://www.go-lab-project.eu/" target="_blank"><img height="120" src="/static/golab.png" alt="Go-Lab logo" /></a>
<h5>Smart Gateway</h5>
</div>
</div>
</div>
<div id="container" style="text-align: center">Loading...</div>
</body |
Hi! This link is the one students typically load in the ILS: The almost content of the link is the one you posted (the one you posted ends in
which takes longer (no cache implemented yet), but it is the standalone version (which is different to the other). |
@porduna, I see what is going on. It is not finding the |
@porduna, I've got the fix now, but indeed now it takes ages to download. Would be great to have some caching, otherwise downloads might timeout. |
@juancarlosfarah That's great! Yes, a cache is definitely needed, especially in the case of the Amrita labs. In PhET and so on it's not necessary since it links to a bundle they provide, but in others we create it on demand, and the more contentes the page has the more it takes. Plus I'm sure it suffers in a classroom context. |
The Study of Plasmolysis lab (https://www.golabz.eu/lab/study-of-plasmolysis), which is marked as offline-ready, is failing due to the following error:
@porduna, as it says
SmartGateway
, I'm thinking it could be something to do with the wrapping. If you Visit Space with id5c7dbbf8ca1f6c2e756da08c
in the new Graasp Desktop app everything works well. However, when you download it to use it locally (save using icon then open from within Saved Spaces), you will see the failing error in the Investigation Phase.Do you think it's from the wrapping? Otherwise, I'll look into any possible issues from the desktop app.
The text was updated successfully, but these errors were encountered: