HOME ➔ SUPPORT ➔ Community ➔ General CourseLab issues ... Passing variables to javascript
Passing variables to javascript
  View type:
Hi Folks,

is there a way I can access variables such as score and course name?

I need this information to pass to an external database.

Thanks,

Dave
 

Hi, David,

Course name is not variable. If you need whole module score you can call

GetObjectiveScore(sObjectiveId)

(sObjectiveId must be ID of module objective) it returns raw score.
But actually there are AICC and SCORM standards that include all that you need and a lot of other useful things. Perhaps it would be much easier to switch to one of this standard to pass data to LMS?

 
Yes you can:
http://www.courselab.com/db/cle/0078F26A99E48CBFC3257601004C6A81/main_id/DEB1AE8A7B1B3576C3256FCF0055974C/extended/1/sid//did//forum.html [:cool:]

but why not use an lms? [:)]
 
 
Thanks Barend,

Do you know if theres a way I could identify the score produced by an assessment, there doesn't seem to be a striaght variable that this get assigned to that I can find.

a getPropert function that can retrieve rawscore and the like, is there a way in javascript that I can access the objects properties?

In answer to your question why not use an LMS, I'm developing this for a client who doesn't want to use it, and would rather send the results to a text file.

Regards,

Dave
 
 
 
Thanks Barend,


Sorry, the last reply didn't make much sense.[:)] What I meant was:

Do you know if theres a way I could identify the score produced by an assessment, there doesn't seem to be a striaght variable that this get assigned to that I can find.

I found a getProperty function in runtime.xml that can retrieve rawscore and the like, is there a way in javascript that I can access that objects properties?

In answer to your question why not use an LMS, I'm developing this for a client who doesn't want to use it, and would rather send the results to a text file.

Regards,

Dave
 
 
 
 
Hi Dave,

Maybe the function GetObjectiveScore in courselab.js (around line 6100) can help?

Javascript which is entered in an action seems to have restricted access to 'normal' functions and variables. I would use the array from the first link as a placeholder.

Succes [:)]
Subject:
Message options
No additional options