diff --git a/mod/scorm/datamodels/scorm_12.js b/mod/scorm/datamodels/scorm_12.js
index 652e6f4..dfefc06 100644
--- a/mod/scorm/datamodels/scorm_12.js
+++ b/mod/scorm/datamodels/scorm_12.js
@@ -548,49 +548,36 @@ function SCORMapi1_2(def, cmiobj, cmiint, cmistring256, cmistring4096, scormdebu
             } else {
                 element = parent + '.' + property;
                 expression = new RegExp(CMIIndex,'g');
-
                 // get the generic name for this element (e.g. convert 'cmi.interactions.1.id' to 'cmi.interactions.n.id')
                 elementmodel = String(element).replace(expression,'.n.');
-
                 // ignore the session time element
                 if (element != "cmi.core.session_time") {
-
                     // check if this specific element is not defined in the datamodel,
                     // but the generic element name is
-                    if ((eval('typeof datamodel["' + scoid + '"]["' + element + '"]')) == "undefined"
-                        && (eval('typeof datamodel["' + scoid + '"]["' + elementmodel + '"]')) != "undefined") {
-
+                    if (typeof datamodel[scoid][element] == "undefined" && typeof datamodel[scoid][elementmodel] != "undefined") {
                         // add this specific element to the data model (by cloning
                         // the generic element) so we can track changes to it
-                        eval('datamodel["' + scoid + '"]["' + element + '"]=CloneObj(datamodel["' + scoid + '"]["' + elementmodel + '"]);');
+                        datamodel[scoid][element] = CloneObj(datamodel[scoid][elementmodel]);
                     }
-
                     // check if the current element exists in the datamodel
-                    if ((typeof eval('datamodel["' + scoid + '"]["' + element + '"]')) != "undefined") {
-
+                    if (typeof datamodel[scoid][element] != "undefined") {
                         // make sure this is not a read only element
-                        if (eval('datamodel["' + scoid + '"]["' + element + '"].mod') != 'r') {
-
+                        if (datamodel[scoid][element].mod != 'r') {
                             elementstring = '&' + underscore(element) + '=' + encodeURIComponent(data[property]);
-
                             // check if the element has a default value
-                            if ((typeof eval('datamodel["' + scoid + '"]["' + element + '"].defaultvalue')) != "undefined") {
-
+                            if (typeof datamodel[scoid][element].defaultvalue != "undefined") {
                                 // check if the default value is different from the current value
-                                if (eval('datamodel["' + scoid + '"]["' + element + '"].defaultvalue') != data[property]
-                                    || eval('typeof(datamodel["' + scoid + '"]["' + element + '"].defaultvalue)') != typeof(data[property])) {
-
+                                if (datamodel[scoid][element].defaultvalue != data[property] || typeof datamodel[scoid][element].defaultvalue != typeof data[property]) {
                                     // append the URI fragment to the string we plan to commit
                                     datastring += elementstring;
-
                                     // update the element default to reflect the current committed value
-                                    eval('datamodel["' + scoid + '"]["' + element + '"].defaultvalue=data[property];');
+                                    datamodel[scoid][element].defaultvalue = data[property];
                                 }
                             } else {
                                 // append the URI fragment to the string we plan to commit
                                 datastring += elementstring;
                                 // no default value for the element, so set it now
-                                eval('datamodel["' + scoid + '"]["' + element + '"].defaultvalue=data[property];');
+                                datamodel[scoid][element].defaultvalue = data[property];
                             }
                         }
                     }
