Picture of K Edison
game-frame
by K Edison - Friday, 20 May 2022, 6:16 PM
 

Hi, I am using the game-frame component in my course. When I put it up on my server it works great. Once I complete the animation it marks it complete and can continue on. When I put in as a packaged course in my LMS it doesn't mark it complete once the animation finishes. It seems like it's not hitting the gamecomplete function only in the LMS, does anyone have a solution? Thanks in advance.

define("components/adapt-game-frame/js/adapt-game-frame",["require","coreViews/componentView","coreJS/adapt"],function(e){

var t=e("coreViews/componentView");
var i=e("coreJS/adapt");var n=false;
var s=t.extend({events:{inview:"inview"},
preRender:function(){
},

postRender:function(){
var e=this;
this.$(".gameIframe-object").ready(function(){e.setReadyStatus()})},

once:function(e){if(!e){
this.$(".gameIframe-object").attr("data",this.model.get("_source"));
this.model.set("_isFired",true);
}else{
return}},

gameComplete:function(e){
alert("I am hitting this function);
if(e.origin===this.model.get("_originURL"))
this.setCompletionStatus();
}},

inview:function(e,t){
if(t){n=this.model.get("_isFired");
this.once(n);
window.addEventListener("message",this.gameComplete.bind(this),false)}}});i.register("game-frame",s)
});

Picture of Simon Date
Re: game-frame
by Simon Date - Tuesday, 24 May 2022, 10:50 AM
 

Have you added the trigger in your Game/HTML5 animation?

https://github.com/anthkris/adapt-game-frame#usage

Picture of K Edison
Re: game-frame
by K Edison - Tuesday, 24 May 2022, 11:52 AM
 

Yes I did add the trigger and it all works like it should when I put it on my server but when I upload to my LMS it doesn't work.

Picture of Simon Date
Re: game-frame
by Simon Date - Tuesday, 24 May 2022, 4:09 PM
 

Sorry, I didn't read your post properly.

Perhaps your LMS has some security setting that limits the use of the Window.postMessage() function. I would recommend playing around with some of these parameter settings to see if you could get it to work or contact your LMS admin/developer who may be able to provide some insight.

Picture of K Edison
Re: game-frame
by K Edison - Friday, 3 June 2022, 1:12 PM
 

Thanks, I will contact my LMS admin.