Merge branch 'MDL-63422' of git://github.com/stronk7/moodle

This commit is contained in:
Andrew Nicols 2018-11-02 08:22:33 +08:00
commit f8e364e31a
27 changed files with 79 additions and 89 deletions

View file

@ -187,7 +187,7 @@ class combined_document {
$status = $file->get('status');
switch ($status) {
case \core_files\conversion::STATUS_COMPLETE:
continue;
continue 2;
break;
default:
$converter->poll_conversion($conversion);

View file

@ -108,7 +108,7 @@ class convert_submissions extends scheduled_task {
case combined_document::STATUS_READY:
case combined_document::STATUS_PENDING_INPUT:
// The document has not been converted yet or is somehow still ready.
continue;
continue 2;
}
document_services::get_page_images_for_attempt(
$assignment,

View file

@ -534,10 +534,9 @@ function mod_assign_get_completion_active_rule_descriptions($cm) {
foreach ($cm->customdata['customcompletionrules'] as $key => $val) {
switch ($key) {
case 'completionsubmit':
if (empty($val)) {
continue;
if (!empty($val)) {
$descriptions[] = get_string('completionsubmit', 'assign');
}
$descriptions[] = get_string('completionsubmit', 'assign');
break;
default:
break;

View file

@ -1007,7 +1007,7 @@ while (true) {
if (!preg_match('/beep=([^&]*)[& ]/', $data, $info)) {
$daemon->trace('Beep sidekick did not contain a valid userid', E_USER_WARNING);
$daemon->dismiss_ufo($handle, true, 'Request with malformed data; connection closed');
continue;
continue 2;
} else {
$customdata = array('beep' => intval($info[1]));
}
@ -1017,7 +1017,7 @@ while (true) {
if (!preg_match('/chat_message=([^&]*)[& ]chat_msgidnr=([^&]*)[& ]/', $data, $info)) {
$daemon->trace('Message sidekick did not contain a valid message', E_USER_WARNING);
$daemon->dismiss_ufo($handle, true, 'Request with malformed data; connection closed');
continue;
continue 2;
} else {
$customdata = array('message' => $info[1], 'index' => $info[2]);
}
@ -1025,7 +1025,7 @@ while (true) {
default:
$daemon->trace('UFO with '.$handle.': Request with unknown type; connection closed', E_USER_WARNING);
$daemon->dismiss_ufo($handle, true, 'Request with unknown type; connection closed');
continue;
continue 2;
break;
}

View file

@ -1453,10 +1453,9 @@ function mod_choice_get_completion_active_rule_descriptions($cm) {
foreach ($cm->customdata['customcompletionrules'] as $key => $val) {
switch ($key) {
case 'completionsubmit':
if (empty($val)) {
continue;
if (!empty($val)) {
$descriptions[] = get_string('completionsubmit', 'choice');
}
$descriptions[] = get_string('completionsubmit', 'choice');
break;
default:
break;

View file

@ -4555,10 +4555,9 @@ function mod_data_get_completion_active_rule_descriptions($cm) {
foreach ($cm->customdata['customcompletionrules'] as $key => $val) {
switch ($key) {
case 'completionentries':
if (empty($val)) {
continue;
if (!empty($val)) {
$descriptions[] = get_string('completionentriesdesc', 'data', $val);
}
$descriptions[] = get_string('completionentriesdesc', 'data', $val);
break;
default:
break;

View file

@ -3097,10 +3097,9 @@ function mod_feedback_get_completion_active_rule_descriptions($cm) {
foreach ($cm->customdata['customcompletionrules'] as $key => $val) {
switch ($key) {
case 'completionsubmit':
if (empty($val)) {
continue;
if (!empty($val)) {
$descriptions[] = get_string('completionsubmit', 'feedback');
}
$descriptions[] = get_string('completionsubmit', 'feedback');
break;
default:
break;

View file

@ -8563,22 +8563,19 @@ function mod_forum_get_completion_active_rule_descriptions($cm) {
foreach ($cm->customdata['customcompletionrules'] as $key => $val) {
switch ($key) {
case 'completiondiscussions':
if (empty($val)) {
continue;
if (!empty($val)) {
$descriptions[] = get_string('completiondiscussionsdesc', 'forum', $val);
}
$descriptions[] = get_string('completiondiscussionsdesc', 'forum', $val);
break;
case 'completionreplies':
if (empty($val)) {
continue;
if (!empty($val)) {
$descriptions[] = get_string('completionrepliesdesc', 'forum', $val);
}
$descriptions[] = get_string('completionrepliesdesc', 'forum', $val);
break;
case 'completionposts':
if (empty($val)) {
continue;
if (!empty($val)) {
$descriptions[] = get_string('completionpostsdesc', 'forum', $val);
}
$descriptions[] = get_string('completionpostsdesc', 'forum', $val);
break;
default:
break;

View file

@ -4314,10 +4314,9 @@ function mod_glossary_get_completion_active_rule_descriptions($cm) {
foreach ($cm->customdata['customcompletionrules'] as $key => $val) {
switch ($key) {
case 'completionentries':
if (empty($val)) {
continue;
if (!empty($val)) {
$descriptions[] = get_string('completionentriesdesc', 'glossary', $val);
}
$descriptions[] = get_string('completionentriesdesc', 'glossary', $val);
break;
default:
break;

View file

@ -1745,16 +1745,14 @@ function mod_lesson_get_completion_active_rule_descriptions($cm) {
foreach ($cm->customdata['customcompletionrules'] as $key => $val) {
switch ($key) {
case 'completionendreached':
if (empty($val)) {
continue;
if (!empty($val)) {
$descriptions[] = get_string('completionendreached_desc', 'lesson', $val);
}
$descriptions[] = get_string('completionendreached_desc', 'lesson', $val);
break;
case 'completiontimespent':
if (empty($val)) {
continue;
if (!empty($val)) {
$descriptions[] = get_string('completiontimespentdesc', 'lesson', format_time($val));
}
$descriptions[] = get_string('completiontimespentdesc', 'lesson', format_time($val));
break;
default:
break;

View file

@ -2266,16 +2266,14 @@ function mod_quiz_get_completion_active_rule_descriptions($cm) {
foreach ($cm->customdata['customcompletionrules'] as $key => $val) {
switch ($key) {
case 'completionattemptsexhausted':
if (empty($val)) {
continue;
if (!empty($val)) {
$descriptions[] = get_string('completionattemptsexhausteddesc', 'quiz');
}
$descriptions[] = get_string('completionattemptsexhausteddesc', 'quiz');
break;
case 'completionpass':
if (empty($val)) {
continue;
if (!empty($val)) {
$descriptions[] = get_string('completionpassdesc', 'quiz', format_time($val));
}
$descriptions[] = get_string('completionpassdesc', 'quiz', format_time($val));
break;
default:
break;

View file

@ -1778,30 +1778,27 @@ function mod_scorm_get_completion_active_rule_descriptions($cm) {
foreach ($cm->customdata['customcompletionrules'] as $key => $val) {
switch ($key) {
case 'completionstatusrequired':
if (is_null($val)) {
continue;
}
// Determine the selected statuses using a bitwise operation.
$cvalues = array();
foreach (scorm_status_options(true) as $bit => $string) {
if (($val & $bit) == $bit) {
$cvalues[] = $string;
if (!is_null($val)) {
// Determine the selected statuses using a bitwise operation.
$cvalues = array();
foreach (scorm_status_options(true) as $bit => $string) {
if (($val & $bit) == $bit) {
$cvalues[] = $string;
}
}
$statusstring = implode(', ', $cvalues);
$descriptions[] = get_string('completionstatusrequireddesc', 'scorm', $statusstring);
}
$statusstring = implode(', ', $cvalues);
$descriptions[] = get_string('completionstatusrequireddesc', 'scorm', $statusstring);
break;
case 'completionscorerequired':
if (is_null($val)) {
continue;
if (!is_null($val)) {
$descriptions[] = get_string('completionscorerequireddesc', 'scorm', $val);
}
$descriptions[] = get_string('completionscorerequireddesc', 'scorm', $val);
break;
case 'completionstatusallscos':
if (empty($val)) {
continue;
if (!empty($val)) {
$descriptions[] = get_string('completionstatusallscos', 'scorm');
}
$descriptions[] = get_string('completionstatusallscos', 'scorm');
break;
default:
break;
@ -1922,4 +1919,4 @@ function mod_scorm_core_calendar_get_valid_event_timestart_range(\calendar_event
}
return [$mindate, $maxdate];
}
}

View file

@ -1201,10 +1201,9 @@ function mod_survey_get_completion_active_rule_descriptions($cm) {
foreach ($cm->customdata['customcompletionrules'] as $key => $val) {
switch ($key) {
case 'completionsubmit':
if (empty($val)) {
continue;
if (!empty($val)) {
$descriptions[] = get_string('completionsubmit', 'survey');
}
$descriptions[] = get_string('completionsubmit', 'survey');
break;
default:
break;