wee
Community Member Posts: 71
I get this message right before it goes to my last page = LMSSetValue Error: Data Model Element Type Mismatch
On my last page I have 2 actions (below) to set completion status for my SCORM 2004 course. Why am I getting this message? Thank you so much for any suggestions.
Show, Modify Variable, AICC_Lesson_Status, Value: completed
Show, Modify Variable, CMI_Completion_Status, Value: completed
Comments
-
Hi,
I have the same problem. The module was published in SCORM 2004. If you publish to Scorm 2004 you need two action at laste page or page where the module would be set to completed.
We used the two actions advised by Trivantis:
<span class=»wysiwyg-font-size-medium»>Completion Status</span>
On: Show
Action: Modify variable
Variable: CMI_Completion_Status
Value: completed<span class=»wysiwyg-font-size-medium»>Success Status</span>
On: Show
Action: Modify variable
Variable: AICC_Lesson_Status
Value: passedCould you someone explain to me why this error occurs? Please let me know.
René
-
Did someone solve this issue? I have the same problem
LMSSetValue Error: Data Model Element Type Mismatch
-
timk
Community Member Posts: 1,237 ✭ Legend ✭As far as I know CMI_Completion_Status is Scorm 2004 and AICC_Lesson_Status is Scorm 1.2, both doing the same, i.e. sending the status a user has achieved for the module. The Scorm versions use different Data Models, so you could try to remove one of the actions depending on which Scorm version you publish to.
-
Scorm2004 is infamous for errors and buggy behaviour. Do use Scorm1.2 or if you really need the extra benefits use xApi. Skip 2004, most of the industry does.
-
I am getting the same error: LMSSetValue Error: Data Model Element Type Mismatch
Does anyone have a solution for it?
I have a check box on the last page of the e-learning.
Trigger : Select
Action: Modify variable
Target: AICC_Lesson_Status
Value: completed.
Thanks in advance.
-
carlfink
Community Member Posts: 1,099 ✭ Legend ✭It’s mentioned up higher in this thread: SCORM 2004 doesn’t use AICC_Lesson_Status. Use CMI_Completion_Status instead.
-
Hi, We are testing a potential new LMS, and I am encountering an error on the SCORM 2004 files that we currently use with no errors on a different LMS. This comes up when I try to exit the course:
LMSSetValue Error: cmi.session_time to [PT0H0M14S] Data Model Element Type Mismatch.
When closing the error popup message, an additional error message is displayed:
LMSSetValue Error: adl.nav.request to [exit] Data Model Element is Read Only.
Any suggestions on how to fix these errors would be greatly appreciated.
Thank you,
Flavia
-
carlfink
Community Member Posts: 1,099 ✭ Legend ✭I’m not an expert, but the message:
LMSSetValue Error: cmi.session_time to [PT0H0M14S] Data Model Element Type Mismatch.
would seem to say that you’re trying to set a time value to the odd string value «PToHoM14S». I think I see that Ho would be hours, M minutes, and S seconds, but what would P or To be? I wonder if that’s a format type that your new LMS does not recognize but the old one did.
Then the second message:
LMSSetValue Error: adl.nav.request to [exit] Data Model Element is Read Only.
That seems to indicate that the new LMS just plain won’t let you set the session time—it can only be set automatically by the LMS, if I am guessing correctly. Are you changing that SCORM variable with an action, or is it something Lectora generated?
-
Hi,
I am not making any changes to the variable — this is just generated by Lectora Online when publishing to SCORM 2004.
Flavia
-
jking4853
Community Member Posts: 1 ☆ Roadie ☆Hi Flavia,
I wonder if you got an answer regarding the LMSSetValue Error: cmi.session_time to [PT0H0M14S]
In debugging a SCORM 2004 course that is not sending time values to the LMS I am finding the same issue.
Hope you were able to resolve.
-
timk
Community Member Posts: 1,237 ✭ Legend ✭[PT0H0M14S]
This seems to be a correctly formatted value of cmi.session_time for Scorm 2004. It means 0 Hours, 0 Minutes, 14 seconds. P could be followed by values for Years, Months and Days.
Data Model Element Type Mismatch
This means that the formatting does not match the Scorm version. In Scorm 1.2 for example the same time should be formatted as «00:00:14.0»
Are you sure, you publish to the same Scorm version the LMS expects?
Categories
- 35.9K All Categories
- 109 ✫ Announcements
- 33.1K Lectora®
- 31.1K Lectora Discussions
- 28.9K Lectora Desktop
- 2K Lectora Online
- 2K Lectora Feature Requests
- 71 Lectora User Groups
- 36 Lectora Accessibility User Group (LAUG)
- 22 ELB Learning Content
- 22 ELB Learning Content Discussions
- 324 CenarioVR®
- 191 CenarioVR Discussions
- 133 CenarioVR Feature Requests
- 41 Rockstar Learning Platform®
- 38 Rockstar Learning Platform Discussions
- 108 CourseMill®
- 108 CourseMill Discussions
- 47 ReviewLink®
- 47 ReviewLink Discussions
- 7 The Training Arcade®
- 7 The Training Arcade Discussions
- 934 All Things eLearning
- 36 eLearning Development
- 546 Learning Management System (LMS) Integration
- 332 Web Accessibility
- 1.2K ♪ The Green Room
- 9 Additional Learning Products
^
Файл технических параметров представляет собой XML-файл, в котором задаются размеры зоны контента и точка входа в ЭУМ. Файл имеет строго фиксированное имя: META-INF/tech-data.xml. Рекомендуемые размеры зоны контента 1024 х 600 пикселей.
Содержание файла технических параметров:
где:
тег
задает размеры зоны контента,
тег
задает имя файла, с которого ОМС-плеер начинает воспроизведение ЭУМ.
^
Результирующие данные ЭУМ базируются на элементах Модели данных SCORM Run-Time Environment (SCORM RTE).
Приведем общую терминологию Модели данных SCORM RTE.
Зарезервированные названия
_version – используется для определения версии Модели данных.
_count – используется для определения числа дочерних элементов элемента Модели данных.
_children – используется для перечисления названий дочерних элементов элемента Модели данных.
^
Ограничители используются для задания параметров или свойств элементов Модели данных. В SCORM RTE применяются следующие свойства:
- {lang=} – задание языка элементов Модели данных (например, {lang=en}).
- {case_matters=} – значимость регистра (например, {case_matters=true} или {case_matters=false}).
- {order_matters=< boolean>} – значимость порядка следования (например, {order_matters=true} или {order_matters= false}).
- [.] – используется для разделения пары взаимодействующих значений: 1[.]a
- [,] – используется для разделения набора взаимодействующих значений в массиве: 1[.]a[,]2[.]c[,]3[.]b
- [:] – Используется как разделитель в ряду числовых значений: 1[:]100 — ряд числовых значений между 1 и 100 (включительно).
Типы данных
- characterstring: Строка символов в стандарте Unicode.
- localized_string_type: Строка символов с указанием языка (lang = ) )
- long_identifier_type: Уникальный в рамках ЭУМ идентификатор. SCORM рекомендует использовать Uniform Resource Name (URN):
( ::=”urn”:”:”)
- short_identifier_type: Уникальный в рамках ЭУМ идентификатор.
- integer: Тип данных, использующий положительные и отрицательные целые числа и ноль.
- state: Тип данных, определяющий, что элементы модели данных имеют определенные (зарезервированные) значения
(state (browse,normal,review)).
- real (10,7): Тип данных, обозначающий действительное число с точностью до семи значимых цифр.
- time (second, 10, 0): Тип данных, представляющий время. Его символьная строка имеет следующий формат:
YYYY[-MM[-DD[Thh[:mm[:ss[.s[TZD]]]]]]], где
- YYYY: 4цифры, определяющие год (1970 >= YYYY >=2038) ;
- MM: 2 цифры, определяющие месяц ([01:12], где 01 – январь)
- DD: 2 цифры, определяющие день месяца ([1-31], в зависимости от месяца и года);
- hh: 2 цифры, определяющие час суток ([00:23]);
- mm: 2 цифры, определяющие минуты ([00:59]);
- ss: 2 цифры, определяющие секунды ([00:59]);
- s: одна или более цифр, представляющая десятые доли секунды;
- TZD: обозначение часового пояса (“Z” for UTC or +hh:mm or –hh:mm).
- timeinterval (second, 10,2): Тип данных, представляющий временной интервал. Его символьная строка имеет следующий формат:
P[yY][mM][dD][T[hH][mM][s[.s]S]], где
- y: количество лет (integer, >=0, не ограничено);
- m: количество месяцев (integer, >=0, не ограничено);
- d: количество дней (integer, >=0, не ограничено);
- h: количество часов (integer, >=0, не ограничено);
- m: количество минут (integer, >=0, не ограничено);
- s: количество секунд и долей секунды ((real or integer, >=0, не ограничено), на долю секунды отводится не более 2 цифр.
Модель данных SCORM RTE
- Версия Модели данных (Data Model Version)
Элемент cmi._version содержит номер версии Модели данных. Для SCORM RTE v.1.3 значение элемента должено быть установлено в «1.0».
^
Модели данных |
Спецификации |
cmi._version | Представляет собой версию модели данных.Требования к элементам Модели данных:
Требования к поведению ЭУМ:
Реализация требований к API:
Пример:
|
- Статус завершения (Completion Status )
Элемент cmi.completion_status определяет статус, указывающий какую часть материала ЭУМ, учащийся отработал (изучил). Пусть при работе с ЭУМ необходимо выполнить лабораторную работу. Далее на разных этапах работы с ЭУМ учащийся может не начать выполнение лабораторной работы, не завершить и завершить ее выполнение полностью. Вот это и есть «статус завершения». Однако лабораторную работу можно выполнить успешно, а можно неуспешно, но этот параметр оценивается другим элементом Модели данных – статусом успешности (Success Status).
SCORM не задает правил, по которым разработчик должен устанавливать значение статуса успешности, оставляя это полностью на его усмотрение.
^
Модели данных |
Спецификации |
cmi.completion_status |
Требования к элементам Модели данных:
Требования к поведению ЭУМ:
Реализация требований к API:
Пример:
|
Определение статуса завершения
При определении статуса завершения разработчик может руководствоваться (но не ограничиваться) следующими критериями:
- количество страниц (сцен) ЭУМ, посещенных учащимся;
- результаты выбора учеником элементов управления пользовательского интерфейса (например, нажатия тех или иных кнопок);
- завершение обучаемым просмотра какого-нибудь видео или прочтение документа.
В случае, если определены элементы модели данных «порог завершения» (cmi.completion_threshold) и «мера прогресса» (cmi.progress_measure), значение «статуса завершения» вычисляется автоматически. Правила вычисления приведены в таблице ниже.
^
(Completion_threshold) |
Мера прогресса
(Progress_measure) |
Статус завершения
(Completion Status) |
Поведение LMS |
Не определен | Не установлено в ЭУМ | Не установлено в ЭУМ | В cmi.completion_status должно быть установлено значение “unknown” |
Не определен | Не установлено в ЭУМ | Установлено одно из значений | В cmi.completion_status остается значение, установленное в ЭУМ . |
Не определен | 0.5 | Установлено одно из значений | В cmi.completion_status остается значение, установленное в ЭУМ .. |
0.8 | 0.5 | Установлено одно из значений | В cmi.completion_status должно быть установлено значение “incomplete”
Причина: 0.5 < 0.8. |
0.8 | 0.9 | Установлено одно из значений | cmi.completion_status должно быть переписано и иметь значение “complete”
Причина: 0.9 > 0.8. |
0.8 | Не установлено в ЭУМ | Не установлено в ЭУМ | В cmi.completion_status должно быть установлено значение “unknown” |
0.8 | 0.5 | Не установлено в ЭУМ | В cmi.completion_status должно быть установлено значение “incomplete”
Причина: 0.5 < 0.8. |
0.8 | 0.9 | Не установлено в ЭУМ | В cmi.completion_status должно быть установлено значение“complete”
Причина: 0.9 > 0.8. |
Не определен | 0.5 | Не установлено в ЭУМ | В cmi.completion_status должно быть установлено значение “unknown” |
0.8 | Не установлено в ЭУМ | Установлено одно из значений | В cmi.completion_status остается значение, установленное в ЭУМ. |
- ^
Значение элемента модели данных cmi.completion_threshold используется для автоматического определения статуса завершения (cmi.completion_status) путем его сравнения с текущей мерой погресса (cmi.progress_measure).
^ | Спецификации |
cmi.completion_threshold |
Требования к элементам Модели данных:
0.0 <= cmi.completion_threshold <= 1.0
Требования к поведению ЭУМ:
Реализация требований к API:
Пример:
|
- Выход (Exit)
Элемент модели данных сmi.exit информирует о том, как или почему ученик прекратил изучение ЭУМ.
^
Модели данных |
Спецификации |
cmi.exit | Требования к элементам Модели данных:
Требования к поведению ЭУМ:
Реализация требований к API:
Пример:
|
- ^
Элемент модели данных cmi.learner_id определяет уникальный идентификатор ученика, от имени которого было начато изучение ЭУМ. Правила создания и присвоения идентификаторов учащимся находятся вне компетенции спецификации SCORM. Обычно идентификатор присваивается учащемуся в процессе регистрации.
^
Модели данных |
Спецификации |
cmi.learner_id | Требования к элементам Модели данных:
Требования к поведению ЭУМ:
Реализация требований к API:
Пример:
|
- Имя ученика (Learner Name)
Элемент модели данных cmi.learner_name определяет имя учащегося. Правила и механизмы назначения «имени ученика» лежат за пределами компетенции спецификации SCORM.
^
Модели данных |
Спецификации |
cmi.learner_name | Требования к элементам Модели данных:
Требования к поведению ЭУМ:
Реализация требований к API:
Пример:
|
- Максимально допустимое время (Maximum Time Allowed)
Элемент модели данных cmi.max_time_allowed определяет общие время, которое отведено учащемуся на работу с ЭУМ.
^
Модели данных |
Спецификации |
cmi.max_time_allowed | Требования к элементам Модели данных:
Требования к поведению ЭУМ:
Реализация требований к API:
Пример:
|
- ^
Элемент cmi.progress_measure определяет степень усвоения учебного материала ЭУМ. Например учащийся при работе с контрольным ЭУМ успел решить 8 задач из 10 предложенных, в этом случае (если применять самый простой метод подсчета) «мера прогресса» будет присвоено значение «0.8». Выбор методов и критериев, применяемых при вычислении «меры прогресса», остается за разработчиком ЭУМ. Взаимосвязь элементов «мера прогресса» и «статус завершения» приведены в таблице ниже.
cmi.progress_measure | cmi.completion_status |
0 | “not attempted” |
1 | “completed” |
0 > value < 1 | “incomplete” (за исключением случаев когда cmi.completion_threshold определен и cmi.progress_measure больше или равно cmi.completion_threshold) |
^
Модели данных |
Спецификации |
cmi.progress_measure | Требования к элементам Модели данных:
Требования к поведению ЭУМ:
Реализация требований к API:
Пример:
|
- Время сеанса (Session Time)
Элемент модели данных cmi.session_time определяет время, затраченное учащимся на работу с ЭУМ в данной сессии.
ЭУМ должен сам отслеживать время взаимодействия с ним учащегося. При подсчете времени сеанса разработчик ЭУМ может учитывать время перерыва или не учитывать, руководствуясь при этом своими методиками.
^
Модели данных |
Спецификации |
cmi.session_time | Требования к элементам Модели данных:
Требования к поведению ЭУМ:
Реализация требований к API:
Пример:
|
- Статус успешности (Success Status)
Элемент модели данных cmi.success_status сообщает о том, можно ли признать, что учащийся усвоил материал, представленный в ЭУМ.
Правила и методики вычисления значения этого элемента лежат вне рамок спецификации SCORM. Разработчик ЭУМ может ориентироваться при вычислении статуса успешности на время взаимодействия учащегося с ЭУМ, процент достигнутых целей обучения, общий балл, полученный за выполнение теста, сравнение результата выполнения теста с эталоном или использовать другие критерии. Стоит отметить, что о статусе успешности имеет смысл говорить только при полном завершение работы с ЭУМ – элемент «статус завершения» (cmi.completion_status) установлен в значение «completed».
^
Модели данных |
Спецификации |
cmi.success_status | Требования к элементам Модели данных:
Требования к поведению ЭУМ:
Реализация требований к API:
Пример:
|
- Действия по истечении лимита (Time Limit Action)
Элемент модели данных cmi.time_limit_action указывает, что должен делать ЭУМ, когда превышено максимально допустимое время (cmi.max_time_allowed), отведенное учащемуся на работу с данным модулем.
^ | Спецификации |
cmi.time_limit_action | Требования к элементам Модели данных:
Требования к поведению ЭУМ:
Реализация требований к API:
Пример:
|
- Общее время (Total Time)
Значение элемента модели данных cmi.total_time является суммой времен всех учебных сеансов (cmi.session_time), накопленной в текущей учебной попытке, вплоть до нового учебного сеанса. Этот элемент модели данных используется для отслеживания общего времени, затраченного во время всех учебных сеансов в рамках данной учебной попытки.
^
Модели данных |
Спецификации |
cmi.total_time | Требования к элементам Модели данных:
Требования к поведению ЭУМ:
Реализация требований к API:
Пример:
|
страница | 14/15 |
Дата | 04.03.2012 |
Размер | 2,18 Mb. |
Тип | Документы, Образовательные материалы |
@jcputney I am a developer from a LMS company. We are using your scorm-again package inside an extension developed by us. So far I could have save the last lesson location of current user in our LMS database and can return it on demand but I don’t find exactly how to return this value and through which argument. Can you please help us in this regard?
We need user to resume exactly from where he/she has left.
Thanks in advance.
in my Vue app, I would import the package like:
import scormAgain from 'scorm-again';
but how would I use this, like how do I get from importing the package to:
window.API = new Scorm12API(settings);
Hi, first I’d like to say well done for this library, I’m currently trying to migrate our current SCORM 1.2 runtime over to your library and I’ve come across what I think is an issue, but it may be my understanding which is incorrect.
Our e-learning is created with Articulate Storyline generally, and I’m trying to load in the cmi.suspend_data
value to the API, which from your docs state it’s possible via the loadFromFlattenedJSON
or loadFromJSON
functions for which I’ve used the former. I’m using the following to load in the initial location value:
window.API.loadFromFlattenedJSON({
'cmi.suspend_data': 'the location string'
});
Following the code in DevTools shows that when it eventually enters loadFromJSON
, the object has taken the form cmi: {suspend_data: 'the location string'}
which I think is correct at this stage. Where things get a bit wonky is where you’re setting the default value for the CMIElement
variable as cmi
(line 1025 in BaseAPI.js) because when the JSON object is processed, you’re then doing const currentCMIElement = (CMIElement ? CMIElement + '.' : '') + key;
on line 1032, but CMIElement
will never be undefined at this stage and this then results in currentCMIElement
taking the form cmi.cmi
.
I can get around this by doing the following but ideally there needs to be a fix put in place for this, unless of course I’ve messed up somewhere:
window.API.loadFromFlattenedJSON({
'suspend_data': 'the location string'
}, 'cmi');
If it is indeed a bug, I’m happy to send a PR over for a fix but would prefer confirmation before doing so.
Thanks again for your great efforts,
Ian.
Hi, is anyone can give example of scorm-again implementation
I try implementing this package and getting this error
Scorm package are the same used by https://github.com/jcputney/scorm-again/tree/gh-pages, but when I move and try to implement it, it still get that error,
even I use same function like on that link which has lms.js, common.js, and another dependencies
I try to implement it on laravel project, and here’s my index.blade.php
https://pastebin.com/xfuJ2Ws8
thank you
I am in the process of implementing SCORM into a learning platform, and am using scorm-again. Has anyone dealt with proxied hosted courses? I’m testing the SCORM 1.2 hosted files for a vendor and am unclear how to reset progress or create new sessions with scorm-again. I am storing the cmi data in an entry in my DB, and have tried deleting the DB entry to clear the progress. The vendor stated that the LMS would need to start a new session to reset progress. Is there a value or session ID that is passed through the cmi.launch_data or cmi.core that is used to start a new session in SCORM?
Here is the vendor test files I am testing:
https://documentation.skillsoft.com/en_us/skillport/8_0/olsa/index.htm#54586.htm
I am using scorm-again to run courses generated from articulate rise. We are running them in iframe and once the user closes the iframe we get this error message.
DOMException: Failed to execute 'send' on 'XMLHttpRequest': Failed to load 'ApiURL/update': Synchronous XHR in page dismissal. See https://www.chromestatus.com/feature/4664843055398912 for more details.
at n (WebAppURL/_next/static/chunks/9.badbab7d92546a90cb17.js:1:25077)
at g (WebAppURL/_next/static/chunks/9.badbab7d92546a90cb17.js:1:5041)
at w (WebAppURL/_next/static/chunks/9.badbab7d92546a90cb17.js:1:5245)
at Function.M.flush (WebAppURL/_next/static/chunks/9.badbab7d92546a90cb17.js:1:5674)
at o.value (WebAppURL/_next/static/chunks/9.badbab7d92546a90cb17.js:1:25675)
at o.value (WebAppURL/_next/static/chunks/9.badbab7d92546a90cb17.js:1:32826)
at o.value (WebAppURL/_next/static/chunks/9.badbab7d92546a90cb17.js:1:14496)
at o.value [as LMSFinish] (WebAppURL/_next/static/chunks/9.badbab7d92546a90cb17.js:1:29772)
at SCORM_CallLMSFinish (WebAppURL/s3/001725d8-c170-438f-ba62-4bc5d56a0c29/scormdriver/scormdriver.js:640:172)
at LMSStandardAPI.SCORM_Finish [as Finish] (WebAppURL/s3/001725d8-c170-438f-ba62-4bc5d56a0c29/scormdriver/scormdriver.js:435:251)
n @ 9.badbab7d92546a90cb17.js:1
I assume that the iframe closes before the lmsComitURL has time to send the final update request.
our settings look like this
{
alwaysSendTotalTime: true,
autocommit: true,
autocommitSeconds: AUTOCOMMIT_SECONDS,
logLevel: 1,
lmsCommitUrl: `ApiURL/update`,
mastery_override: true,
selfReportSessionTime: true,
}
Do you have any ideas on how we could resolve this issue?
Thank you
Here is a replit that reproduces the issue:
const debounce = require("lodash/debounce") class BaseAPI { processHttpRequest(url) { const process = function(url) { console.log(`GET ${url}`) } const debounced = debounce(process, 500) debounced(url) } } // WRONG! Both calls get processed. const api = new BaseAPI() api.processHttpRequest("http://example.com/1") api.processHttpRequest("http://example.com/2")
Each call to processHttpRequest
creates a new process
function and a debounced version: debounced
. So consecutive calls to processHttpRequest
never target the same function, and debouncing doesn’t work. It’s just a 500ms delay.
Fixing it would be more or less straightforward. The gist of it is: remove the debounce stuff from processHttpRequest
and add:
class BaseAPI { constructor() { this.processHttpRequest = debounce(this.processHttpRequest.bind(this), 500); } }
The thing is, I don’t think we really want this. First, it would break existing behaviour. And more importantly: debouncing in this way would lose data:
api.processHttpRequest("http://example.com", { foo: "bar" }) // This data would be lost. // Less than 500 ms later... api.processHttpRequest("http://example.com", { bat: "man" })
A more correct implementation would debounce calls with the same [url, params]
, but I think that’s more trouble than it’s worth.
If you agree with this analysis, I could create a PR for removing the debouncing stuff from BaseAPI. Which would in turn simplify calls to processHttpRequest
a bit, since we woudn’t need the immediate
parameter.
When I try to validate if a choice request is valid I get the error
The data model element passed to GetValue (adl.nav.request_valid.choice.{target=settings}) is not a valid SCORM data model element.
Hello;
Please any sample code for the «requestHandler» ?
Thank you in advance.
Hi All;
First congrats for this good script. I’m testing this library on localhost.
My settings are:
const settings = { autocommit: true, autocommitSeconds: 30, dataCommitFormat: 'params', commitRequestDataType: 'application/x-www-form-urlencoded', autoProgress: false, logLevel: 1, mastery_override: false, };
The «lmsCommitUrl» is set to «http://127.0.0.1/scorm/commit»
The issue is: There is no communication between the library and the remote api.
Any solution ?
Thank you in advance
Hello and thank you for this great project!
Works fine for me with SCORM 2004 so far.
But during my SCORM 1.2 tests, the lesson_status wont change to ‘passed’ or ‘failed’ and keep the status ‘incomplete’.
I know that the imsmanifest.xml need the property ‘mastery_score’ to handle this process.
I added this line to my XML file: adlcp:masteryscore80</adlcp:masteryscore>
But somehow the value cant be find in student_data.mastery_score
I also tried to use the setting mastery_override=true… seems this is ignored as well.
I’m pretty sure, there is something I dont see. How I can check if a course is finished succesful or not?
Thank you for your support
Thank you @jcputney for making this project available.
I’m trying to use it within a modern TypeScript create-react-app PWA.
I can’t find any TypeScript declarations within the project or at the alternate @types/scorm-again
location (i.e. within DefinitelyTyped).
Are there any plans to make TypeScript declarations available?
A few of us are working on an extension to the SCORM 1.2 spec that adds (but doesn’t require) async callback for several of the API methods. The goal is to extend the spec without breaking it.
Is their any interest in this? If so I may be able to contribute the necessary changes.
Here is the initial spec for IScorm: https://github.com/NexPort-Solutions/iscorm
The scorm has many models and editions. So, please, tell me if:
- Does it Scorm12API works fine to scorm 1.1?
- Does it Scorm2004API works fine to Scorm2004 2nd Edition, 3rd edition and 4th edition?
I asked this because i didn’t find all scorms models and editions to test.
I await the answers.
Sorry about my english.
Hello,
I’ve been having issues utilizing the XHR Headers settings. I noticed the following comment in a pull request from September:
#338 (comment)
Their solution was able to resolve my problem, but it seems that this is still an active issue and that setting XHR headers are not working currently. Thanks in advance for taking a look at this!
Hi,
Do you have any plans to support cmi5 content in the future? If yes, do you have any wild estimates?
I’m using Scorm2004API
and hosting Articulate Rise 360 courses. When users interact with multiple choice quizzes I’m getting logs with errors like:
SetValue ['cmi.interactions.0.id', 'urn:scormdriver:Test_Your_Knowledge_A_52-year-old_…ng_to_surgery_later.Select_the_ONE_TRUE_answer._0']
SetValue ['cmi.interactions.0.type', 'choice']
SetValue ['cmi.interactions.0.learner_response', 'urn:scormdriver:The%20pain%20type%20is%20severe,%20chronic,%20nociceptive,%20non-cancer%20pain.']
SetValue ['cmi.interactions.0.result', 'incorrect']
throwSCORMError : 406: Data Model Element Type Mismatch
throwSCORMError : 401: The data model element passed to SetValue (cmi.interactions.0.correct_responses.0.pattern) is not a valid SCORM data model element.
throwSCORMError : 401: The data model element passed to SetValue (cmi.interactions.0.correct_responses.0.pattern) is not a valid SCORM data model element.
SetValue ['cmi.interactions.0.correct_responses.0.pattern', 'urn:scormdriver:An%20opioid%20is%20an%20appropriate%20pharmacological%20treatment.']
SetValue ['cmi.interactions.0.description', 'A 52-year-old man caught his right hand in machine…oing to surgery later.Select the ONE TRUE answer.']
SetValue ['cmi.interactions.0.weighting', '1']
SetValue ['cmi.interactions.0.latency', 'PT9.84S']
SetValue ['cmi.interactions.0.objectives.0.id', 'urn:scormdriver:0']
SetValue ['cmi.interactions.0.timestamp', '2021-09-08T00:19:41.0+10']
This should be a valid SCORM data model element. From the data model reference:
cmi.interactions.n.correct_responses.n.pattern (format depends on interaction type, RW) One correct response pattern for the interaction
scorm-again then does not populate these values to the underlying window.API_1484_11.cmi
object.
In addition, the cmi.interactions.n.learner_response
values are incorrectly recorded on the cmi object as an empty string. i.e. The learner response values passed to SetValue, as logged above, are lost.
Its not resuming the content and always starts from the beginning of the lesson content. How to achieve resume functionality?
Server and client-side errors happen occasionally, and we commonly refer to them as HTTP responses or status codes. The “406 error” or “406 Not Acceptable” error is one such HTTP response.
You may see the 406 error while visiting a site. Or worse, on your website. While It may irritate the average internet user, it can be borderline terrifying for a website or application owner. Besides looking somewhat unprofessional and confusing, any HTTP response code, including the 406 error, can lose sales and users.
This article will explain the basics of the “406 Not Acceptable” error, its causes, how to fix it, and steps to avoid it in the future.
Check Out Our Guide to Fixing a 406 Error and Find the Source of the Problem
What Is 406 Error?
The good news is that the HTTP error “406 Not Acceptable” message is not nearly as common as the 404 server error (which usually indicates a non-existent webpage), or even 301 or 500 HTTP errors. Therefore, you definitely shouldn’t see this one as much.
Although it’s rare, it’s still possible that the 406 error may come into play as a problem for your website. It usually looks like this:
The message typically reads:
Not Acceptable
An appropriate representation of the requested resource could not be found on this server.
It then sometimes identifies the “requested resource” where the problem lies, with other messages or server information mentioned at the end:
The appearance and text within the 406 error message depending on the website, host, and browser used to access the website. The 406 error may reveal where the errors stem from. Other times you may find that it’s a simple “406 Not Acceptable” error without any information helping you solve the problem.
Now, let’s pretend browsers spoke in plain English and not these cryptic messages. In that case, the browser would be saying something like this:
Hello, I’m a browser. I tried to show this webpage, but one of the two problems occurred:
- The website’s server sent me the wrong file format, so I can’t accept it.
- The website’s server violates some settings or security requirements.
Therefore, please resolve the violation or have the server use one of the file formats I accept. In case you’re wondering, here are the file formats I know how to read.
If only browsers were that friendly!
Essentially, there’s a miscommunication between the server and the browser or machine used to present the web application. The browser either can’t read what’s coming in or verify the data because it didn’t meet some requirements.
Now we have to answer some questions to figure out the cause of that miscommunication.
Server and client-side errors happen from time to time, but that doesn’t make them any less frustrating 😅 Learn how to fix one common error in this in-depth guide 👇Click to Tweet
What Causes the 406 Error?
Every time you open a web page, your browser (like Safari, Firefox, Brave, Chrome, or Internet Explorer) sends a request to the page’s server to obtain site content and database files. The browser acts as the messenger between you and the server — it tells the server what the user wants to see, and hopefully, the correct information comes back.
During that first request, the browser tells the server all about the file formats it can accept. It’s called an Accept- header request, which prompts the server to deliver the files in the proper formats to produce the entire website or web application, starting with the header.
Sometimes the server sends a reply that’s not in the suitable format or violates a rule set forth by the browser or client machine. In this situation, a 406 error appears in the browser window, indicating the server isn’t delivering the appropriate data.
Here are some examples of “bad formats” and “rule violations” that can come up with the header requests:
- Accept-ranges: Some servers have security measures set in place or only allow a specific file size range in the response. If the response attempts to send too many bytes outside the allowable range, you’ll see the 406 error.
- Accept-encoding: Here’s an area of the header meant to compress files, so they move quickly from the server to the browser. Some compression methods and formats aren’t accepted, rendering a 406 error code.
- Accept-charset: Refers to a character set or how site file tables take code (like CSS and HTML) and turn it into understandable characters. There are so many characters, languages, and symbols in the world that it’s challenging to cover them all. The standard table is called ISO-8859, but there are other complementary tables as well. New character tables occasionally get released to keep up with language and character additions.
- Accept-language: This is usually a different name for Accept-charset that references its focus on international languages.
- MIME type violation: Sometimes, the browser requests a specific MIME type from the server. MIME types are content elements like JPEG images, specific video formats, or simple text. If the server can’t provide a requested MIME type, like JPEG images, you’ll see a 406 error.
The primary way to address and fix a 406 error is by checking the source code for issues in the Accept-, Request-, and Response- headers.
The easiest way to review Accept- and Response- headers is to open a webpage in your browser, right-click, and select Inspect.
Go to Network > Headers to reveal all requests from this webpage.
You can typically select any request from the long list to see the Request- and Response- headers for that particular request.
Or, you can contact your web developer to take a look into the source code. However, checking the source code is much easier when you have tools for debugging and cleaning your database, which we’ll discuss later in this article.
As mentioned before, a “406 Not Acceptable” error tells us that the client has sent a valid request to the server, but the request included a unique requirement for the server to follow. That special requirement in the initial request was in the form of an HTTP Accept- header.
That leaves us with a few potential causes:
- The server didn’t provide the requested MIME type or proper formats, like a JPEG or mp4 video.
- The server didn’t return with the correct language (Accept-language). For instance, it may have sent back a response in German when the browser asked for French.
- The server used the wrong compression method or format in response to the Accept-encoding request.
- The server sent back too many bytes that didn’t align with the Accept-ranges request.
- The server failed to provide understandable characters, which would result in a problem with the Accept-charset request from the browser.
There are other reasons you may see the 406 error, but they’re not nearly as common. The above list is from the most common reasons to the least common. The first two come into play far more often than the others, so there’s a good chance you should usually focus on troubleshooting the potential for a MIME type violation or an Accept-language problem.
Overall, website owners should know about these format problems and violations, seeing how something within your site files may cause problems. Such situations often occur because of human error, like accidentally typing in the wrong code, deleting necessary code, or misconfiguring the server. The 406 error also appears when specific security settings or rules block content transmission from the server.
How to Fix the 406 Error
It’s prudent to run a website or application backup before completing any steps to resolve a 406 error. There’s always the potential for causing further problems by going into your site’s source code, so you’ll want to have a database and site file backup to restore if necessary.
Make sure you complete a full backup with everything from the database to the application and the media elements to the site files. If you’re a Kinsta user, you can do this with the MyKinsta backup feature, which logs your entire website in a separate file and has a Restore button for later use:
Now that we have a deeper understanding of why the 406 error occurs, it’s time to talk about the best methods to troubleshoot the error and prevent it from happening again.
These tactics include client-side causes (where a user makes an error or the machine isn’t working correctly), server-side causes, and platform-based causes like faulty plugins.
Make Sure the URL Is Correct
Our first piece of advice may sound simple, but it’s the quickest troubleshooting option, and it puts a focus on issues with the client-side of things (i.e., your computer).
A 404 error is far more likely than a 406 error in this situation, but you may end up seeing a “406 Not Acceptable” error if the website URL is valid. Yet, there’s something odd about the way your browser translates the request. For instance, adding “JSON” or “PHP” to the end of URLs could be misinterpreted as a request for those particular formats, even though the client doesn’t need them.
To resolve the issue, double-check the previously used URL that produced the error. Try typing it in again or opting for a different subdomain on the website to see if it’s only one page that isn’t rendering.
A 406 message is technically considered a client-side error code (even though it’s often a platform or server issue), so this is the first course of action to determine if something’s wrong on the client side.
Reset Your Devices and Networks
Another client-side problem occasionally involves those same Accept- headers sent from the user’s computer to a platform that can’t satisfy the request. Many of these platforms include gaming- or media-oriented systems like Hulu or music marketplaces like Spotify.
In simpler terms, you may log into a platform like Hulu, try to watch your favorite TV show, and receive a 406 error message. In this example, the problem is almost always on the client-side. It’s usually your computer, network, or another device you’ve used to launch the platform.
Although it can happen with any platform, some platforms that commonly report 406 errors include:
- Hulu
- Google Play
- Square Enix Games
- Netflix
- Xbox
- Windows (usually for gaming)
This list is far from complete, but it gives you an idea of where the 406 error may occur.
Media and gaming platforms are complicated with many restrictions, and those restrictions depend on your location or network configuration. There’s a chance you might encounter an error like this due to all the moving pieces.
Although we can’t help you troubleshoot every specific platform, consider walking through the following recommendations and checking to see if the error resolves:
- Go online to check the status of your platform’s server. It may simply be a problem with the company’s server.
- Restart your computer, gaming system, streaming device, or other machines.
- Disconnect all devices from their cables, wait a few minutes before reconnecting them all, and check to see if the error is gone.
- Check if the app is running the most current version. Also, see if any of your machines have firmware updates available.
- Reset your home or office network (the WiFi or internet connection through your router).
- Consider switching from a wireless network to a wired network connection if you’re still having trouble.
- Although this isn’t always a possibility, consider duplicating the error with a completely different machine. Make sure that the device is on the same network. If you can’t replicate the error, look into your network and the original machine.
If all else fails, go to your search engine and type in the name of your platform along with “+ 406 error code” for platform-specific troubleshooting advice. That often reveals forums and support documentation to guide you through the process.
Rollback Your Recent CMS Changes
Next, it’s time to explore the system used for your websites or applications. You may find that your content management system, such as WordPress, is the direct cause of a “406 Not Acceptable” error due to a complication with something inside your site files.
Whether using WordPress or any other content management system, look into when your last update occurred. WordPress has a sturdy default infrastructure meant to avoid these types of errors, no matter what.
However, specific plugins, themes, or manually adjusted coding could produce situations where the site files violate client or server requests. A simple upgrade to your CMS’s latest version can solve the problem right away.
To figure out if it’s your CMS, start by rolling back any recent upgrades that occurred to the core files. As you may already know, WordPress sends out updates to its system regularly. Most of these updates happen automatically, but older versions still require you to click a button.
Furthermore, WordPress and other CMSs utilize several moving parts like plugins, themes, and extensions. Those also get updated regularly, so you might need to roll back some of them.
For all systems outside of WordPress, search for “platform name + how to downgrade.”
If you use WordPress, you can easily downgrade your WordPress website, effectively rolling it back to one of the previous versions:
That guide outlines the following methods for downgrading your WordPress site, most of which only take a few minutes:
- Manually downgrading your WordPress site.
- Using a plugin to complete the WordPress system downgrade.
- Restoring a previous backup to bring back an old version, or at least the content and files from before.
- Manually downgrading a theme or plugin.
- Downgrading a plugin or theme with a separate plugin.
- Switching to an older version of PHP.
Uninstall and Reinstall Plugins, Themes, and Extensions
WordPress plugins and themes add extra code to your site files that interact with the core WordPress files. Reputable plugins typically don’t cause any problems, but occasionally a conflict occurs. A plugin, theme, or third-party extension may be the reason for the 406 error.
The tried-and-true method for identifying a troublesome plugin or theme is to deactivate your plugins and themes one by one. After disabling each, check to see if the 406 error has vanished. If so, you’ve found the problem. If it doesn’t go away, reinstall the plugin or theme and continue uninstalling the next one.
Analyze the Status of Your Database for Changes and Conflicts
Unfortunately, a removed “problem” plugin could still affect your WordPress database since plugins get full access to the database to work well. Therefore, you should still check the status of your database even if it appears the removal of a plugin has made the 406 error go away. Otherwise, you may still run the risk of seeing further issues in the future.
If a plugin or theme wasn’t the culprit, you should also check your database if it’s the primary source of the error. Sometimes a database change, whether accidental or purposeful, becomes the primary reason a 406 error appears.
To scan and fix your database, consider these solutions:
- Install a database scanner and cleaner that removes useless and troublesome tables and assets. Some options include WP Optimize and the Advanced Database Cleaner. Much of this process involves deleting old or orphaned items like trash posts, revisions, and metadata. It’s a solid first step to cleaning up your database and potentially eliminating that 406 error.
- Scan the database and look for records and tables potentially changed by a problematic plugin or ones that look out of place or unnecessary.
- If you have an idea of what’s wrong with your database, go to a search engine and seek out help from forums and other discussions online. There’s a good chance someone else has experienced the same problem.
Analyze Your Server Logs
The previous recommendations focus on client-side and CMS-oriented troubleshooting. Now we’ll consider all server-side issues. This tip, and the ones following, are best if you aren’t using a CMS or know that the 406 error has no connection to your CMS or client machine.
The first step in troubleshooting the server is checking the logs. It doesn’t matter what type of web application, CMS, or web design system you use; they all have server-side logs.
The application logs store that web application’s entire (or recent) history, with information about each database inquiry, results provided, pages requested, and much more. On the other hand, the server logs contain information about the health and status of the server or hardware used to run the web application.
For Kinsta users, you can find error and server logs in the MyKinsta dashboard. Check all logs that may be causing the 406 error:
- The error.log file
- The kinsta-cache-perf.log file
- The access.log file
You can also check raw access and WordPress error log files with an FTP client. Other options include enabling error logs in wp-config.php and going through the debug mode in the MyKinsta dashboard.
If you have problems finding the error logs or don’t know how to interpret them, contact the Kinsta customer support team for assistance.
Debug the Web Application (Like WordPress)
Like most web applications have server and error logs, they also typically provide information about debugging the application itself. Debugging involves going through the application’s code to find and eliminate minor errors (or bugs).
One of the best ways to run a complete scan of WordPress (and any web application for that matter) is to debug the database and website files. Luckily, debugging doesn’t mean you have to read through every line of code and pick out the bugs yourself. Programs are available for this specific purpose, and as we mentioned earlier, Kinsta even has its debugging tool within the MyKinsta dashboard.
Start the debugging process by learning the basics of debugging WordPress with the Kinsta Debug Mode, WordPress Debug plugins, or a more manual process:
Preventing the 406 Error in the Future
The problem with the 406 error is that it can pop up in many different situations. You might see the “406 Not Acceptable HTTP” error while browsing through Hulu or Netflix as a regular consumer.
That isn’t very pleasant, but nothing a little troubleshooting can’t fix. The more concerning occurrence of the 406 error is when it happens on your website or application. For those instances, you’ll need to check the server and CMS site files.
If it’s your website, you’ll want to prevent the error from ever happening again. Plugins, themes, and human error can always come into play, but we have a few suggestions to keep your databases and site files clean into the future:
- Only install necessary and reputable plugins, themes, and extensions. Always keep these elements to a minimum.
- Don’t ever modify the core WordPress files unless you absolutely must and know what you’re doing.
- Run a database cleaner and site optimizer regularly. We recommend completing this process every month and ideally finding a cleaner plugin that runs automatically in the background.
- Make a habit of debugging your server and web application. As mentioned, Kinsta offers a Debugging feature in its dashboard. Many other applications have this type of functionality as well.
- Set automated backups of your website or application. This way, a code conflict or error won’t cause you much stress since you can restore a previous version of the website and start from there.
- Run a manual backup of your site before you plan on updating WordPress and any plugins, even if you already run automated backups (better safe than sorry). It’s also wise to run backups before editing any files or adding new code to your site.
In addition to looking unprofessional and causing confusion, the 406 error can cause you to lose sales or users 💸 Learn how to fix it here ⬇️Click to Tweet
Summary
You can fix the 406 error in several ways. As long as you know what you are seeing and where to look for the fix, you should be able to clear the error up.
While this is not one of the more common WordPress errors, it is one you will see from time to time if your configuration is not correct.
Do you have any other recommendations for resolving “406 Not Acceptable” errors? Please share them in the comments section below!
Get all your applications, databases and WordPress sites online and under one roof. Our feature-packed, high-performance cloud platform includes:
- Easy setup and management in the MyKinsta dashboard
- 24/7 expert support
- The best Google Cloud Platform hardware and network, powered by Kubernetes for maximum scalability
- An enterprise-level Cloudflare integration for speed and security
- Global audience reach with up to 35 data centers and 275 PoPs worldwide
Test it yourself with $20 off your first month of Application Hosting or Database Hosting. Explore our plans or talk to sales to find your best fit.