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

Note to MOODLE_405_STABLE release of surveypro #971

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 3 additions & 3 deletions .github/workflows/moodle-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ jobs:
matrix:
include:
- php: 8.1
moodle-branch: MOODLE_403_STABLE
moodle-branch: MOODLE_405_STABLE
database: mariadb
suite: classic
profile: default
- php: 8.1
moodle-branch: MOODLE_403_STABLE
- php: 8.2
moodle-branch: MOODLE_405_STABLE
database: pgsql
suite: default
profile: chrome
Expand Down
20 changes: 10 additions & 10 deletions TODO.txt
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
-> does it make sense the research per long text?
-> "Manage relation" page has lots of features, but the consequence is that the page is "cluttered" with too many settings.
-> "Manage relation" page has lots of features, but the consequence is that the page is "cluttered" with too many settings.
Obviously a Show/Hide advanced button is needed. (thanks to JR)
-> The Autofill question message "Content will be added at submit time" should not be displayed to the Student when taking the Survey,
-> The Autofill question message "Content will be added at submit time" should not be displayed to the Student taking the Survey,
as it does not mean anything to him. That is a message for Teacher, not Student. (thanks to JR)
-> grades?
-> surveypro_get_view_actions()?
-> surveypro_get_post_actions()?
-> surveypro_scale_used($surveyproid, $scaleid)?
-> surveypro_scale_used_anywhere($scaleid)?
-> unit test (they are a must)
-> *** Crucial known issue that is not fixable in my opinion. I apply a master template.
I make a surveypro with it. Tomorrow I update the master template with a newer version.
This new version has one more item in the middle.
Surveys built with the old release of the plugin will stop working fine as they will find in the right position string of a different template.
-> *** Crucial known issue that is not fixable in my opinion. I apply a master template.
I make a surveypro with it. Tomorrow I update the master template with a newer version.
This new version has one more item in the middle.
Surveys built with the old plugins will stop working fine as they will find in the right position string of a different template.
-> possible better solution: use the first 32 chars of the question escaped
-> is the autofill field saved to userdata even if it is not shown?
-> allow upperbound date/datetime == to now
Expand All @@ -21,7 +21,7 @@ Surveys built with the old release of the plugin will stop working fine as they
-> mform elements in MMM have different sizes probably because of /theme/yui_combo.php?
3.13.0/cssreset/cssreset.css&3.13.0/cssfonts/cssfonts.css&3.13.0/cssgrids/cssgrids.css&3.13.0/cssbase/cssbase.css

1) Still it seems to be something strange when handling fileareas.
1) Still it seems to be something strange when handling fileareas.
I just grepped by get_area_files and found a bunch of them new/strange for me. ELOY has to review this!
> Please let me know better what do you mean. I can not understand it.

Expand All @@ -31,15 +31,15 @@ I just grepped by get_area_files and found a bunch of them new/strange for me. E
> literals is ok.
> more yet, if there are groups... then everything (listing, reports, graphs)
> must be by group.
things like the "phantom tabs" (sorry for the expression, lol, just joking) or the way "attempts" are performed...
things like the "phantom tabs" (sorry for the expression, lol, just joking) or the way "attempts" are performed...
are substandard (to name it in some way).

2.a) A read me about what's missing (migration from old, usability review and discussion)

2.b) A commit (decided by you) where you want me to cut history.
2.b) A commit (decided by you) where you want me to cut history.
Can be current commit of anything else if you want to preserve your latest commits for any reason.

2.c) A BIG WARNING saying that it must not be used in production sites with existing old surveypros
2.c) A BIG WARNING saying that it must not be used in production sites with existing old surveypros
because they will be erased completely (beacuse of 1).
README.md (so it will display nicely in github) ?

Expand Down
20 changes: 12 additions & 8 deletions backup/moodle2/backup_surveypro_stepslib.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,18 +44,22 @@ protected function define_structure() {
// Define each element separated.
// Root element describing surveypro instance.
$surveypro = new backup_nested_element('surveypro', ['id'], [
'name', 'intro', 'introformat', 'newpageforchild', 'neverstartedemail',
'pauseresume', 'keepinprogress', 'captcha', 'history', 'anonymous',
'timeopen', 'timeclose', 'startyear', 'stopyear',
'maxentries', 'mailroles', 'mailextraaddresses', 'mailcontent', 'mailcontentformat',
'thankspage', 'thankspageformat', 'riskyeditdeadline', 'template', 'completionsubmit',
'timecreated', 'timemodified', ]);
'name', 'intro', 'introformat', 'newpageforchild', 'neverstartedemail',
'pauseresume', 'keepinprogress', 'captcha', 'history', 'anonymous',
'timeopen', 'timeclose', 'startyear', 'stopyear',
'maxentries', 'mailroles', 'mailextraaddresses', 'mailcontent', 'mailcontentformat',
'thankspage', 'thankspageformat', 'riskyeditdeadline', 'template', 'completionsubmit',
'timecreated', 'timemodified',
]);

$items = new backup_nested_element('items');

$item = new backup_nested_element('item', ['id', 'type', 'plugin'], [
'hidden', 'insearchform', 'reserved', 'sortindex', 'formpage',
'parentid', 'parentvalue', 'timecreated', 'timemodified', ]);
'content', 'contentformat',
'required', 'indent', 'position', 'customnumber', 'hideinstructions', 'variable', 'extranote',
'hidden', 'insearchform', 'reserved', 'sortindex', 'formpage',
'parentid', 'parentvalue', 'timecreated', 'timemodified',
]);

$submissions = new backup_nested_element('submissions');

Expand Down
2 changes: 1 addition & 1 deletion classes/event/submission_created.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public function get_url() {
$paramurl['id'] = $this->contextinstanceid;
$paramurl['submissionid'] = $this->objectid;
$paramurl['mode'] = $this->other['mode'];
$paramurl['section'] = 'submissionform';
$paramurl['section'] = 'responsesubmit';
return new \moodle_url('/mod/surveypro/view.php', $paramurl);
}

Expand Down
2 changes: 1 addition & 1 deletion classes/event/submission_modified.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public function get_url() {
$paramurl['id'] = $this->contextinstanceid;
$paramurl['submissionid'] = $this->objectid;
$paramurl['mode'] = $this->other['mode'];
$paramurl['section'] = 'submissionform';
$paramurl['section'] = 'responsesubmit';
return new \moodle_url('/mod/surveypro/view.php', $paramurl);
}

Expand Down
2 changes: 1 addition & 1 deletion classes/event/submission_viewed.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public function get_url() {
$paramurl['id'] = $this->contextinstanceid;
$paramurl['submissionid'] = $this->objectid;
$paramurl['mode'] = $this->other['mode'];
$paramurl['section'] = 'submissionform';
$paramurl['section'] = 'responsesubmit';
return new \moodle_url('/mod/surveypro/view.php', $paramurl);
}

Expand Down
7 changes: 4 additions & 3 deletions classes/formbase.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,9 @@ public function set_user_boundary_formpages() {
FROM {surveypro_item}
WHERE surveyproid = :surveyproid
AND reserved = :reserved
AND hidden = :hidden
AND plugin <> :plugin';
$whereparams = ['surveyproid' => $this->surveypro->id, 'reserved' => 0, 'plugin' => 'pagebreak'];
$whereparams = ['surveyproid' => $this->surveypro->id, 'reserved' => 0, 'hidden' => 0, 'plugin' => 'pagebreak'];
$boundaries = $DB->get_record_sql($sql, $whereparams);

$userfirstpage = isset($boundaries->userfirstpage) ? $boundaries->userfirstpage : 1;
Expand Down Expand Up @@ -232,7 +233,7 @@ private function page_has_items($formpage) {
}

foreach ($itemseeds as $itemseed) {
$parentitem = surveypro_get_item($this->cm, $this->surveypro, $itemseed->parentid);
$parentitem = surveypro_get_itemclass($this->cm, $this->surveypro, $itemseed->parentid);
if ($parentitem->userform_is_child_allowed_static($this->get_submissionid(), $itemseed)) {
// If at least one parent allows its child, I finished. The page is going to display items.
return true;
Expand Down Expand Up @@ -296,7 +297,7 @@ public function get_prefill_data() {
[$where, $params] = surveypro_fetch_items_seeds($id, true, $canaccessreserveditems, null, SURVEYPRO_TYPEFIELD, $page);
if ($itemseeds = $DB->get_recordset_select('surveypro_item', $where, $params, 'sortindex', 'id, type, plugin')) {
foreach ($itemseeds as $itemseed) {
$item = surveypro_get_item($this->cm, $this->surveypro, $itemseed->id, $itemseed->type, $itemseed->plugin);
$item = surveypro_get_itemclass($this->cm, $this->surveypro, $itemseed->id, $itemseed->type, $itemseed->plugin);

$where = ['submissionid' => $this->submissionid, 'itemid' => $item->get_itemid()];
$olduserdata = $DB->get_record('surveypro_answer', $where);
Expand Down
Loading
Loading