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

Fixes learnweb/moodle-mod_ratingallocate#306 #309

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
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
12 changes: 6 additions & 6 deletions locallib.php
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ private function process_action_start_distribution() {
}
$raters = $this->get_raters_in_course();
$completion = new completion_info($this->course);
if ($completion->is_enabled($this->coursemodule)) {
if ($completion->is_enabled($this->coursemodule) == COMPLETION_TRACKING_AUTOMATIC) {
foreach ($raters as $rater) {
$completion->update_state($this->coursemodule, COMPLETION_UNKNOWN, $rater->id);
}
Expand Down Expand Up @@ -745,7 +745,7 @@ private function process_action_manual_allocation() {
}
$raters = $this->get_raters_in_course();
$completion = new completion_info($this->course);
if ($completion->is_enabled($this->coursemodule)) {
if ($completion->is_enabled($this->coursemodule) == COMPLETION_TRACKING_AUTOMATIC) {
foreach ($raters as $rater) {
$completion->update_state($this->coursemodule, COMPLETION_UNKNOWN, $rater->id);
}
Expand Down Expand Up @@ -1045,7 +1045,7 @@ public function distribute_users_without_choice(string $distributionalgorithm):
$transaction->allow_commit();

$completion = new completion_info($this->course);
if ($completion->is_enabled($this->coursemodule)) {
if ($completion->is_enabled($this->coursemodule) == COMPLETION_TRACKING_AUTOMATIC) {
foreach ($possibleusers as $userid) {
$completion->update_state($this->coursemodule, COMPLETION_UNKNOWN, $userid);
}
Expand Down Expand Up @@ -1445,7 +1445,7 @@ public function distrubute_choices() {

$completion = new completion_info($this->course);
$raters = $this->get_raters_in_course();
if ($completion->is_enabled($this->coursemodule)) {
if ($completion->is_enabled($this->coursemodule) == COMPLETION_TRACKING_AUTOMATIC) {
foreach ($raters as $rater) {
$completion->update_state($this->coursemodule, COMPLETION_UNKNOWN, $rater->id);
}
Expand Down Expand Up @@ -1956,7 +1956,7 @@ public function save_ratings_to_db($userid, array $data) {
$transaction->allow_commit();

$completion = new completion_info($this->course);
if ($completion->is_enabled()) {
if ($completion->is_enabled() == COMPLETION_TRACKING_AUTOMATIC) {
$completion->set_module_viewed($this->coursemodule, $userid);
$completion->update_state($this->coursemodule, COMPLETION_UNKNOWN, $userid);
}
Expand Down Expand Up @@ -2099,7 +2099,7 @@ public function save_manual_allocation_form($allocdata, $userdata) {
$transaction->allow_commit();

$completion = new completion_info($this->course);
if ($completion->is_enabled($this->coursemodule)) {
if ($completion->is_enabled($this->coursemodule) == COMPLETION_TRACKING_AUTOMATIC) {
foreach ($allusers as $rater) {
$completion->update_state($this->coursemodule, COMPLETION_UNKNOWN, $rater->id);
}
Expand Down