Merge pull request #1576 from dpalou/MOBILE-1874

Mobile 1874
main
Juan Leyva 2018-10-23 12:41:53 +02:00 committed by GitHub
commit 7b117d802e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
125 changed files with 2687 additions and 107 deletions

View File

@ -10,6 +10,7 @@
"addon.badges.issuername": "badges",
"addon.badges.nobadges": "badges",
"addon.badges.recipientdetails": "badges",
"addon.block_activitymodules.pluginname": "block_activity_modules",
"addon.block_myoverview.all": "block_myoverview",
"addon.block_myoverview.future": "block_myoverview",
"addon.block_myoverview.inprogress": "block_myoverview",
@ -20,6 +21,7 @@
"addon.block_myoverview.nocoursespast": "block_myoverview",
"addon.block_myoverview.past": "block_myoverview",
"addon.block_myoverview.title": "block_myoverview",
"addon.block_sitemainmenu.pluginname": "block_site_main_menu",
"addon.block_timeline.duedate": "block_timeline",
"addon.block_timeline.next30days": "block_timeline",
"addon.block_timeline.next3months": "block_timeline",
@ -202,6 +204,7 @@
"addon.mod_assign.markingworkflowstatereadyforrelease": "assign",
"addon.mod_assign.markingworkflowstatereadyforreview": "assign",
"addon.mod_assign.markingworkflowstatereleased": "assign",
"addon.mod_assign.modulenameplural": "assign",
"addon.mod_assign.multipleteams": "assign",
"addon.mod_assign.multipleteams_desc": "assign",
"addon.mod_assign.noattempt": "assign",
@ -256,6 +259,7 @@
"addon.mod_assign_submission_file.pluginname": "assignsubmission_file",
"addon.mod_assign_submission_onlinetext.pluginname": "assignsubmission_onlinetext",
"addon.mod_book.errorchapter": "book",
"addon.mod_book.modulenameplural": "book",
"addon.mod_chat.beep": "chat",
"addon.mod_chat.currentusers": "chat",
"addon.mod_chat.enterchat": "chat",
@ -268,6 +272,7 @@
"addon.mod_chat.messagebeepsyou": "chat",
"addon.mod_chat.messageenter": "chat",
"addon.mod_chat.messageexit": "chat",
"addon.mod_chat.modulenameplural": "chat",
"addon.mod_chat.mustbeonlinetosendmessages": "local_moodlemobileapp",
"addon.mod_chat.nomessages": "chat",
"addon.mod_chat.send": "chat",
@ -278,6 +283,7 @@
"addon.mod_choice.errorgetchoice": "local_moodlemobileapp",
"addon.mod_choice.expired": "choice",
"addon.mod_choice.full": "choice",
"addon.mod_choice.modulenameplural": "choice",
"addon.mod_choice.noresultsviewable": "choice",
"addon.mod_choice.notopenyet": "choice",
"addon.mod_choice.numberofuser": "choice",
@ -317,6 +323,7 @@
"addon.mod_data.fields": "data",
"addon.mod_data.latlongboth": "data",
"addon.mod_data.menuchoose": "data",
"addon.mod_data.modulenameplural": "data",
"addon.mod_data.more": "data",
"addon.mod_data.nomatch": "data",
"addon.mod_data.norecords": "data",
@ -348,6 +355,7 @@
"addon.mod_feedback.feedbackopen": "feedback",
"addon.mod_feedback.mapcourses": "feedback",
"addon.mod_feedback.mode": "feedback",
"addon.mod_feedback.modulenameplural": "feedback",
"addon.mod_feedback.next_page": "feedback",
"addon.mod_feedback.non_anonymous": "feedback",
"addon.mod_feedback.non_anonymous_entries": "feedback",
@ -368,6 +376,7 @@
"addon.mod_feedback.started": "feedback",
"addon.mod_feedback.this_feedback_is_already_submitted": "feedback",
"addon.mod_folder.emptyfilelist": "local_moodlemobileapp",
"addon.mod_folder.modulenameplural": "folder",
"addon.mod_forum.addanewdiscussion": "forum",
"addon.mod_forum.addanewquestion": "forum",
"addon.mod_forum.addanewtopic": "forum",
@ -390,6 +399,7 @@
"addon.mod_forum.modeflatnewestfirst": "forum",
"addon.mod_forum.modeflatoldestfirst": "forum",
"addon.mod_forum.modenested": "forum",
"addon.mod_forum.modulenameplural": "forum",
"addon.mod_forum.numdiscussions": "local_moodlemobileapp",
"addon.mod_forum.numreplies": "local_moodlemobileapp",
"addon.mod_forum.posttoforum": "forum",
@ -425,9 +435,11 @@
"addon.mod_glossary.fillfields": "glossary",
"addon.mod_glossary.fullmatch": "glossary",
"addon.mod_glossary.linking": "glossary",
"addon.mod_glossary.modulenameplural": "glossary",
"addon.mod_glossary.noentriesfound": "local_moodlemobileapp",
"addon.mod_glossary.searchquery": "local_moodlemobileapp",
"addon.mod_imscp.deploymenterror": "imscp",
"addon.mod_imscp.modulenameplural": "imscp",
"addon.mod_imscp.showmoduledescription": "local_moodlemobileapp",
"addon.mod_lesson.answer": "lesson",
"addon.mod_lesson.attempt": "lesson",
@ -471,6 +483,7 @@
"addon.mod_lesson.lowtime": "lesson",
"addon.mod_lesson.maximumnumberofattemptsreached": "lesson",
"addon.mod_lesson.modattemptsnoteacher": "lesson",
"addon.mod_lesson.modulenameplural": "lesson",
"addon.mod_lesson.noanswer": "lesson",
"addon.mod_lesson.nolessonattempts": "lesson",
"addon.mod_lesson.nolessonattemptsgroup": "lesson",
@ -515,7 +528,9 @@
"addon.mod_lti.errorgetlti": "local_moodlemobileapp",
"addon.mod_lti.errorinvalidlaunchurl": "local_moodlemobileapp",
"addon.mod_lti.launchactivity": "local_moodlemobileapp",
"addon.mod_lti.modulenameplural": "lti",
"addon.mod_page.errorwhileloadingthepage": "local_moodlemobileapp",
"addon.mod_page.modulenameplural": "page",
"addon.mod_quiz.attemptfirst": "quiz",
"addon.mod_quiz.attemptlast": "quiz",
"addon.mod_quiz.attemptnumber": "quiz",
@ -550,6 +565,7 @@
"addon.mod_quiz.grademethod": "quiz",
"addon.mod_quiz.gradesofar": "quiz",
"addon.mod_quiz.marks": "quiz",
"addon.mod_quiz.modulenameplural": "quiz",
"addon.mod_quiz.mustbesubmittedby": "quiz",
"addon.mod_quiz.noquestions": "quiz",
"addon.mod_quiz.noreviewattempt": "quiz",
@ -594,6 +610,7 @@
"addon.mod_quiz.yourfinalgradeis": "quiz",
"addon.mod_resource.errorwhileloadingthecontent": "local_moodlemobileapp",
"addon.mod_resource.modifieddate": "resource",
"addon.mod_resource.modulenameplural": "resource",
"addon.mod_resource.openthefile": "local_moodlemobileapp",
"addon.mod_resource.uploadeddate": "resource",
"addon.mod_scorm.asset": "scorm",
@ -630,6 +647,7 @@
"addon.mod_scorm.incomplete": "scorm",
"addon.mod_scorm.lastattempt": "scorm",
"addon.mod_scorm.mode": "scorm",
"addon.mod_scorm.modulenameplural": "scorm",
"addon.mod_scorm.newattempt": "scorm",
"addon.mod_scorm.noattemptsallowed": "scorm",
"addon.mod_scorm.noattemptsmade": "scorm",
@ -649,10 +667,12 @@
"addon.mod_survey.errorgetsurvey": "local_moodlemobileapp",
"addon.mod_survey.ifoundthat": "survey",
"addon.mod_survey.ipreferthat": "survey",
"addon.mod_survey.modulenameplural": "survey",
"addon.mod_survey.responses": "survey",
"addon.mod_survey.results": "local_moodlemobileapp",
"addon.mod_survey.surveycompletednograph": "survey",
"addon.mod_url.accessurl": "local_moodlemobileapp",
"addon.mod_url.modulenameplural": "url",
"addon.mod_url.pointingtourl": "local_moodlemobileapp",
"addon.mod_wiki.cannoteditpage": "wiki",
"addon.mod_wiki.createpage": "wiki",
@ -661,6 +681,7 @@
"addon.mod_wiki.errornowikiavailable": "local_moodlemobileapp",
"addon.mod_wiki.gowikihome": "local_moodlemobileapp",
"addon.mod_wiki.map": "wiki",
"addon.mod_wiki.modulenameplural": "wiki",
"addon.mod_wiki.newpagehdr": "wiki",
"addon.mod_wiki.newpagetitle": "wiki",
"addon.mod_wiki.nocontent": "wiki",
@ -699,6 +720,7 @@
"addon.mod_workshop.gradinggradecalculated": "workshop",
"addon.mod_workshop.gradinggradeof": "workshop",
"addon.mod_workshop.gradinggradeover": "workshop",
"addon.mod_workshop.modulenameplural": "workshop",
"addon.mod_workshop.nogradeyet": "workshop",
"addon.mod_workshop.notassessed": "workshop",
"addon.mod_workshop.notoverridden": "workshop",
@ -1467,6 +1489,7 @@
"core.refresh": "moodle",
"core.required": "moodle",
"core.requireduserdatamissing": "local_moodlemobileapp",
"core.resources": "moodle",
"core.restore": "moodle",
"core.retry": "local_moodlemobileapp",
"core.save": "moodle",

View File

@ -0,0 +1,44 @@
// (C) Copyright 2015 Martin Dougiamas
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
import { NgModule } from '@angular/core';
import { IonicModule } from 'ionic-angular';
import { TranslateModule } from '@ngx-translate/core';
import { CoreComponentsModule } from '@components/components.module';
import { CoreDirectivesModule } from '@directives/directives.module';
import { AddonBlockActivityModulesComponentsModule } from './components/components.module';
import { CoreBlockDelegate } from '@core/block/providers/delegate';
import { AddonBlockActivityModulesHandler } from './providers/block-handler';
@NgModule({
declarations: [
],
imports: [
IonicModule,
CoreComponentsModule,
CoreDirectivesModule,
AddonBlockActivityModulesComponentsModule,
TranslateModule.forChild()
],
exports: [
],
providers: [
AddonBlockActivityModulesHandler
]
})
export class AddonBlockActivityModulesModule {
constructor(blockDelegate: CoreBlockDelegate, blockHandler: AddonBlockActivityModulesHandler) {
blockDelegate.registerHandler(blockHandler);
}
}

View File

@ -0,0 +1,26 @@
ion-app.app-root.md addon-block-activitymodules {
.core-module-icon {
margin-top: $label-md-margin-top;
margin-bottom: $label-md-margin-bottom;
width: 24px;
height: 24px;
}
}
ion-app.app-root.ios addon-block-activitymodules {
.core-module-icon {
margin-top: $label-ios-margin-top;
margin-bottom: $label-ios-margin-bottom;
width: 24px;
height: 24px;
}
}
ion-app.app-root.wp addon-block-activitymodules {
.core-module-icon {
margin-top: $item-wp-padding-top;
margin-bottom: $item-wp-padding-bottom;
width: 24px;
height: 24px;
}
}

View File

@ -0,0 +1,124 @@
// (C) Copyright 2015 Martin Dougiamas
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
import { Component, OnInit, Injector, Input } from '@angular/core';
import { CoreUtilsProvider } from '@providers/utils/utils';
import { CoreCourseProvider } from '@core/course/providers/course';
import { CoreCourseModuleDelegate } from '@core/course/providers/module-delegate';
import { CoreBlockBaseComponent } from '@core/block/classes/base-block-component';
import { CoreConstants } from '@core/constants';
import { TranslateService } from '@ngx-translate/core';
/**
* Component to render an "activity modules" block.
*/
@Component({
selector: 'addon-block-activitymodules',
templateUrl: 'addon-block-activitymodules.html'
})
export class AddonBlockActivityModulesComponent extends CoreBlockBaseComponent implements OnInit {
@Input() block: any; // The block to render.
@Input() contextLevel: string; // The context where the block will be used.
@Input() instanceId: number; // The instance ID associated with the context level.
entries: any[] = [];
protected fetchContentDefaultError = 'Error getting activity modules data.';
constructor(injector: Injector, protected utils: CoreUtilsProvider, protected courseProvider: CoreCourseProvider,
protected translate: TranslateService, protected moduleDelegate: CoreCourseModuleDelegate) {
super(injector, 'AddonBlockActivityModulesComponent');
}
/**
* Component being initialized.
*/
ngOnInit(): void {
super.ngOnInit();
}
/**
* Perform the invalidate content function.
*
* @return {Promise<any>} Resolved when done.
*/
protected invalidateContent(): Promise<any> {
return this.courseProvider.invalidateSections(this.instanceId);
}
/**
* Fetch the data to render the block.
*
* @return {Promise<any>} Promise resolved when done.
*/
protected fetchContent(): Promise<any> {
return this.courseProvider.getSections(this.instanceId, false, true).then((sections) => {
this.entries = [];
const archetypes = {};
let modFullNames = {};
sections.forEach((section) => {
if (!section.modules) {
return;
}
section.modules.forEach((mod) => {
if (mod.uservisible === false || !this.courseProvider.moduleHasView(mod) ||
typeof modFullNames[mod.modname] != 'undefined') {
// Ignore this module.
return;
}
// Get the archetype of the module type.
if (typeof archetypes[mod.modname] == 'undefined') {
archetypes[mod.modname] = this.moduleDelegate.supportsFeature(mod.modname,
CoreConstants.FEATURE_MOD_ARCHETYPE, CoreConstants.MOD_ARCHETYPE_OTHER);
}
// Get the full name of the module type.
if (archetypes[mod.modname] == CoreConstants.MOD_ARCHETYPE_RESOURCE) {
// All resources are gathered in a single "Resources" option.
if (!modFullNames['resources']) {
modFullNames['resources'] = this.translate.instant('core.resources');
}
} else {
modFullNames[mod.modname] = mod.modplural;
}
});
});
// Sort the modnames alphabetically.
modFullNames = this.utils.sortValues(modFullNames);
for (const modName in modFullNames) {
let icon;
if (modName === 'resources') {
icon = this.courseProvider.getModuleIconSrc('page');
} else {
icon = this.moduleDelegate.getModuleIconSrc(modName);
}
this.entries.push({
icon: icon,
name: modFullNames[modName],
modName: modName
});
}
});
}
}

View File

@ -0,0 +1,6 @@
<core-loading [hideUntil]="loaded" class="core-loading-center">
<a ion-item text-wrap *ngFor="let entry of entries" class="item-media" detail-none [navPush]="'CoreCourseListModTypePage'" [navParams]="{title: entry.name, courseId: instanceId, modName: entry.modName}">
<img item-start [src]="entry.icon" alt="" role="presentation" class="core-module-icon">
<core-format-text [text]="entry.name"></core-format-text>
</a>
</core-loading>

View File

@ -0,0 +1,45 @@
// (C) Copyright 2015 Martin Dougiamas
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { IonicModule } from 'ionic-angular';
import { TranslateModule } from '@ngx-translate/core';
import { AddonBlockActivityModulesComponent } from './activitymodules/activitymodules';
import { CoreComponentsModule } from '@components/components.module';
import { CoreDirectivesModule } from '@directives/directives.module';
import { CoreCourseComponentsModule } from '@core/course/components/components.module';
@NgModule({
declarations: [
AddonBlockActivityModulesComponent
],
imports: [
CommonModule,
IonicModule,
TranslateModule.forChild(),
CoreComponentsModule,
CoreDirectivesModule,
CoreCourseComponentsModule
],
providers: [
],
exports: [
AddonBlockActivityModulesComponent
],
entryComponents: [
AddonBlockActivityModulesComponent
]
})
export class AddonBlockActivityModulesComponentsModule {}

View File

@ -0,0 +1,3 @@
{
"pluginname": "Activities"
}

View File

@ -0,0 +1,58 @@
// (C) Copyright 2015 Martin Dougiamas
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
import { Injectable, Injector } from '@angular/core';
import { CoreBlockHandler, CoreBlockHandlerData } from '@core/block/providers/delegate';
import { AddonBlockActivityModulesComponent } from '../components/activitymodules/activitymodules';
/**
* Course nav handler.
*/
@Injectable()
export class AddonBlockActivityModulesHandler implements CoreBlockHandler {
name = 'AddonBlockActivityModulesHandler';
blockName = 'activity_modules';
constructor() {
// Nothing to do.
}
/**
* Check if the handler is enabled on a site level.
*
* @return {boolean} Whether or not the handler is enabled on a site level.
*/
isEnabled(): boolean | Promise<boolean> {
return true;
}
/**
* Returns the data needed to render the block.
*
* @param {Injector} injector Injector.
* @param {any} block The block to render.
* @param {string} contextLevel The context where the block will be used.
* @param {number} instanceId The instance ID associated with the context level.
* @return {CoreBlockHandlerData|Promise<CoreBlockHandlerData>} Data or promise resolved with the data.
*/
getDisplayData?(injector: Injector, block: any, contextLevel: string, instanceId: number)
: CoreBlockHandlerData | Promise<CoreBlockHandlerData> {
return {
title: 'addon.block_activitymodules.pluginname',
class: 'addon-block-activitymodules',
component: AddonBlockActivityModulesComponent
};
}
}

View File

@ -23,7 +23,7 @@ import { CoreCoursesHelperProvider } from '@core/courses/providers/helper';
import { CoreCourseHelperProvider } from '@core/course/providers/helper';
import { CoreCourseOptionsDelegate } from '@core/course/providers/options-delegate';
import { AddonCourseCompletionProvider } from '@addon/coursecompletion/providers/coursecompletion';
import { AddonBlockComponent } from '../../classes/block-component';
import { CoreBlockBaseComponent } from '@core/block/classes/base-block-component';
/**
* Component to render a my overview block.
@ -32,7 +32,7 @@ import { AddonBlockComponent } from '../../classes/block-component';
selector: 'addon-block-myoverview',
templateUrl: 'addon-block-myoverview.html'
})
export class AddonBlockMyOverviewComponent extends AddonBlockComponent implements OnInit, OnDestroy {
export class AddonBlockMyOverviewComponent extends CoreBlockBaseComponent implements OnInit, OnDestroy {
@ViewChild('searchbar') searchbar: Searchbar;
courses = {

View File

@ -0,0 +1,45 @@
// (C) Copyright 2015 Martin Dougiamas
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { IonicModule } from 'ionic-angular';
import { TranslateModule } from '@ngx-translate/core';
import { AddonBlockSiteMainMenuComponent } from './sitemainmenu/sitemainmenu';
import { CoreComponentsModule } from '@components/components.module';
import { CoreDirectivesModule } from '@directives/directives.module';
import { CoreCourseComponentsModule } from '@core/course/components/components.module';
@NgModule({
declarations: [
AddonBlockSiteMainMenuComponent
],
imports: [
CommonModule,
IonicModule,
TranslateModule.forChild(),
CoreComponentsModule,
CoreDirectivesModule,
CoreCourseComponentsModule
],
providers: [
],
exports: [
AddonBlockSiteMainMenuComponent
],
entryComponents: [
AddonBlockSiteMainMenuComponent
]
})
export class AddonBlockSiteMainMenuComponentsModule {}

View File

@ -0,0 +1,7 @@
<core-loading [hideUntil]="loaded" class="core-loading-center">
<ion-item text-wrap *ngIf="block.summary">
<core-format-text [text]="block.summary"></core-format-text>
</ion-item>
<core-course-module *ngFor="let module of block.modules" [module]="module" [courseId]="siteHomeId" [downloadEnabled]="true" [section]="block"></core-course-module>
</core-loading>

View File

@ -0,0 +1,114 @@
// (C) Copyright 2015 Martin Dougiamas
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
import { Component, OnInit, Injector } from '@angular/core';
import { CoreSitesProvider } from '@providers/sites';
import { CoreCourseProvider } from '@core/course/providers/course';
import { CoreCourseHelperProvider } from '@core/course/providers/helper';
import { CoreSiteHomeProvider } from '@core/sitehome/providers/sitehome';
import { CoreCourseModulePrefetchDelegate } from '@core/course/providers/module-prefetch-delegate';
import { CoreBlockBaseComponent } from '@core/block/classes/base-block-component';
/**
* Component to render a site main menu block.
*/
@Component({
selector: 'addon-block-sitemainmenu',
templateUrl: 'addon-block-sitemainmenu.html'
})
export class AddonBlockSiteMainMenuComponent extends CoreBlockBaseComponent implements OnInit {
block: any;
siteHomeId: number;
protected fetchContentDefaultError = 'Error getting main menu data.';
constructor(injector: Injector, protected sitesProvider: CoreSitesProvider, protected courseProvider: CoreCourseProvider,
protected courseHelper: CoreCourseHelperProvider, protected siteHomeProvider: CoreSiteHomeProvider,
protected prefetchDelegate: CoreCourseModulePrefetchDelegate) {
super(injector, 'AddonBlockSiteMainMenuComponent');
this.siteHomeId = sitesProvider.getCurrentSite().getSiteHomeId();
}
/**
* Component being initialized.
*/
ngOnInit(): void {
super.ngOnInit();
}
/**
* Perform the invalidate content function.
*
* @return {Promise<any>} Resolved when done.
*/
protected invalidateContent(): Promise<any> {
const promises = [];
promises.push(this.courseProvider.invalidateSections(this.siteHomeId));
promises.push(this.siteHomeProvider.invalidateNewsForum(this.siteHomeId));
if (this.block && this.block.modules) {
// Invalidate modules prefetch data.
promises.push(this.prefetchDelegate.invalidateModules(this.block.modules, this.siteHomeId));
}
return Promise.all(promises);
}
/**
* Fetch the data to render the block.
*
* @return {Promise<any>} Promise resolved when done.
*/
protected fetchContent(): Promise<any> {
return this.courseProvider.getSections(this.siteHomeId, false, true).then((sections) => {
this.block = sections[0];
if (this.block) {
this.block.hasContent = this.courseHelper.sectionHasContent(this.block);
this.courseHelper.addHandlerDataForModules([this.block], this.siteHomeId);
// Check if Site Home displays announcements. If so, remove it from the main menu block.
const currentSite = this.sitesProvider.getCurrentSite(),
config = currentSite ? currentSite.getStoredConfig() || {} : {};
let hasNewsItem = false;
if (config.frontpageloggedin) {
const items = config.frontpageloggedin.split(',');
hasNewsItem = items.find((item) => { return item == '0'; });
}
if (hasNewsItem && this.block.modules) {
// Remove forum activity (news one only) from the main menu block to prevent duplicates.
return this.siteHomeProvider.getNewsForum(this.siteHomeId).then((forum) => {
// Search the module that belongs to site news.
for (let i = 0; i < this.block.modules.length; i++) {
const module = this.block.modules[i];
if (module.modname == 'forum' && module.instance == forum.id) {
this.block.modules.splice(i, 1);
break;
}
}
}).catch(() => {
// Ignore errors.
});
}
}
});
}
}

View File

@ -0,0 +1,3 @@
{
"pluginname": "Main menu"
}

View File

@ -0,0 +1,58 @@
// (C) Copyright 2015 Martin Dougiamas
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
import { Injectable, Injector } from '@angular/core';
import { CoreBlockHandler, CoreBlockHandlerData } from '@core/block/providers/delegate';
import { AddonBlockSiteMainMenuComponent } from '../components/sitemainmenu/sitemainmenu';
/**
* Course nav handler.
*/
@Injectable()
export class AddonBlockSiteMainMenuHandler implements CoreBlockHandler {
name = 'AddonBlockSiteMainMenuHandler';
blockName = 'site_main_menu';
constructor() {
// Nothing to do.
}
/**
* Check if the handler is enabled on a site level.
*
* @return {boolean} Whether or not the handler is enabled on a site level.
*/
isEnabled(): boolean | Promise<boolean> {
return true;
}
/**
* Returns the data needed to render the block.
*
* @param {Injector} injector Injector.
* @param {any} block The block to render.
* @param {string} contextLevel The context where the block will be used.
* @param {number} instanceId The instance ID associated with the context level.
* @return {CoreBlockHandlerData|Promise<CoreBlockHandlerData>} Data or promise resolved with the data.
*/
getDisplayData?(injector: Injector, block: any, contextLevel: string, instanceId: number)
: CoreBlockHandlerData | Promise<CoreBlockHandlerData> {
return {
title: 'addon.block_sitemainmenu.pluginname',
class: 'addon-block-sitemainmenu',
component: AddonBlockSiteMainMenuComponent
};
}
}

View File

@ -0,0 +1,44 @@
// (C) Copyright 2015 Martin Dougiamas
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
import { NgModule } from '@angular/core';
import { IonicModule } from 'ionic-angular';
import { TranslateModule } from '@ngx-translate/core';
import { CoreComponentsModule } from '@components/components.module';
import { CoreDirectivesModule } from '@directives/directives.module';
import { AddonBlockSiteMainMenuComponentsModule } from './components/components.module';
import { CoreBlockDelegate } from '@core/block/providers/delegate';
import { AddonBlockSiteMainMenuHandler } from './providers/block-handler';
@NgModule({
declarations: [
],
imports: [
IonicModule,
CoreComponentsModule,
CoreDirectivesModule,
AddonBlockSiteMainMenuComponentsModule,
TranslateModule.forChild()
],
exports: [
],
providers: [
AddonBlockSiteMainMenuHandler
]
})
export class AddonBlockSiteMainMenuModule {
constructor(blockDelegate: CoreBlockDelegate, blockHandler: AddonBlockSiteMainMenuHandler) {
blockDelegate.registerHandler(blockHandler);
}
}

View File

@ -19,7 +19,7 @@ import { CoreSitesProvider } from '@providers/sites';
import { CoreCoursesProvider } from '@core/courses/providers/courses';
import { CoreCoursesHelperProvider } from '@core/courses/providers/helper';
import { CoreCourseOptionsDelegate } from '@core/course/providers/options-delegate';
import { AddonBlockComponent } from '../../../classes/block-component';
import { CoreBlockBaseComponent } from '@core/block/classes/base-block-component';
import { AddonBlockTimelineProvider } from '../../providers/timeline';
/**
@ -29,7 +29,7 @@ import { AddonBlockTimelineProvider } from '../../providers/timeline';
selector: 'addon-block-timeline',
templateUrl: 'addon-block-timeline.html'
})
export class AddonBlockTimelineComponent extends AddonBlockComponent implements OnInit {
export class AddonBlockTimelineComponent extends CoreBlockBaseComponent implements OnInit {
sort = 'sortbydates';
filter = 'next30days';
currentSite: any;

View File

@ -29,6 +29,7 @@ import { AddonModAssignModuleHandler } from './providers/module-handler';
import { AddonModAssignPrefetchHandler } from './providers/prefetch-handler';
import { AddonModAssignSyncCronHandler } from './providers/sync-cron-handler';
import { AddonModAssignIndexLinkHandler } from './providers/index-link-handler';
import { AddonModAssignListLinkHandler } from './providers/list-link-handler';
import { AddonModAssignSubmissionModule } from './submission/submission.module';
import { AddonModAssignFeedbackModule } from './feedback/feedback.module';
import { CoreUpdateManagerProvider } from '@providers/update-manager';
@ -62,18 +63,22 @@ export const ADDON_MOD_ASSIGN_PROVIDERS: any[] = [
AddonModAssignModuleHandler,
AddonModAssignPrefetchHandler,
AddonModAssignSyncCronHandler,
AddonModAssignIndexLinkHandler
AddonModAssignIndexLinkHandler,
AddonModAssignListLinkHandler
]
})
export class AddonModAssignModule {
constructor(moduleDelegate: CoreCourseModuleDelegate, moduleHandler: AddonModAssignModuleHandler,
prefetchDelegate: CoreCourseModulePrefetchDelegate, prefetchHandler: AddonModAssignPrefetchHandler,
cronDelegate: CoreCronDelegate, syncHandler: AddonModAssignSyncCronHandler, updateManager: CoreUpdateManagerProvider,
contentLinksDelegate: CoreContentLinksDelegate, linkHandler: AddonModAssignIndexLinkHandler) {
contentLinksDelegate: CoreContentLinksDelegate, linkHandler: AddonModAssignIndexLinkHandler,
listLinkHandler: AddonModAssignListLinkHandler) {
moduleDelegate.registerHandler(moduleHandler);
prefetchDelegate.registerHandler(prefetchHandler);
cronDelegate.register(syncHandler);
contentLinksDelegate.registerHandler(linkHandler);
contentLinksDelegate.registerHandler(listLinkHandler);
// Allow migrating the tables from the old app to the new schema.
updateManager.registerSiteTablesMigration([

View File

@ -50,6 +50,7 @@
"markingworkflowstatereadyforreview": "Marking completed",
"markingworkflowstatereadyforrelease": "Ready for release",
"markingworkflowstatereleased": "Released",
"modulenameplural": "Assignments",
"multipleteams": "Member of more than one group",
"multipleteams_desc": "The assignment requires submission in groups. You are a member of more than one group. To be able to submit you must be a member of only one group. Please contact your teacher to change your group membership.",
"noattempt": "No attempt",

View File

@ -136,13 +136,20 @@ export class AddonModAssignProvider {
protected getAssignmentByField(courseId: number, key: string, value: any, siteId?: string): Promise<any> {
return this.sitesProvider.getSite(siteId).then((site) => {
const params = {
courseids: [courseId]
courseids: [courseId],
includenotenrolledcourses: 1
},
preSets = {
cacheKey: this.getAssignmentCacheKey(courseId)
};
return site.read('mod_assign_get_assignments', params, preSets).then((response) => {
return site.read('mod_assign_get_assignments', params, preSets).catch(() => {
// In 3.6 we added a new parameter includenotenrolledcourses that could cause offline data not to be found.
// Retry again without the param to check if the request is already cached.
delete params.includenotenrolledcourses;
return site.read('mod_assign_get_assignments', params, preSets);
}).then((response) => {
// Search the assignment to return.
if (response.courses && response.courses.length) {
const assignments = response.courses[0].assignments;

View File

@ -0,0 +1,41 @@
// (C) Copyright 2015 Martin Dougiamas
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
import { Injectable } from '@angular/core';
import { CoreContentLinksModuleListHandler } from '@core/contentlinks/classes/module-list-handler';
import { CoreContentLinksHelperProvider } from '@core/contentlinks/providers/helper';
import { TranslateService } from '@ngx-translate/core';
import { AddonModAssignProvider } from './assign';
/**
* Handler to treat links to assign list page.
*/
@Injectable()
export class AddonModAssignListLinkHandler extends CoreContentLinksModuleListHandler {
name = 'AddonModAssignListLinkHandler';
constructor(linkHelper: CoreContentLinksHelperProvider, translate: TranslateService,
protected assignProvider: AddonModAssignProvider) {
super(linkHelper, translate, 'AddonModAssign', 'assign');
}
/**
* Check if the handler is enabled on a site level.
*
* @return {boolean} Whether or not the handler is enabled on a site level.
*/
isEnabled(): boolean {
return this.assignProvider.isPluginEnabled();
}
}

View File

@ -18,6 +18,7 @@ import { CoreCourseModuleHandler, CoreCourseModuleHandlerData } from '@core/cour
import { CoreCourseProvider } from '@core/course/providers/course';
import { AddonModAssignProvider } from './assign';
import { AddonModAssignIndexComponent } from '../components/index/index';
import { CoreConstants } from '@core/constants';
/**
* Handler to support assign modules.
@ -27,6 +28,21 @@ export class AddonModAssignModuleHandler implements CoreCourseModuleHandler {
name = 'AddonModAssign';
modName = 'assign';
supportedFeatures = {
[CoreConstants.FEATURE_GROUPS]: true,
[CoreConstants.FEATURE_GROUPINGS]: true,
[CoreConstants.FEATURE_MOD_INTRO]: true,
[CoreConstants.FEATURE_COMPLETION_TRACKS_VIEWS]: true,
[CoreConstants.FEATURE_COMPLETION_HAS_RULES]: true,
[CoreConstants.FEATURE_GRADE_HAS_GRADE]: true,
[CoreConstants.FEATURE_GRADE_OUTCOMES]: true,
[CoreConstants.FEATURE_BACKUP_MOODLE2]: true,
[CoreConstants.FEATURE_SHOW_DESCRIPTION]: true,
[CoreConstants.FEATURE_ADVANCED_GRADING]: true,
[CoreConstants.FEATURE_PLAGIARISM]: true,
[CoreConstants.FEATURE_COMMENT]: true
};
constructor(private courseProvider: CoreCourseProvider, private assignProvider: AddonModAssignProvider) { }
/**

View File

@ -17,6 +17,7 @@ import { AddonModBookComponentsModule } from './components/components.module';
import { AddonModBookProvider } from './providers/book';
import { AddonModBookModuleHandler } from './providers/module-handler';
import { AddonModBookLinkHandler } from './providers/link-handler';
import { AddonModBookListLinkHandler } from './providers/list-link-handler';
import { AddonModBookPrefetchHandler } from './providers/prefetch-handler';
import { CoreCourseModuleDelegate } from '@core/course/providers/module-delegate';
import { CoreContentLinksDelegate } from '@core/contentlinks/providers/delegate';
@ -37,15 +38,19 @@ export const ADDON_MOD_BOOK_PROVIDERS: any[] = [
AddonModBookProvider,
AddonModBookModuleHandler,
AddonModBookLinkHandler,
AddonModBookListLinkHandler,
AddonModBookPrefetchHandler
]
})
export class AddonModBookModule {
constructor(moduleDelegate: CoreCourseModuleDelegate, moduleHandler: AddonModBookModuleHandler,
contentLinksDelegate: CoreContentLinksDelegate, linkHandler: AddonModBookLinkHandler,
prefetchDelegate: CoreCourseModulePrefetchDelegate, prefetchHandler: AddonModBookPrefetchHandler) {
prefetchDelegate: CoreCourseModulePrefetchDelegate, prefetchHandler: AddonModBookPrefetchHandler,
listLinkHandler: AddonModBookListLinkHandler) {
moduleDelegate.registerHandler(moduleHandler);
contentLinksDelegate.registerHandler(linkHandler);
contentLinksDelegate.registerHandler(listLinkHandler);
prefetchDelegate.registerHandler(prefetchHandler);
}
}

View File

@ -1,3 +1,4 @@
{
"errorchapter": "Error reading chapter of book."
"errorchapter": "Error reading chapter of book.",
"modulenameplural": "Books"
}

View File

@ -0,0 +1,46 @@
// (C) Copyright 2015 Martin Dougiamas
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
import { Injectable } from '@angular/core';
import { CoreContentLinksModuleListHandler } from '@core/contentlinks/classes/module-list-handler';
import { CoreContentLinksHelperProvider } from '@core/contentlinks/providers/helper';
import { TranslateService } from '@ngx-translate/core';
import { AddonModBookProvider } from './book';
/**
* Handler to treat links to book list page.
*/
@Injectable()
export class AddonModBookListLinkHandler extends CoreContentLinksModuleListHandler {
name = 'AddonModBookListLinkHandler';
constructor(linkHelper: CoreContentLinksHelperProvider, translate: TranslateService,
protected bookProvider: AddonModBookProvider) {
super(linkHelper, translate, 'AddonModBook', 'book');
}
/**
* Check if the handler is enabled for a certain site (site + user) and a URL.
* If not defined, defaults to true.
*
* @param {string} siteId The site ID.
* @param {string} url The URL to treat.
* @param {any} params The params of the URL. E.g. 'mysite.com?id=1' -> {id: 1}
* @param {number} [courseId] Course ID related to the URL. Optional but recommended.
* @return {boolean|Promise<boolean>} Whether the handler is enabled for the URL and site.
*/
isEnabled(siteId: string, url: string, params: any, courseId?: number): boolean | Promise<boolean> {
return this.bookProvider.isPluginEnabled();
}
}

View File

@ -18,6 +18,7 @@ import { AddonModBookProvider } from './book';
import { AddonModBookIndexComponent } from '../components/index/index';
import { CoreCourseModuleHandler, CoreCourseModuleHandlerData } from '@core/course/providers/module-delegate';
import { CoreCourseProvider } from '@core/course/providers/course';
import { CoreConstants } from '@core/constants';
/**
* Handler to support book modules.
@ -27,6 +28,18 @@ export class AddonModBookModuleHandler implements CoreCourseModuleHandler {
name = 'AddonModBook';
modName = 'book';
supportedFeatures = {
[CoreConstants.FEATURE_MOD_ARCHETYPE]: CoreConstants.MOD_ARCHETYPE_RESOURCE,
[CoreConstants.FEATURE_GROUPS]: false,
[CoreConstants.FEATURE_GROUPINGS]: false,
[CoreConstants.FEATURE_MOD_INTRO]: true,
[CoreConstants.FEATURE_COMPLETION_TRACKS_VIEWS]: true,
[CoreConstants.FEATURE_GRADE_HAS_GRADE]: false,
[CoreConstants.FEATURE_GRADE_OUTCOMES]: false,
[CoreConstants.FEATURE_BACKUP_MOODLE2]: true,
[CoreConstants.FEATURE_SHOW_DESCRIPTION]: true
};
constructor(protected bookProvider: AddonModBookProvider, private courseProvider: CoreCourseProvider) { }
/**

View File

@ -18,6 +18,7 @@ import { CoreCourseModuleDelegate } from '@core/course/providers/module-delegate
import { AddonModChatComponentsModule } from './components/components.module';
import { AddonModChatProvider } from './providers/chat';
import { AddonModChatLinkHandler } from './providers/link-handler';
import { AddonModChatListLinkHandler } from './providers/list-link-handler';
import { AddonModChatModuleHandler } from './providers/module-handler';
// List of providers (without handlers).
@ -34,13 +35,17 @@ export const ADDON_MOD_CHAT_PROVIDERS: any[] = [
providers: [
AddonModChatProvider,
AddonModChatLinkHandler,
AddonModChatListLinkHandler,
AddonModChatModuleHandler,
]
})
export class AddonModChatModule {
constructor(moduleDelegate: CoreCourseModuleDelegate, moduleHandler: AddonModChatModuleHandler,
contentLinksDelegate: CoreContentLinksDelegate, linkHandler: AddonModChatLinkHandler) {
contentLinksDelegate: CoreContentLinksDelegate, linkHandler: AddonModChatLinkHandler,
listLinkHandler: AddonModChatListLinkHandler) {
moduleDelegate.registerHandler(moduleHandler);
contentLinksDelegate.registerHandler(linkHandler);
contentLinksDelegate.registerHandler(listLinkHandler);
}
}

View File

@ -11,6 +11,7 @@
"messagebeepsyou": "{{$a}} has just beeped you!",
"messageenter": "{{$a}} has just entered this chat",
"messageexit": "{{$a}} has left this chat",
"modulenameplural": "Chats",
"mustbeonlinetosendmessages": "You must be online to send messages.",
"nomessages": "No messages yet",
"send": "Send",

View File

@ -0,0 +1,30 @@
// (C) Copyright 2015 Martin Dougiamas
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
import { Injectable } from '@angular/core';
import { CoreContentLinksModuleListHandler } from '@core/contentlinks/classes/module-list-handler';
import { CoreContentLinksHelperProvider } from '@core/contentlinks/providers/helper';
import { TranslateService } from '@ngx-translate/core';
/**
* Handler to treat links to chat list page.
*/
@Injectable()
export class AddonModChatListLinkHandler extends CoreContentLinksModuleListHandler {
name = 'AddonModChatListLinkHandler';
constructor(linkHelper: CoreContentLinksHelperProvider, translate: TranslateService) {
super(linkHelper, translate, 'AddonModChat', 'chat');
}
}

View File

@ -17,6 +17,7 @@ import { NavController, NavOptions } from 'ionic-angular';
import { AddonModChatIndexComponent } from '../components/index/index';
import { CoreCourseModuleHandler, CoreCourseModuleHandlerData } from '@core/course/providers/module-delegate';
import { CoreCourseProvider } from '@core/course/providers/course';
import { CoreConstants } from '@core/constants';
/**
* Handler to support chat modules.
@ -26,6 +27,17 @@ export class AddonModChatModuleHandler implements CoreCourseModuleHandler {
name = 'AddonModChat';
modName = 'chat';
supportedFeatures = {
[CoreConstants.FEATURE_GROUPS]: true,
[CoreConstants.FEATURE_GROUPINGS]: true,
[CoreConstants.FEATURE_MOD_INTRO]: true,
[CoreConstants.FEATURE_COMPLETION_TRACKS_VIEWS]: true,
[CoreConstants.FEATURE_GRADE_HAS_GRADE]: false,
[CoreConstants.FEATURE_GRADE_OUTCOMES]: true,
[CoreConstants.FEATURE_BACKUP_MOODLE2]: true,
[CoreConstants.FEATURE_SHOW_DESCRIPTION]: true
};
constructor(private courseProvider: CoreCourseProvider) { }
/**

View File

@ -21,6 +21,7 @@ import { AddonModChoiceComponentsModule } from './components/components.module';
import { AddonModChoiceModuleHandler } from './providers/module-handler';
import { AddonModChoiceProvider } from './providers/choice';
import { AddonModChoiceLinkHandler } from './providers/link-handler';
import { AddonModChoiceListLinkHandler } from './providers/list-link-handler';
import { AddonModChoicePrefetchHandler } from './providers/prefetch-handler';
import { AddonModChoiceSyncProvider } from './providers/sync';
import { AddonModChoiceSyncCronHandler } from './providers/sync-cron-handler';
@ -47,6 +48,7 @@ export const ADDON_MOD_CHOICE_PROVIDERS: any[] = [
AddonModChoiceModuleHandler,
AddonModChoicePrefetchHandler,
AddonModChoiceLinkHandler,
AddonModChoiceListLinkHandler,
AddonModChoiceSyncCronHandler
]
})
@ -54,10 +56,13 @@ export class AddonModChoiceModule {
constructor(moduleDelegate: CoreCourseModuleDelegate, moduleHandler: AddonModChoiceModuleHandler,
prefetchDelegate: CoreCourseModulePrefetchDelegate, prefetchHandler: AddonModChoicePrefetchHandler,
contentLinksDelegate: CoreContentLinksDelegate, linkHandler: AddonModChoiceLinkHandler,
cronDelegate: CoreCronDelegate, syncHandler: AddonModChoiceSyncCronHandler, updateManager: CoreUpdateManagerProvider) {
cronDelegate: CoreCronDelegate, syncHandler: AddonModChoiceSyncCronHandler, updateManager: CoreUpdateManagerProvider,
listLinkHandler: AddonModChoiceListLinkHandler) {
moduleDelegate.registerHandler(moduleHandler);
prefetchDelegate.registerHandler(prefetchHandler);
contentLinksDelegate.registerHandler(linkHandler);
contentLinksDelegate.registerHandler(listLinkHandler);
cronDelegate.register(syncHandler);
// Allow migrating the tables from the old app to the new schema.

View File

@ -4,6 +4,7 @@
"errorgetchoice": "Error getting choice data.",
"expired": "Sorry, this activity closed on {{$a}} and is no longer available",
"full": "(Full)",
"modulenameplural": "Choices",
"noresultsviewable": "The results are not currently viewable.",
"notopenyet": "Sorry, this activity is not available until {{$a}}",
"numberofuser": "Number of responses",

View File

@ -0,0 +1,30 @@
// (C) Copyright 2015 Martin Dougiamas
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
import { Injectable } from '@angular/core';
import { CoreContentLinksModuleListHandler } from '@core/contentlinks/classes/module-list-handler';
import { CoreContentLinksHelperProvider } from '@core/contentlinks/providers/helper';
import { TranslateService } from '@ngx-translate/core';
/**
* Handler to treat links to choice list page.
*/
@Injectable()
export class AddonModChoiceListLinkHandler extends CoreContentLinksModuleListHandler {
name = 'AddonModChoiceListLinkHandler';
constructor(linkHelper: CoreContentLinksHelperProvider, translate: TranslateService) {
super(linkHelper, translate, 'AddonModChoice', 'choice');
}
}

View File

@ -17,6 +17,7 @@ import { NavController, NavOptions } from 'ionic-angular';
import { AddonModChoiceIndexComponent } from '../components/index/index';
import { CoreCourseModuleHandler, CoreCourseModuleHandlerData } from '@core/course/providers/module-delegate';
import { CoreCourseProvider } from '@core/course/providers/course';
import { CoreConstants } from '@core/constants';
/**
* Handler to support choice modules.
@ -26,6 +27,18 @@ export class AddonModChoiceModuleHandler implements CoreCourseModuleHandler {
name = 'AddonModChoice';
modName = 'choice';
supportedFeatures = {
[CoreConstants.FEATURE_GROUPS]: true,
[CoreConstants.FEATURE_GROUPINGS]: true,
[CoreConstants.FEATURE_MOD_INTRO]: true,
[CoreConstants.FEATURE_COMPLETION_TRACKS_VIEWS]: true,
[CoreConstants.FEATURE_COMPLETION_HAS_RULES]: true,
[CoreConstants.FEATURE_GRADE_HAS_GRADE]: false,
[CoreConstants.FEATURE_GRADE_OUTCOMES]: false,
[CoreConstants.FEATURE_BACKUP_MOODLE2]: true,
[CoreConstants.FEATURE_SHOW_DESCRIPTION]: true
};
constructor(private courseProvider: CoreCourseProvider) { }
/**

View File

@ -25,6 +25,7 @@ import { AddonModDataApproveLinkHandler } from './providers/approve-link-handler
import { AddonModDataDeleteLinkHandler } from './providers/delete-link-handler';
import { AddonModDataShowLinkHandler } from './providers/show-link-handler';
import { AddonModDataEditLinkHandler } from './providers/edit-link-handler';
import { AddonModDataListLinkHandler } from './providers/list-link-handler';
import { AddonModDataHelperProvider } from './providers/helper';
import { AddonModDataPrefetchHandler } from './providers/prefetch-handler';
import { AddonModDataSyncProvider } from './providers/sync';
@ -64,6 +65,7 @@ export const ADDON_MOD_DATA_PROVIDERS: any[] = [
AddonModDataDeleteLinkHandler,
AddonModDataShowLinkHandler,
AddonModDataEditLinkHandler,
AddonModDataListLinkHandler,
AddonModDataSyncCronHandler,
AddonModDataDefaultFieldHandler
]
@ -74,7 +76,9 @@ export class AddonModDataModule {
contentLinksDelegate: CoreContentLinksDelegate, linkHandler: AddonModDataLinkHandler,
cronDelegate: CoreCronDelegate, syncHandler: AddonModDataSyncCronHandler, updateManager: CoreUpdateManagerProvider,
approveLinkHandler: AddonModDataApproveLinkHandler, deleteLinkHandler: AddonModDataDeleteLinkHandler,
showLinkHandler: AddonModDataShowLinkHandler, editLinkHandler: AddonModDataEditLinkHandler) {
showLinkHandler: AddonModDataShowLinkHandler, editLinkHandler: AddonModDataEditLinkHandler,
listLinkHandler: AddonModDataListLinkHandler) {
moduleDelegate.registerHandler(moduleHandler);
prefetchDelegate.registerHandler(prefetchHandler);
contentLinksDelegate.registerHandler(linkHandler);
@ -82,6 +86,7 @@ export class AddonModDataModule {
contentLinksDelegate.registerHandler(deleteLinkHandler);
contentLinksDelegate.registerHandler(showLinkHandler);
contentLinksDelegate.registerHandler(editLinkHandler);
contentLinksDelegate.registerHandler(listLinkHandler);
cronDelegate.register(syncHandler);
// Allow migrating the tables from the old app to the new schema.

View File

@ -20,6 +20,7 @@
"fields": "Fields",
"latlongboth": "Both latitude and longitude are required.",
"menuchoose": "Choose...",
"modulenameplural": "Databases",
"more": "More",
"nomatch": "No matching entries found!",
"norecords": "No entries in database",

View File

@ -0,0 +1,41 @@
// (C) Copyright 2015 Martin Dougiamas
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
import { Injectable } from '@angular/core';
import { CoreContentLinksModuleListHandler } from '@core/contentlinks/classes/module-list-handler';
import { CoreContentLinksHelperProvider } from '@core/contentlinks/providers/helper';
import { TranslateService } from '@ngx-translate/core';
import { AddonModDataProvider } from './data';
/**
* Handler to treat links to data list page.
*/
@Injectable()
export class AddonModDataListLinkHandler extends CoreContentLinksModuleListHandler {
name = 'AddonModDataListLinkHandler';
constructor(linkHelper: CoreContentLinksHelperProvider, translate: TranslateService,
protected dataProvider: AddonModDataProvider) {
super(linkHelper, translate, 'AddonModData', 'data');
}
/**
* Check if the handler is enabled on a site level.
*
* @return {Promise<boolean>} Whether or not the handler is enabled on a site level.
*/
isEnabled(): Promise<boolean> {
return this.dataProvider.isPluginEnabled();
}
}

View File

@ -18,6 +18,7 @@ import { AddonModDataIndexComponent } from '../components/index/index';
import { CoreCourseModuleHandler, CoreCourseModuleHandlerData } from '@core/course/providers/module-delegate';
import { CoreCourseProvider } from '@core/course/providers/course';
import { AddonModDataProvider } from './data';
import { CoreConstants } from '@core/constants';
/**
* Handler to support data modules.
@ -27,6 +28,20 @@ export class AddonModDataModuleHandler implements CoreCourseModuleHandler {
name = 'AddonModData';
modName = 'data';
supportedFeatures = {
[CoreConstants.FEATURE_GROUPS]: true,
[CoreConstants.FEATURE_GROUPINGS]: true,
[CoreConstants.FEATURE_MOD_INTRO]: true,
[CoreConstants.FEATURE_COMPLETION_TRACKS_VIEWS]: true,
[CoreConstants.FEATURE_COMPLETION_HAS_RULES]: true,
[CoreConstants.FEATURE_GRADE_HAS_GRADE]: true,
[CoreConstants.FEATURE_GRADE_OUTCOMES]: true,
[CoreConstants.FEATURE_BACKUP_MOODLE2]: true,
[CoreConstants.FEATURE_SHOW_DESCRIPTION]: true,
[CoreConstants.FEATURE_RATE]: true,
[CoreConstants.FEATURE_COMMENT]: true
};
constructor(private courseProvider: CoreCourseProvider, private dataProvider: AddonModDataProvider) { }
/**

View File

@ -26,6 +26,7 @@ import { AddonModFeedbackShowEntriesLinkHandler } from './providers/show-entries
import { AddonModFeedbackShowNonRespondentsLinkHandler } from './providers/show-non-respondents-link-handler';
import { AddonModFeedbackCompleteLinkHandler } from './providers/complete-link-handler';
import { AddonModFeedbackPrintLinkHandler } from './providers/print-link-handler';
import { AddonModFeedbackListLinkHandler } from './providers/list-link-handler';
import { AddonModFeedbackHelperProvider } from './providers/helper';
import { AddonModFeedbackPrefetchHandler } from './providers/prefetch-handler';
import { AddonModFeedbackSyncProvider } from './providers/sync';
@ -60,6 +61,7 @@ export const ADDON_MOD_FEEDBACK_PROVIDERS: any[] = [
AddonModFeedbackShowNonRespondentsLinkHandler,
AddonModFeedbackCompleteLinkHandler,
AddonModFeedbackPrintLinkHandler,
AddonModFeedbackListLinkHandler,
AddonModFeedbackSyncCronHandler
]
})
@ -72,7 +74,8 @@ export class AddonModFeedbackModule {
showEntriesLinkHandler: AddonModFeedbackShowEntriesLinkHandler,
showNonRespondentsLinkHandler: AddonModFeedbackShowNonRespondentsLinkHandler,
completeLinkHandler: AddonModFeedbackCompleteLinkHandler,
printLinkHandler: AddonModFeedbackPrintLinkHandler) {
printLinkHandler: AddonModFeedbackPrintLinkHandler, listLinkHandler: AddonModFeedbackListLinkHandler) {
moduleDelegate.registerHandler(moduleHandler);
prefetchDelegate.registerHandler(prefetchHandler);
contentLinksDelegate.registerHandler(linkHandler);
@ -81,6 +84,7 @@ export class AddonModFeedbackModule {
contentLinksDelegate.registerHandler(showNonRespondentsLinkHandler);
contentLinksDelegate.registerHandler(completeLinkHandler);
contentLinksDelegate.registerHandler(printLinkHandler);
contentLinksDelegate.registerHandler(listLinkHandler);
cronDelegate.register(syncHandler);
// Allow migrating the tables from the old app to the new schema.

View File

@ -13,6 +13,7 @@
"feedback_submitted_offline": "This feedback has been saved to be submitted later.",
"mapcourses": "Map feedback to courses",
"mode": "Mode",
"modulenameplural": "Feedback",
"next_page": "Next page",
"non_anonymous": "User's name will be logged and shown with answers",
"non_anonymous_entries": "Non anonymous entries ({{$a}})",

View File

@ -0,0 +1,41 @@
// (C) Copyright 2015 Martin Dougiamas
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
import { Injectable } from '@angular/core';
import { CoreContentLinksModuleListHandler } from '@core/contentlinks/classes/module-list-handler';
import { CoreContentLinksHelperProvider } from '@core/contentlinks/providers/helper';
import { TranslateService } from '@ngx-translate/core';
import { AddonModFeedbackProvider } from './feedback';
/**
* Handler to treat links to feedback list page.
*/
@Injectable()
export class AddonModFeedbackListLinkHandler extends CoreContentLinksModuleListHandler {
name = 'AddonModFeedbackListLinkHandler';
constructor(linkHelper: CoreContentLinksHelperProvider, translate: TranslateService,
protected feedbackProvider: AddonModFeedbackProvider) {
super(linkHelper, translate, 'AddonModFeedback', 'feedback');
}
/**
* Check if the handler is enabled on a site level.
*
* @return {Promise<boolean>} Whether or not the handler is enabled on a site level.
*/
isEnabled(): Promise<boolean> {
return this.feedbackProvider.isPluginEnabled();
}
}

View File

@ -18,6 +18,7 @@ import { AddonModFeedbackIndexComponent } from '../components/index/index';
import { CoreCourseModuleHandler, CoreCourseModuleHandlerData } from '@core/course/providers/module-delegate';
import { CoreCourseProvider } from '@core/course/providers/course';
import { AddonModFeedbackProvider } from './feedback';
import { CoreConstants } from '@core/constants';
/**
* Handler to support feedback modules.
@ -27,6 +28,18 @@ export class AddonModFeedbackModuleHandler implements CoreCourseModuleHandler {
name = 'AddonModFeedback';
modName = 'feedback';
supportedFeatures = {
[CoreConstants.FEATURE_GROUPS]: true,
[CoreConstants.FEATURE_GROUPINGS]: true,
[CoreConstants.FEATURE_MOD_INTRO]: true,
[CoreConstants.FEATURE_COMPLETION_TRACKS_VIEWS]: true,
[CoreConstants.FEATURE_COMPLETION_HAS_RULES]: true,
[CoreConstants.FEATURE_GRADE_HAS_GRADE]: false,
[CoreConstants.FEATURE_GRADE_OUTCOMES]: false,
[CoreConstants.FEATURE_BACKUP_MOODLE2]: true,
[CoreConstants.FEATURE_SHOW_DESCRIPTION]: true
};
constructor(private courseProvider: CoreCourseProvider, private feedbackProvider: AddonModFeedbackProvider) { }
/**

View File

@ -20,6 +20,7 @@ import { CoreCourseModuleDelegate } from '@core/course/providers/module-delegate
import { AddonModFolderComponentsModule } from './components/components.module';
import { AddonModFolderPrefetchHandler } from './providers/prefetch-handler';
import { AddonModFolderLinkHandler } from './providers/link-handler';
import { AddonModFolderListLinkHandler } from './providers/list-link-handler';
import { AddonModFolderPluginFileHandler } from './providers/pluginfile-handler';
import { CoreContentLinksDelegate } from '@core/contentlinks/providers/delegate';
import { CoreCourseModulePrefetchDelegate } from '@core/course/providers/module-prefetch-delegate';
@ -43,6 +44,7 @@ export const ADDON_MOD_FOLDER_PROVIDERS: any[] = [
AddonModFolderModuleHandler,
AddonModFolderPrefetchHandler,
AddonModFolderLinkHandler,
AddonModFolderListLinkHandler,
AddonModFolderPluginFileHandler
]
})
@ -50,10 +52,13 @@ export class AddonModFolderModule {
constructor(moduleDelegate: CoreCourseModuleDelegate, moduleHandler: AddonModFolderModuleHandler,
prefetchDelegate: CoreCourseModulePrefetchDelegate, prefetchHandler: AddonModFolderPrefetchHandler,
contentLinksDelegate: CoreContentLinksDelegate, linkHandler: AddonModFolderLinkHandler,
pluginfileDelegate: CorePluginFileDelegate, pluginfileHandler: AddonModFolderPluginFileHandler) {
pluginfileDelegate: CorePluginFileDelegate, pluginfileHandler: AddonModFolderPluginFileHandler,
listLinkHandler: AddonModFolderListLinkHandler) {
moduleDelegate.registerHandler(moduleHandler);
prefetchDelegate.registerHandler(prefetchHandler);
contentLinksDelegate.registerHandler(linkHandler);
contentLinksDelegate.registerHandler(listLinkHandler);
pluginfileDelegate.registerHandler(pluginfileHandler);
}
}

View File

@ -1,3 +1,4 @@
{
"emptyfilelist": "There are no files to show."
"emptyfilelist": "There are no files to show.",
"modulenameplural": "Folders"
}

View File

@ -0,0 +1,30 @@
// (C) Copyright 2015 Martin Dougiamas
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
import { Injectable } from '@angular/core';
import { CoreContentLinksModuleListHandler } from '@core/contentlinks/classes/module-list-handler';
import { CoreContentLinksHelperProvider } from '@core/contentlinks/providers/helper';
import { TranslateService } from '@ngx-translate/core';
/**
* Handler to treat links to folder list page.
*/
@Injectable()
export class AddonModFolderListLinkHandler extends CoreContentLinksModuleListHandler {
name = 'AddonModFolderListLinkHandler';
constructor(linkHelper: CoreContentLinksHelperProvider, translate: TranslateService) {
super(linkHelper, translate, 'AddonModFolder', 'folder');
}
}

View File

@ -17,6 +17,7 @@ import { NavController, NavOptions } from 'ionic-angular';
import { AddonModFolderIndexComponent } from '../components/index/index';
import { CoreCourseModuleHandler, CoreCourseModuleHandlerData } from '@core/course/providers/module-delegate';
import { CoreCourseProvider } from '@core/course/providers/course';
import { CoreConstants } from '@core/constants';
/**
* Handler to support folder modules.
@ -26,6 +27,18 @@ export class AddonModFolderModuleHandler implements CoreCourseModuleHandler {
name = 'AddonModFolder';
modName = 'folder';
supportedFeatures = {
[CoreConstants.FEATURE_MOD_ARCHETYPE]: CoreConstants.MOD_ARCHETYPE_RESOURCE,
[CoreConstants.FEATURE_GROUPS]: false,
[CoreConstants.FEATURE_GROUPINGS]: false,
[CoreConstants.FEATURE_MOD_INTRO]: true,
[CoreConstants.FEATURE_COMPLETION_TRACKS_VIEWS]: true,
[CoreConstants.FEATURE_GRADE_HAS_GRADE]: false,
[CoreConstants.FEATURE_GRADE_OUTCOMES]: false,
[CoreConstants.FEATURE_BACKUP_MOODLE2]: true,
[CoreConstants.FEATURE_SHOW_DESCRIPTION]: true
};
constructor(private courseProvider: CoreCourseProvider) { }
/**

View File

@ -26,6 +26,7 @@ import { AddonModForumPrefetchHandler } from './providers/prefetch-handler';
import { AddonModForumSyncCronHandler } from './providers/sync-cron-handler';
import { AddonModForumIndexLinkHandler } from './providers/index-link-handler';
import { AddonModForumDiscussionLinkHandler } from './providers/discussion-link-handler';
import { AddonModForumListLinkHandler } from './providers/list-link-handler';
import { AddonModForumComponentsModule } from './components/components.module';
import { CoreUpdateManagerProvider } from '@providers/update-manager';
@ -52,6 +53,7 @@ export const ADDON_MOD_FORUM_PROVIDERS: any[] = [
AddonModForumPrefetchHandler,
AddonModForumSyncCronHandler,
AddonModForumIndexLinkHandler,
AddonModForumListLinkHandler,
AddonModForumDiscussionLinkHandler
]
})
@ -60,13 +62,14 @@ export class AddonModForumModule {
prefetchDelegate: CoreCourseModulePrefetchDelegate, prefetchHandler: AddonModForumPrefetchHandler,
cronDelegate: CoreCronDelegate, syncHandler: AddonModForumSyncCronHandler, linksDelegate: CoreContentLinksDelegate,
indexHandler: AddonModForumIndexLinkHandler, discussionHandler: AddonModForumDiscussionLinkHandler,
updateManager: CoreUpdateManagerProvider) {
updateManager: CoreUpdateManagerProvider, listLinkHandler: AddonModForumListLinkHandler) {
moduleDelegate.registerHandler(moduleHandler);
prefetchDelegate.registerHandler(prefetchHandler);
cronDelegate.register(syncHandler);
linksDelegate.registerHandler(indexHandler);
linksDelegate.registerHandler(discussionHandler);
linksDelegate.registerHandler(listLinkHandler);
// Allow migrating the tables from the old app to the new schema.
updateManager.registerSiteTablesMigration([

View File

@ -21,6 +21,7 @@
"modeflatnewestfirst": "Display replies flat, with newest first",
"modeflatoldestfirst": "Display replies flat, with oldest first",
"modenested": "Display replies in nested form",
"modulenameplural": "Forums",
"numdiscussions": "{{numdiscussions}} discussions",
"numreplies": "{{numreplies}} replies",
"posttoforum": "Post to forum",

View File

@ -0,0 +1,30 @@
// (C) Copyright 2015 Martin Dougiamas
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
import { Injectable } from '@angular/core';
import { CoreContentLinksModuleListHandler } from '@core/contentlinks/classes/module-list-handler';
import { CoreContentLinksHelperProvider } from '@core/contentlinks/providers/helper';
import { TranslateService } from '@ngx-translate/core';
/**
* Handler to treat links to forum list page.
*/
@Injectable()
export class AddonModForumListLinkHandler extends CoreContentLinksModuleListHandler {
name = 'AddonModForumListLinkHandler';
constructor(linkHelper: CoreContentLinksHelperProvider, translate: TranslateService) {
super(linkHelper, translate, 'AddonModForum', 'forum');
}
}

View File

@ -21,6 +21,7 @@ import { CoreCourseModuleHandler, CoreCourseModuleHandlerData } from '@core/cour
import { CoreCourseProvider } from '@core/course/providers/course';
import { AddonModForumProvider } from './forum';
import { AddonModForumIndexComponent } from '../components/index/index';
import { CoreConstants } from '@core/constants';
/**
* Handler to support forum modules.
@ -30,6 +31,20 @@ export class AddonModForumModuleHandler implements CoreCourseModuleHandler {
name = 'AddonModForum';
modName = 'forum';
supportedFeatures = {
[CoreConstants.FEATURE_GROUPS]: true,
[CoreConstants.FEATURE_GROUPINGS]: true,
[CoreConstants.FEATURE_MOD_INTRO]: true,
[CoreConstants.FEATURE_COMPLETION_TRACKS_VIEWS]: true,
[CoreConstants.FEATURE_COMPLETION_HAS_RULES]: true,
[CoreConstants.FEATURE_GRADE_HAS_GRADE]: true,
[CoreConstants.FEATURE_GRADE_OUTCOMES]: true,
[CoreConstants.FEATURE_BACKUP_MOODLE2]: true,
[CoreConstants.FEATURE_SHOW_DESCRIPTION]: true,
[CoreConstants.FEATURE_RATE]: true,
[CoreConstants.FEATURE_PLAGIARISM]: true
};
constructor(private courseProvider: CoreCourseProvider, private forumProvider: AddonModForumProvider,
private translate: TranslateService, private eventsProvider: CoreEventsProvider,
private sitesProvider: CoreSitesProvider) {}

View File

@ -26,6 +26,7 @@ import { AddonModGlossaryPrefetchHandler } from './providers/prefetch-handler';
import { AddonModGlossarySyncCronHandler } from './providers/sync-cron-handler';
import { AddonModGlossaryIndexLinkHandler } from './providers/index-link-handler';
import { AddonModGlossaryEntryLinkHandler } from './providers/entry-link-handler';
import { AddonModGlossaryListLinkHandler } from './providers/list-link-handler';
import { AddonModGlossaryComponentsModule } from './components/components.module';
import { CoreUpdateManagerProvider } from '@providers/update-manager';
@ -53,6 +54,7 @@ export const ADDON_MOD_GLOSSARY_PROVIDERS: any[] = [
AddonModGlossarySyncCronHandler,
AddonModGlossaryIndexLinkHandler,
AddonModGlossaryEntryLinkHandler,
AddonModGlossaryListLinkHandler
]
})
export class AddonModGlossaryModule {
@ -60,13 +62,14 @@ export class AddonModGlossaryModule {
prefetchDelegate: CoreCourseModulePrefetchDelegate, prefetchHandler: AddonModGlossaryPrefetchHandler,
cronDelegate: CoreCronDelegate, syncHandler: AddonModGlossarySyncCronHandler, linksDelegate: CoreContentLinksDelegate,
indexHandler: AddonModGlossaryIndexLinkHandler, discussionHandler: AddonModGlossaryEntryLinkHandler,
updateManager: CoreUpdateManagerProvider) {
updateManager: CoreUpdateManagerProvider, listLinkHandler: AddonModGlossaryListLinkHandler) {
moduleDelegate.registerHandler(moduleHandler);
prefetchDelegate.registerHandler(prefetchHandler);
cronDelegate.register(syncHandler);
linksDelegate.registerHandler(indexHandler);
linksDelegate.registerHandler(discussionHandler);
linksDelegate.registerHandler(listLinkHandler);
// Allow migrating the tables from the old app to the new schema.
updateManager.registerSiteTableMigration({

View File

@ -24,6 +24,7 @@
"fillfields": "Concept and definition are mandatory fields.",
"fullmatch": "Match whole words only",
"linking": "Auto-linking",
"modulenameplural": "Glossaries",
"noentriesfound": "No entries were found.",
"searchquery": "Search query"
}

View File

@ -0,0 +1,30 @@
// (C) Copyright 2015 Martin Dougiamas
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
import { Injectable } from '@angular/core';
import { CoreContentLinksModuleListHandler } from '@core/contentlinks/classes/module-list-handler';
import { CoreContentLinksHelperProvider } from '@core/contentlinks/providers/helper';
import { TranslateService } from '@ngx-translate/core';
/**
* Handler to treat links to glossary list page.
*/
@Injectable()
export class AddonModGlossaryListLinkHandler extends CoreContentLinksModuleListHandler {
name = 'AddonModGlossaryListLinkHandler';
constructor(linkHelper: CoreContentLinksHelperProvider, translate: TranslateService) {
super(linkHelper, translate, 'AddonModGlossary', 'glossary');
}
}

View File

@ -17,6 +17,7 @@ import { NavController, NavOptions } from 'ionic-angular';
import { AddonModGlossaryIndexComponent } from '../components/index/index';
import { CoreCourseModuleHandler, CoreCourseModuleHandlerData } from '@core/course/providers/module-delegate';
import { CoreCourseProvider } from '@core/course/providers/course';
import { CoreConstants } from '@core/constants';
/**
* Handler to support glossary modules.
@ -26,6 +27,20 @@ export class AddonModGlossaryModuleHandler implements CoreCourseModuleHandler {
name = 'AddonModGlossary';
modName = 'glossary';
supportedFeatures = {
[CoreConstants.FEATURE_GROUPS]: false,
[CoreConstants.FEATURE_GROUPINGS]: false,
[CoreConstants.FEATURE_MOD_INTRO]: true,
[CoreConstants.FEATURE_COMPLETION_TRACKS_VIEWS]: true,
[CoreConstants.FEATURE_COMPLETION_HAS_RULES]: true,
[CoreConstants.FEATURE_GRADE_HAS_GRADE]: true,
[CoreConstants.FEATURE_GRADE_OUTCOMES]: true,
[CoreConstants.FEATURE_BACKUP_MOODLE2]: true,
[CoreConstants.FEATURE_SHOW_DESCRIPTION]: true,
[CoreConstants.FEATURE_RATE]: true,
[CoreConstants.FEATURE_PLAGIARISM]: true
};
constructor(private courseProvider: CoreCourseProvider) { }
/**

View File

@ -18,6 +18,7 @@ import { AddonModImscpModuleHandler } from './providers/module-handler';
import { AddonModImscpProvider } from './providers/imscp';
import { AddonModImscpPrefetchHandler } from './providers/prefetch-handler';
import { AddonModImscpLinkHandler } from './providers/link-handler';
import { AddonModImscpListLinkHandler } from './providers/list-link-handler';
import { AddonModImscpPluginFileHandler } from './providers/pluginfile-handler';
import { CoreContentLinksDelegate } from '@core/contentlinks/providers/delegate';
import { CoreCourseModuleDelegate } from '@core/course/providers/module-delegate';
@ -40,6 +41,7 @@ export const ADDON_MOD_IMSCP_PROVIDERS: any[] = [
AddonModImscpModuleHandler,
AddonModImscpPrefetchHandler,
AddonModImscpLinkHandler,
AddonModImscpListLinkHandler,
AddonModImscpPluginFileHandler
]
})
@ -47,10 +49,13 @@ export class AddonModImscpModule {
constructor(moduleDelegate: CoreCourseModuleDelegate, moduleHandler: AddonModImscpModuleHandler,
prefetchDelegate: CoreCourseModulePrefetchDelegate, prefetchHandler: AddonModImscpPrefetchHandler,
contentLinksDelegate: CoreContentLinksDelegate, linkHandler: AddonModImscpLinkHandler,
pluginfileDelegate: CorePluginFileDelegate, pluginfileHandler: AddonModImscpPluginFileHandler) {
pluginfileDelegate: CorePluginFileDelegate, pluginfileHandler: AddonModImscpPluginFileHandler,
listLinkHandler: AddonModImscpListLinkHandler) {
moduleDelegate.registerHandler(moduleHandler);
prefetchDelegate.registerHandler(prefetchHandler);
contentLinksDelegate.registerHandler(linkHandler);
contentLinksDelegate.registerHandler(listLinkHandler);
pluginfileDelegate.registerHandler(pluginfileHandler);
}
}

View File

@ -1,4 +1,5 @@
{
"deploymenterror": "Content package error!",
"modulenameplural": "IMS content packages",
"showmoduledescription": "Show description"
}

View File

@ -0,0 +1,41 @@
// (C) Copyright 2015 Martin Dougiamas
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
import { Injectable } from '@angular/core';
import { CoreContentLinksModuleListHandler } from '@core/contentlinks/classes/module-list-handler';
import { CoreContentLinksHelperProvider } from '@core/contentlinks/providers/helper';
import { TranslateService } from '@ngx-translate/core';
import { AddonModImscpProvider } from './imscp';
/**
* Handler to treat links to IMSCP list page.
*/
@Injectable()
export class AddonModImscpListLinkHandler extends CoreContentLinksModuleListHandler {
name = 'AddonModImscpListLinkHandler';
constructor(linkHelper: CoreContentLinksHelperProvider, translate: TranslateService,
protected imscpProvider: AddonModImscpProvider) {
super(linkHelper, translate, 'AddonModImscp', 'imscp');
}
/**
* Check if the handler is enabled on a site level.
*
* @return {boolean|Promise<boolean>} Whether or not the handler is enabled on a site level.
*/
isEnabled(): boolean | Promise<boolean> {
return this.imscpProvider.isPluginEnabled();
}
}

View File

@ -18,6 +18,7 @@ import { CoreCourseModuleHandler, CoreCourseModuleHandlerData } from '@core/cour
import { CoreCourseProvider } from '@core/course/providers/course';
import { AddonModImscpIndexComponent } from '../components/index/index';
import { AddonModImscpProvider } from './imscp';
import { CoreConstants } from '@core/constants';
/**
* Handler to support IMSCP modules.
@ -27,6 +28,18 @@ export class AddonModImscpModuleHandler implements CoreCourseModuleHandler {
name = 'AddonModImscp';
modName = 'imscp';
supportedFeatures = {
[CoreConstants.FEATURE_MOD_ARCHETYPE]: CoreConstants.MOD_ARCHETYPE_RESOURCE,
[CoreConstants.FEATURE_GROUPS]: false,
[CoreConstants.FEATURE_GROUPINGS]: false,
[CoreConstants.FEATURE_MOD_INTRO]: true,
[CoreConstants.FEATURE_COMPLETION_TRACKS_VIEWS]: true,
[CoreConstants.FEATURE_GRADE_HAS_GRADE]: false,
[CoreConstants.FEATURE_GRADE_OUTCOMES]: false,
[CoreConstants.FEATURE_BACKUP_MOODLE2]: true,
[CoreConstants.FEATURE_SHOW_DESCRIPTION]: true
};
constructor(private courseProvider: CoreCourseProvider, protected imscpProvider: AddonModImscpProvider) { }
/**

View File

@ -14,6 +14,7 @@
import { Injectable, Injector } from '@angular/core';
import { CoreCourseModuleHandler, CoreCourseModuleHandlerData } from '@core/course/providers/module-delegate';
import { CoreConstants } from '@core/constants';
/**
* Handler to support label modules.
@ -23,6 +24,19 @@ export class AddonModLabelModuleHandler implements CoreCourseModuleHandler {
name = 'AddonModLabel';
modName = 'label';
supportedFeatures = {
[CoreConstants.FEATURE_MOD_ARCHETYPE]: CoreConstants.MOD_ARCHETYPE_RESOURCE,
[CoreConstants.FEATURE_IDNUMBER]: true,
[CoreConstants.FEATURE_GROUPS]: false,
[CoreConstants.FEATURE_GROUPINGS]: false,
[CoreConstants.FEATURE_MOD_INTRO]: true,
[CoreConstants.FEATURE_COMPLETION_TRACKS_VIEWS]: false,
[CoreConstants.FEATURE_GRADE_HAS_GRADE]: false,
[CoreConstants.FEATURE_GRADE_OUTCOMES]: false,
[CoreConstants.FEATURE_BACKUP_MOODLE2]: true,
[CoreConstants.FEATURE_SHOW_DESCRIPTION]: true
};
constructor() {
// Nothing to do.
}

View File

@ -41,6 +41,7 @@
"lowtime": "Low time",
"maximumnumberofattemptsreached": "Maximum number of attempts reached - Moving to next page",
"modattemptsnoteacher": "Student review only works for students.",
"modulenameplural": "Lessons",
"noanswer": "One or more questions have no answer given. Please go back and submit an answer.",
"nolessonattempts": "No attempts have been made on this lesson.",
"nolessonattemptsgroup": "No attempts have been made by {{$a}} group members on this lesson.",

View File

@ -28,6 +28,7 @@ import { AddonModLessonSyncCronHandler } from './providers/sync-cron-handler';
import { AddonModLessonIndexLinkHandler } from './providers/index-link-handler';
import { AddonModLessonGradeLinkHandler } from './providers/grade-link-handler';
import { AddonModLessonReportLinkHandler } from './providers/report-link-handler';
import { AddonModLessonListLinkHandler } from './providers/list-link-handler';
import { CoreUpdateManagerProvider } from '@providers/update-manager';
// List of providers (without handlers).
@ -54,7 +55,8 @@ export const ADDON_MOD_LESSON_PROVIDERS: any[] = [
AddonModLessonSyncCronHandler,
AddonModLessonIndexLinkHandler,
AddonModLessonGradeLinkHandler,
AddonModLessonReportLinkHandler
AddonModLessonReportLinkHandler,
AddonModLessonListLinkHandler
]
})
export class AddonModLessonModule {
@ -62,7 +64,8 @@ export class AddonModLessonModule {
prefetchDelegate: CoreCourseModulePrefetchDelegate, prefetchHandler: AddonModLessonPrefetchHandler,
cronDelegate: CoreCronDelegate, syncHandler: AddonModLessonSyncCronHandler, linksDelegate: CoreContentLinksDelegate,
indexHandler: AddonModLessonIndexLinkHandler, gradeHandler: AddonModLessonGradeLinkHandler,
reportHandler: AddonModLessonReportLinkHandler, updateManager: CoreUpdateManagerProvider) {
reportHandler: AddonModLessonReportLinkHandler, updateManager: CoreUpdateManagerProvider,
listLinkHandler: AddonModLessonListLinkHandler) {
moduleDelegate.registerHandler(moduleHandler);
prefetchDelegate.registerHandler(prefetchHandler);
@ -70,6 +73,7 @@ export class AddonModLessonModule {
linksDelegate.registerHandler(indexHandler);
linksDelegate.registerHandler(gradeHandler);
linksDelegate.registerHandler(reportHandler);
linksDelegate.registerHandler(listLinkHandler);
// Allow migrating the tables from the old app to the new schema.
updateManager.registerSiteTablesMigration([

View File

@ -0,0 +1,41 @@
// (C) Copyright 2015 Martin Dougiamas
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
import { Injectable } from '@angular/core';
import { CoreContentLinksModuleListHandler } from '@core/contentlinks/classes/module-list-handler';
import { CoreContentLinksHelperProvider } from '@core/contentlinks/providers/helper';
import { TranslateService } from '@ngx-translate/core';
import { AddonModLessonProvider } from './lesson';
/**
* Handler to treat links to lesson list page.
*/
@Injectable()
export class AddonModLessonListLinkHandler extends CoreContentLinksModuleListHandler {
name = 'AddonModLessonListLinkHandler';
constructor(linkHelper: CoreContentLinksHelperProvider, translate: TranslateService,
protected lessonProvider: AddonModLessonProvider) {
super(linkHelper, translate, 'AddonModLesson', 'lesson');
}
/**
* Check if the handler is enabled on a site level.
*
* @return {Promise<boolean>} Promise resolved with boolean: whether or not the handler is enabled on a site level.
*/
isEnabled(): Promise<boolean> {
return this.lessonProvider.isPluginEnabled();
}
}

View File

@ -18,6 +18,7 @@ import { AddonModLessonIndexComponent } from '../components/index/index';
import { CoreCourseModuleHandler, CoreCourseModuleHandlerData } from '@core/course/providers/module-delegate';
import { CoreCourseProvider } from '@core/course/providers/course';
import { AddonModLessonProvider } from './lesson';
import { CoreConstants } from '@core/constants';
/**
* Handler to support quiz modules.
@ -27,6 +28,18 @@ export class AddonModLessonModuleHandler implements CoreCourseModuleHandler {
name = 'AddonModLesson';
modName = 'lesson';
supportedFeatures = {
[CoreConstants.FEATURE_GROUPS]: true,
[CoreConstants.FEATURE_GROUPINGS]: true,
[CoreConstants.FEATURE_MOD_INTRO]: true,
[CoreConstants.FEATURE_COMPLETION_TRACKS_VIEWS]: true,
[CoreConstants.FEATURE_COMPLETION_HAS_RULES]: true,
[CoreConstants.FEATURE_GRADE_HAS_GRADE]: true,
[CoreConstants.FEATURE_GRADE_OUTCOMES]: true,
[CoreConstants.FEATURE_BACKUP_MOODLE2]: true,
[CoreConstants.FEATURE_SHOW_DESCRIPTION]: true
};
constructor(private courseProvider: CoreCourseProvider, private lessonProvider: AddonModLessonProvider) { }
/**

View File

@ -1,5 +1,6 @@
{
"errorgetlti": "Error getting module data.",
"errorinvalidlaunchurl": "The launch URL is not valid.",
"launchactivity": "Launch the activity"
"launchactivity": "Launch the activity",
"modulenameplural": "External tools"
}

View File

@ -17,6 +17,7 @@ import { AddonModLtiComponentsModule } from './components/components.module';
import { AddonModLtiModuleHandler } from './providers/module-handler';
import { AddonModLtiProvider } from './providers/lti';
import { AddonModLtiLinkHandler } from './providers/link-handler';
import { AddonModLtiListLinkHandler } from './providers/list-link-handler';
import { CoreContentLinksDelegate } from '@core/contentlinks/providers/delegate';
import { CoreCourseModuleDelegate } from '@core/course/providers/module-delegate';
@ -34,13 +35,17 @@ export const ADDON_MOD_LTI_PROVIDERS: any[] = [
providers: [
AddonModLtiProvider,
AddonModLtiModuleHandler,
AddonModLtiLinkHandler
AddonModLtiLinkHandler,
AddonModLtiListLinkHandler
]
})
export class AddonModLtiModule {
constructor(moduleDelegate: CoreCourseModuleDelegate, moduleHandler: AddonModLtiModuleHandler,
contentLinksDelegate: CoreContentLinksDelegate, linkHandler: AddonModLtiLinkHandler) {
contentLinksDelegate: CoreContentLinksDelegate, linkHandler: AddonModLtiLinkHandler,
listLinkHandler: AddonModLtiListLinkHandler) {
moduleDelegate.registerHandler(moduleHandler);
contentLinksDelegate.registerHandler(linkHandler);
contentLinksDelegate.registerHandler(listLinkHandler);
}
}

View File

@ -0,0 +1,30 @@
// (C) Copyright 2015 Martin Dougiamas
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
import { Injectable } from '@angular/core';
import { CoreContentLinksModuleListHandler } from '@core/contentlinks/classes/module-list-handler';
import { CoreContentLinksHelperProvider } from '@core/contentlinks/providers/helper';
import { TranslateService } from '@ngx-translate/core';
/**
* Handler to treat links to LTI list page.
*/
@Injectable()
export class AddonModLtiListLinkHandler extends CoreContentLinksModuleListHandler {
name = 'AddonModLtiListLinkHandler';
constructor(linkHelper: CoreContentLinksHelperProvider, translate: TranslateService) {
super(linkHelper, translate, 'AddonModLti', 'lti');
}
}

View File

@ -23,6 +23,7 @@ import { CoreFilepoolProvider } from '@providers/filepool';
import { CoreSitesProvider } from '@providers/sites';
import { AddonModLtiIndexComponent } from '../components/index/index';
import { AddonModLtiProvider } from './lti';
import { CoreConstants } from '@core/constants';
/**
* Handler to support LTI modules.
@ -32,6 +33,17 @@ export class AddonModLtiModuleHandler implements CoreCourseModuleHandler {
name = 'AddonModLti';
modName = 'lti';
supportedFeatures = {
[CoreConstants.FEATURE_GROUPS]: false,
[CoreConstants.FEATURE_GROUPINGS]: false,
[CoreConstants.FEATURE_MOD_INTRO]: true,
[CoreConstants.FEATURE_COMPLETION_TRACKS_VIEWS]: true,
[CoreConstants.FEATURE_GRADE_HAS_GRADE]: true,
[CoreConstants.FEATURE_GRADE_OUTCOMES]: true,
[CoreConstants.FEATURE_BACKUP_MOODLE2]: true,
[CoreConstants.FEATURE_SHOW_DESCRIPTION]: true
};
constructor(private appProvider: CoreAppProvider,
private courseProvider: CoreCourseProvider,
private domUtils: CoreDomUtilsProvider,

View File

@ -1,3 +1,4 @@
{
"errorwhileloadingthepage": "Error while loading the page content."
"errorwhileloadingthepage": "Error while loading the page content.",
"modulenameplural": "Pages"
}

View File

@ -18,6 +18,7 @@ import { AddonModPageModuleHandler } from './providers/module-handler';
import { AddonModPageProvider } from './providers/page';
import { AddonModPagePrefetchHandler } from './providers/prefetch-handler';
import { AddonModPageLinkHandler } from './providers/link-handler';
import { AddonModPageListLinkHandler } from './providers/list-link-handler';
import { AddonModPagePluginFileHandler } from './providers/pluginfile-handler';
import { AddonModPageHelperProvider } from './providers/helper';
import { CoreContentLinksDelegate } from '@core/contentlinks/providers/delegate';
@ -43,6 +44,7 @@ export const ADDON_MOD_PAGE_PROVIDERS: any[] = [
AddonModPageModuleHandler,
AddonModPagePrefetchHandler,
AddonModPageLinkHandler,
AddonModPageListLinkHandler,
AddonModPagePluginFileHandler
]
})
@ -50,10 +52,13 @@ export class AddonModPageModule {
constructor(moduleDelegate: CoreCourseModuleDelegate, moduleHandler: AddonModPageModuleHandler,
prefetchDelegate: CoreCourseModulePrefetchDelegate, prefetchHandler: AddonModPagePrefetchHandler,
contentLinksDelegate: CoreContentLinksDelegate, linkHandler: AddonModPageLinkHandler,
pluginfileDelegate: CorePluginFileDelegate, pluginfileHandler: AddonModPagePluginFileHandler) {
pluginfileDelegate: CorePluginFileDelegate, pluginfileHandler: AddonModPagePluginFileHandler,
listLinkHandler: AddonModPageListLinkHandler) {
moduleDelegate.registerHandler(moduleHandler);
prefetchDelegate.registerHandler(prefetchHandler);
contentLinksDelegate.registerHandler(linkHandler);
contentLinksDelegate.registerHandler(listLinkHandler);
pluginfileDelegate.registerHandler(pluginfileHandler);
}
}

View File

@ -0,0 +1,41 @@
// (C) Copyright 2015 Martin Dougiamas
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
import { Injectable } from '@angular/core';
import { CoreContentLinksModuleListHandler } from '@core/contentlinks/classes/module-list-handler';
import { CoreContentLinksHelperProvider } from '@core/contentlinks/providers/helper';
import { TranslateService } from '@ngx-translate/core';
import { AddonModPageProvider } from './page';
/**
* Handler to treat links to page list page.
*/
@Injectable()
export class AddonModPageListLinkHandler extends CoreContentLinksModuleListHandler {
name = 'AddonModPageListLinkHandler';
constructor(linkHelper: CoreContentLinksHelperProvider, translate: TranslateService,
protected pageProvider: AddonModPageProvider) {
super(linkHelper, translate, 'AddonModPage', 'page');
}
/**
* Check if the handler is enabled on a site level.
*
* @return {boolean|Promise<boolean>} Whether or not the handler is enabled on a site level.
*/
isEnabled(): boolean | Promise<boolean> {
return this.pageProvider.isPluginEnabled();
}
}

View File

@ -18,6 +18,7 @@ import { AddonModPageProvider } from './page';
import { AddonModPageIndexComponent } from '../components/index/index';
import { CoreCourseModuleHandler, CoreCourseModuleHandlerData } from '@core/course/providers/module-delegate';
import { CoreCourseProvider } from '@core/course/providers/course';
import { CoreConstants } from '@core/constants';
/**
* Handler to support page modules.
@ -27,6 +28,18 @@ export class AddonModPageModuleHandler implements CoreCourseModuleHandler {
name = 'AddonModPage';
modName = 'page';
supportedFeatures = {
[CoreConstants.FEATURE_MOD_ARCHETYPE]: CoreConstants.MOD_ARCHETYPE_RESOURCE,
[CoreConstants.FEATURE_GROUPS]: false,
[CoreConstants.FEATURE_GROUPINGS]: false,
[CoreConstants.FEATURE_MOD_INTRO]: true,
[CoreConstants.FEATURE_COMPLETION_TRACKS_VIEWS]: true,
[CoreConstants.FEATURE_GRADE_HAS_GRADE]: false,
[CoreConstants.FEATURE_GRADE_OUTCOMES]: false,
[CoreConstants.FEATURE_BACKUP_MOODLE2]: true,
[CoreConstants.FEATURE_SHOW_DESCRIPTION]: true
};
constructor(private courseProvider: CoreCourseProvider, protected pageProvider: AddonModPageProvider) { }
/**

View File

@ -33,6 +33,7 @@
"grademethod": "Grading method",
"gradesofar": "{{$a.method}}: {{$a.mygrade}} / {{$a.quizgrade}}.",
"marks": "Marks",
"modulenameplural": "Quizzes",
"mustbesubmittedby": "This attempt must be submitted by {{$a}}.",
"noquestions": "No questions have been added yet",
"noreviewattempt": "You are not allowed to review this attempt.",

View File

@ -0,0 +1,30 @@
// (C) Copyright 2015 Martin Dougiamas
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
import { Injectable } from '@angular/core';
import { CoreContentLinksModuleListHandler } from '@core/contentlinks/classes/module-list-handler';
import { CoreContentLinksHelperProvider } from '@core/contentlinks/providers/helper';
import { TranslateService } from '@ngx-translate/core';
/**
* Handler to treat links to quiz list page.
*/
@Injectable()
export class AddonModQuizListLinkHandler extends CoreContentLinksModuleListHandler {
name = 'AddonModQuizListLinkHandler';
constructor(linkHelper: CoreContentLinksHelperProvider, translate: TranslateService) {
super(linkHelper, translate, 'AddonModQuiz', 'quiz');
}
}

View File

@ -17,6 +17,7 @@ import { NavController, NavOptions } from 'ionic-angular';
import { AddonModQuizIndexComponent } from '../components/index/index';
import { CoreCourseModuleHandler, CoreCourseModuleHandlerData } from '@core/course/providers/module-delegate';
import { CoreCourseProvider } from '@core/course/providers/course';
import { CoreConstants } from '@core/constants';
/**
* Handler to support quiz modules.
@ -26,6 +27,20 @@ export class AddonModQuizModuleHandler implements CoreCourseModuleHandler {
name = 'AddonModQuiz';
modName = 'quiz';
supportedFeatures = {
[CoreConstants.FEATURE_GROUPS]: true,
[CoreConstants.FEATURE_GROUPINGS]: true,
[CoreConstants.FEATURE_MOD_INTRO]: true,
[CoreConstants.FEATURE_COMPLETION_TRACKS_VIEWS]: true,
[CoreConstants.FEATURE_COMPLETION_HAS_RULES]: true,
[CoreConstants.FEATURE_GRADE_HAS_GRADE]: true,
[CoreConstants.FEATURE_GRADE_OUTCOMES]: true,
[CoreConstants.FEATURE_BACKUP_MOODLE2]: true,
[CoreConstants.FEATURE_SHOW_DESCRIPTION]: true,
[CoreConstants.FEATURE_CONTROLS_GRADE_VISIBILITY]: true,
[CoreConstants.FEATURE_USES_QUESTIONS]: true
};
constructor(private courseProvider: CoreCourseProvider) { }
/**

View File

@ -28,6 +28,7 @@ import { AddonModQuizSyncCronHandler } from './providers/sync-cron-handler';
import { AddonModQuizIndexLinkHandler } from './providers/index-link-handler';
import { AddonModQuizGradeLinkHandler } from './providers/grade-link-handler';
import { AddonModQuizReviewLinkHandler } from './providers/review-link-handler';
import { AddonModQuizListLinkHandler } from './providers/list-link-handler';
import { AddonModQuizComponentsModule } from './components/components.module';
import { CoreUpdateManagerProvider } from '@providers/update-manager';
@ -77,7 +78,8 @@ export const ADDON_MOD_QUIZ_PROVIDERS: any[] = [
AddonModQuizSyncCronHandler,
AddonModQuizIndexLinkHandler,
AddonModQuizGradeLinkHandler,
AddonModQuizReviewLinkHandler
AddonModQuizReviewLinkHandler,
AddonModQuizListLinkHandler
]
})
export class AddonModQuizModule {
@ -85,7 +87,8 @@ export class AddonModQuizModule {
prefetchDelegate: CoreCourseModulePrefetchDelegate, prefetchHandler: AddonModQuizPrefetchHandler,
cronDelegate: CoreCronDelegate, syncHandler: AddonModQuizSyncCronHandler, linksDelegate: CoreContentLinksDelegate,
indexHandler: AddonModQuizIndexLinkHandler, gradeHandler: AddonModQuizGradeLinkHandler,
reviewHandler: AddonModQuizReviewLinkHandler, updateManager: CoreUpdateManagerProvider) {
reviewHandler: AddonModQuizReviewLinkHandler, updateManager: CoreUpdateManagerProvider,
listLinkHandler: AddonModQuizListLinkHandler) {
moduleDelegate.registerHandler(moduleHandler);
prefetchDelegate.registerHandler(prefetchHandler);
@ -93,6 +96,7 @@ export class AddonModQuizModule {
linksDelegate.registerHandler(indexHandler);
linksDelegate.registerHandler(gradeHandler);
linksDelegate.registerHandler(reviewHandler);
linksDelegate.registerHandler(listLinkHandler);
// Allow migrating the tables from the old app to the new schema.
updateManager.registerSiteTableMigration({

View File

@ -1,6 +1,7 @@
{
"errorwhileloadingthecontent": "Error while loading the content.",
"modifieddate": "Modified {{$a}}",
"modulenameplural": "Files",
"openthefile": "Open the file",
"uploadeddate": "Uploaded {{$a}}"
}

View File

@ -0,0 +1,41 @@
// (C) Copyright 2015 Martin Dougiamas
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
import { Injectable } from '@angular/core';
import { CoreContentLinksModuleListHandler } from '@core/contentlinks/classes/module-list-handler';
import { CoreContentLinksHelperProvider } from '@core/contentlinks/providers/helper';
import { TranslateService } from '@ngx-translate/core';
import { AddonModResourceProvider } from './resource';
/**
* Handler to treat links to resource list page.
*/
@Injectable()
export class AddonModResourceListLinkHandler extends CoreContentLinksModuleListHandler {
name = 'AddonModResourceListLinkHandler';
constructor(linkHelper: CoreContentLinksHelperProvider, translate: TranslateService,
protected resourceProvider: AddonModResourceProvider) {
super(linkHelper, translate, 'AddonModResource', 'resource');
}
/**
* Check if the handler is enabled on a site level.
*
* @return {boolean|Promise<boolean>} Whether or not the handler is enabled on a site level.
*/
isEnabled(): boolean | Promise<boolean> {
return this.resourceProvider.isPluginEnabled();
}
}

View File

@ -34,6 +34,18 @@ export class AddonModResourceModuleHandler implements CoreCourseModuleHandler {
name = 'AddonModResource';
modName = 'resource';
supportedFeatures = {
[CoreConstants.FEATURE_MOD_ARCHETYPE]: CoreConstants.MOD_ARCHETYPE_RESOURCE,
[CoreConstants.FEATURE_GROUPS]: false,
[CoreConstants.FEATURE_GROUPINGS]: false,
[CoreConstants.FEATURE_MOD_INTRO]: true,
[CoreConstants.FEATURE_COMPLETION_TRACKS_VIEWS]: true,
[CoreConstants.FEATURE_GRADE_HAS_GRADE]: false,
[CoreConstants.FEATURE_GRADE_OUTCOMES]: false,
[CoreConstants.FEATURE_BACKUP_MOODLE2]: true,
[CoreConstants.FEATURE_SHOW_DESCRIPTION]: true
};
protected statusObserver;
constructor(protected resourceProvider: AddonModResourceProvider, private courseProvider: CoreCourseProvider,

View File

@ -18,6 +18,7 @@ import { AddonModResourceModuleHandler } from './providers/module-handler';
import { AddonModResourceProvider } from './providers/resource';
import { AddonModResourcePrefetchHandler } from './providers/prefetch-handler';
import { AddonModResourceLinkHandler } from './providers/link-handler';
import { AddonModResourceListLinkHandler } from './providers/list-link-handler';
import { AddonModResourcePluginFileHandler } from './providers/pluginfile-handler';
import { AddonModResourceHelperProvider } from './providers/helper';
import { CoreContentLinksDelegate } from '@core/contentlinks/providers/delegate';
@ -42,6 +43,7 @@ export const ADDON_MOD_RESOURCE_PROVIDERS: any[] = [
AddonModResourceHelperProvider,
AddonModResourcePrefetchHandler,
AddonModResourceLinkHandler,
AddonModResourceListLinkHandler,
AddonModResourcePluginFileHandler
]
})
@ -49,10 +51,13 @@ export class AddonModResourceModule {
constructor(moduleDelegate: CoreCourseModuleDelegate, moduleHandler: AddonModResourceModuleHandler,
prefetchDelegate: CoreCourseModulePrefetchDelegate, prefetchHandler: AddonModResourcePrefetchHandler,
contentLinksDelegate: CoreContentLinksDelegate, linkHandler: AddonModResourceLinkHandler,
pluginfileDelegate: CorePluginFileDelegate, pluginfileHandler: AddonModResourcePluginFileHandler) {
pluginfileDelegate: CorePluginFileDelegate, pluginfileHandler: AddonModResourcePluginFileHandler,
listLinkHandler: AddonModResourceListLinkHandler) {
moduleDelegate.registerHandler(moduleHandler);
prefetchDelegate.registerHandler(prefetchHandler);
contentLinksDelegate.registerHandler(linkHandler);
contentLinksDelegate.registerHandler(listLinkHandler);
pluginfileDelegate.registerHandler(pluginfileHandler);
}
}

View File

@ -33,6 +33,7 @@
"incomplete": "Incomplete",
"lastattempt": "Last completed attempt",
"mode": "Mode",
"modulenameplural": "SCORM packages",
"newattempt": "Start a new attempt",
"noattemptsallowed": "Number of attempts allowed",
"noattemptsmade": "Number of attempts you have made",

View File

@ -0,0 +1,30 @@
// (C) Copyright 2015 Martin Dougiamas
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
import { Injectable } from '@angular/core';
import { CoreContentLinksModuleListHandler } from '@core/contentlinks/classes/module-list-handler';
import { CoreContentLinksHelperProvider } from '@core/contentlinks/providers/helper';
import { TranslateService } from '@ngx-translate/core';
/**
* Handler to treat links to SCORM list page.
*/
@Injectable()
export class AddonModScormListLinkHandler extends CoreContentLinksModuleListHandler {
name = 'AddonModScormListLinkHandler';
constructor(linkHelper: CoreContentLinksHelperProvider, translate: TranslateService) {
super(linkHelper, translate, 'AddonModScorm', 'scorm');
}
}

View File

@ -17,6 +17,7 @@ import { NavController, NavOptions } from 'ionic-angular';
import { AddonModScormIndexComponent } from '../components/index/index';
import { CoreCourseModuleHandler, CoreCourseModuleHandlerData } from '@core/course/providers/module-delegate';
import { CoreCourseProvider } from '@core/course/providers/course';
import { CoreConstants } from '@core/constants';
/**
* Handler to support SCORM modules.
@ -26,6 +27,18 @@ export class AddonModScormModuleHandler implements CoreCourseModuleHandler {
name = 'AddonModScorm';
modName = 'scorm';
supportedFeatures = {
[CoreConstants.FEATURE_GROUPS]: true,
[CoreConstants.FEATURE_GROUPINGS]: true,
[CoreConstants.FEATURE_MOD_INTRO]: true,
[CoreConstants.FEATURE_COMPLETION_TRACKS_VIEWS]: true,
[CoreConstants.FEATURE_COMPLETION_HAS_RULES]: true,
[CoreConstants.FEATURE_GRADE_HAS_GRADE]: true,
[CoreConstants.FEATURE_GRADE_OUTCOMES]: true,
[CoreConstants.FEATURE_BACKUP_MOODLE2]: true,
[CoreConstants.FEATURE_SHOW_DESCRIPTION]: true
};
constructor(private courseProvider: CoreCourseProvider) { }
/**

View File

@ -25,6 +25,7 @@ import { AddonModScormPrefetchHandler } from './providers/prefetch-handler';
import { AddonModScormSyncCronHandler } from './providers/sync-cron-handler';
import { AddonModScormIndexLinkHandler } from './providers/index-link-handler';
import { AddonModScormGradeLinkHandler } from './providers/grade-link-handler';
import { AddonModScormListLinkHandler } from './providers/list-link-handler';
import { AddonModScormSyncProvider } from './providers/scorm-sync';
import { AddonModScormComponentsModule } from './components/components.module';
import { CoreUpdateManagerProvider } from '@providers/update-manager';
@ -52,7 +53,8 @@ export const ADDON_MOD_SCORM_PROVIDERS: any[] = [
AddonModScormPrefetchHandler,
AddonModScormSyncCronHandler,
AddonModScormIndexLinkHandler,
AddonModScormGradeLinkHandler
AddonModScormGradeLinkHandler,
AddonModScormListLinkHandler
]
})
export class AddonModScormModule {
@ -60,13 +62,14 @@ export class AddonModScormModule {
prefetchDelegate: CoreCourseModulePrefetchDelegate, prefetchHandler: AddonModScormPrefetchHandler,
cronDelegate: CoreCronDelegate, syncHandler: AddonModScormSyncCronHandler, linksDelegate: CoreContentLinksDelegate,
indexHandler: AddonModScormIndexLinkHandler, gradeHandler: AddonModScormGradeLinkHandler,
updateManager: CoreUpdateManagerProvider) {
updateManager: CoreUpdateManagerProvider, listLinkHandler: AddonModScormListLinkHandler) {
moduleDelegate.registerHandler(moduleHandler);
prefetchDelegate.registerHandler(prefetchHandler);
cronDelegate.register(syncHandler);
linksDelegate.registerHandler(indexHandler);
linksDelegate.registerHandler(gradeHandler);
linksDelegate.registerHandler(listLinkHandler);
// Allow migrating the tables from the old app to the new schema.
updateManager.registerSiteTablesMigration([

View File

@ -3,6 +3,7 @@
"errorgetsurvey": "Error getting survey data.",
"ifoundthat": "I found that",
"ipreferthat": "I prefer that",
"modulenameplural": "Surveys",
"responses": "Responses",
"results": "Results",
"surveycompletednograph": "You have completed this survey."

View File

@ -0,0 +1,30 @@
// (C) Copyright 2015 Martin Dougiamas
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
import { Injectable } from '@angular/core';
import { CoreContentLinksModuleListHandler } from '@core/contentlinks/classes/module-list-handler';
import { CoreContentLinksHelperProvider } from '@core/contentlinks/providers/helper';
import { TranslateService } from '@ngx-translate/core';
/**
* Handler to treat links to survey list page.
*/
@Injectable()
export class AddonModSurveyListLinkHandler extends CoreContentLinksModuleListHandler {
name = 'AddonModSurveyListLinkHandler';
constructor(linkHelper: CoreContentLinksHelperProvider, translate: TranslateService) {
super(linkHelper, translate, 'AddonModSurvey', 'survey');
}
}

View File

@ -17,6 +17,7 @@ import { NavController, NavOptions } from 'ionic-angular';
import { AddonModSurveyIndexComponent } from '../components/index/index';
import { CoreCourseModuleHandler, CoreCourseModuleHandlerData } from '@core/course/providers/module-delegate';
import { CoreCourseProvider } from '@core/course/providers/course';
import { CoreConstants } from '@core/constants';
/**
* Handler to support survey modules.
@ -26,6 +27,18 @@ export class AddonModSurveyModuleHandler implements CoreCourseModuleHandler {
name = 'AddonModSurvey';
modName = 'survey';
supportedFeatures = {
[CoreConstants.FEATURE_GROUPS]: true,
[CoreConstants.FEATURE_GROUPINGS]: true,
[CoreConstants.FEATURE_MOD_INTRO]: true,
[CoreConstants.FEATURE_COMPLETION_TRACKS_VIEWS]: true,
[CoreConstants.FEATURE_COMPLETION_HAS_RULES]: true,
[CoreConstants.FEATURE_GRADE_HAS_GRADE]: false,
[CoreConstants.FEATURE_GRADE_OUTCOMES]: false,
[CoreConstants.FEATURE_BACKUP_MOODLE2]: true,
[CoreConstants.FEATURE_SHOW_DESCRIPTION]: true
};
constructor(private courseProvider: CoreCourseProvider) { }
/**

View File

@ -21,6 +21,7 @@ import { AddonModSurveyComponentsModule } from './components/components.module';
import { AddonModSurveyModuleHandler } from './providers/module-handler';
import { AddonModSurveyProvider } from './providers/survey';
import { AddonModSurveyLinkHandler } from './providers/link-handler';
import { AddonModSurveyListLinkHandler } from './providers/list-link-handler';
import { AddonModSurveyHelperProvider } from './providers/helper';
import { AddonModSurveyPrefetchHandler } from './providers/prefetch-handler';
import { AddonModSurveySyncProvider } from './providers/sync';
@ -50,6 +51,7 @@ export const ADDON_MOD_SURVEY_PROVIDERS: any[] = [
AddonModSurveyModuleHandler,
AddonModSurveyPrefetchHandler,
AddonModSurveyLinkHandler,
AddonModSurveyListLinkHandler,
AddonModSurveySyncCronHandler
]
})
@ -57,11 +59,13 @@ export class AddonModSurveyModule {
constructor(moduleDelegate: CoreCourseModuleDelegate, moduleHandler: AddonModSurveyModuleHandler,
prefetchDelegate: CoreCourseModulePrefetchDelegate, prefetchHandler: AddonModSurveyPrefetchHandler,
contentLinksDelegate: CoreContentLinksDelegate, linkHandler: AddonModSurveyLinkHandler,
cronDelegate: CoreCronDelegate, syncHandler: AddonModSurveySyncCronHandler, updateManager: CoreUpdateManagerProvider) {
cronDelegate: CoreCronDelegate, syncHandler: AddonModSurveySyncCronHandler, updateManager: CoreUpdateManagerProvider,
listLinkHandler: AddonModSurveyListLinkHandler) {
moduleDelegate.registerHandler(moduleHandler);
prefetchDelegate.registerHandler(prefetchHandler);
contentLinksDelegate.registerHandler(linkHandler);
contentLinksDelegate.registerHandler(listLinkHandler);
cronDelegate.register(syncHandler);
// Allow migrating the tables from the old app to the new schema.

View File

@ -1,4 +1,5 @@
{
"accessurl": "Access the URL",
"modulenameplural": "URLs",
"pointingtourl": "URL that the resource points to."
}

View File

@ -0,0 +1,30 @@
// (C) Copyright 2015 Martin Dougiamas
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
import { Injectable } from '@angular/core';
import { CoreContentLinksModuleListHandler } from '@core/contentlinks/classes/module-list-handler';
import { CoreContentLinksHelperProvider } from '@core/contentlinks/providers/helper';
import { TranslateService } from '@ngx-translate/core';
/**
* Handler to treat links to URL list page.
*/
@Injectable()
export class AddonModUrlListLinkHandler extends CoreContentLinksModuleListHandler {
name = 'AddonModUrlListLinkHandler';
constructor(linkHelper: CoreContentLinksHelperProvider, translate: TranslateService) {
super(linkHelper, translate, 'AddonModUrl', 'url');
}
}

View File

@ -31,6 +31,18 @@ export class AddonModUrlModuleHandler implements CoreCourseModuleHandler {
name = 'AddonModUrl';
modName = 'url';
supportedFeatures = {
[CoreConstants.FEATURE_MOD_ARCHETYPE]: CoreConstants.MOD_ARCHETYPE_RESOURCE,
[CoreConstants.FEATURE_GROUPS]: false,
[CoreConstants.FEATURE_GROUPINGS]: false,
[CoreConstants.FEATURE_MOD_INTRO]: true,
[CoreConstants.FEATURE_COMPLETION_TRACKS_VIEWS]: true,
[CoreConstants.FEATURE_GRADE_HAS_GRADE]: false,
[CoreConstants.FEATURE_GRADE_OUTCOMES]: false,
[CoreConstants.FEATURE_BACKUP_MOODLE2]: true,
[CoreConstants.FEATURE_SHOW_DESCRIPTION]: true
};
constructor(private courseProvider: CoreCourseProvider, private urlProvider: AddonModUrlProvider,
private urlHelper: AddonModUrlHelperProvider, private domUtils: CoreDomUtilsProvider,
private contentLinksHelper: CoreContentLinksHelperProvider) { }

View File

@ -17,6 +17,7 @@ import { AddonModUrlComponentsModule } from './components/components.module';
import { AddonModUrlModuleHandler } from './providers/module-handler';
import { AddonModUrlProvider } from './providers/url';
import { AddonModUrlLinkHandler } from './providers/link-handler';
import { AddonModUrlListLinkHandler } from './providers/list-link-handler';
import { AddonModUrlHelperProvider } from './providers/helper';
import { CoreContentLinksDelegate } from '@core/contentlinks/providers/delegate';
import { CoreCourseModuleDelegate } from '@core/course/providers/module-delegate';
@ -37,13 +38,17 @@ export const ADDON_MOD_URL_PROVIDERS: any[] = [
AddonModUrlProvider,
AddonModUrlHelperProvider,
AddonModUrlModuleHandler,
AddonModUrlLinkHandler
AddonModUrlLinkHandler,
AddonModUrlListLinkHandler
]
})
export class AddonModUrlModule {
constructor(moduleDelegate: CoreCourseModuleDelegate, moduleHandler: AddonModUrlModuleHandler,
contentLinksDelegate: CoreContentLinksDelegate, linkHandler: AddonModUrlLinkHandler) {
contentLinksDelegate: CoreContentLinksDelegate, linkHandler: AddonModUrlLinkHandler,
listLinkHandler: AddonModUrlListLinkHandler) {
moduleDelegate.registerHandler(moduleHandler);
contentLinksDelegate.registerHandler(linkHandler);
contentLinksDelegate.registerHandler(listLinkHandler);
}
}

View File

@ -6,6 +6,7 @@
"errornowikiavailable": "This wiki does not have any content yet.",
"gowikihome": "Go to the wiki first page",
"map": "Map",
"modulenameplural": "Wikis",
"newpagehdr": "New page",
"newpagetitle": "New page title",
"nocontent": "There is no content for this page",

View File

@ -0,0 +1,30 @@
// (C) Copyright 2015 Martin Dougiamas
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
import { Injectable } from '@angular/core';
import { CoreContentLinksModuleListHandler } from '@core/contentlinks/classes/module-list-handler';
import { CoreContentLinksHelperProvider } from '@core/contentlinks/providers/helper';
import { TranslateService } from '@ngx-translate/core';
/**
* Handler to treat links to wiki list page.
*/
@Injectable()
export class AddonModWikiListLinkHandler extends CoreContentLinksModuleListHandler {
name = 'AddonModWikiListLinkHandler';
constructor(linkHelper: CoreContentLinksHelperProvider, translate: TranslateService) {
super(linkHelper, translate, 'AddonModWiki', 'wiki');
}
}

View File

@ -17,6 +17,7 @@ import { NavController, NavOptions } from 'ionic-angular';
import { AddonModWikiIndexComponent } from '../components/index/index';
import { CoreCourseModuleHandler, CoreCourseModuleHandlerData } from '@core/course/providers/module-delegate';
import { CoreCourseProvider } from '@core/course/providers/course';
import { CoreConstants } from '@core/constants';
/**
* Handler to support wiki modules.
@ -26,6 +27,19 @@ export class AddonModWikiModuleHandler implements CoreCourseModuleHandler {
name = 'AddonModWiki';
modName = 'wiki';
supportedFeatures = {
[CoreConstants.FEATURE_GROUPS]: true,
[CoreConstants.FEATURE_GROUPINGS]: true,
[CoreConstants.FEATURE_MOD_INTRO]: true,
[CoreConstants.FEATURE_COMPLETION_TRACKS_VIEWS]: true,
[CoreConstants.FEATURE_GRADE_HAS_GRADE]: false,
[CoreConstants.FEATURE_GRADE_OUTCOMES]: false,
[CoreConstants.FEATURE_BACKUP_MOODLE2]: true,
[CoreConstants.FEATURE_SHOW_DESCRIPTION]: true,
[CoreConstants.FEATURE_RATE]: false,
[CoreConstants.FEATURE_COMMENT]: true
};
constructor(private courseProvider: CoreCourseProvider) { }
/**

View File

@ -28,6 +28,7 @@ import { AddonModWikiIndexLinkHandler } from './providers/index-link-handler';
import { AddonModWikiPageOrMapLinkHandler } from './providers/page-or-map-link-handler';
import { AddonModWikiCreateLinkHandler } from './providers/create-link-handler';
import { AddonModWikiEditLinkHandler } from './providers/edit-link-handler';
import { AddonModWikiListLinkHandler } from './providers/list-link-handler';
import { CoreUpdateManagerProvider } from '@providers/update-manager';
// List of providers (without handlers).
@ -53,7 +54,8 @@ export const ADDON_MOD_WIKI_PROVIDERS: any[] = [
AddonModWikiIndexLinkHandler,
AddonModWikiPageOrMapLinkHandler,
AddonModWikiCreateLinkHandler,
AddonModWikiEditLinkHandler
AddonModWikiEditLinkHandler,
AddonModWikiListLinkHandler
]
})
export class AddonModWikiModule {
@ -62,7 +64,7 @@ export class AddonModWikiModule {
cronDelegate: CoreCronDelegate, syncHandler: AddonModWikiSyncCronHandler, linksDelegate: CoreContentLinksDelegate,
indexHandler: AddonModWikiIndexLinkHandler, pageOrMapHandler: AddonModWikiPageOrMapLinkHandler,
createHandler: AddonModWikiCreateLinkHandler, editHandler: AddonModWikiEditLinkHandler,
updateManager: CoreUpdateManagerProvider) {
updateManager: CoreUpdateManagerProvider, listLinkHandler: AddonModWikiListLinkHandler) {
moduleDelegate.registerHandler(moduleHandler);
prefetchDelegate.registerHandler(prefetchHandler);
@ -71,6 +73,7 @@ export class AddonModWikiModule {
linksDelegate.registerHandler(pageOrMapHandler);
linksDelegate.registerHandler(createHandler);
linksDelegate.registerHandler(editHandler);
linksDelegate.registerHandler(listLinkHandler);
// Allow migrating the tables from the old app to the new schema.
updateManager.registerSiteTableMigration({

View File

@ -26,6 +26,7 @@
"gradinggradecalculated": "Calculated grade for assessment",
"gradinggradeof": "Grade for assessment (of {{$a}})",
"gradinggradeover": "Override grade for assessment",
"modulenameplural": "Workshops",
"nogradeyet": "No grade yet",
"notassessed": "Not assessed yet",
"notoverridden": "Not overridden",

View File

@ -0,0 +1,41 @@
// (C) Copyright 2015 Martin Dougiamas
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
import { Injectable } from '@angular/core';
import { CoreContentLinksModuleListHandler } from '@core/contentlinks/classes/module-list-handler';
import { CoreContentLinksHelperProvider } from '@core/contentlinks/providers/helper';
import { TranslateService } from '@ngx-translate/core';
import { AddonModWorkshopProvider } from './workshop';
/**
* Handler to treat links to workshop list page.
*/
@Injectable()
export class AddonModWorkshopListLinkHandler extends CoreContentLinksModuleListHandler {
name = 'AddonModWorkshopListLinkHandler';
constructor(linkHelper: CoreContentLinksHelperProvider, translate: TranslateService,
protected workshopProvider: AddonModWorkshopProvider) {
super(linkHelper, translate, 'AddonModWorkshop', 'workshop');
}
/**
* Check if the handler is enabled on a site level.
*
* @return {Promise<boolean>} Whether or not the handler is enabled on a site level.
*/
isEnabled(): Promise<boolean> {
return this.workshopProvider.isPluginEnabled();
}
}

View File

@ -18,6 +18,7 @@ import { AddonModWorkshopIndexComponent } from '../components/index/index';
import { CoreCourseModuleHandler, CoreCourseModuleHandlerData } from '@core/course/providers/module-delegate';
import { CoreCourseProvider } from '@core/course/providers/course';
import { AddonModWorkshopProvider } from './workshop';
import { CoreConstants } from '@core/constants';
/**
* Handler to support workshop modules.
@ -27,6 +28,17 @@ export class AddonModWorkshopModuleHandler implements CoreCourseModuleHandler {
name = 'AddonModWorkshop';
modName = 'workshop';
supportedFeatures = {
[CoreConstants.FEATURE_GROUPS]: true,
[CoreConstants.FEATURE_GROUPINGS]: true,
[CoreConstants.FEATURE_MOD_INTRO]: true,
[CoreConstants.FEATURE_COMPLETION_TRACKS_VIEWS]: true,
[CoreConstants.FEATURE_GRADE_HAS_GRADE]: true,
[CoreConstants.FEATURE_BACKUP_MOODLE2]: true,
[CoreConstants.FEATURE_SHOW_DESCRIPTION]: true,
[CoreConstants.FEATURE_PLAGIARISM]: true
};
constructor(private courseProvider: CoreCourseProvider, private workshopProvider: AddonModWorkshopProvider) { }
/**

View File

@ -22,6 +22,7 @@ import { AddonModWorkshopComponentsModule } from './components/components.module
import { AddonModWorkshopModuleHandler } from './providers/module-handler';
import { AddonModWorkshopProvider } from './providers/workshop';
import { AddonModWorkshopLinkHandler } from './providers/link-handler';
import { AddonModWorkshopListLinkHandler } from './providers/list-link-handler';
import { AddonModWorkshopOfflineProvider } from './providers/offline';
import { AddonModWorkshopSyncProvider } from './providers/sync';
import { AddonModWorkshopHelperProvider } from './providers/helper';
@ -50,6 +51,7 @@ export const ADDON_MOD_WORKSHOP_PROVIDERS: any[] = [
AddonModWorkshopProvider,
AddonModWorkshopModuleHandler,
AddonModWorkshopLinkHandler,
AddonModWorkshopListLinkHandler,
AddonModWorkshopOfflineProvider,
AddonModWorkshopSyncProvider,
AddonModWorkshopHelperProvider,
@ -63,10 +65,11 @@ export class AddonModWorkshopModule {
contentLinksDelegate: CoreContentLinksDelegate, linkHandler: AddonModWorkshopLinkHandler,
prefetchDelegate: CoreCourseModulePrefetchDelegate, prefetchHandler: AddonModWorkshopPrefetchHandler,
cronDelegate: CoreCronDelegate, syncHandler: AddonModWorkshopSyncCronHandler,
updateManager: CoreUpdateManagerProvider) {
updateManager: CoreUpdateManagerProvider, listLinkHandler: AddonModWorkshopListLinkHandler) {
moduleDelegate.registerHandler(moduleHandler);
contentLinksDelegate.registerHandler(linkHandler);
contentLinksDelegate.registerHandler(listLinkHandler);
prefetchDelegate.registerHandler(prefetchHandler);
cronDelegate.register(syncHandler);

View File

@ -75,6 +75,7 @@ import { CoreSitePluginsModule } from '@core/siteplugins/siteplugins.module';
import { CoreCompileModule } from '@core/compile/compile.module';
import { CoreQuestionModule } from '@core/question/question.module';
import { CoreCommentsModule } from '@core/comments/comments.module';
import { CoreBlockModule } from '@core/block/block.module';
// Addon modules.
import { AddonBadgesModule } from '@addon/badges/badges.module';
@ -83,7 +84,9 @@ import { AddonCompetencyModule } from '@addon/competency/competency.module';
import { AddonCourseCompletionModule } from '@addon/coursecompletion/coursecompletion.module';
import { AddonUserProfileFieldModule } from '@addon/userprofilefield/userprofilefield.module';
import { AddonFilesModule } from '@addon/files/files.module';
import { AddonBlockActivityModulesModule } from '@addon/block/activitymodules/activitymodules.module';
import { AddonBlockMyOverviewModule } from '@addon/block/myoverview/myoverview.module';
import { AddonBlockSiteMainMenuModule } from '@addon/block/sitemainmenu/sitemainmenu.module';
import { AddonBlockTimelineModule } from '@addon/block/timeline/timeline.module';
import { AddonModAssignModule } from '@addon/mod/assign/assign.module';
import { AddonModBookModule } from '@addon/mod/book/book.module';
@ -188,13 +191,16 @@ export const CORE_PROVIDERS: any[] = [
CoreCompileModule,
CoreQuestionModule,
CoreCommentsModule,
CoreBlockModule,
AddonBadgesModule,
AddonCalendarModule,
AddonCompetencyModule,
AddonCourseCompletionModule,
AddonUserProfileFieldModule,
AddonFilesModule,
AddonBlockActivityModulesModule,
AddonBlockMyOverviewModule,
AddonBlockSiteMainMenuModule,
AddonBlockTimelineModule,
AddonModAssignModule,
AddonModBookModule,

View File

@ -10,6 +10,7 @@
"addon.badges.issuername": "Issuer name",
"addon.badges.nobadges": "There are no badges available.",
"addon.badges.recipientdetails": "Recipient details",
"addon.block_activitymodules.pluginname": "Activities",
"addon.block_myoverview.all": "All",
"addon.block_myoverview.future": "Future",
"addon.block_myoverview.inprogress": "In progress",
@ -20,6 +21,7 @@
"addon.block_myoverview.nocoursespast": "No past courses",
"addon.block_myoverview.past": "Past",
"addon.block_myoverview.title": "Title",
"addon.block_sitemainmenu.pluginname": "Main menu",
"addon.block_timeline.duedate": "Due date",
"addon.block_timeline.next30days": "Next 30 days",
"addon.block_timeline.next3months": "Next 3 months",
@ -202,6 +204,7 @@
"addon.mod_assign.markingworkflowstatereadyforrelease": "Ready for release",
"addon.mod_assign.markingworkflowstatereadyforreview": "Marking completed",
"addon.mod_assign.markingworkflowstatereleased": "Released",
"addon.mod_assign.modulenameplural": "Assignments",
"addon.mod_assign.multipleteams": "Member of more than one group",
"addon.mod_assign.multipleteams_desc": "The assignment requires submission in groups. You are a member of more than one group. To be able to submit you must be a member of only one group. Please contact your teacher to change your group membership.",
"addon.mod_assign.noattempt": "No attempt",
@ -256,6 +259,7 @@
"addon.mod_assign_submission_file.pluginname": "File submissions",
"addon.mod_assign_submission_onlinetext.pluginname": "Online text submissions",
"addon.mod_book.errorchapter": "Error reading chapter of book.",
"addon.mod_book.modulenameplural": "Books",
"addon.mod_chat.beep": "Beep",
"addon.mod_chat.currentusers": "Current users",
"addon.mod_chat.enterchat": "Click here to enter the chat now",
@ -268,6 +272,7 @@
"addon.mod_chat.messagebeepsyou": "{{$a}} has just beeped you!",
"addon.mod_chat.messageenter": "{{$a}} has just entered this chat",
"addon.mod_chat.messageexit": "{{$a}} has left this chat",
"addon.mod_chat.modulenameplural": "Chats",
"addon.mod_chat.mustbeonlinetosendmessages": "You must be online to send messages.",
"addon.mod_chat.nomessages": "No messages yet",
"addon.mod_chat.send": "Send",
@ -278,6 +283,7 @@
"addon.mod_choice.errorgetchoice": "Error getting choice data.",
"addon.mod_choice.expired": "Sorry, this activity closed on {{$a}} and is no longer available",
"addon.mod_choice.full": "(Full)",
"addon.mod_choice.modulenameplural": "Choices",
"addon.mod_choice.noresultsviewable": "The results are not currently viewable.",
"addon.mod_choice.notopenyet": "Sorry, this activity is not available until {{$a}}",
"addon.mod_choice.numberofuser": "Number of responses",
@ -317,6 +323,7 @@
"addon.mod_data.fields": "Fields",
"addon.mod_data.latlongboth": "Both latitude and longitude are required.",
"addon.mod_data.menuchoose": "Choose...",
"addon.mod_data.modulenameplural": "Databases",
"addon.mod_data.more": "More",
"addon.mod_data.nomatch": "No matching entries found!",
"addon.mod_data.norecords": "No entries in database",
@ -348,6 +355,7 @@
"addon.mod_feedback.feedbackopen": "Allow answers from",
"addon.mod_feedback.mapcourses": "Map feedback to courses",
"addon.mod_feedback.mode": "Mode",
"addon.mod_feedback.modulenameplural": "Feedback",
"addon.mod_feedback.next_page": "Next page",
"addon.mod_feedback.non_anonymous": "User's name will be logged and shown with answers",
"addon.mod_feedback.non_anonymous_entries": "Non anonymous entries ({{$a}})",
@ -368,6 +376,7 @@
"addon.mod_feedback.started": "Started",
"addon.mod_feedback.this_feedback_is_already_submitted": "You've already completed this activity.",
"addon.mod_folder.emptyfilelist": "There are no files to show.",
"addon.mod_folder.modulenameplural": "Folders",
"addon.mod_forum.addanewdiscussion": "Add a new discussion topic",
"addon.mod_forum.addanewquestion": "Add a new question",
"addon.mod_forum.addanewtopic": "Add a new topic",
@ -390,6 +399,7 @@
"addon.mod_forum.modeflatnewestfirst": "Display replies flat, with newest first",
"addon.mod_forum.modeflatoldestfirst": "Display replies flat, with oldest first",
"addon.mod_forum.modenested": "Display replies in nested form",
"addon.mod_forum.modulenameplural": "Forums",
"addon.mod_forum.numdiscussions": "{{numdiscussions}} discussions",
"addon.mod_forum.numreplies": "{{numreplies}} replies",
"addon.mod_forum.posttoforum": "Post to forum",
@ -425,9 +435,11 @@
"addon.mod_glossary.fillfields": "Concept and definition are mandatory fields.",
"addon.mod_glossary.fullmatch": "Match whole words only",
"addon.mod_glossary.linking": "Auto-linking",
"addon.mod_glossary.modulenameplural": "Glossaries",
"addon.mod_glossary.noentriesfound": "No entries were found.",
"addon.mod_glossary.searchquery": "Search query",
"addon.mod_imscp.deploymenterror": "Content package error!",
"addon.mod_imscp.modulenameplural": "IMS content packages",
"addon.mod_imscp.showmoduledescription": "Show description",
"addon.mod_lesson.answer": "Answer",
"addon.mod_lesson.attempt": "Attempt: {{$a}}",
@ -471,6 +483,7 @@
"addon.mod_lesson.lowtime": "Low time",
"addon.mod_lesson.maximumnumberofattemptsreached": "Maximum number of attempts reached - Moving to next page",
"addon.mod_lesson.modattemptsnoteacher": "Student review only works for students.",
"addon.mod_lesson.modulenameplural": "Lessons",
"addon.mod_lesson.noanswer": "One or more questions have no answer given. Please go back and submit an answer.",
"addon.mod_lesson.nolessonattempts": "No attempts have been made on this lesson.",
"addon.mod_lesson.nolessonattemptsgroup": "No attempts have been made by {{$a}} group members on this lesson.",
@ -515,7 +528,9 @@
"addon.mod_lti.errorgetlti": "Error getting module data.",
"addon.mod_lti.errorinvalidlaunchurl": "The launch URL is not valid.",
"addon.mod_lti.launchactivity": "Launch the activity",
"addon.mod_lti.modulenameplural": "External tools",
"addon.mod_page.errorwhileloadingthepage": "Error while loading the page content.",
"addon.mod_page.modulenameplural": "Pages",
"addon.mod_quiz.attemptfirst": "First attempt",
"addon.mod_quiz.attemptlast": "Last attempt",
"addon.mod_quiz.attemptnumber": "Attempt",
@ -550,6 +565,7 @@
"addon.mod_quiz.grademethod": "Grading method",
"addon.mod_quiz.gradesofar": "{{$a.method}}: {{$a.mygrade}} / {{$a.quizgrade}}.",
"addon.mod_quiz.marks": "Marks",
"addon.mod_quiz.modulenameplural": "Quizzes",
"addon.mod_quiz.mustbesubmittedby": "This attempt must be submitted by {{$a}}.",
"addon.mod_quiz.noquestions": "No questions have been added yet",
"addon.mod_quiz.noreviewattempt": "You are not allowed to review this attempt.",
@ -594,6 +610,7 @@
"addon.mod_quiz.yourfinalgradeis": "Your final grade for this quiz is {{$a}}.",
"addon.mod_resource.errorwhileloadingthecontent": "Error while loading the content.",
"addon.mod_resource.modifieddate": "Modified {{$a}}",
"addon.mod_resource.modulenameplural": "Files",
"addon.mod_resource.openthefile": "Open the file",
"addon.mod_resource.uploadeddate": "Uploaded {{$a}}",
"addon.mod_scorm.asset": "Asset",
@ -630,6 +647,7 @@
"addon.mod_scorm.incomplete": "Incomplete",
"addon.mod_scorm.lastattempt": "Last completed attempt",
"addon.mod_scorm.mode": "Mode",
"addon.mod_scorm.modulenameplural": "SCORM packages",
"addon.mod_scorm.newattempt": "Start a new attempt",
"addon.mod_scorm.noattemptsallowed": "Number of attempts allowed",
"addon.mod_scorm.noattemptsmade": "Number of attempts you have made",
@ -649,10 +667,12 @@
"addon.mod_survey.errorgetsurvey": "Error getting survey data.",
"addon.mod_survey.ifoundthat": "I found that",
"addon.mod_survey.ipreferthat": "I prefer that",
"addon.mod_survey.modulenameplural": "Surveys",
"addon.mod_survey.responses": "Responses",
"addon.mod_survey.results": "Results",
"addon.mod_survey.surveycompletednograph": "You have completed this survey.",
"addon.mod_url.accessurl": "Access the URL",
"addon.mod_url.modulenameplural": "URLs",
"addon.mod_url.pointingtourl": "URL that the resource points to.",
"addon.mod_wiki.cannoteditpage": "You can not edit this page.",
"addon.mod_wiki.createpage": "Create page",
@ -661,6 +681,7 @@
"addon.mod_wiki.errornowikiavailable": "This wiki does not have any content yet.",
"addon.mod_wiki.gowikihome": "Go to the wiki first page",
"addon.mod_wiki.map": "Map",
"addon.mod_wiki.modulenameplural": "Wikis",
"addon.mod_wiki.newpagehdr": "New page",
"addon.mod_wiki.newpagetitle": "New page title",
"addon.mod_wiki.nocontent": "There is no content for this page",
@ -699,6 +720,7 @@
"addon.mod_workshop.gradinggradecalculated": "Calculated grade for assessment",
"addon.mod_workshop.gradinggradeof": "Grade for assessment (of {{$a}})",
"addon.mod_workshop.gradinggradeover": "Override grade for assessment",
"addon.mod_workshop.modulenameplural": "Workshops",
"addon.mod_workshop.nogradeyet": "No grade yet",
"addon.mod_workshop.notassessed": "Not assessed yet",
"addon.mod_workshop.notoverridden": "Not overridden",
@ -1467,6 +1489,7 @@
"core.refresh": "Refresh",
"core.required": "Required",
"core.requireduserdatamissing": "This user lacks some required profile data. Please enter the data in your site and try again.<br>{{$a}}",
"core.resources": "Resources",
"core.restore": "Restore",
"core.retry": "Retry",
"core.save": "Save",

Some files were not shown because too many files have changed in this diff Show More