mirror of
https://github.com/moodle/moodle.git
synced 2025-08-06 09:26:35 +02:00
Merge branch 'MDL-84243-main' of https://github.com/ferranrecio/moodle
This commit is contained in:
commit
68156941ff
4 changed files with 24 additions and 4 deletions
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -471,8 +471,16 @@ export default class {
|
|||
* @param {bool} complete the new completion value
|
||||
*/
|
||||
cmCompletion(stateManager, cmIds, complete) {
|
||||
const newValue = (complete) ? 1 : 0;
|
||||
this._setElementsValue(stateManager, 'cm', cmIds, 'completionstate', newValue);
|
||||
const newState = (complete) ? 1 : 0;
|
||||
stateManager.setReadOnly(false);
|
||||
cmIds.forEach((id) => {
|
||||
const element = stateManager.get('cm', id);
|
||||
if (element) {
|
||||
element.isoverallcomplete = complete;
|
||||
element.completionstate = newState;
|
||||
}
|
||||
});
|
||||
stateManager.setReadOnly(true);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -43,12 +43,24 @@ Feature: Course index completion icons
|
|||
Scenario: Manual completion should update the course index completion
|
||||
Given I am on the "C1" "Course" page logged in as "student1"
|
||||
And "To do" "icon" should exist in the "courseindex-content" "region"
|
||||
# Mark an uncompleted activity as completed.
|
||||
When I press "Mark as done"
|
||||
And I wait until "Done" "button" exists
|
||||
Then "Done" "icon" should exist in the "courseindex-content" "region"
|
||||
And I press "Done"
|
||||
And I wait until "Mark as done" "button" exists
|
||||
And "To do" "icon" should exist in the "courseindex-content" "region"
|
||||
# Mark an completed activity as uncompleted (to discard any possible JS dependency, see MDL-84243).
|
||||
And I press "Mark as done"
|
||||
And I wait until "Done" "button" exists
|
||||
And I reload the page
|
||||
And "Done" "icon" should exist in the "courseindex-content" "region"
|
||||
And I press "Done"
|
||||
And I wait until "Mark as done" "button" exists
|
||||
And "To do" "icon" should exist in the "courseindex-content" "region"
|
||||
And I press "Mark as done"
|
||||
And I wait until "Done" "button" exists
|
||||
Then "Done" "icon" should exist in the "courseindex-content" "region"
|
||||
|
||||
@javascript
|
||||
Scenario: Manual completion in an activity page should update the course index
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue