adlnet / adl_lrs Goto Github PK
View Code? Open in Web Editor NEWADL's Open Source Learning Record Store (LRS) is used to store learning data collected with the Experience API.
Home Page: https://lrs.adlnet.gov
License: Apache License 2.0
ADL's Open Source Learning Record Store (LRS) is used to store learning data collected with the Experience API.
Home Page: https://lrs.adlnet.gov
License: Apache License 2.0
Hi all !
I'm using Articulate 13 to build my courses and i'm facing problems reporting to lrs.
I have already reported data to lrs with other sources but only have problems with Articulate in their last version.
The error is "Error with Agent. The agent partial did not match any agents on record" and the root one is "Agent matching query does not exist."
from this lines in lrs/objects/AgentManager.py:
try:
if 'member' in params:
params.pop('member', None)
# If retreiving agents always get global version
params['global_representation'] = True
# gotta get account info right for this..
if 'account' in params:
acc = params.pop('account')
if 'homePage' in acc:
params['account_homePage'] = acc['homePage']
if 'name' in acc:
params['account_name'] = acc['name']
self.Agent = ag.objects.get(**params)
except :
err_msg = "Error with Agent. The agent partial did not match any agents on record"
raise IDNotFoundError(err_msg)
Request URL:http://localhost:8000/xapi/activities/state?method=GET
Request Method:POST
Status Code:404 NOT FOUND
method:GET
Request Payload
registration=&agent=%7B%22mbox%22%3A%22mailto%3Anorton%2Eprot%40gmail%2Ecom%22%2C%22name%22%3A%22dasdasd%22%2C%22account%22%3A%7B%22name%22%3A%22%2D%22%2C%22homePage%22%3A%22%2D%22%7D%7D&X%2DExperience%2DAPI%2DVersion=1%2E0%2E0&Authorization=Basic%20bm9ydG9uOnF3ZXJ0eQ%3D%3D&stateId=resume&Content%2DType=application%2Fjson&activityId=5giEz36l1xWEcourseeid
I'n not fluent with python so any help will be apreciate.
Statement API works very in the current version, but it throws an Internal Server Error (500) when trying to filter by an activity.
It should work like this http://example.com/XAPI/statements?object=activityId, but it doesn't.
Thank you for your work, guys. You rock.
For whatever reason, psycopg2 fails to authenticate the postgresql user if the authentication mode is set to "ident" in the postgresql server config. You get the error:
psycopg2.OperationalError: FATAL: Ident authentication failed for user <db_user>
This is a problem because ident is the default security mode on Redhat-based distros. In order for it to work, the psql auth mode must be set to either md5 or trust in /var/lib/pgsql/data/pg_hba.conf.
For boolean fields, need to check if it exists.
For example, if result_success is False...
if self.result_success ==> False
So the value doesn't get returned with the dictionary. If it is true, then it does.
@creighton holla back
Hi,
as described at
https://github.com/adlnet/xAPI-Spec/blob/master/xAPI.md#417-timestamp
A timestamp MUST be formatted according to ISO 8601.
actual result:
timestamp: "2013-10-28 23:53:38.197000+00:00"
expected result:
timestamp: "2013-10-28T23:53:38.197000+00:00"
Sometimes LRS occurred "[CRITICAL] WORKER TIMEOUT" error when a client posted a large statements data.
There are no information in lrs.log and django_request.log.
I could find only below log.
less /tmp/web-stderr---supervisor-AuMcsf.log
2013-10-30 10:42:08 [17279] [CRITICAL] WORKER TIMEOUT (pid:17282)
2013-10-30 10:42:08 [17279] [CRITICAL] WORKER TIMEOUT (pid:17282)
How do I fix this problem? Are there any idea?
Dear friends,
I have a problem when I do 'fab setup_lrs', console shows this:
"
[localhost] run: ./manage.py createcachetable cache_statement_list
Fatal error: local() encountered an error (return code 127) while executing './manage.py createcachetable cache_statement_list'
Aborting.
"
I'm traying to install lrs in Debian 6.0 and all was fine. I don't know how to resolve this error.
Thank you very much for your support and excuse me for my bad english 8)
Add time zone filtering. I remember the directive for parsing TZ was buggy which is why we cut it off and localize TZ to UTC.
Hi there,
Pretty interesting project you have here.
I see the readme was last updated 1 year ago. Has the status of "NOT READY FOR PRODUCTION" changed since then? Is it even barely ready for production? What are you projections about the time to availability for production use?
What are the key issues preventing the use for production and how can I help?
It should return error 404. (at least that's what Wax does)
When running Django via gunicorn (and therefore via supervisord), the static content is not served. http://example.com/static returns a 404 error, saying /static is not in the list of valid URLs as defined by adl_lrs.urls. However, if the server is run directly ($ python manage.py runserver), the static content is served correctly.
This is purely cosmetic as far as I can tell. The sundry APIs still function, just the homepage is ugly.
I think it's not supported anymore, but I've downloaded and set up the version .9 to be compatible with Articulate Storyline.
During the "test_lrs" phase of the setup, I am denied access to:
tincanapi.com/wp-content/assets/tincan.xsd
Yet, I can go to that site via web browser and get the required XML. Any ideas how I can get this to work on the fab test_lrs?
This is now a note for me (or anybody) to add a reminder before the setup environment instructions that the user should still be in the ADL_LRS folder. (In case they moved folder when editing settings.py).
Updated 23/11/13 (which is why comments below no longer make sense)
Found by observing tests; the duration element is assigned a string formatted according to an ISO 8601 timestamp, but not an ISO 8601 duration as required.
======================================================================
ERROR: test_activity_no_def_json_conform (lrs.tests.ActivityManagerTests.ActivityManagerTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/opt/ADL_LRS/lrs/tests/ActivityManagerTests.py", line 130, in test_activity_no_def_json_conform
self.assertEqual(name_set.keys()[0], 'en-FR')
AttributeError: 'unicode' object has no attribute 'keys'
======================================================================
ERROR: test_activity_no_def_schema_conform_extensions (lrs.tests.ActivityManagerTests.ActivityManagerTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/opt/ADL_LRS/lrs/tests/ActivityManagerTests.py", line 186, in test_activity_no_def_schema_conform_extensions
self.assertEqual(name_set.keys()[0], 'en-US')
AttributeError: 'unicode' object has no attribute 'keys'
I suspect the test cases provide a string where a language map is expected, or else the test expectations need to be revised.
Found by looking through tests; many mboxes in statements intended to be accepted are not mailto URIs (but are naked email addresses, which is not allowed).
I think this is not an issue but I'm a little desperate. I am using the 0.95 release and when I want to make a query filtered by object id get the following error:
relation \ "cache_statement_list " does not exist \ nline 1: SELECT cache_key, value, expires FROM \ "cache_statement_list " ... \ n
Greetings from Chile.
While testing out the OAuth1 functionality, I bumped into the following:
2014-07-22 09:50:35,460 [ERROR] django.request: Internal Server Error: /xAPI/OAuth/initiate
Traceback (most recent call last):
File "/home/adllrs/LRS/env/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 111, in get_response
response = callback(request, *callback_args, **callback_kwargs)
File "/home/adllrs/LRS/ADL_LRS/oauth_provider/views.py", line 41, in request_token
token = oauth_server.fetch_request_token(oauth_request)
File "/home/adllrs/LRS/ADL_LRS/oauth_provider/oauth/oauth.py", line 405, in fetch_request_token
self._check_signature(oauth_request, consumer, None)
File "/home/adllrs/LRS/ADL_LRS/oauth_provider/oauth/oauth.py", line 505, in _check_signature
token, signature)
File "/home/adllrs/LRS/ADL_LRS/oauth_provider/oauth/oauth.py", line 601, in check_signature
built = self.build_signature(oauth_request, consumer, token)
File "/home/adllrs/LRS/ADL_LRS/oauth_provider/oauth/oauth.py", line 633, in build_signature
hashed = hmac.new(key, raw, sha)
File "/usr/lib/python2.7/hmac.py", line 133, in new
return HMAC(key, msg, digestmod)
File "/usr/lib/python2.7/hmac.py", line 72, in __init__
self.outer.update(key.translate(trans_5C))
TypeError: character mapping must return integer, None or unicode
From what I can find out, HMAC does not accept unicode for the key, but for reasons I haven't figured out yet, is receiving a unicode key.
My temporary solution is to edit ADL_LRS/oauth_provider/oauth/oauth.py
line 633, from:
hashed = hmac.new(key, raw, sha)
to:
hashed = hmac.new(str(key), raw, sha)
My envorinment:
Looks like we only check for the statement id in the params. We need to also look at at the statement.
Also assume we throw a 400 if both are present but are different values.
Hi,
I'm involved in a project in which the client is interested in invoking LRS. I noticed lacking support for recent Django versions. Is there any reason why LRS would be incompatible with later Django versions? Would ADL be interested in required upgrade patches? If so we will happily supply some pull requests.
We are also toying the idea of moving LRS to the Django REST framework[1] for cleaner code and auto API documentation. Please let me know if there is an interest in receiving patches for this as well.
Hi guys,
Since Django 1.4, new versions of Django are better optimised and a few components are depreciated. Just wondering if you intend update the ADL_LRS for Django 1.6 and above in the future.
Thanks,
Varuna
MAX_URL_LENGTH specified in oauth_provider/consts.py is greater than InnoDB index maximum (255) and MyISAM (333). When using MySQL MAX_URL_LENGTH needs to be adjusted.
I had details in this wiki
https://github.com/adlnet/ADL_LRS/wiki/MYSQL-backend-support
when running "fab setup_lrs"
\[localhost\] local: ./manage.py syncdb
Error: One or more models did not validate:
lrs.verb: "verb_id": CharField cannot have a "max_length" greater than 255 when using "unique=True".
Changing the "MAX_URL_LENGTH = 2083" to "MAX_URL_LENGTH = 255" in ADL_LRS/oauth_provider/consts.py works, but not sure if it actually require more than 255 since this MAX_URL_LENGTH is used by lot of models in model.py, if 2083 is actually required you have to change all feilds in mysql database which has varchar(255) to varchar(1000) by storage engine to MyISAM, after they are created succesfuly by setup.py with value 255.
After starting the LSR app and generating some statements into LRS using LMS (Sakai). When tried to view the statements below error occurs.
2014-02-11 15:29:31,793 [ERROR] django.request: Internal Server Error: /xAPI/me/statements/Traceback (most recent call last):
File "/home/adllrs/lrs/env/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 111, in get_response response = callback(request, *callback_args, **callback_kwargs)
File "/home/adllrs/lrs/env/local/lib/python2.7/site-packages/django/contrib/auth/decorators.py", line 20, in _wrapped_view return view_func(request, *args, **kwargs)
File "/home/adllrs/lrs/ADL_LRS/lrs/views.py", line 273, in my_statements
stmt_objs = [stmt for stmt in models.Statement.objects.filter(id__in=(idlist)).order_by('-timestamp')]
File "/home/adllrs/lrs/env/local/lib/python2.7/site-packages/django/db/models/query.py", line 118, in _result_iter
self._fill_cache()
File "/home/adllrs/lrs/env/local/lib/python2.7/site-packages/django/db/models/query.py", line 875, in _fill_cache
self._result_cache.append(self._iter.next())
File "/home/adllrs/lrs/env/local/lib/python2.7/site-packages/django/db/models/query.py", line 291, in iterator for row in compiler.results_iter():
File "/home/adllrs/lrs/env/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py", line 763, in results_iter for rows in self.execute_sql(MULTI):
File "/home/adllrs/lrs/env/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py", line 818, in execute_sql cursor.execute(sql, params)
File "/home/adllrs/lrs/env/local/lib/python2.7/site-packages/django/db/backends/util.py", line 40, in execute return self.cursor.execute(sql, params)
File "/home/adllrs/lrs/env/local/lib/python2.7/site-packages/django/db/backends/mysql/base.py", line 114, in execute return self.cursor.execute(query, args)
File "/home/adllrs/lrs/env/local/lib/python2.7/site-packages/MySQLdb/cursors.py", line 205, in execute self.errorhandler(self, exc, value)
File "/home/adllrs/lrs/env/local/lib/python2.7/site-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler raise errorclass, errorvalue
DatabaseError: (1235, "This version of MySQL doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery'")
In ADL_LRS/lrs/views.py ,forcing execution of the first query "idlist" using function list() fixed this.
Below is the diff for the fix .
@@ -270,7 +270,7 @@ def my_statements(request):
idlist = page.object_list
if idlist.count() > 0:
- stmt_objs = [stmt for stmt in models.Statement.objects.filter(id__in=(idlist)).order_by('-timestamp')]
+ stmt_objs = [stmt for stmt in models.Statement.objects.filter(id__in=list(idlist)).order_by('-timestamp')]
else:
stmt_objs = []
Got an error running through the tutorial, at fab setup_lrs:
Traceback (most recent call last):
File "./manage.py", line 10, in
execute_from_command_line(sys.argv)
File "/home/adllrs/lrs/env/local/lib/python2.7/site-packages/django/core/management/init.py", line 443, in execute_from_command_line
utility.execute()
File "/home/adllrs/lrs/env/local/lib/python2.7/site-packages/django/core/management/init.py", line 382, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/home/adllrs/lrs/env/local/lib/python2.7/site-packages/django/core/management/base.py", line 196, in run_from_argv
self.execute(_args, *_options.dict)
File "/home/adllrs/lrs/env/local/lib/python2.7/site-packages/django/core/management/base.py", line 232, in execute
output = self.handle(_args, *_options)
File "/home/adllrs/lrs/env/local/lib/python2.7/site-packages/django/core/management/base.py", line 341, in handle
label_output = self.handle_label(label, **options)
File "/home/adllrs/lrs/env/local/lib/python2.7/site-packages/django/core/management/commands/createcachetable.py", line 54, in handle_label
curs = connection.cursor()
File "/home/adllrs/lrs/env/local/lib/python2.7/site-packages/django/db/backends/init.py", line 306, in cursor
cursor = self.make_debug_cursor(self._cursor())
File "/home/adllrs/lrs/env/local/lib/python2.7/site-packages/django/db/backends/postgresql_psycopg2/base.py", line 177, in _cursor
self.connection = Database.connect(**conn_params)
File "/home/adllrs/lrs/env/local/lib/python2.7/site-packages/psycopg2/init.py", line 164, in connect
conn = _connect(dsn, connection_factory=connection_factory, async=async)
psycopg2.OperationalError: FATAL: password authentication failed for user "root"
FATAL: password authentication failed for user "root"
Fatal error: local() encountered an error (return code 1) while executing './manage.py createcachetable cache_statement_list'
Aborting.
Not sure why there's a failed password auth - I'm logged in as adllrs (as per the tutorial).
I have installed the latest version, the application works fine however using any of the prototypes including those of Rustici results in Http Bad Request Fiddler shows the error as X-Experience-API-Version header missing this is also true when using the following url http://lrs.adlnet.gov/xapi/statements?limit=1
Many Thanks
During fab setup_lrs, it gives me back the following error:
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/fabric/main.py", line 712, in main
_args, *_kwargs
File "/usr/lib/python2.7/dist-packages/fabric/tasks.py", line 327, in execute
results[''] = task.run(_args, *_new_kwargs)
File "/usr/lib/python2.7/dist-packages/fabric/tasks.py", line 112, in run
return self.wrapped(_args, *_kwargs)
File "/home/adllrs/adllrs/ADL_LRS/fabfile.py", line 34, in setup_lrs
adldir = settings.MEDIA_ROOT
File "/usr/lib/python2.7/dist-packages/django/utils/functional.py", line 184, in inner
self._setup()
File "/usr/lib/python2.7/dist-packages/django/conf/init.py", line 42, in _setup
self._wrapped = Settings(settings_module)
File "/usr/lib/python2.7/dist-packages/django/conf/init.py", line 95, in init
raise ImportError("Could not import settings '%s' (Is it on sys.path?): %s" % (self.SETTINGS_MODULE, e))
ImportError: Could not import settings 'adl_lrs.settings' (Is it on sys.path?): No module named unipath
I checked the adl_lrs folder; settings.py, settings.pyc both exist. I also pip'ed installed unipath after source ../env/bin/activate too, and I'm not sure why it says no module.
Thanks in advance.
This might be an issue/doubt over some fundamentals.
As far as I know, multiple users should be able to send statements and they should be able to paricipate in the same activity.
Now, we know an Activity has to have its own unique identifier (Activity ID). In the statement is is the Object->id.
Now, the way I see ADL_LRS Django project does activity is it stores every activity in the lrs_activity model table.
Precisely in req_validate.py and method: server_validate_statement_object we have a check if the statement that is coming in is checked and its activity id is checked against the user who is sending it.
Specifically this code:
if activity.authoritative != '' and activity.authoritative != auth_name:
err_msg = "This ActivityID already exists, and you do not have the correct authority to create or update it."
suggests that no two users can share or even do the same activity.
I did test this by making two users in the ADL LRS and sent a statement. The second user to send the statement failed as the above error in code appeared.
Now, there are two assumptions that Im making which I think are correct.
I'd like to get some clarity on why this happens so. Even if this is supposed to happen, How are two distinct users supposed to a. authenticate themselves and b. be stored as users in the LRS.
*sorry not the most appropriate place to ask but didn't know where, I'll close when done
Thanks
Hi, First off Thank you for building this, it has really been helpful, you guys did a lot of work.
So if the complex query already finds all the statements that match, wouldn't searching (and recursively searching) through statement refs. come up with same results? Thanks for the insight
# only find references when a filter other than
# since, until, or limit was used
if reffilter:
stmtset = findstmtrefs(stmtset.distinct(), sinceq, untilq)
We check for the content type to decide if the POST is really a POST or if it's a GET. According to the spec, this is supposed to be decided based on the parameters. Change to make this determination based on the params
I am using the latest tincan.js from Rustici and am attempting to use the set state function with the following params ('location','Page01.html') and get the following error
There was a problem communicating with the Learning Record Store (400 || cannot evaluate data in dictionary to parse -- Error malformed string Page01.html)
I have tried the same setstate function with the following params
'location',01 sets activity\state OK
location, 02 sets activity\state OK
location 03 sets activity\state OK
location 08 sets activity\state fails
location 09 sets activity\state fails
location 10 sets activity\state OK
Any Ideas would be greatly appreciated
Many Thanks
Gary
Found by observing tests
If I attempt to retrieve all statements with a particular activity, the LRS does not return statements with that activity as the contextActivities.*. It only returns statements with the activity as the object. This occurs regardless of the presence, absence, or value of the 'context' query parameter.
This happens when we access the url xapi/statements to get a list of statements.
In /lrs/util/retrieve_statement.py line 185:
if format == 'exact':
result = '{"statements": [%s], "more": "%s"}' % (",".join([stmt.full_statement for stmt in
Statement.objects.filter(id__in=stmt_pager.page(1).object_list).order_by(stored)]), MORE_ENDPOINT + cache_key)
Works okay until I had a few statements being accepted. What happens is the statements (stmt.full_statement) gets treated as a dict and hence throws error: TypeError: sequence item 0: expected string, dict found.
if we do >> type(stmt.full_statement) it is a dict.
In that case, if we string-ify the statements, we solve this problem:
if format == 'exact':
result = '{"statements": [%s], "more": "%s"}' % (",".join([str(stmt.full_statement) for stmt in
Statement.objects.filter(id__in=stmt_pager.page(1).object_list).order_by(stored)]), MORE_ENDPOINT + cache_key)]
[Note the str(..)]
I'm not sure if this is a bug and I'd like to get some clarification on this.
Found by checking tests; I see quite a few non-URI activity IDs in statements that are tested to be accepted.
the lrs isn't filtering statements based on the actor parameter
see google group post
https://groups.google.com/a/adlnet.gov/forum/?fromgroups=#!topic/tincanapi-adopters/fNumxgENelU
actor filter is using mbox of [email protected], which has no statements in the LRS.. however, all statements are returned
Including a version parameter generates an error:
"[warning] There was a problem communicating with the Learning Record Store. (400 | The put statements request contained unexpected parameters: version)"
To replicate, go to this URL (but replace the endpoint and auth with those for your instance of the LRS):
Other LRS's do not generate this error.
Sorry if I am missing something obvious, but where can I find the ini files referred to by the uWSGI Setup section of the "Using Nginx for Production" Wiki Page? Thanks.
Wrong log paths are being used for the log handlers in settings.py
I facing problem while requesting activities... I need to search all activities which his parent id is:
http://my_course_111/
Sub activities ids are:
http://my_course_111/A
http://my_course_111/B
http://my_course_111/C
So with the next api request i'd like to have all ( parent and childs ):
http://localhost:8000/xapi/statements?limit=100&activity=http://my_course_111/
But i obtain exact one, the parent ( equal instead contains ).
What you think?
Is there a simple way to do it?
https://pypi.python.org/pypi/jsonschema could simplify a lot of code in the validators since a lot of it does not handle any logic, just makes sure the json structure adheres to xAPI.
As it is, OAuth authentication is all but unusable to authorize access to the API. Having a human in the loop when systems try to communicate is not terribly helpful.
I have successfully executed fab setup_env and got stuck while trying to execute fab setup_lrs. I got the following message and not sure what is going on?
I am using Debian.
root@debian:/home/adllrs/adllrs_dev/ADL_LRS# fab setup_lrs
[localhost] local: ./manage.py createcachetable cache_statement_list
Traceback (most recent call last):
File "./manage.py", line 8, in
from django.core.management import execute_from_command_line
ImportError: No module named django.core.management
Fatal error: local() encountered an error (return code 1) while executing './manage.py createcachetable cache_statement_list'
consumer, nonce, statementcontextactivity, substatementcontextactivity & token models define MySQL reserved name "key".
ast.literal_eval unable to parse json that has true or false. Since python uses True and False, the literal_eval fails when attempting to turn json strings into objects to merge.
work around for now is to use string representations of values, for example, 'true' instead of true
Can some please help me how to resolve this? I have installed (needed to install on) windows version psycopg2.
FOLLOWING ARE THE HIGHLIGHTS FROM THE ATTACHED LOG:
(ADL_LRS)PS C:\Users\Bhaskra> pip install -r C:\works\lrs\requirements.txt
(ADL_LRS)PS C:\Users\Bhaskra> python
(ADL_LRS)PS C:\Users\Bhaskra> pip install -r C:\works\lrs\requirements.txt
Downloading/unpacking Django==1.4 (from -r C:\works\lrs\requirements.txt (line 1))
Running setup.py egg_info for package Django
Downloading/unpacking gunicorn==0.14.2 (from -r C:\works\lrs\requirements.txt (line 2))
Running setup.py egg_info for package gunicorn
warning: no files found matching '*' under directory 'debian'
Downloading/unpacking pytz==2012c (from -r C:\works\lrs\requirements.txt (line 3))
Running setup.py egg_info for package pytz
warning: no files found matching '*.pot' under directory 'pytz'
warning: no previously-included files found matching 'test_zdump.py'
Downloading/unpacking supervisor==3.0a12 (from -r C:\works\lrs\requirements.txt (line 4))
Running setup.py egg_info for package supervisor
Downloading/unpacking bencode==1.0 (from -r C:\works\lrs\requirements.txt (line 5))
Running setup.py egg_info for package bencode
Downloading/unpacking oauth2==1.5.170 (from -r C:\works\lrs\requirements.txt (line 6))
Running setup.py egg_info for package oauth2
Downloading/unpacking psycopg2==2.5 (from -r C:\works\lrs\requirements.txt (line 7))
Running setup.py egg_info for package psycopg2
Error: pg_config executable not found.
Please add the directory containing pg_config to the PATH
or specify the full executable path with the option:
python setup.py build_ext --pg-config /path/to/pg_config build ...
or with the pg_config option in 'setup.cfg'.
Complete output from command python setup.py egg_info:
running egg_info
writing pip-egg-info\psycopg2.egg-info\PKG-INFO
writing top-level names to pip-egg-info\psycopg2.egg-info\top_level.txt
writing dependency_links to pip-egg-info\psycopg2.egg-info\dependency_links.txt
warning: manifest_maker: standard file '-c' not found
Error: pg_config executable not found.
Please add the directory containing pg_config to the PATH
or specify the full executable path with the option:
python setup.py build_ext --pg-config /path/to/pg_config build ...
or with the pg_config option in 'setup.cfg'.
Command python setup.py egg_info failed with error code 1 in C:\Users\Bhaskra.virtualenvs\ADL_LRS\build\psycopg2
Storing complete log in C:\Users\XXXX\pip\pip.log
(ADL_LRS)PS C:\Users\XXXXX>
I have a local instance of the LRS at http://localhost:8000, and a test application at http://localhost/test-app.htm. Whenever I use jQuery.ajax() to query the statements API, the call fails without even making a request, throwing the error 'Access to restricted URI denied'. This is a Firefox-specific error, basically saying that querying that URI is not allowed.
In Chrome, it makes the request, but comes back with an OPTIONS request, asking for the basic authentication credentials even though they are already specified in the URL.
My AJAX call is below:
var statement = {/* valid query or statement here */};
var ajaxValue = {};
var blockFlag = true;
var settings = {
'url': 'http://user:pass@localhost:8000/xapi/statements',
'success': function(data,textStatus,jqXHR){
ajaxValue = data;
},
'error': function(jqXHR, textStatus, errorThrown){
ajaxValue = {'textStatus': textStatus, 'errorThrown': errorThrown};
},
'complete': function(jqXHR, textStatus){
blockFlag = false;
},
'headers': {
'Content-Type': 'application/json',
'X-Experience-API-Version': '0.95'
},
'xhrFields': {'withCredentials': true }
};
if( statement ){
settings['type'] = 'POST';
settings['data'] = statement;
settings['dataType'] = 'json';
}
$.ajax(settings);
Any best practices I should be following to avoid these kinds of cross-domain problems? I know they're not inevitable because the old Tin Can javascript API used in the client examples functions for the same endpoints. (I'd like to avoid reusing that API if I can, as it's quite verbose and overly complicated for what I need.)
It came to my attention that it was unclear that sign up was an immediate thing and that the 'Name' and 'Password' on the sign up page were used to sign in.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.