Why am I getting errors after making runtime.js change

For developers using the Construct 2 Javascript SDK

Post » Sun May 29, 2016 12:07 am

This is hard to understand. I made the following change.

This was the change to the edittime.js

// example
AddStringParam("Message", "Enter a string to alert.");
AddAction(0, af_none, "Alert", "PipeCalls", "Alert {0}", "Description for my action!", "Pipecall_Alert");
AddAction(1, af_none, "Initialize", "PipeCalls", "Initialize", "Description for my action!", "Initial");
AddAction(2, af_none, "Terminate", "PipeCalls", "Terminate", "Description for my action!", "Finish");

AddComboParamOption("student_id");
AddComboParamOption("student_name");
AddComboParamOption("lesson_location");
AddComboParamOption("credit");
AddComboParamOption("lesson_status");
AddComboParamOption("entry");
AddComboParamOption("total_time");
AddComboParamOption("lesson_mode");
AddComboParamOption("exit");
AddComboParamOption("session_time");
AddComboParamOption("RO");
AddComboParam("Parameter to get", "Parameter", "{0},{1},{2},{3},{4},{5},{6},{7},{8},{9},{10}");
AddAction(3, af_none, "GetValue", "PipeCalls", "GetValue {0}", "Description for my action!", "GeT");

// (student_id, student_name, lesson_location, credit, lesson_status, entry, score, total_time, lesson_mode, exit, session_time, RO)

AddComboParamOption("student_id");
AddComboParamOption("student_name");
AddComboParamOption("lesson_location");
AddComboParamOption("credit");
AddComboParamOption("lesson_status");
AddComboParamOption("entry");
AddComboParamOption("total_time");
AddComboParamOption("lesson_mode");
AddComboParamOption("exit");
AddComboParamOption("session_time");
AddComboParamOption("RO");
AddComboParam("Parameter to set", "Parameter", "{0},{1},{2},{3},{4},{5},{6},{7},{8},{9},{10}");
AddStringParam("Set it to what", "value");
AddAction(4, af_none, "SetValue", "PipeCalls", "SetValue {0},{1}", "Description for my action!", "SeT");
AddAction(5, af_none, "Save", "PipeCalls", "Save", "Description for my action!", "Save");
AddAction(6, af_none, "Get Last Error", "PipeCalls", "Get Last Error {0}", "Description for my action!", "GeT_Error");
AddAction(7, af_none, "Get an error string", "PipeCalls", "Get a SCORM error as a string {0}", "Description for my action!", "GeTError_Str");
AddAction(8, af_none, "Get Diagnostic", "PipeCalls", "Get Diagnostic {0}", "Description for my action!", "GeT_Diog");



////////////////////////////////////////

And this is the change in the runtime.js

// ... other actions here ...
Acts.prototype.GeT = function (pos)
{
// alert the message
if(pos==2){ alert("you selected lesson_location");}

};

Any help appreciated.
Cheers
Luke
B
10
S
2
Posts: 50
Reputation: 1,100

Post » Sun May 29, 2016 4:30 am

What are the errors?
B
94
S
33
G
114
Posts: 5,359
Reputation: 73,779

Post » Sun May 29, 2016 5:41 am

Its OK,

I realized that my errors are caused by my external .js not being hosted on a moodle.

Thanks for replying.
Luke
B
10
S
2
Posts: 50
Reputation: 1,100


Return to Javascript SDK

Who is online

Users browsing this forum: No registered users and 0 guests