]> git.mjollnir.org Git - moodle.git/log
moodle.git
17 years agoenrol/paypal: mark the contextpath as dirty on unenrolment
martinlanghoff [Wed, 19 Sep 2007 07:12:22 +0000 (07:12 +0000)]
enrol/paypal: mark the contextpath as dirty on unenrolment

so the unenrolment is effective immediately.

17 years agoenrol/mnet: mark context as dirty after unenrol
martinlanghoff [Wed, 19 Sep 2007 07:12:10 +0000 (07:12 +0000)]
enrol/mnet: mark context as dirty after unenrol

So the unenrolment is effective immediately.

17 years agodeprecatedlib: Legacy interactive enrol/unenrol codepaths mark the context dirty
martinlanghoff [Wed, 19 Sep 2007 07:11:56 +0000 (07:11 +0000)]
deprecatedlib: Legacy interactive enrol/unenrol codepaths mark the context dirty

My heart is not so cold. These old buddies also need love and care...

17 years agoAll interactive enrol/unenrol codepaths mark the context dirty
martinlanghoff [Wed, 19 Sep 2007 07:11:42 +0000 (07:11 +0000)]
All interactive enrol/unenrol codepaths mark the context dirty

Manually enrolling and unenrolling self, and other users should
transparently set the context dirty. So walk all callers to
role_assign() and role_unassign() and mark the context dirty
where appropriate.

OTOH, most automated-backend enrol/unenrol mechanisms should not.
The backend lookups that happen when you login are well covered
by the login/enrolment process, and don't need to be marked dirty.

17 years agocron: call cleanup_dirty_contexts()
martinlanghoff [Wed, 19 Sep 2007 07:11:31 +0000 (07:11 +0000)]
cron: call cleanup_dirty_contexts()

17 years agoaccesslib: Introduce (and use) reload_all_capabilities()
martinlanghoff [Wed, 19 Sep 2007 07:11:18 +0000 (07:11 +0000)]
accesslib: Introduce (and use) reload_all_capabilities()

If accessinfo is stale, we need to reload it without losing
out "interesting" state -- transparently for the end user.

That means preserving active role switches, loginas (site and course
level), etc. The logic for that is encapsulated in
reload_all_capabilities().

Also affected:
 - has_capability() which now calls reload_all_capabilities()
 - role_switch() - minor tidyup

17 years agoaccesslib: get_user_courses_bycap() fix bug introduced by refactor
martinlanghoff [Wed, 19 Sep 2007 07:11:04 +0000 (07:11 +0000)]
accesslib: get_user_courses_bycap() fix bug introduced by refactor

The refactor that created make_context_subobj() triggered a bug.
Smack in the hand to the sloppy programmer using variables outside
of the context they were meant to be used in!

17 years agoadmin/roles: context-specific role changes mark the context as dirty
martinlanghoff [Wed, 19 Sep 2007 07:10:52 +0000 (07:10 +0000)]
admin/roles: context-specific role changes mark the context as dirty

And will force a reload of $USER->access for logged-in users that need
to read _this_ context. Much lower impact - still not a great idea to
edit assignments/caps on very busy courses, but impact should be low.

17 years agoadmin/roles: sitewide role changes mark site context as dirty
martinlanghoff [Wed, 19 Sep 2007 07:10:37 +0000 (07:10 +0000)]
admin/roles: sitewide role changes mark site context as dirty

And will force a reload of $USER->access for all logged-in users
on their next request.

We will have to tell admins of large sites to avoid making role changes
at busy times, as it does generate extra load.

17 years agoaccesslib: Introduce $DIRTYCONTEXTS, $USER->access[time],is_contextpath_clean()
martinlanghoff [Wed, 19 Sep 2007 07:10:24 +0000 (07:10 +0000)]
accesslib: Introduce $DIRTYCONTEXTS, $USER->access[time],is_contextpath_clean()

has_capability() now (ab)uses a new global: DIRTYCONTEXTS where we
load the contexts that have changed since since $USER->access[time]

The shallow/easy checks are done in has_capability(), deeper checks
go into the newfangled is_contextpath_clean().

The only complication now is to reload the relevant caps without losing
switches, loginas, etc...

17 years agoaccesslib: Introduce functions to deal with dirty contexts
martinlanghoff [Wed, 19 Sep 2007 07:10:09 +0000 (07:10 +0000)]
accesslib: Introduce functions to deal with dirty contexts

The accessinfo held in $USER->access can easily get out of
sync with reality if and admin has removed our access,
or expanded it after we loaded our accessinfo.

To handle this, we'll use the config_plugins table with an
'accesslib/dirtycontexts' plugin signature to store the paths of
recently changed contexts. To handle those dirrrty entries, here
we introduce

  get_dirty_contexts() - for lib/setup
  mark_context_dirty()
  cleanup_dirty_contexts() - for cron

17 years agoget_role_users() callers rework to use the new $gethidden
martinlanghoff [Wed, 19 Sep 2007 07:09:50 +0000 (07:09 +0000)]
get_role_users() callers rework to use the new $gethidden

17 years agogroup/assign: fixed performance of assigning users to groups
martinlanghoff [Wed, 19 Sep 2007 07:09:36 +0000 (07:09 +0000)]
group/assign: fixed performance of assigning users to groups

- page would not display on a course with 600 users

17 years agocourse/lib:print_course() smarter calling of get_role_users()
martinlanghoff [Wed, 19 Sep 2007 07:09:24 +0000 (07:09 +0000)]
course/lib:print_course() smarter calling of get_role_users()

And saves a few dbqueries too...

17 years agoaccesslib:get_role_users() revamp
martinlanghoff [Wed, 19 Sep 2007 07:09:13 +0000 (07:09 +0000)]
accesslib:get_role_users() revamp

Now get_role_users() joins with contexts and roles too, so we can
push more work into it, and simplify the callers.

One important change is that the $view flag gets reworked into
$gethidden, pushing the cap check to the caller.

This commit is followed by a cleanup of the callers...

17 years agodatalib: get_courses_search() remove dead code
martinlanghoff [Wed, 19 Sep 2007 07:09:01 +0000 (07:09 +0000)]
datalib: get_courses_search() remove dead code

17 years agocourse/search.php: smarter about contexts, bugfix in pagination
martinlanghoff [Wed, 19 Sep 2007 07:08:50 +0000 (07:08 +0000)]
course/search.php: smarter about contexts, bugfix in pagination

Save a ton of queries about contexts, and a bugfix in how we are
calling the pagination for get_courses_search().

17 years agodatalib: get_courses_search() learns to be smart about contexts...
martinlanghoff [Wed, 19 Sep 2007 07:08:37 +0000 (07:08 +0000)]
datalib: get_courses_search() learns to be smart about contexts...

Join against contexts, save bazillion context lookups...

17 years agocategories: Categories page and get_courses_page() - smarter about context
martinlanghoff [Wed, 19 Sep 2007 07:08:24 +0000 (07:08 +0000)]
categories: Categories page and get_courses_page() - smarter about context

This patch saves 1600 context lookups on a 1600 course category. rcache
does help a bit with small categories, but on large setups, this is
not sustainable.

And it's not needed either. We have the data right at our fingertips.
Just get it when it's cheap...

17 years agoaccesslib: introducing make_context_subobj() - and refactor callers
martinlanghoff [Wed, 19 Sep 2007 07:08:12 +0000 (07:08 +0000)]
accesslib: introducing make_context_subobj() - and refactor callers

We had many copies of the subcontext building bit. Time to
abstract it, and fix callers...

17 years agoaccesslib: Fix dup enrolment entries in get_user_access_bycontext() and get_user_acce...
martinlanghoff [Wed, 19 Sep 2007 07:07:59 +0000 (07:07 +0000)]
accesslib: Fix dup enrolment entries in get_user_access_bycontext() and get_user_access_sitewide()

Avoid duplicate entries in the ra array. Now it works too!

17 years agoaccesslib: get_context_users_bycap() draft for course participants...
martinlanghoff [Wed, 19 Sep 2007 07:07:45 +0000 (07:07 +0000)]
accesslib: get_context_users_bycap() draft for course participants...

Introducing get_context_users_bycap() which gets the data in
2 DB queries, takes around 10ms on my laptop, and returns
the records with a nice context property attached.

Note Note Note: right now, some user recs do not have a context
associated, so are _not_ returned. So this awaits Matt's fix
to contexts maintenance to be 100% accurate...

17 years agoget_my_courses() - bugfix in sitewide-login-as support.
martinlanghoff [Wed, 19 Sep 2007 07:07:34 +0000 (07:07 +0000)]
get_my_courses() - bugfix in sitewide-login-as support.

Oops. The supportfor login-as was buggy now with sitewide
loginas. Now works in both.

17 years agoget_my_courses(): Support course-level login as
martinlanghoff [Wed, 19 Sep 2007 07:07:21 +0000 (07:07 +0000)]
get_my_courses(): Support course-level login as

A walkthrough of course-login-as functionality shows that is
Just Works, except that get_my_courses() was showing all the
courses. So we fix it.

And cleanup load_all_capabilities() - things just work
transparently.

17 years agoaccesslib: remove some functions we do not need anymore
martinlanghoff [Wed, 19 Sep 2007 07:07:08 +0000 (07:07 +0000)]
accesslib: remove some functions we do not need anymore

This is *the* scary commit. No more scaffolding, no more
training wheels. Remove the legacy has_capabilty_old() and
several supporting functions.

   has_capability_old()
   capability_search()
   is_parent_context()
   roles_context_cmp()
   load_user_capability()
   capability_prohibits()

I've grepped far and wide. Noone else uses the supporting
functions anywhere in-the-known-universe. If I could not
find it, it does not exist.

[Thankful that cvs/git/whatever will hold on to them
 if I end up having to regret this.]

17 years agoaccesslib: Intro global $ACCESS and load_user_accessdata()
martinlanghoff [Wed, 19 Sep 2007 07:06:55 +0000 (07:06 +0000)]
accesslib: Intro global $ACCESS and load_user_accessdata()

This patch introduces a new global $ACCESS that will cache
accessdata (our ra/rdef array) for users that are _not_ the
logged in user.

Most of the time it will be empty (luckily).

Each new user we have to get "in" costs us 3 or 4 cheap
dbqueries at the moment, so it is not that bad.

has_capability() now calls load_user_accessdata() if the
call is for a non-logged-user. So $ACCESS is autopopulated
transparently.

This also means that has_capability no longer calls
has_capability_old(). Yay!

With this patch, user/view.php for looking at a user in a course...

  Before: 62 dbqueries, 10.3MB, 0.7s
  After:  49 dbqueries,  8.5MB, 0.3s

17 years agocourse/view: roleswitch checks moved to the course page
martinlanghoff [Wed, 19 Sep 2007 07:06:44 +0000 (07:06 +0000)]
course/view: roleswitch checks moved to the course page

Implemented all the relevant checks for role_switch().

accesslib's role_switch() doesn't do any UI-related checks any more,
being a backend lib call. These belong here.

17 years agoaccesslib: add support for multi-enrolments
martinlanghoff [Wed, 19 Sep 2007 07:06:30 +0000 (07:06 +0000)]
accesslib: add support for multi-enrolments

I had dropped support for multi-enrolments on the same context.

 Oops!

This patch reinstates it, changing the semantics of the 'ra'
array leaves from an int to an array of ints.

So no instead of

   $USER->access['ra']['/1/12/543'] = 5

we have

   $USER->access['ra']['/1/12/543'] = array(5)

the functions that build the array, and the array walkers have
been updated. This touches...

  Writing RAs
    load_all_capabilities()
    get_user_access_sitewide()
    get_user_access_bycontext()

  Reading RAs
    has_cap_fromsess()
    aggr_roles_fromsess()

Thanks to Matt Clarkson for mentioning multi-enrolments!

17 years agoweblib: switchroles_form() user_login_string() handle the new switchroles
martinlanghoff [Wed, 19 Sep 2007 07:06:17 +0000 (07:06 +0000)]
weblib: switchroles_form() user_login_string() handle the new switchroles

The switched role data bits have moved to a
different place in the session. Trivial to fix here.

17 years agoaccesslib: role_switch() supports unswitching by passing $roleid=0
martinlanghoff [Wed, 19 Sep 2007 07:06:03 +0000 (07:06 +0000)]
accesslib: role_switch() supports unswitching by passing $roleid=0

It is a good idea, silly of me to remove it...

17 years agoaccesslib: has_cap_from_sess() now supports role switching
martinlanghoff [Wed, 19 Sep 2007 07:05:48 +0000 (07:05 +0000)]
accesslib: has_cap_from_sess() now supports role switching

With this commit we now have very fast support for
roleswitching, based on $sess[rsw] entries.

And a bit of phpdoc. This is function, and the
datastructure it walks, is the heart of of it.

17 years agoaccesslib - role_switch() revamp, introduce get_role_access_bycontext()
martinlanghoff [Wed, 19 Sep 2007 07:05:32 +0000 (07:05 +0000)]
accesslib - role_switch() revamp, introduce get_role_access_bycontext()

First stage of role_switch() rewrite - role_switch() sets up
a rsw entry in $USER->access, and makes sure we have the
appropriate role definitions in rdef.

That is where get_role_access_bycontext() comes into play -
gets all the rdef entries in one cheap sql query.

... though there may be many of them...

TODO:

 - fix callers of role_switch()
 - teach has_cap_fromsess() to read the rsw entries

17 years agoaccesslib: Draft get_context_users_byrole()
martinlanghoff [Wed, 19 Sep 2007 07:05:21 +0000 (07:05 +0000)]
accesslib: Draft get_context_users_byrole()

 Draft - use for the course participants list page

 Uses 1 DB query (cheap too - 2~7ms).

 TODO:
 - implement additional where clauses
 - sorting
 - get course participants list to use it!

 returns a users array, both sorted _and_ keyed
 on id (as get_my_courses() does)

 as a bonus, every user record comes with its own
 personal context, as our callers need it straight away
 {save 1 dbquery per user! yay!}

17 years agoget_my_courses() and get_user_courses_bycap() field handling and caching
martinlanghoff [Wed, 19 Sep 2007 07:04:59 +0000 (07:04 +0000)]
get_my_courses() and get_user_courses_bycap() field handling and caching

- Field handling moves back to get_my_courses() and now we have
  almost all the fields that the old get_my_courses() did
  (except for summary, which is *huge*) so get_my_courses() asks
  for a lot of fields, but the get_user_courses_bycap() defaults
  are _much_ leaner now.

  I think this makes sense ;-)

- get_my_courses() now caches the course ids for the currently logged in
  user in $USER->mycourses -- as a _string_. This is magnitudes more efficient
  than having it as an array.

The cache makes a difference, but it's not very visible on
normal pageloads (with my courses block, for example).

However, over 100 iterations, for a user with 50 enrolments in a site
with 6K courses, we go from 4.3s to 0.6s. And the DB queries are *cheap*.

            $tt = microtime(true);
            for($n=0;$n<100;$n++) {
                get_my_courses($USER->id, 'sortorder ASC');
            }
            error_log("took " .  (microtime(true) - $tt));

17 years agoaccesslib: get_user_courses_bycap() - make $doanything work in the optimised path
martinlanghoff [Wed, 19 Sep 2007 07:04:37 +0000 (07:04 +0000)]
accesslib: get_user_courses_bycap() - make $doanything work in the optimised path

OMG! Bugfix!

17 years agoaccesslib: get_user_courses_bycap() is less of a piggy now...
martinlanghoff [Wed, 19 Sep 2007 07:04:23 +0000 (07:04 +0000)]
accesslib: get_user_courses_bycap() is less of a piggy now...

get_user_courses_bycap() replaces get_courses_bycap_fromsess().

Using a combination of in-DB enrolments and in-session capability
checks, we narrow down the courses we fetch from the DB for checking.

This patch adds a small DB query, and has has a moderate impact on
the timings observable on my laptop (~300ms?), but reduces
*significantly* the bandwidth used, which in cluster environments
with frontends separate from backends has a serious impact.

17 years agodatalib: get_my_courses() - some fixes to the data we return
martinlanghoff [Wed, 19 Sep 2007 07:04:10 +0000 (07:04 +0000)]
datalib: get_my_courses() - some fixes to the data we return

strangely, get_my_courses() is expected to return the
array keyed on id, which messes up the sorting

So let's do it ;-)

17 years agoaccesslib: get_my_courses() rework, new get_courses_bycap_fromsess()
martinlanghoff [Wed, 19 Sep 2007 07:03:49 +0000 (07:03 +0000)]
accesslib: get_my_courses() rework, new get_courses_bycap_fromsess()

get_my_courses() goes from a bazillion queries (500 in some sample
cases) to 1 for the logged-in user, and 4 for a non-logged-in user.

One of those queries brings a *lot* of data across (all rows from
mdl_course) so there is room for serious optimisation.

  However, this clocks at ~300 ms on my laptop, costly, but not
  the end of the world. If your PHP-DB link has bandwidth probs
  it might be a problem.

A few important changes to get_my_courses()

 - (Compat ALERT!) the default fields are less than before --
   (will be followed by patches that fix the callers!) our defaults
   had grown to quite a bit because of the crazy caching scheme it had

 - the $fields parameter is to name _additional_ fields you need, and
   ideally wants them passed as an array. Will cope with old-style
   strings too.

 - the returned courses have an extra property "context" that is
   a fully valid context object, so if the caller needs to perform
   further accesslib checks, we save a query per course down the road

The work is done in the newfangled get_courses_bycap_fromsess()
which is brute-force but fast. I'm sure we can optimise the common
cases a lot in it if we try. It'd be worthwhile to

  - reduce the rows we grab - that's really boneheaded

  - if we copy and tweak the logic of has_cap_fromsess() in it
    it can be made even faster

17 years agoaccesslib: has_capability() - useful debugging bit...
martinlanghoff [Wed, 19 Sep 2007 07:03:34 +0000 (07:03 +0000)]
accesslib: has_capability() - useful debugging bit...

17 years agoaccesslib: get_user_access_bycontext() fetches overrides in subcontexts, intro aggr_r...
martinlanghoff [Wed, 19 Sep 2007 07:03:19 +0000 (07:03 +0000)]
accesslib: get_user_access_bycontext() fetches overrides in subcontexts, intro aggr_roles_fromsess()

The main thing here is that overrides in subcontexts are
now read correctly (and still cheaply) into the access array.

Also

 - introducing aggr_roles_fromsess() with gives you a list of
   the relevant roles that affect the user in this context

 - we clear out $USER->access on login/logout

 - get_user_access_bycontext() gets a few optimisations too...

17 years agoaccesslib: default, guest and notloggedin roles work properly now
martinlanghoff [Wed, 19 Sep 2007 07:02:57 +0000 (07:02 +0000)]
accesslib: default, guest and notloggedin roles work properly now

Changes around load_user_capability() and has_capability() to make
the default role fallbacks and guest/nonloggedin roles work.

This commit also introduces the concept of having a magic
context next to the root context in $USER->access[ra], as

 $USER->access[ra][/1] = 1 (admin roleid)
 $USER->access[ra][/1:def] = 7 (loggedinuser roleid)

and has_cap_fromsess() now checks for that magic context
as well.

17 years agoaccesslib: has_capability() now works for the logged in user
martinlanghoff [Wed, 19 Sep 2007 07:02:44 +0000 (07:02 +0000)]
accesslib: has_capability() now works for the logged in user

With this commit, the new has_capability works for the logged
in user correctly.

 - load_all_capabilities() no longer calls load_user_capability()!
   6K dbqueries less on login... ;-)

 - When delving into a context we haven't loaded yet, we call
   get_user_access_bycontext()

 - Introduce: get_user_access_bycontext()

 - Several fixes in get_user_access_sitewide()
   (renamed from get_user_sitewide_access())

 - Fixes in has_cap_fromsess()

 - Introduce access_insess() to check if we have to call
   get_user_access_bycontext() for the context

17 years agoaccesslib: initial has_capability() rewrite
martinlanghoff [Wed, 19 Sep 2007 07:02:31 +0000 (07:02 +0000)]
accesslib: initial has_capability() rewrite

 - has_capability() renamed has_capability_old() and we fallback
   when we cannot answer the question

 - has_capability() works great for the course-and-above contexts
   for the logged in user - does not touch the DB

 - works based on $USER->access which has a pretty compact view
   of the user's access rights...

TODO:

 - deal with contexts below the course - here we need to
   trigger the role-assignment and role-defs load when needed

 - deal with "other" contexts that hang from the system context

 - deal with global roleswitch, local roleswitch

17 years agolib/setup: declare SYSCONTEXTID to have the system context handy
martinlanghoff [Wed, 19 Sep 2007 07:02:18 +0000 (07:02 +0000)]
lib/setup: declare SYSCONTEXTID to have the system context handy

17 years agoaccesslib: Introducing get_user_sitewide_access($userid)
martinlanghoff [Wed, 19 Sep 2007 07:02:04 +0000 (07:02 +0000)]
accesslib: Introducing get_user_sitewide_access($userid)

This function carefully fetches all the data needed to
handle site/category/course access for a given user
as cheaply as possible.

It currently takes 3 db queries.

17 years agodatalib: Introducing sql_intarray_to_in()
martinlanghoff [Wed, 19 Sep 2007 07:01:53 +0000 (07:01 +0000)]
datalib: Introducing sql_intarray_to_in()

Trivial function to turn an array of ints into a string
usable in an IN sql clause.

17 years agouser_set_preference(): minor optimisation
martinlanghoff [Wed, 19 Sep 2007 07:01:41 +0000 (07:01 +0000)]
user_set_preference(): minor optimisation

Don't update if the values already match...

17 years agoaccesslib: Introducing build_context_path()
martinlanghoff [Wed, 19 Sep 2007 07:01:27 +0000 (07:01 +0000)]
accesslib: Introducing build_context_path()

which populates the context.path and context.depth fields

17 years agodatalib:add_to_log() - avoid schema lookups, pace updates to user and user_lastaccess
martinlanghoff [Wed, 19 Sep 2007 07:01:04 +0000 (07:01 +0000)]
datalib:add_to_log() - avoid schema lookups, pace updates to user and user_lastaccess

* All updates to user.lastaccess and user_lastaccess.timeaccess are paced to
60s of the last update on the same record -- this should reduce the heat
on those tables.

* Updates/inserts to user_lastaccess are down with raw SQL to avoid costly
schema lookups on every request.

17 years agopagelib: Course page - preload child contexts and smarter user_allowed_editing()
martinlanghoff [Wed, 19 Sep 2007 06:53:09 +0000 (06:53 +0000)]
pagelib: Course page - preload child contexts and smarter user_allowed_editing()

With this patch we preload the child contexts for the course
and hold on to them. This means that in one DB query we have all the contexts
we are going to need.

The checks for user_allowed_editing() move from weblib:update_icon() to
user_allowed_editing(), where we cache the result, and in the process save
50% of the cap checks by testing separately blocks from modules (doh!).

Still, the cap checks here are very inefficient...

With the last 3 patches, a course page with default blocks and 9 modinstances
goes from 157 to 86 db queries when logged in as a non-editing user (guest,
student). As admin it drops from 88 to 81.

Conflicts:

lib/pagelib.php

17 years agoweblib:update_course_icon() - remove access control from here
martinlanghoff [Wed, 19 Sep 2007 06:52:52 +0000 (06:52 +0000)]
weblib:update_course_icon() - remove access control from here

Access control for the course icon display should happen
at the page level, as we'll need to ask "can edit?" quite
a few times in the page.

The fact that this is weblib should be a good hint that
functions that print html should not be doing access control...

17 years agoaccesslib:get_child_contexts() reworked to use context.path
martinlanghoff [Wed, 19 Sep 2007 06:52:34 +0000 (06:52 +0000)]
accesslib:get_child_contexts() reworked to use context.path

Using context.path, now get_child_contexts...

 - always takes 1 query
 - populated the context_cache
 - returns full records
 - when called with an category, it won't
   recurse into the children of courses

Also

 - All callers in accesslib changed to the new
   calling convention

A normal course page with a std blocks and a few
activities sees around 100 queries less with this patch.

Note: this commit is slightly different on HEAD/19 and on
MOODLE_18_STABLE, as groups-related tables have changed.

17 years agoaccesslib: Introducing cleanup_contexts() and use it in cron
martinlanghoff [Wed, 19 Sep 2007 06:50:53 +0000 (06:50 +0000)]
accesslib: Introducing cleanup_contexts() and use it in cron

The newly minted cleanup_contexts() walks the context table
matching contexts with the tables they are referencing and
clearing any leftover contexts.

17 years agominor fix for count of users
toyomoyo [Wed, 19 Sep 2007 03:48:44 +0000 (03:48 +0000)]
minor fix for count of users

17 years agoMDL-11324, only display users with moodle:course/view capability when assinging in...
toyomoyo [Wed, 19 Sep 2007 03:31:22 +0000 (03:31 +0000)]
MDL-11324, only display users with moodle:course/view capability when assinging in module context or lower

17 years agoNow assignment_submissions->data1 & data2 are nullable. MDL-11268
stronk7 [Tue, 18 Sep 2007 22:20:13 +0000 (22:20 +0000)]
Now assignment_submissions->data1 & data2 are nullable. MDL-11268

17 years agoMinor improvements to messages window for wood.
stronk7 [Tue, 18 Sep 2007 18:57:59 +0000 (18:57 +0000)]
Minor improvements to messages window for wood.

17 years agoMDL-1883 info for 3rd party developers in DEBUG_DEVELOPER mode
skodak [Tue, 18 Sep 2007 18:50:14 +0000 (18:50 +0000)]
MDL-1883 info for 3rd party developers in DEBUG_DEVELOPER mode

17 years agoMDL-1883 improved perf when editing scales - new function xxx_scale_used_anywhere()
skodak [Tue, 18 Sep 2007 18:37:58 +0000 (18:37 +0000)]
MDL-1883 improved perf when editing scales - new function xxx_scale_used_anywhere()

17 years agoFix some HTML in messages (wrong <a> and roundcorners support)
stronk7 [Tue, 18 Sep 2007 18:24:52 +0000 (18:24 +0000)]
Fix some HTML in messages (wrong <a> and roundcorners support)

17 years agoenhancements for messages: remove header and footer with CSS. increase user top frame...
urs_hunkler [Tue, 18 Sep 2007 17:10:32 +0000 (17:10 +0000)]
enhancements for messages: remove header and footer with CSS. increase user top frame height via JavaScript to view the whole user image.

17 years agoMDL-11312 Added new grade_letters table, and new grade_items.display field.
nicolasconnault [Tue, 18 Sep 2007 14:26:15 +0000 (14:26 +0000)]
MDL-11312 Added new grade_letters table, and new grade_items.display field.

17 years agoTypo!
thepurpleblob [Tue, 18 Sep 2007 12:30:19 +0000 (12:30 +0000)]
Typo!

Merged from STABLE_18

17 years agoMDL-11317 - Slashes displayed in incorrect responses for short answer questions....
tjhunt [Tue, 18 Sep 2007 12:15:22 +0000 (12:15 +0000)]
MDL-11317 - Slashes displayed in incorrect responses for short answer questions. Fix by adding stripslashes in the appropriate place. Merged from MOODLE_18_STABLE.

17 years agomoved question_make_default_categories function to questionlib.php since it is needed...
jamiesensei [Tue, 18 Sep 2007 11:23:29 +0000 (11:23 +0000)]
moved question_make_default_categories function to questionlib.php since it is needed by other modules outside the question bank editing interface.

17 years agoMDL-11318 formslib now respects a template for an element if it is set. But since...
jamiesensei [Tue, 18 Sep 2007 09:35:44 +0000 (09:35 +0000)]
MDL-11318 formslib now respects a template for an element if it is set. But since formslib uses the templates to insert help buttons for setAdvanced functionality etc. if you use templates you will lose this functionality.

17 years agoThe "alias" role names were not being used in the role assign screens. Now they...
moodler [Tue, 18 Sep 2007 08:35:12 +0000 (08:35 +0000)]
The "alias" role names were not being used in the role assign screens.  Now they are.  MDL-11323

17 years agoadded a string for backup/restore
toyomoyo [Tue, 18 Sep 2007 07:14:37 +0000 (07:14 +0000)]
added a string for backup/restore

17 years agoMDL-11234, if role definitions matches, restore role mapping should be allowed with...
toyomoyo [Tue, 18 Sep 2007 07:00:57 +0000 (07:00 +0000)]
MDL-11234, if role definitions matches, restore role mapping should be allowed with or without role assign capabilities

17 years agoAutomatic installer.php lang files by installer_builder (20070918)
moodler [Tue, 18 Sep 2007 04:21:57 +0000 (04:21 +0000)]
Automatic installer.php lang files by installer_builder (20070918)

17 years agoadded needsupdate flag into backup/restore, added a new switch for restore on/off...
toyomoyo [Tue, 18 Sep 2007 04:03:02 +0000 (04:03 +0000)]
added needsupdate flag into backup/restore, added a new switch for restore on/off for grade histories, fixed some NULL related warnings

17 years agoiAdded a string for preview rows in exports
moodler [Tue, 18 Sep 2007 03:38:33 +0000 (03:38 +0000)]
iAdded a string for preview rows in exports

17 years agoCleaned up the display of the export pages
moodler [Tue, 18 Sep 2007 03:36:47 +0000 (03:36 +0000)]
Cleaned up the display of the export pages

17 years agoSome layout for the grades export download link / buttons
moodler [Tue, 18 Sep 2007 03:24:28 +0000 (03:24 +0000)]
Some layout for the grades export download link / buttons

17 years agoAdding Id to file
stronk7 [Mon, 17 Sep 2007 22:10:22 +0000 (22:10 +0000)]
Adding Id to file

17 years agoAdded data_decode_content_links_caller() and data_decode_content_links()
stronk7 [Mon, 17 Sep 2007 21:58:55 +0000 (21:58 +0000)]
Added data_decode_content_links_caller() and data_decode_content_links()
to provide interlinking capabilities to restore. MDL-9576

17 years agoMDL-11299 - Make objectClass string comparison case insensitive.
iarenaza [Mon, 17 Sep 2007 21:30:20 +0000 (21:30 +0000)]
MDL-11299 - Make objectClass string comparison case insensitive.

LDAP serves accept attribute names in a case insensitive way, so don't
force the users to use any particular spelling.

17 years agoAdding data_encode_content_links() to backup, so data module
stronk7 [Mon, 17 Sep 2007 17:59:54 +0000 (17:59 +0000)]
Adding data_encode_content_links() to backup, so data module
links are encoded to be transported in backup files. Part of MDL-11268.

17 years agomismatched code version in file.
diml [Mon, 17 Sep 2007 17:45:29 +0000 (17:45 +0000)]
mismatched code version in file.

17 years agoMDL-11282 Just displaying a simple notice, and continuing with the regrading.
nicolasconnault [Mon, 17 Sep 2007 17:39:35 +0000 (17:39 +0000)]
MDL-11282 Just displaying a simple notice, and continuing with the regrading.

17 years agoMDL-11275
nicolasconnault [Mon, 17 Sep 2007 17:32:20 +0000 (17:32 +0000)]
MDL-11275

17 years agoMDL-11275 added (submissions). Also fixed :
nicolasconnault [Mon, 17 Sep 2007 17:31:48 +0000 (17:31 +0000)]
MDL-11275 added (submissions). Also fixed :
Issue:
    Teachers can edit grader report preferences (including switches for quickgrading and
    quickfeedback), but do not have access to the "Turn editing on/off" button, so they
    can't do quickgrading.
Solutions:
    1.Decouple the quickgrading and quickfeedback modes from the editing mode,
        and turn them on/off through the preferences page. New capability: moodle/grade:edit
        * preferences: don't show quickgrading if no capability grade:edit
        * If quickgrading is switched off as a preference and user doesn't have manage cap, show edit icons around grades when in editing mode

17 years agoMDL-11267 - Anywone who can view quiz reports can delete student attempts. Merged...
tjhunt [Mon, 17 Sep 2007 16:17:24 +0000 (16:17 +0000)]
MDL-11267 - Anywone who can view quiz reports can delete student attempts. Merged from MOODLE_18_STABLE.

17 years agoFixing a string I thought I fixed before ...
moodler [Mon, 17 Sep 2007 15:32:24 +0000 (15:32 +0000)]
Fixing a string I thought I fixed before ...

17 years agoMDL-11310 - Multichoice edititing form should have space for 5 answers by default...
tjhunt [Mon, 17 Sep 2007 14:39:52 +0000 (14:39 +0000)]
MDL-11310 - Multichoice edititing form should have space for 5 answers by default. Merged from MOODLE_18_STABLE.

17 years agoMDL-11104
thepurpleblob [Mon, 17 Sep 2007 12:37:51 +0000 (12:37 +0000)]
MDL-11104
Markdown updated to latest version.

17 years agoMDL-11104:
thepurpleblob [Mon, 17 Sep 2007 12:30:22 +0000 (12:30 +0000)]
MDL-11104:
Added some extra information for markdown-extra features.

Merged from STABLE_18

17 years agoForgot to take out duplicate question count check.
thepurpleblob [Mon, 17 Sep 2007 11:01:53 +0000 (11:01 +0000)]
Forgot to take out duplicate question count check.

Merged from STABLE_18

17 years agoMDL-11279:
thepurpleblob [Mon, 17 Sep 2007 10:57:49 +0000 (10:57 +0000)]
MDL-11279:
Code was not properly checking for empty category.
Check moved to right place and proper print_error() function called as appropriate

Merged from STABLE_18

17 years agoMDL-11084, "s in grade comments causes problems
toyomoyo [Mon, 17 Sep 2007 06:53:24 +0000 (06:53 +0000)]
MDL-11084, "s in grade comments causes problems

17 years agoFIxed wierd blue line in forum posts
moodler [Mon, 17 Sep 2007 05:39:20 +0000 (05:39 +0000)]
FIxed wierd blue line in forum posts

17 years agoAutomatic installer.php lang files by installer_builder (20070917)
moodler [Mon, 17 Sep 2007 04:54:36 +0000 (04:54 +0000)]
Automatic installer.php lang files by installer_builder (20070917)

17 years agoMDL-11276, average calculations are inaccurate in percentage form due to double rounding
toyomoyo [Mon, 17 Sep 2007 04:25:51 +0000 (04:25 +0000)]
MDL-11276, average calculations are inaccurate in percentage form due to double rounding

17 years agoFixed popup window call (eg from email)
moodler [Mon, 17 Sep 2007 04:25:38 +0000 (04:25 +0000)]
Fixed popup window call (eg from email)

17 years agoremoving extra number_format(), format_float() already calls number_format()
toyomoyo [Mon, 17 Sep 2007 02:15:51 +0000 (02:15 +0000)]
removing extra number_format(), format_float() already calls number_format()

17 years agoMDL-10820 Fixed double quotes in SQL statements
skodak [Sun, 16 Sep 2007 21:48:47 +0000 (21:48 +0000)]
MDL-10820 Fixed double quotes in SQL statements

17 years agoMDL-11230 fixing wrong include for tags library - always use require_once() instead...
skodak [Sun, 16 Sep 2007 21:43:08 +0000 (21:43 +0000)]
MDL-11230 fixing wrong include for tags library - always use require_once() instead of include() when dealing with library files!

17 years agoMDL-11046 multiple tag/edit.php issues - see bug report
skodak [Sun, 16 Sep 2007 21:37:28 +0000 (21:37 +0000)]
MDL-11046 multiple tag/edit.php issues - see bug report

17 years agoMDL-11301 tag autocomplete on edit page works again
skodak [Sun, 16 Sep 2007 21:24:13 +0000 (21:24 +0000)]
MDL-11301 tag autocomplete on edit page works again

17 years agoDelete one unused table when grading online assignment submissions.
stronk7 [Sun, 16 Sep 2007 21:06:56 +0000 (21:06 +0000)]
Delete one unused table when grading online assignment submissions.