-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'update/M4.4' of github.com:learnweb/moodle-mod_moodleov…
…erflow into feature/limitedanswermode
- Loading branch information
Showing
27 changed files
with
173 additions
and
128 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,7 +24,6 @@ | |
* @copyright 2017 Kennet Winter <[email protected]> | ||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later | ||
*/ | ||
|
||
use mod_moodleoverflow\anonymous; | ||
use mod_moodleoverflow\capabilities; | ||
use mod_moodleoverflow\event\post_deleted; | ||
|
@@ -157,7 +156,7 @@ function moodleoverflow_print_latest_discussions($moodleoverflow, $cm, $page = - | |
$userstatsbuttontext = get_string('seeuserstats', 'moodleoverflow'); | ||
$userstatsbuttonurl = new moodle_url('/mod/moodleoverflow/userstats.php', ['id' => $cm->id, | ||
'courseid' => $moodleoverflow->course, | ||
'mid' => $moodleoverflow->id]); | ||
'mid' => $moodleoverflow->id, ]); | ||
$userstatsbutton = new single_button($userstatsbuttonurl, $userstatsbuttontext, 'get'); | ||
$userstatsbutton->class = 'singlebutton align-middle m-2'; | ||
echo $OUTPUT->render($userstatsbutton); | ||
|
@@ -325,7 +324,7 @@ function moodleoverflow_print_latest_discussions($moodleoverflow, $cm, $page = - | |
} else { | ||
// Get his picture, his name and the link to his profile. | ||
$preparedarray[$i]['picture'] = $OUTPUT->user_picture($startuser, ['courseid' => $moodleoverflow->course, | ||
'link' => false]); | ||
'link' => false, ]); | ||
$preparedarray[$i]['username'] = fullname($startuser, has_capability('moodle/site:viewfullnames', $context)); | ||
$preparedarray[$i]['userlink'] = $CFG->wwwroot . '/user/view.php?id=' . | ||
$discussion->userid . '&course=' . $moodleoverflow->course; | ||
|
@@ -1484,12 +1483,6 @@ function moodleoverflow_print_post($post, $discussion, $moodleoverflow, $cm, $co | |
} | ||
$mustachedata->questioner = $post->userid == $discussion->userid ? 'questioner' : ''; | ||
|
||
// Set options for the post. | ||
$options = new stdClass(); | ||
$options->para = false; | ||
$options->trusted = false; | ||
$options->context = $modulecontext; | ||
|
||
$reviewdelay = get_config('moodleoverflow', 'reviewpossibleaftertime'); | ||
$mustachedata->reviewdelay = format_time($reviewdelay); | ||
$mustachedata->needsreview = !$post->reviewed; | ||
|
@@ -1498,7 +1491,7 @@ function moodleoverflow_print_post($post, $discussion, $moodleoverflow, $cm, $co | |
$mustachedata->withinreviewperiod = $reviewable; | ||
|
||
// Prepare the post. | ||
$mustachedata->postcontent = format_text($post->message, $post->messageformat, $options, $course->id); | ||
$mustachedata->postcontent = format_text($post->message, $post->messageformat, ['context' => $modulecontext]); | ||
|
||
// Load the attachments. | ||
$mustachedata->attachments = get_attachments($post, $cm); | ||
|
@@ -1915,10 +1908,10 @@ function moodleoverflow_delete_post($post, $deletechildren, $cm, $moodleoverflow | |
$attachments = $fs->get_area_files($context->id, 'mod_moodleoverflow', 'attachment', | ||
$post->id, "filename", true); | ||
foreach ($attachments as $attachment) { | ||
// Get file | ||
// Get file. | ||
$file = $fs->get_file($context->id, 'mod_moodleoverflow', 'attachment', $post->id, | ||
$attachment->get_filepath(), $attachment->get_filename()); | ||
// Delete it if it exists | ||
// Delete it if it exists. | ||
if ($file) { | ||
$file->delete(); | ||
} | ||
|
@@ -2120,7 +2113,7 @@ function moodleoverflow_update_user_grade_on_db($moodleoverflow, $postuserrating | |
if ($DB->record_exists('moodleoverflow_grades', ['userid' => $userid, 'moodleoverflowid' => $moodleoverflow->id])) { | ||
|
||
$DB->set_field('moodleoverflow_grades', 'grade', $grade, ['userid' => $userid, | ||
'moodleoverflowid' => $moodleoverflow->id]); | ||
'moodleoverflowid' => $moodleoverflow->id, ]); | ||
|
||
} else { | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.