Skip to content

Commit 50e348e

Browse files
authored
Revert "New feature: restricted time for participation for moodleoverflow for…"
This reverts commit 81c3e1e.
1 parent 11a5adb commit 50e348e

21 files changed

+62
-369
lines changed

Diff for: .github/workflows/moodle-ci.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
strategy:
1010
matrix:
1111
php: ['8.3']
12-
moodle-branch: ['MOODLE_405_STABLE']
12+
moodle-branch: ['MOODLE_404_STABLE']
1313
database: ['pgsql']
1414

1515
steps:
@@ -111,17 +111,17 @@ jobs:
111111
fail-fast: false
112112
matrix:
113113
php: ['8.0', '8.1', '8.2', '8.3']
114-
moodle-branch: ['MOODLE_401_STABLE', 'MOODLE_403_STABLE', 'MOODLE_404_STABLE', 'MOODLE_405_STABLE']
114+
moodle-branch: ['MOODLE_401_STABLE', 'MOODLE_402_STABLE', 'MOODLE_403_STABLE', 'MOODLE_404_STABLE']
115115
database: ['mariadb', 'pgsql']
116116
exclude:
117117
- php: '8.0'
118118
moodle-branch: 'MOODLE_404_STABLE'
119-
- php: '8.0'
120-
moodle-branch: 'MOODLE_405_STABLE'
121119
- php: '8.2'
122120
moodle-branch: 'MOODLE_401_STABLE'
123121
- php: '8.3'
124122
moodle-branch: 'MOODLE_401_STABLE'
123+
- php: '8.3'
124+
moodle-branch: 'MOODLE_402_STABLE'
125125
- php: '8.3'
126126
moodle-branch: 'MOODLE_403_STABLE'
127127
include:

Diff for: backup/moodle2/backup_moodleoverflow_stepslib.php

+11-14
Original file line numberDiff line numberDiff line change
@@ -39,41 +39,35 @@ class backup_moodleoverflow_activity_structure_step extends backup_activity_stru
3939
* @return backup_nested_element
4040
*/
4141
protected function define_structure() {
42-
4342
// To know if we are including userinfo.
4443
$userinfo = $this->get_setting_value('userinfo');
4544

4645
// Define the root element describing the moodleoverflow instance.
4746
$moodleoverflow = new backup_nested_element('moodleoverflow', ['id'], [
48-
'name', 'intro', 'introformat', 'maxbytes', 'maxattachments', 'timecreated', 'timemodified',
49-
'forcesubscribe', 'trackingtype', 'ratingpreference', 'coursewidereputation', 'allowrating',
50-
'allowreputation', 'allownegativereputation', 'grademaxgrade', 'gradescalefactor', 'gradecat',
51-
'anonymous', 'allowmultiplemarks', 'la_starttime', 'la_endtime', ]);
47+
'name', 'intro', 'introformat', 'maxbytes', 'maxattachments', 'timecreated', 'timemodified', 'forcesubscribe',
48+
'trackingtype', 'ratingpreference', 'coursewidereputation', 'allowrating', 'allowreputation', 'allownegativereputation',
49+
'grademaxgrade', 'gradescalefactor', 'gradecat', 'anonymous', 'allowmultiplemarks', ]);
5250

5351
// Define each element separated.
5452
$discussions = new backup_nested_element('discussions');
5553
$discussion = new backup_nested_element('discussion', ['id'], [
5654
'name', 'firstpost', 'userid', 'timestart', 'timemodified', 'usermodified', ]);
5755

5856
$posts = new backup_nested_element('posts');
59-
$post = new backup_nested_element('post', ['id'], [
60-
'parent', 'userid', 'created', 'modified',
61-
'message', 'messageformat', 'attachment', 'mailed', 'reviewed', 'timereviewed', ]);
57+
$post = new backup_nested_element('post', ['id'], ['parent', 'userid', 'created', 'modified', 'message',
58+
'messageformat', 'attachment', 'mailed', 'reviewed', 'timereviewed', ]);
6259

6360
$ratings = new backup_nested_element('ratings');
64-
$rating = new backup_nested_element('rating', ['id'], [
65-
'userid', 'rating', 'firstrated', 'lastchanged', ]);
61+
$rating = new backup_nested_element('rating', ['id'], ['userid', 'rating', 'firstrated', 'lastchanged']);
6662

6763
$discussionsubs = new backup_nested_element('discuss_subs');
68-
$discussionsub = new backup_nested_element('discuss_sub', ['id'], [
69-
'userid', 'preference', ]);
64+
$discussionsub = new backup_nested_element('discuss_sub', ['id'], ['userid', 'preference']);
7065

7166
$subscriptions = new backup_nested_element('subscriptions');
7267
$subscription = new backup_nested_element('subscription', ['id'], ['userid']);
7368

7469
$readposts = new backup_nested_element('readposts');
75-
$read = new backup_nested_element('read', ['id'], [
76-
'userid', 'discussionid', 'postid', 'firstread', 'lastread', ]);
70+
$read = new backup_nested_element('read', ['id'], ['userid', 'discussionid', 'postid', 'firstread', 'lastread']);
7771

7872
$grades = new backup_nested_element('grades');
7973
$grade = new backup_nested_element('grade', ['id'], ['userid', 'grade']);
@@ -100,6 +94,9 @@ protected function define_structure() {
10094
$moodleoverflow->add_child($readposts);
10195
$readposts->add_child($read);
10296

97+
$moodleoverflow->add_child($grades);
98+
$grades->add_child($grade);
99+
103100
$moodleoverflow->add_child($tracking);
104101
$tracking->add_child($track);
105102

Diff for: classes/output/helpicon.php

-68
This file was deleted.

Diff for: classes/tables/userstats_table.php

-4
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
require_once($CFG->dirroot . '/mod/moodleoverflow/lib.php');
3131
require_once($CFG->dirroot . '/mod/moodleoverflow/locallib.php');
3232
require_once($CFG->libdir . '/tablelib.php');
33-
use mod_moodleoverflow\output\helpicon;
3433

3534
/**
3635
* Table listing all user statistics of a course
@@ -153,9 +152,6 @@ public function get_usertable() {
153152
*/
154153
public function set_helpactivity() {
155154
global $CFG;
156-
$htmlclass = 'helpactivityclass btn btn-link';
157-
$content = get_string('helpamountofactivity', 'moodleoverflow');
158-
$helpobject = new helpicon($htmlclass, $content);
159155
$this->helpactivity = new \stdClass();
160156
$this->helpactivity->iconurl = $CFG->wwwroot . '/pix/a/help.png';
161157
$this->helpactivity->icon = \html_writer::img($this->helpactivity->iconurl,

Diff for: db/install.xml

-2
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@
2828
<FIELD NAME="anonymous" TYPE="int" LENGTH="2" NOTNULL="true" DEFAULT="0" SEQUENCE="false"/>
2929
<FIELD NAME="needsreview" TYPE="int" LENGTH="2" NOTNULL="true" DEFAULT="0" SEQUENCE="false"/>
3030
<FIELD NAME="allowmultiplemarks" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0" SEQUENCE="false"/>
31-
<FIELD NAME="la_starttime" TYPE="int" LENGTH="10" NOTNULL="false" DEFAULT="0" SEQUENCE="false"/>
32-
<FIELD NAME="la_endtime" TYPE="int" LENGTH="10" NOTNULL="false" DEFAULT="0" SEQUENCE="false"/>
3331
</FIELDS>
3432
<KEYS>
3533
<KEY NAME="primary" TYPE="primary" FIELDS="id"/>

Diff for: db/upgrade.php

-17
Original file line numberDiff line numberDiff line change
@@ -292,23 +292,6 @@ function xmldb_moodleoverflow_upgrade($oldversion) {
292292
upgrade_mod_savepoint(true, 2023040400, 'moodleoverflow');
293293
}
294294

295-
if ($oldversion < 2024061700) {
296-
// Define table moodleoverflow to be edited.
297-
$table = new xmldb_table('moodleoverflow');
298-
299-
// Create the field fot the start time for the limited answer mode.
300-
$field = new xmldb_field('la_starttime', XMLDB_TYPE_INTEGER, '10', null, null, null, 0, 'allowmultiplemarks');
301-
if (!$dbman->field_exists($table, $field)) {
302-
$dbman->add_field($table, $field);
303-
}
304-
// Create the field for the end time for the limited answer mode.
305-
$field = new xmldb_field('la_endtime', XMLDB_TYPE_INTEGER, '10', null, null, null, 0, 'la_starttime');
306-
if (!$dbman->field_exists($table, $field)) {
307-
$dbman->add_field($table, $field);
308-
}
309-
upgrade_mod_savepoint(true, 2024061700, 'moodleoverflow');
310-
}
311-
312295
if ($oldversion < 2024072600) {
313296
require_once($CFG->dirroot . '/mod/moodleoverflow/db/upgradelib.php');
314297

Diff for: discussion.php

+1-3
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,6 @@
5555
if ($marksetting->allowmultiplemarks == 1) {
5656
$multiplemarks = true;
5757
}
58-
// Setting of limitedanswer. Limitedanswertime saves the timestamp, until the limitedanswer is on (0 if off).
59-
$limitedanswersetting = $DB->get_record('moodleoverflow', ['id' => $moodleoverflow->id], 'la_starttime, la_endtime');
6058

6159
// Get the related coursemodule and its context.
6260
if (!$cm = get_coursemodule_from_instance('moodleoverflow', $moodleoverflow->id, $course->id)) {
@@ -158,7 +156,7 @@
158156

159157
echo '<div id="moodleoverflow-posts"><div id="moodleoverflow-root">';
160158

161-
moodleoverflow_print_discussion($course, $cm, $moodleoverflow, $discussion, $post, $multiplemarks, $limitedanswersetting);
159+
moodleoverflow_print_discussion($course, $cm, $moodleoverflow, $discussion, $post, $multiplemarks);
162160
echo '</div></div>';
163161

164162
echo $OUTPUT->footer();

Diff for: lang/en/moodleoverflow.php

-11
Original file line numberDiff line numberDiff line change
@@ -172,18 +172,7 @@
172172
$string['invalidpostid'] = 'Invalid post ID - {$a}';
173173
$string['invalidratingid'] = 'The submitted rating is neither an upvote nor a downvote.';
174174
$string['jump_to_next_post_needing_review'] = 'Jump to next post needing to be reviewed.';
175-
$string['la_endtime'] = 'End time students can answer';
176-
$string['la_endtime_help'] = 'Students can not answer to qustions after the set up date';
177-
$string['la_starttime'] = 'Start time students can answer';
178-
$string['la_starttime_help'] = 'Students can not answer to questions until the set up date';
179175
$string['lastpost'] = 'Last post';
180-
$string['limitedanswer_helpicon_teacher'] = 'This can be changed in the settings of the Moodleoverflow.';
181-
$string['limitedanswer_info_endtime'] = 'Posts can not be answered after {$a->limitedanswerdate}.';
182-
$string['limitedanswer_info_start'] = 'This Moodleoverflow is in a limited answer mode.';
183-
$string['limitedanswer_info_starttime'] = 'Posts can not be answered until {$a->limitedanswerdate}.';
184-
$string['limitedanswerheading'] = 'Limited Answer Mode';
185-
$string['limitedanswerwarning_answers'] = 'There are already answered posts in this Moodleoverflow.';
186-
$string['limitedanswerwarning_conclusion'] = 'Activating or changing limited answer mode might confuse users.';
187176
$string['mailindexlink'] = 'Change your forum preferences: {$a}';
188177
$string['manydiscussions'] = 'Discussions per page';
189178
$string['markallread'] = 'Mark all posts in this discussion as read';

0 commit comments

Comments
 (0)