5285 Commits

Author SHA1 Message Date
martinlanghoff
1f3c9d097f accesslib: Introducing build_context_path()
which populates the context.path and context.depth fields
2007-09-19 07:01:27 +00:00
martinlanghoff
a9fcd13a77 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.
2007-09-19 07:01:04 +00:00
martinlanghoff
e1e1f49820 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
2007-09-19 06:53:09 +00:00
martinlanghoff
0532aec946 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...
2007-09-19 06:52:52 +00:00
martinlanghoff
19bb8a0517 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.
2007-09-19 06:52:34 +00:00
martinlanghoff
17b0efae11 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.
2007-09-19 06:50:53 +00:00
skodak
06ea7db0c3 MDL-1883 info for 3rd party developers in DEBUG_DEVELOPER mode 2007-09-18 18:50:14 +00:00
skodak
85c9ebb926 MDL-1883 improved perf when editing scales - new function xxx_scale_used_anywhere() 2007-09-18 18:37:58 +00:00
nicolasconnault
e480c18cf1 MDL-11312 Added new grade_letters table, and new grade_items.display field. 2007-09-18 14:26:15 +00:00
jamiesensei
8f0f605ddf moved question_make_default_categories function to questionlib.php since it is needed by other modules outside the question bank editing interface. 2007-09-18 11:23:29 +00:00
jamiesensei
41b6d0011c 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. 2007-09-18 09:35:44 +00:00
nicolasconnault
678e8898aa MDL-11282 Just displaying a simple notice, and continuing with the regrading. 2007-09-17 17:39:35 +00:00
nicolasconnault
a5b8be622c 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
2007-09-17 17:31:48 +00:00
thepurpleblob
450802d3bd MDL-11104
Markdown updated to latest version.
2007-09-17 12:37:51 +00:00
skodak
fce1ff5aa1 MDL-11297 adding new PARAM_TAG - numeric tags not allowed 2007-09-16 19:31:56 +00:00
skodak
8e1ec6be58 MDL-11298 use textlib_get_instance() instead of new textlib() 2007-09-16 18:49:41 +00:00
skodak
4eb718d801 MDL-11048 + MDL-11297 improved tag normalisation, more security 2007-09-16 18:41:57 +00:00
skodak
bcef031984 MDL-11297 adding new PARAM_TAG and PARAM_TAGLIST that are needed for blog and interest tags 2007-09-16 14:20:32 +00:00
skodak
e8515774c3 MDL-11048 adding new method to textlib strtotitle() - please note that is may not be usable in all locales, it might also produce different results when mbstring available 2007-09-16 11:45:30 +00:00
skodak
43c137ac23 applying the same patch to advcheckbox - Fixes MDL-8627, "HTML QuickForm displays (some?) disabled elements in a non-accessible way", overrides parent::getFrozenHtml. 2007-09-15 19:43:01 +00:00
skodak
e193724e38 MDL-11295 editorshortcutshelpbutton breaking xhtml strict 2007-09-15 19:36:31 +00:00
skodak
6b5c722df5 MDL-9542 new function needed for showing of final grades in Quiz + minor changes in grading public API used by modules 2007-09-15 19:24:10 +00:00
nicolasconnault
b159da787a MDL-11282 Using notice_yesno(), but not sure how to provide a backlink with the cancel action... 2007-09-14 19:32:50 +00:00
nicolasconnault
e171963b3e MDL-11278 Implementation is complete, but grade_categories records in DB are not affected by global settings. This way, when global settings are switched back to "Do not Force", the original category settings will be in place. 2007-09-14 17:21:30 +00:00
nicolasconnault
cd9e4ec472 MDL-11278 Admin settings page completed, implementation of settings in the gradebook coming up next. 2007-09-14 10:40:49 +00:00
nicolasconnault
53461661ae MDL-11278 Admin settings page completed, implementation of settings in the gradebook coming up next. 2007-09-14 08:54:46 +00:00
nicolasconnault
c421ad4b2e MDL-11233 Corrected typo in grader report lib, and added a second sort parameter for lastname and firstname sorts, to add consistency to result sets. Non-students no longer appear in the list 2007-09-13 13:44:35 +00:00
moodler
43ee1454df Added Zoomspider as allowed to enter when opentogoogle is open 2007-09-13 08:59:31 +00:00
moodler
e7aa5a8800 Patch as suggested by Eloy in MDL-11237 to work around a nasty PHP bug in PHP 5.20 2007-09-13 06:42:49 +00:00
nfreear
a98a90163e Fixes MDL-8627, "HTML QuickForm displays (some?) disabled elements in a non-accessible way", overrides parent::getFrozenHtml. 2007-09-12 11:17:35 +00:00
sam_marshall
d75c6556c7 MDL-11224 Updated UFO Flash JS library from 3.20 to 3.22, preserving minor Moodle-specific change (and added comment to top about it!) 2007-09-12 10:14:12 +00:00
donal72
c824d47823 Uninitialized variable 2007-09-12 03:25:43 +00:00
martinlanghoff
cf1348caae PERF logging - move handling to moodle_request_shutdown()
By moving the performance profile logging to the very
end of PHP processing, we cover more pages, notably those
that don't end up with a footer or a redirect, like file
serving.

This should improve quality of our performance logs, and
help catch some piggies...
2007-09-12 02:57:26 +00:00
martinlanghoff
3446daa3da redirect() - log performance profiling info
Many heavy pages end in a redirect. Log their profiling data!

Thanks to Matt Clarkson for spotting the problem.
2007-09-12 02:57:08 +00:00
martinlanghoff
d863419245 course/index: move orphan fixups to an optimised fix_coursecategory_orphans()
Move the fixups for orphan courses to the newly minted
fix_coursecategory_orphans() -- and optimise it to take only 1 dbquery for
the common case.

If we do find lots of orphans, we issue 2 updates per orphan.

This cuts down dbqueries drastically - we used to have 2x the number of
courses in the site.
2007-09-12 02:56:36 +00:00
martinlanghoff
f8ea60777c fix_course_sortorder(): fix breakage with large categories, saner error
Two improvements for fix_course_sortorder()

 - If the category has more courses than the shift range
   use a larger shift range to avoid overlapping with itself

 - If things do go wrong during the per-course sortorder updates,
   rollback and try and call ourselves with a 'safe' flag.

Still - far from perfect. Probably the global sortorder approach
is broken. The sanest way is to rework things to always join against
course_categories and order by the combined sortorders.
2007-09-12 02:56:16 +00:00
stronk7
dc6cc11a72 Annihilate one wrong use of getNameForObject() now
that we are able to detect REAL check constraints names
2007-09-11 19:39:28 +00:00
stronk7
da40b0beab And now, the unused getStandardNameForObject() is out. Back to the
exclusive getNameForObject() function, ONLY USED TO CREATE NEW
OBJECTS, NEVER TO GUESS THE NAME OF EXISTING ONES. MDL-9356
2007-09-11 19:37:13 +00:00
stronk7
3d74e77aae Now we aren't guessing check constraint names
but getting the real ones under Oracle. MDL-9356
2007-09-11 19:08:11 +00:00
stronk7
92529a70fa Now we aren't guessing check constraint names
but getting the real ones under MSSQL. MDL-9356
2007-09-11 19:07:17 +00:00
stronk7
f0dfc20124 Now we aren't guessing check constraint names
but getting the real ones under PostgreSQL. MDL-9356
2007-09-11 19:06:38 +00:00
stronk7
f090314f46 General cleanup of debugging messages.
Now change_field_enum() introspects DB and detects
if the enum existed or no, as needed. MDL-9356
2007-09-11 18:33:23 +00:00
stronk7
af1192b159 Now both check_constraint_exists() and find_check_constraint_name()
are working under mysql, postgresql and mssql. 1st step of MDL-9356
2007-09-10 22:42:04 +00:00
stronk7
faa1a939f0 Now Oracle is also able to detect its check constraints per field. 2007-09-10 22:30:26 +00:00
stronk7
7abc6e09c0 Adding two new functions to search for check constraints from ddl stuff.
Unused and unfinished for now. I need them in CVS.
2007-09-10 22:22:23 +00:00
stronk7
a347e5e439 Preparing getCheckConstraintsFromDB() to retrieve the check constraint
defined for one field. Not used yet but I need it in CVS now.
2007-09-10 22:00:24 +00:00
stronk7
15999a9351 Allow the upgrade_plugins() function to autodetect if the header
has been printed, so it runs in "embedded" mode. Useful to run
submodule installation/upgrade in the same page than the parent. MDL-11183
2007-09-10 17:13:12 +00:00
stronk7
4215e41ecb Extending getCheckConstraintsFromDB() to support a new parameter
used to filter what field in the table we want to know
its check constraints
2007-09-09 16:28:16 +00:00
stronk7
4cc68ea184 Now mysql returns getCheckConstraintsFromDB() in a compatible
way (array of name & description objects) with the check
constraints found in the table
2007-09-09 16:09:00 +00:00
skodak
ffc536af8e MDL-7380 converted various places to use new groups API 2007-09-08 20:53:05 +00:00