Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make default rules editable (#26) #59

Closed
wants to merge 53 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
2f56bf4
Now static filters are editable.
Canx Feb 19, 2017
20d0e52
Populate block_xp_default_filters correctly.
Canx Feb 19, 2017
a33bbcc
improving based on review
Canx Feb 25, 2017
f3b01e5
Refactoring filters, not finished
Canx Mar 7, 2017
b174f18
Refactored aiming at filter_manager::course_default_filters_to_course
Canx Mar 8, 2017
32dc4f0
Renamed classes and files to follow ruleset model
Canx Mar 9, 2017
c4cb5eb
Default filters now are stored using zero courseid in block_xp_filters
Canx Mar 9, 2017
76c8ba4
Merge branch 'issue-27-zerohack' into issue-26
Canx Mar 9, 2017
f5f0aa5
Renamed files and classes to follow ruleset pattern
Canx Mar 10, 2017
590a5a3
Fixing first failing test
Canx Mar 10, 2017
8edd6cf
Undoing bug, don't know why tests are failing...
Canx Mar 10, 2017
e6559cb
Now tests pass
Canx Mar 11, 2017
1592295
Readded non-editable static rules in rules.php, but now they are only…
Canx Mar 12, 2017
70b547c
Added header license in new files
Canx Mar 12, 2017
374a614
Wrong description
Canx Mar 12, 2017
a22c0ea
abstract functions should be protected
Canx Mar 12, 2017
9600918
Cleaned code style
Canx Mar 13, 2017
ae568c8
Added comment
Canx Mar 13, 2017
cee1259
Improving filter classes and adding tests. Still some failing old tests
Canx Mar 14, 2017
da4e569
Refactoring filter_manager and adapting old tests. manager_tests fail…
Canx Mar 16, 2017
a877742
Cleaning debug comments. Detected bug but manager_test still fails...…
Canx Mar 16, 2017
11380d8
Now course rules render ok!
Canx Mar 16, 2017
fb29ddd
Now all tests passes. I'm going to cry!
Canx Mar 16, 2017
9d7c4a9
Prepare filter_manager to manage default filters.
Canx Mar 19, 2017
a6a4a54
Added comments and renamed function
Canx Mar 20, 2017
a6b9b88
filterset lazy loading
Canx Mar 20, 2017
ce43806
Refactoring filter save function
Canx Mar 20, 2017
8c81559
Refactor filter load method
Canx Mar 20, 2017
4c2f17b
Refactor load_as_new
Canx Mar 20, 2017
d303018
Refactor load_from data and renaming
Canx Mar 20, 2017
776c042
Comment function insert_or_update
Canx Mar 20, 2017
7ae003a
Refactor load filterset method
Canx Mar 20, 2017
ae4c262
use factory from filter class
Canx Mar 20, 2017
fe57237
rules.php refactor and solved errors.
Canx Mar 21, 2017
e11d003
Readding types in params (PHP5) and refactoring filter match.
Canx Mar 21, 2017
1c1e15c
Added iterator pattern to filterset
Canx Mar 21, 2017
23555f6
Iterator->SeekableIterator interface for filterset. Removed and clean…
Canx Mar 21, 2017
547ba24
Simple factories to get more readable code.
Canx Mar 22, 2017
9e3342e
Added test to check addition of default filters to current courses.
Canx Mar 22, 2017
b584083
Renamed methods.
Canx Mar 23, 2017
149f652
properties should be protected.
Canx Mar 24, 2017
55127a9
Filtersets now have renderer.
Canx Mar 26, 2017
716ba0e
forgot to rename function.
Canx Mar 27, 2017
468f6a8
Added test to check filter_manager::save_default_filters().
Canx Mar 27, 2017
1176abd
Added admin page to modify default rules.
Canx Mar 29, 2017
a7859f5
Merged from upstream with latest version.
Canx Mar 31, 2017
f2c18bd
Added tests to check adding filters to courses and moved invalidate_f…
Canx Apr 3, 2017
2e55685
thinking of using decorator pattern to cache
Canx Apr 3, 2017
9e12b04
Only add default filters if they are not still in the course.
Canx Apr 3, 2017
08aad6d
Replaced save_default_filters by a raw DB function.
Canx Apr 9, 2017
97118ff
Added generator tool to help write raw DB commands.
Canx Apr 9, 2017
ac6f77f
append_default_rules_to_courses function implemented with low level d…
Canx Apr 9, 2017
d6d199e
Cleaned upgradelib.
Canx Apr 10, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Added comment
  • Loading branch information
Canx committed Mar 13, 2017
commit ae568c8d38f8dfeaa28e3eefed5954f4facf4fe2
13 changes: 11 additions & 2 deletions classes/filter_default.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,17 @@

class block_xp_filter_default extends block_xp_filter {

public function load(StdClass $filter) {
// TODO: check null.
/**
* Loads filter data from object except courseid and id.
*
* default filters don't have courseid.
* Not having id means that when saved will always create a new record.
*
* @param stdClass or block_xp_filter $filter
*/
public function load($filter) {
// TODO: check nulls.
// TODO: validate ruledata to avoid course context.
$this->ruledata = $filter->ruledata;
$this->points = $filter->points;
$this->sortorder = $filter->sortorder;
Expand Down