Giter Club home page Giter Club logo

adl_lrs's Introduction

ADL LRS

Note: This LRS has recently been updated to match the IEEE 9274.1.1 Base Standard -- also known as xAPI 2.0.

This version is stable, but only intended to support a small amount of users as a proof of concept.

Installation

The simplest way to install the ADL LRS is via Docker and Docker Compose. You can find detailed instructions on this process here.

Helpful Information

Contributing to the Project

We welcome contributions to this project. Fork this repository, make changes, and submit pull requests. If you're not comfortable with editing the code, please submit an issue and we'll be happy to address it.

License

Copyright ©2016 Advanced Distributed Learning

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

adl_lrs's People

Contributors

adl-trey avatar adlmeganbohland avatar argenrost avatar blister avatar creighton avatar dependabot[bot] avatar floriantolk avatar godloveet avatar hsmith-adl avatar joeybowseradl avatar kgrandis avatar ljwolford avatar ottenhoff avatar pauliejes avatar simis-trey avatar vbhayden avatar wegrata avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

adl_lrs's Issues

ADL_LRS .9

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?

Error: The put statements request contained unexpected parameters: version

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):

http://cdn.tincanapi.com/wp-content/assets/ClientPrototypes/GolfExample_TCAPI/index.html?endpoint=http%3A%2F%2Flocalhost%3A8000%2Fxapi%2F&auth=Basic%20YW5kcmV3OmVuYQ%3D%3D&actor={%22name%22%3A%22Admin%20User%22%2C%22mbox%22%3A%22mailto%3Amrdownes%40hotmail.com%22%2C%22objectType%22%3A%22Agent%22}&registration=755f06cf-0b72-4745-9b30-c7524f377bcc&version=1.0.0

Other LRS's do not generate this error.

Should use 2-legged OAuth, not 3-legged

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.

Registering an app

When registering an app on the hosted version of the LRS, even on my own account, the feedback says "Thank you tom" and then strangely "Thank you Megan Bowe"
Fullscreen_2_20_13_11_01_AM

Avoiding cross-domain issues when using an external LRS

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.)

Ini Files for "Using nginx for Production"

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.

Test failures on clean install

======================================================================
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.

Activity filter doesn't search context

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.

user registration / sign up unclear

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.

update doc endpoints can cause 500

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

Posting a statement

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

Static content (css, etc.) 404's when served from gunicorn

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.

fab setup_lrs issue after fab setup_env setup

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'

LRS allows misformatted durations

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.

Statement retrieval treated as dict?

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.

windows 8 INSTALLATION HELP: LOG ATTACHED

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:

  1. The log shows that PG_CONFIG Executable not found. "where to get that?"
  2. writing dependency_links to pip-egg-info\psycopg2.egg-info\dependency_links.txt
  3. warning: manifest_maker: standard file '-c' not found
  4. 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'.

(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>

Filter Time zones

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.

Oauth issue with HMAC and unicode

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:

  • Unbuntu 14.04 LTS server 64bit
  • Python 2.7.6

Activity ID being constrained to only one user ?

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.

  1. Every user in the ADL LRS represents a real world user and it is usuing this user credentials, that the user can send statements.
  2. Every user should be able to do the same activity. for example: Chapter 1 can be done by Bob and Mary.
  3. The user is authenticated on the http request side. When bob and mary's devices make statements to /xapi/statments/ their user is authorised by the basic authentication method that works in ADL_LRS Django.

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.

fix POST / GET statement determination

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

Sometimes LRS occurred "[CRITICAL] WORKER TIMEOUT" error when a client posted a large statements data.

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?

Fatal error with step 'fab setup_lrs'

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)

Question re Django upgrades

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.

1: http://www.django-rest-framework.org/

Set State

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

Question: retrieve_statement.py's findstmtrefs function, why?

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)

What is the status of the project, still not ready for production?

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?

password authentication failed for user root

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).

psycopg2 authentication fails for auth mode "ident"

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.

MYSQL backend support issues

I had details in this wiki
https://github.com/adlnet/ADL_LRS/wiki/MYSQL-backend-support

Issue 1:

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".
Possible Solution:

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.

Issue 2:

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'")
Solution:

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 = []

cache_statement_list does not exist

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.

Change exact statement filter to contains

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?

installation instructions could be clearer

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)

settings.py not found during fab setup_lrs

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.

Problems with Agent with Articulate 13 TinCan.

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.

object_return bug

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.