68 Commits

Author SHA1 Message Date
Ferran Recio
15db7d9d98 MDL-80190 core_courseformat: fix activity creation on delegated sections
The method for checking if the user can create an activity executed
create_if_missing wihtout checking the section exists or not. This is
a problem for delegated sections because create_if_missing will create a
regular section and push down all delegate ones. With the patch the
method first checks if the section exists.
2024-02-07 12:06:03 +01:00
Amaia Anabitarte
85d07564cb MDL-78527 core_completion: Improving core completion styling 2023-09-12 15:43:48 +02:00
Sara Arjona
274db7f747
MDL-78528 completion: Add suffix support to avoid duplicated ids 2023-08-09 09:12:43 +02:00
Jun Pataleta
52d8364819 Merge branch 'MDL-76257-master' of https://github.com/juancs/moodle 2023-03-17 13:10:13 +01:00
Daniel Ziegenberg
3018036ebd
MDL-67526 plagiarism: Final deprecation of plagiarism functions
Following MDL-65835 this now finally deprecates and removes the
functions:
  - plagiarism_save_form_elements(), please use
    {plugin name}_coursemodule_edit_post_actions() instead
  - plagiarism_get_form_elements_module(), please use
    {plugin name}_coursemodule_standard_elements() instead.
  - plagiarism_plugin::get_form_elements_module(), please
    use {plugin name}_coursemodule_edit_post_actions() instead.
  - plagiarism_plugin::save_form_elements(), please use
    {plugin name}_coursemodule_standard_elements() instead.

Signed-off-by: Daniel Ziegenberg <daniel@ziegenberg.at>
2023-03-14 17:04:20 +01:00
Juan Segarra Montesinos
d7055c80e2 MDL-76257 core: Activity intro should honor user preference on creation 2023-03-14 06:02:39 +01:00
sam marshall
fbd61d1268 MDL-75878 Course: Adding graded activity too slow when lots of grades
Adding an activity with a grade item previously triggered a course
regrade, which can be extremely slow. This change makes it so that on
courses where regrading is slow, when you add an activity that
requires regrading, it takes you to an intermediate screen with a
progress bar.

This change also fixes a bug in the existing grade overview report,
which shows grades across multiple courses, but previously only
checked, and if necessary regraded, one course.
2023-01-03 16:04:58 +00:00
Stefan Hanauska
6378a41995 MDL-75594 course: Add beforemod parameter 2022-12-12 14:39:53 +01:00
Tim Hunt
8babdbd396 MDL-74608 activities: a new option to force the activity language
For a long time, Moodle has had the feature to force the language
for a whole course. This change adds the same feature at activity
level.

The course-level feature was controlled by a capability
moodle/course:setforcedlanguage, and I decided to use the same
capability to control this feature. I think a new capability would be
overkill.
2022-08-15 22:15:52 +01:00
Sujith Haridasan
73d604369d MDL-71062 core: Step 1 deprecation of print_error function 2022-07-13 08:20:54 +05:30
hieuvu
5cfaa18cad MDL-74533 core_completion: Update using new grade pass for completion 2022-05-23 15:14:12 +07:00
Dongsheng Cai
f97b86e841 MDL-72991 Course: Partial course cache rebuild
When updating/deleting a section/module, the system now only
invalidate of the element (section/module), not the whole course cache
Also, the system now only recalculate the cache for element (section/module)
if necessary, not the whole course cache

Move module/section purging to course_modinfo:
  + course_modinfo::purge_course_section_cache_by_id was created to purge section by id
  + course_modinfo::purge_course_section_cache_by_number was created to purge section by number
  + course_modinfo::purge_course_module_cache was created to purge module
2022-03-17 15:34:01 +07:00
Simey Lameze
89e59a60ef MDL-69561 mod: handle content download on course modules 2021-11-11 18:38:53 +08:00
Shamim Rezaie
46d744c34a Merge branch 'MDL-70083-master' of git://github.com/jleyva/moodle 2021-11-05 14:37:44 +11:00
Juan Leyva
6f0f979ae3 MDL-70083 message: Updated content notification task 2021-11-04 12:23:21 +01:00
Ilya Tregubov
ac93013cd1 MDL-72995 core_course: Revert "MDL-55231: Partial course cache rebuild"
This reverts commits c1468388bcecec43e671335db8edfc839494e710,
c1468388bcecec43e671335db8edfc839494e710 and
9a900492bc14176c4f56b8e600ef459069a3ec7a.
2021-11-04 11:57:58 +02:00
Dongsheng Cai
9a900492bc MDL-55231 core_course: Partial course cache rebuild 2021-10-26 19:08:15 +11:00
Peter
90acd8d381 MDL-52206 core: Add completion criteria to course_modules 2021-10-04 19:44:02 +08:00
Jun Pataleta
6a6cdf14ca MDL-71178 completion: Rebuild course cache before completion reset
Before resetting completion states during module update, we need to
rebuild the course cache first in order to properly reset the completion
states. Otherwise, calls to methods that fetch course module info
via cache (e.g. cm_info::create()) will fetch outdated information.
2021-04-01 00:46:34 +08:00
Jun Pataleta
3728866a5f MDL-52578 core_course: Peer review fixes
* Fetch parent category only when necessary.
* Fix outdated variable names in original patch.
* Fix variable scope for $outcomeexists.
2020-05-20 10:29:46 +08:00
Steve Bader
604fb8c2a2 MDL-52578 core_course: Activity weight set to 0 on creation 2020-05-20 01:28:59 +08:00
Adrian Greeve
d0d65b498c MDL-65835 plagiarism: Initial deprecation of old functions.
This is the initial deprecation of:
* plagiarism_save_form_elements
* plagiarism_get_form_elements_module
* plagiarism_plugin::get_form_elements_module
* plagiarism_plugin::save_form_elements
2020-01-02 11:38:49 +08:00
Andrew Nicols
c3777543a6 MDL-67116 course: Restore removed line
This line was inadvertently removed in a previous commit.
2019-11-14 11:43:37 +08:00
Andrew Nicols
0a5a2ca89b MDL-67116 course: Strict empty string check required
In PHP the following are true:

    assert('' == '');
    assert(0 == '');
    assert(null == '');

The options in the course completion settings are now:

    ''    => none selected
    [int] => itemnumber of activity course completion item.

In the case where the itemnumber was 0  this was being incorrectly
evaluated as an empty string due to the implicit cast to int of the
empty string:

    (int) '' === 0

As a result, the non-strict comparison means that the following are
identical:

    assert(0 == '');
    assert(0 == (int) '');
    assert(0 == '0');

Changing the comparison to a strict comparison is correct because it
ensures the type consitency between the empty string value, and the int
of itemnumber 0. It is safe because the value always comes from the
form, where an int is always returned, and not the DB, where a string is
returned.
2019-11-14 08:59:56 +08:00
Andrew Nicols
c035141971 MDL-67116 course: Fix completion disabled for gradable items
The default value is an empty string (""), which in PHP evaluates to 0 when
cast to a string in our DML layer.

The fix is to forcibly make it null which is not cast to string in DML
for optional strings.
2019-11-13 12:49:59 +08:00
Andrew Nicols
fe795b59e4 MDL-67116 form: Require grade in multi-grade-item activities
AMOS BEGIN
  CPY [rating,rating],[grade_rating_name,rating]
AMOS END
2019-11-13 10:14:37 +08:00
Andrew Nicols
fcc88fddba MDL-66079 core_grades: Add support for multiple grade items in an activity
Part of MDL-66074
2019-10-30 10:23:40 +08:00
Peter Eliyahu Kornfeld
78ef2ac1e0 MDL-60459 core_course: set default for 'visibleoncoursepage' 2019-02-07 10:52:34 +08:00
Marina Glancy
07ec41bcf9 MDL-59655 course: visibleoncoursepage is not mandatory 2017-07-31 14:04:37 +08:00
Marina Glancy
7f53e8aa22 MDL-58267 completion: allow to set default activity completion
Part of MDL-58138 epic
2017-04-19 08:54:35 +08:00
Marina Glancy
8341055eb4 MDL-4782 course: Allow activities in the "stealth" mode
Add field 'visibleoncoursepage' to the course_modules table
Add site-wide setting for turning on stealth mode availability
Add callback for "stealth" mode support in the course formats
Change display of modules/sections availability on the course page
2017-02-14 16:38:05 +08:00
Eloy Lafuente (stronk7)
bd31523a30 Merge branch 'MDL-55720' of https://github.com/ak4t0sh/moodle 2016-12-13 11:41:35 +01:00
Donald Barrett
4fc74fe587 MDL-56301 course: Use value for intro field if set in a mods function
Respects a module that has set a value for the db field intro in it's lib function modulename_add_instance.
2016-12-06 10:34:38 +08:00
ak4t0sh
70a557db24 MDL-55720 course: fix potential undefined variable and cleaning
This commit replace $e usage by $returnfromfunc.
Indeed $returnfromfunc always exists in the scope and take $e value in case of moodle_exception.

This commit also remove useless $modcontext affectation.
2016-11-02 23:15:45 +01:00
Rajesh Taneja
16e62ecc56
MDL-55739 core_course: Check if gradepass is set and not empty
Default value of gradepass is 0.00000 and empty check
passes. But on oracle gradepass value is 0, so just
check if the field is set and that should be enough
2016-10-06 09:50:21 +08:00
Juan Leyva
796876b0ab MDL-55739 course: Update get_course_module to return new data 2016-10-04 13:00:35 +01:00
Damyon Wiese
8995c2702f MDL-52534 course: Course module form can be extended by plugins via callbacks.
3 new plugin callbacks are available to extend any course module form.

xx_coursemodule_standard_elements()
xx_coursemodule_validation()
xx_coursemodule_edit_post_actions()

This allows you to add elements to the form, extend the validation
and process the extra information once the module has been created/updated.
2016-04-18 10:58:52 +08:00
Nadav Kavalerchik
dffcf46f43 MDL-52252 Tags: Add tags to modules (Resources and Activities) 2016-03-09 14:19:47 +08:00
Damyon Wiese
e7c71c189b MDL-48634 grades: Make the rescaling option required if maxgrade changes 2016-02-05 18:20:17 +08:00
Damyon Wiese
d629c601c5 MDL-48634 grades: Add an option to rescale when changing the maxgrade 2016-02-05 18:20:17 +08:00
Frederic Massart
5419cbc9eb MDL-50062 grades: Carry agg. settings between categories when possible 2015-08-06 10:24:25 +08:00
Dave Cooper
135efd5116 MDL-50062 gradebook: Fixed behaviour when changing aggregation mathods. 2015-08-06 10:24:25 +08:00
Mark Nelson
595b911a98 MDL-48187 core_course: use updated '$grade_item' 2015-04-19 20:30:21 -07:00
Gregory Faller
8164fad49d MDL-13831 course: add gradepass field to mod_form 2015-03-23 10:56:56 +08:00
sam marshall
af729c3f5e MDL-48452 Completion: Expected date doesn't save when form is locked
The completion fields are locked when a user has already completed the
task, to prevent you accidentally causing it to recalculate the data.

This lock doesn't apply to the expected date field, as this doesn't
affect user completion. However, changes to the field in this
situation were incorrectly not saved.
2014-12-16 17:31:00 +00:00
sam marshall
06c0603825 MDL-47322 Availability: empty availability should be saved as null
As part of the unit test modifications for this change, I added the get_json
function to the availability conditions that didn't have it. (This is a function
for use in unit tests.)
2014-09-26 15:42:37 +01:00
sam marshall
4717a5fca6 MDL-44725 Availability: Replace groupmembersonly - forms (4)
Remove groupmembersonly option from module editing forms.
2014-09-02 13:03:13 +01:00
Simey Lameze
78618bc677 MDL-45029 core_course: set aggregationcoef while creating a new course module 2014-08-20 11:56:11 +08:00
Ankit Agarwal
e20d306969 MDL-39883 events: Create a new api create_from_cm for module create event 2014-06-18 15:39:02 +08:00
Marina Glancy
3e6adca945 MDL-45688 added missing library requirement 2014-05-24 18:33:00 +08:00