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.
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.
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.
MDL-11317 - Slashes displayed in incorrect responses for short answer questions. Fix by adding stripslashes in the appropriate place. Merged from MOODLE_18_STABLE.
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.
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
MDL-11300
1/ potential sql injection through tag types - missing param type + can add new types + usually no addslashes before update of tags
2/ paging does not work at all
3/ missing param type definitions
4/ not xhtml strict compliant
5/ CSRF - missing sesskey checks
6/ UI code in tag/lib.php - should be in manage.php or other file
7/ missing localization of types - default/standard
Show the roll dates option only if the backup course has a start date
(some formats like main page, social..., haven't it and rolling dates
from 0 produces crazy dates. MDL-10125
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
applying the same patch to advcheckbox - Fixes MDL-8627, "HTML QuickForm displays (some?) disabled elements in a non-accessible way", overrides parent::getFrozenHtml.
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.
MDL-11271 - The closing bracket "}" can't be used in cloze question type. Now, you can excape a closing } with a backslash. Do feedback, as well as answer. Merged from MOODLE_18_STABLE.
MDL-11271 - The closing bracket "}" can't be used in cloze question type. Now, you can excape a closing } with a backslash. Merged from MOODLE_18_STABLE.
Issue:
The number of submissions in the Group average and Course average calculations
should be shown in brackets. (submissions) should be added after the Group average
and Course average labels.
Solution:
new grader report preference (Display number of grades in average cells).
MDL-11081 and MDL-11211 - Implement quiz_question_list_instances. The lach of this function was causing a horrible dataloss bug: MDL-11211. Fix thanks to Janne Mikkonen, refined by me. Merged from MOODLE_16_STABLE.
Issue:
Only students should appear in the tutor report, however
sorting by Surname results in the tutor being included, which we don't want.
Solution:
Confirmed as a bug and filed in tracker: http://tracker.moodle.org/browse/MDL-11233
Issue:
Clicking on Hide Groups reveals the results for all students
and all tutors and course staff appear. A tutor should only be able to see
the results for their tutor group
Solution:
Prevent tutors from ever seeing student grades from other groups: use existing capabilities
moodle/site:accessallgroups = off AND moodle/grade:viewall = on
Issue:
Preferences tab should not be available to users without gradereport/grader:manage capability
Solution:
Hide the tab completely
Issue:
Apply different style to average cells
Solution:
Add css classes to the different average cells, and write a default style in css file.
Issue:
The Average under group average might be better labelled Course average.
Solution:
Rename to "Complete average"
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
MDL-11238 Removed reference to $grade_grade->feedback and replaced with grade_grade_text->feedback. Also instantiated the $grade_grade object properly instead of just get_record(), so that its set_hidden() method could be accessible.