forked from EVOgeek/Vmeda.Online
commit
c39e75f894
|
@ -12,9 +12,11 @@
|
||||||
// See the License for the specific language governing permissions and
|
// See the License for the specific language governing permissions and
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
|
|
||||||
import { Component, ViewChild } from '@angular/core';
|
import { AfterViewInit, Component, ViewChild } from '@angular/core';
|
||||||
import { CoreCourseModuleMainActivityPage } from '@features/course/classes/main-activity-page';
|
import { CoreCourseModuleMainActivityPage } from '@features/course/classes/main-activity-page';
|
||||||
import { AddonModAssignIndexComponent } from '../../components/index/index';
|
import { AddonModAssignIndexComponent } from '../../components/index/index';
|
||||||
|
import { CoreNavigator } from '@services/navigator';
|
||||||
|
import { CoreUtils } from '@services/utils/utils';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Page that displays an assign.
|
* Page that displays an assign.
|
||||||
|
@ -23,8 +25,30 @@ import { AddonModAssignIndexComponent } from '../../components/index/index';
|
||||||
selector: 'page-addon-mod-assign-index',
|
selector: 'page-addon-mod-assign-index',
|
||||||
templateUrl: 'index.html',
|
templateUrl: 'index.html',
|
||||||
})
|
})
|
||||||
export class AddonModAssignIndexPage extends CoreCourseModuleMainActivityPage<AddonModAssignIndexComponent> {
|
export class AddonModAssignIndexPage extends CoreCourseModuleMainActivityPage<AddonModAssignIndexComponent>
|
||||||
|
implements AfterViewInit {
|
||||||
|
|
||||||
|
private action?: string;
|
||||||
|
|
||||||
@ViewChild(AddonModAssignIndexComponent) activityComponent?: AddonModAssignIndexComponent;
|
@ViewChild(AddonModAssignIndexComponent) activityComponent?: AddonModAssignIndexComponent;
|
||||||
|
|
||||||
|
constructor() {
|
||||||
|
super();
|
||||||
|
|
||||||
|
this.action = CoreNavigator.getRouteParam('action');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @inheritdoc
|
||||||
|
*/
|
||||||
|
async ngAfterViewInit(): Promise<void> {
|
||||||
|
switch (this.action) {
|
||||||
|
case 'editsubmission':
|
||||||
|
await CoreUtils.waitFor(() => !!this.activityComponent?.submissionComponent, { timeout: 5000 });
|
||||||
|
await this.activityComponent?.submissionComponent?.goToEdit();
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
|
|
||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { CoreContentLinksModuleIndexHandler } from '@features/contentlinks/classes/module-index-handler';
|
import { CoreContentLinksModuleIndexHandler } from '@features/contentlinks/classes/module-index-handler';
|
||||||
|
import { CoreNavigationOptions } from '@services/navigator';
|
||||||
import { makeSingleton } from '@singletons';
|
import { makeSingleton } from '@singletons';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -28,5 +29,16 @@ export class AddonModAssignIndexLinkHandlerService extends CoreContentLinksModul
|
||||||
super('AddonModAssign', 'assign');
|
super('AddonModAssign', 'assign');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @inheritdoc
|
||||||
|
*/
|
||||||
|
getModNavOptions(url: string, params: Record<string, string>): CoreNavigationOptions {
|
||||||
|
if (!params.action) {
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
|
||||||
|
return { params: { action: params.action } };
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
export const AddonModAssignIndexLinkHandler = makeSingleton(AddonModAssignIndexLinkHandlerService);
|
export const AddonModAssignIndexLinkHandler = makeSingleton(AddonModAssignIndexLinkHandlerService);
|
||||||
|
|
|
@ -21,6 +21,7 @@ import { CorePromisedValue } from '@classes/promised-value';
|
||||||
import { IonContent } from '@ionic/angular';
|
import { IonContent } from '@ionic/angular';
|
||||||
import { CoreDomUtils, VerticalPoint } from '@services/utils/dom';
|
import { CoreDomUtils, VerticalPoint } from '@services/utils/dom';
|
||||||
import { CoreUtils } from '@services/utils/utils';
|
import { CoreUtils } from '@services/utils/utils';
|
||||||
|
import { NgZone } from '@singletons';
|
||||||
import { CoreDom } from '@singletons/dom';
|
import { CoreDom } from '@singletons/dom';
|
||||||
import { CoreEventObserver } from '@singletons/events';
|
import { CoreEventObserver } from '@singletons/events';
|
||||||
import { CoreMath } from '@singletons/math';
|
import { CoreMath } from '@singletons/math';
|
||||||
|
@ -62,8 +63,8 @@ export class CoreSwipeSlidesComponent<Item = unknown> implements OnChanges, OnDe
|
||||||
this.swiper.slideTo(this.options.initialSlide, 0, this.options.runCallbacksOnInit);
|
this.swiper.slideTo(this.options.initialSlide, 0, this.options.runCallbacksOnInit);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.swiper.on('slideChangeTransitionStart', () => this.slideWillChange());
|
this.swiper.on('slideChangeTransitionStart', () => NgZone.run(() => this.slideWillChange()));
|
||||||
this.swiper.on('slideChangeTransitionEnd', () => this.slideDidChange());
|
this.swiper.on('slideChangeTransitionEnd', () => NgZone.run(() => this.slideDidChange()));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -119,14 +119,21 @@ Feature: Test basic usage of courses in app
|
||||||
Scenario: Links to actions in Timeline work for teachers/students
|
Scenario: Links to actions in Timeline work for teachers/students
|
||||||
# Submit assignment as student
|
# Submit assignment as student
|
||||||
Given I entered the app as "student1"
|
Given I entered the app as "student1"
|
||||||
When I press "Add submission" in the app
|
When I press "assignment" in the app
|
||||||
Then the header should be "assignment" in the app
|
Then the header should be "assignment" in the app
|
||||||
And I should find "Test assignment description" in the app
|
And I should find "Test assignment description" in the app
|
||||||
And I should find "No attempt" in the app
|
And I should find "No attempt" in the app
|
||||||
And I should find "Due:" in the app
|
And I should find "Due:" in the app
|
||||||
|
|
||||||
When I press "Add submission" in the app
|
When I press "Add submission" in the app
|
||||||
And I set the field "Online text submissions" to "test" in the app
|
Then I should find "Online text submissions" in the app
|
||||||
|
|
||||||
|
When I press the back button in the app
|
||||||
|
And I press the back button in the app
|
||||||
|
And I press "Add submission" in the app
|
||||||
|
Then I should find "Online text submissions" in the app
|
||||||
|
|
||||||
|
When I set the field "Online text submissions" to "test" in the app
|
||||||
And I press "Save" in the app
|
And I press "Save" in the app
|
||||||
And I press "Submit assignment" in the app
|
And I press "Submit assignment" in the app
|
||||||
And I press "OK" in the app
|
And I press "OK" in the app
|
||||||
|
|
Loading…
Reference in New Issue