MDL-66536 course: No teaching model renamed

This commit is contained in:
David Monllaó 2019-08-30 13:39:34 +08:00
parent 41db25935c
commit 3581813348
7 changed files with 52 additions and 62 deletions

View File

@ -58,7 +58,7 @@
"models": [
{
"defid": "id24680aceg",
"targetname": "No teaching",
"targetname": "Courses at risk of not starting",
"targetclass": "\\core\\analytics\\target\\no_teaching",
"indicatorsnum": 2,
"indicators": [

View File

@ -15,55 +15,55 @@ Feature: Restoring default models
Scenario: Restore a single deleted default model
Given I log in as "manager"
And I navigate to "Analytics > Analytics models" in site administration
# Delete 'No teaching' model.
And I click on "Delete" "link" in the "No teaching" "table_row"
# Delete 'Courses at risk of not starting' model.
And I click on "Delete" "link" in the "Courses at risk of not starting" "table_row"
And I should see "Analytics models"
And I should not see "No teaching"
And I should not see "Courses at risk of not starting"
# Delete 'Students at risk of dropping out' model.
And I click on "Delete" "link" in the "Students at risk of dropping out" "table_row"
And I should see "Analytics models"
And I should not see "Students at risk of dropping out"
# Go to the page for restoring deleted models.
When I click on "Restore default models" "link"
And I should see "No teaching"
And I should see "Courses at risk of not starting"
And I should see "Students at risk of dropping out"
# Select and restore the 'No teaching' model.
And I set the field with xpath "//tr[contains(normalize-space(.), 'No teaching')]//input[@type='checkbox']" to "1"
# Select and restore the 'Courses at risk of not starting' model.
And I set the field with xpath "//tr[contains(normalize-space(.), 'Courses at risk of not starting')]//input[@type='checkbox']" to "1"
And I click on "Restore selected" "button"
Then I should see "Succesfully re-created 1 new model(s)."
And I should see "Analytics models"
And I should see "No teaching"
And I should see "Courses at risk of not starting"
And I should not see "Students at risk of dropping out"
Scenario: Restore multiple deleted default models at once
Given I log in as "manager"
And I navigate to "Analytics > Analytics models" in site administration
# Delete 'No teaching' model.
And I click on "Delete" "link" in the "No teaching" "table_row"
# Delete 'Courses at risk of not starting' model.
And I click on "Delete" "link" in the "Courses at risk of not starting" "table_row"
And I should see "Analytics models"
And I should not see "No teaching"
And I should not see "Courses at risk of not starting"
# Delete 'Students at risk of dropping out' model.
And I click on "Delete" "link" in the "Students at risk of dropping out" "table_row"
And I should see "Analytics models"
And I should not see "Students at risk of dropping out"
# Go to the page for restoring deleted models.
When I click on "Restore default models" "link"
And I should see "No teaching"
And I should see "Courses at risk of not starting"
And I should see "Students at risk of dropping out"
# Select and restore both models.
And I set the field with xpath "//tr[contains(normalize-space(.), 'No teaching')]//input[@type='checkbox']" to "1"
And I set the field with xpath "//tr[contains(normalize-space(.), 'Courses at risk of not starting')]//input[@type='checkbox']" to "1"
And I set the field with xpath "//tr[contains(normalize-space(.), 'Students at risk of dropping out')]//input[@type='checkbox']" to "1"
And I click on "Restore selected" "button"
Then I should see "Succesfully re-created 2 new model(s)."
And I should see "Analytics models"
And I should see "No teaching"
And I should see "Courses at risk of not starting"
And I should see "Students at risk of dropping out"
Scenario: Going to the restore page while no models can be restored
Given I log in as "manager"
And I navigate to "Analytics > Analytics models" in site administration
And I should see "Analytics models"
And I should see "No teaching"
And I should see "Courses at risk of not starting"
When I click on "Restore default models" "link"
Then I should see "All default models provided by core and installed plugins have been created. No new models were found; there is nothing to restore."
And I click on "Back" "link"
@ -73,23 +73,23 @@ Feature: Restoring default models
Scenario: User can select and restore all missing models
Given I log in as "manager"
And I navigate to "Analytics > Analytics models" in site administration
# Delete 'No teaching' model.
And I click on "Actions" "link" in the "No teaching" "table_row"
And I click on "Delete" "link" in the "No teaching" "table_row"
# Delete 'Courses at risk of not starting' model.
And I click on "Actions" "link" in the "Courses at risk of not starting" "table_row"
And I click on "Delete" "link" in the "Courses at risk of not starting" "table_row"
And I click on "Delete" "button" in the "Delete" "dialogue"
And I should see "Analytics models"
And I should not see "No teaching"
And I should not see "Courses at risk of not starting"
# Delete 'Students at risk of dropping out' model.
And I click on "Actions" "link" in the "Students at risk of dropping out" "table_row"
And I click on "Delete" "link" in the "Students at risk of dropping out" "table_row"
And I click on "Delete" "button" in the "Delete" "dialogue"
And I should see "Analytics models"
And I should not see "No teaching"
And I should not see "Courses at risk of not starting"
And I should not see "Students at risk of dropping out"
# Go to the page for restoring deleted models.
And I click on "New model" "link"
And I click on "Restore default models" "link"
And I should see "No teaching"
And I should see "Courses at risk of not starting"
And I should see "Students at risk of dropping out"
# Attempt to submit the form without selecting any model.
And I click on "Restore selected" "button"
@ -99,5 +99,5 @@ Feature: Restoring default models
And I click on "Restore selected" "button"
Then I should see "Succesfully re-created 2 new model(s)."
And I should see "Analytics models"
And I should see "No teaching"
And I should see "Courses at risk of not starting"
And I should see "Students at risk of dropping out"

View File

@ -64,23 +64,6 @@ class no_student extends \core_analytics\local\indicator\binary {
return array('context', 'course');
}
/**
* Reversed because the indicator is in 'negative' and the max returned value means student present.
*
* @param float $value
* @param string $subtype
* @return string
*/
public function get_display_value($value, $subtype = false) {
// No subtypes for binary values by default.
if ($value == -1) {
return get_string('yes');
} else if ($value == 1) {
return get_string('no');
}
}
/**
* calculate_sample
*

View File

@ -64,23 +64,6 @@ class no_teacher extends \core_analytics\local\indicator\binary {
return array('context', 'course');
}
/**
* Reversed because the indicator is in 'negative' and the max returned value means teacher present.
*
* @param float $value
* @param string $subtype
* @return string
*/
public function get_display_value($value, $subtype = false) {
// No subtypes for binary values by default.
if ($value == -1) {
return get_string('yes');
} else if ($value == 1) {
return get_string('no');
}
}
/**
* calculate_sample
*

View File

@ -76,6 +76,27 @@ class no_teaching extends \core_analytics\local\target\binary {
return get_string('noteachingupcomingcourses');
}
/**
* Returns the body message for the insight.
*
* @param \context $context
* @param string $contextname
* @param \stdClass $user
* @param \moodle_url $insighturl
* @return string[] The plain text message and the HTML message
*/
public function get_insight_body(\context $context, string $contextname, \stdClass $user, \moodle_url $insighturl): array {
global $OUTPUT;
$a = (object)['userfirstname' => $user->firstname];
$fullmessage = get_string('noteachinginfomessage', 'course', $a) . PHP_EOL . PHP_EOL . $insighturl->out(false);
$fullmessagehtml = $OUTPUT->render_from_template('core_analytics/insight_info_message',
['url' => $insighturl->out(false), 'insightinfomessage' => get_string('noteachinginfomessage', 'course', $a)]
);
return [$fullmessage, $fullmessagehtml];
}
/**
* prediction_actions
*

View File

@ -46,6 +46,9 @@ $string['nocourseactivity'] = 'Not enough course activity between the start and
$string['nocourseendtime'] = 'The course does not have an end time';
$string['nocoursesections'] = 'No course sections';
$string['nocoursestudents'] = 'No students';
$string['noteachinginfomessage'] = 'Hi {$a->userfirstname},
</br><br/>Courses with start dates in the next week have been identified as having no teacher or student enrolments.';
$string['privacy:perpage'] = 'The number of courses to show per page.';
$string['privacy:completionpath'] = 'Course completion';
$string['privacy:favouritespath'] = 'Course starred information';
@ -63,7 +66,7 @@ $string['target:coursedropout'] = 'Students at risk of dropping out';
$string['target:coursedropout_help'] = 'This target describes whether the student is considered at risk of dropping out.';
$string['target:coursegradetopass'] = 'Students at risk of not achieving the minimum grade to pass the course';
$string['target:coursegradetopass_help'] = 'This target describes whether the student is at risk of not achieving the minimum grade to pass the course.';
$string['target:noteachingactivity'] = 'No teaching';
$string['target:noteachingactivity'] = 'Courses at risk of not starting';
$string['target:noteachingactivity_help'] = 'This target describes whether courses due to start in the coming week will have teaching activity.';
$string['targetlabelstudentcompletionno'] = 'Student who is likely to meet the course completion conditions';
$string['targetlabelstudentcompletionyes'] = 'Student at risk of not meeting the course completion conditions';
@ -74,4 +77,4 @@ $string['targetlabelstudentdropoutno'] = 'Not at risk';
$string['targetlabelstudentgradetopassno'] = 'Student who is likely to meet the minimum grade to pass the course.';
$string['targetlabelstudentgradetopassyes'] = 'Student at risk of not meeting the minimum grade to pass the course.';
$string['targetlabelteachingyes'] = 'Users with teaching capabilities who have access to the course';
$string['targetlabelteachingno'] = 'No teaching';
$string['targetlabelteachingno'] = 'Courses at risk of not starting';

View File

@ -1053,10 +1053,10 @@ $string['indicator:completeduserprofile'] = 'User profile is completed';
$string['indicator:completeduserprofile_help'] = 'This indicator represents that the student has completed their user profile.';
$string['indicator:completionenabled'] = 'Completion tracking enabled';
$string['indicator:completionenabled_help'] = 'This indicator represents that completion tracking has been enabled for this course.';
$string['indicator:nostudent'] = 'There are no students';
$string['indicator:nostudent_help'] = 'This indicator reflects that this course has no students.';
$string['indicator:noteacher'] = 'There are no teachers';
$string['indicator:noteacher_help'] = 'This indicator reflects that this course has no teachers.';
$string['indicator:nostudent'] = 'Student enrolments';
$string['indicator:nostudent_help'] = 'This indicator reflects the availability of students in the course.';
$string['indicator:noteacher'] = 'Teacher availability';
$string['indicator:noteacher_help'] = 'This indicator reflects the availability of teachers in the course.';
$string['indicator:potentialcognitive'] = 'Course potential cognitive depth';
$string['indicator:potentialcognitive_help'] = 'This indicator is based on the potential cognitive depth that could be reached by a student participating in course activities.';
$string['indicator:potentialsocial'] = 'Course potential social breadth';