Moodle for mobile

Mobile error

 
Picture of Mohit juyal
Mobile error
 

I tried to compile moodle mobile version 2 and getting these errors.


Error

Close

Typescript Error

Cannot find name 'module'.

D:/Moodle/moodlemobile2/src/core/course/directives/download-module-main-file.ts

}).finally(() => {

    modal.dismiss();

});

Typescript Error

Cannot find name 'require'.

D:/Moodle/moodlemobile2/src/core/emulator/classes/inappbrowserobject.ts

    width = display.workArea.width || width;

    height = display.workArea.height || height;

}

Typescript Error

Cannot find name 'require'.

D:/Moodle/moodlemobile2/src/core/emulator/classes/inappbrowserobject.ts

        height = display.workArea.height || height;

    }

}

Typescript Error

Cannot find name 'require'.

D:/Moodle/moodlemobile2/src/core/emulator/emulator.module.ts

undefined

Typescript Error

Cannot find name 'require'.

D:/Moodle/moodlemobile2/src/core/emulator/providers/badge.ts

*

* @returns {Promise<any>}

*/

Typescript Error

Cannot find name 'require'.

D:/Moodle/moodlemobile2/src/core/emulator/providers/badge.ts

*/

increase(increaseBy: number): Promise<any> {

    return Promise.reject('increase is only supported in mobile devices');

Typescript Error

Cannot find name 'require'.

D:/Moodle/moodlemobile2/src/core/emulator/providers/clipboard.ts

* @param {string} text The text to copy.

* @return {Promise<any>} Promise resolved when copied.

*/

Typescript Error

'FileTransferError' only refers to a type, but is being used as a value here.

D:/Moodle/moodlemobile2/src/core/emulator/providers/file-transfer.ts

    // In desktop we need to convert the arraybuffer into a Buffer.

    response = Buffer.from(<any> new Uint8Array(response));

}

Typescript Error

Cannot find name 'Buffer'.

D:/Moodle/moodlemobile2/src/core/emulator/providers/file-transfer.ts

* This code is extracted from Cordova FileTransfer plugin.

*

* @param {string} urlString The URL to get the credentials from.

Typescript Error

Cannot find name 'FileUploadOptions'.

D:/Moodle/moodlemobile2/src/core/emulator/providers/file-transfer.ts

    options.headers = options.headers || {};

    options.headers[basicAuthHeader.name] = basicAuthHeader.value;

}

Typescript Error

'FileTransferError' only refers to a type, but is being used as a value here.

D:/Moodle/moodlemobile2/src/core/emulator/providers/file-transfer.ts

// Create a form data to send params and the file.

const fd = new FormData();

for (const name in params) {

Typescript Error

Cannot find name 'FileWriter'.

D:/Moodle/moodlemobile2/src/core/emulator/providers/file.ts

*

* @param {any} err Error.

*/

Typescript Error

Cannot find name 'FileWriter'.

D:/Moodle/moodlemobile2/src/core/emulator/providers/file.ts

* @param {any} err Error.

*/

private fillErrorMessageMock(err: any): void {

Typescript Error

Cannot find name 'Flags'.

D:/Moodle/moodlemobile2/src/core/emulator/providers/file.ts

        reject(xc);

    }

});

Typescript Error

Cannot find name 'Flags'.

D:/Moodle/moodlemobile2/src/core/emulator/providers/file.ts

        });

    }

 

Typescript Error

Property 'requestFileSystem' does not exist on type 'Window'.

D:/Moodle/moodlemobile2/src/core/emulator/providers/file.ts

    calculateByRequest(size * ratio, ratio).then(resolve);

}, () => {

    resolve(size / ratio);

Typescript Error

Property 'requestFileSystem' does not exist on type 'Window'.

D:/Moodle/moodlemobile2/src/core/emulator/providers/file.ts

 

                // General calculation, base 1MB and increasing factor 1.3.

                calculateByRequest(1048576, 1.3).then((size: number) => {

Typescript Error

Cannot find name 'LocalFileSystem'.

D:/Moodle/moodlemobile2/src/core/emulator/providers/file.ts

 

                // General calculation, base 1MB and increasing factor 1.3.

                calculateByRequest(1048576, 1.3).then((size: number) => {

Typescript Error

Cannot find name 'require'.

D:/Moodle/moodlemobile2/src/core/emulator/providers/file.ts

                basePath = this.textUtils.concatenatePaths(basePath.replace(/\\/g, '/'), CoreConfigConstants.app_id) + '/';

 

                // Create the folder if needed.

Typescript Error

Cannot find name 'require'.

D:/Moodle/moodlemobile2/src/core/emulator/providers/file.ts

 

                // Create the folder if needed.

                fs.mkdir(basePath, (e) => {

Typescript Error

Property 'requestFileSystem' does not exist on type 'Window'.

D:/Moodle/moodlemobile2/src/core/emulator/providers/file.ts

* @param {Entry} srce The Entry to copy.

* @param {DirectoryEntry} destDir The directory where to move the file/dir.

* @param {string} newName New name of the file/dir.

Typescript Error

Cannot find name 'LocalFileSystem'.

D:/Moodle/moodlemobile2/src/core/emulator/providers/file.ts

* @param {Entry} srce The Entry to copy.

* @param {DirectoryEntry} destDir The directory where to move the file/dir.

* @param {string} newName New name of the file/dir.

Typescript Error

Cannot find name 'DirectoryReader'.

D:/Moodle/moodlemobile2/src/core/emulator/providers/file.ts

*

* @param {string} path Base FileSystem.

* @param {string} file Name of file, relative to path.

Typescript Error

Property 'resolveLocalFileSystemURL' does not exist on type 'Window'.

D:/Moodle/moodlemobile2/src/core/emulator/providers/file.ts

/**

* Remove a directory and all its contents.

*

Typescript Error

Cannot find name 'FileWriter'.

D:/Moodle/moodlemobile2/src/core/emulator/providers/file.ts

        writer.write(data);

    });

}

Typescript Error

Cannot find name 'FileWriter'.

D:/Moodle/moodlemobile2/src/core/emulator/providers/file.ts

writer.onwrite = (): void => {

    if (writtenSize < data.size) {

        writeNextChunk();

Typescript Error

Cannot find name 'require'.

D:/Moodle/moodlemobile2/src/core/emulator/providers/globalization.ts

* @return {Promise<{value: string}>} Promise resolved with an object with the language string.

*/

getLocaleName(): Promise<{ value: string }> {

Typescript Error

Cannot find name 'GlobalizationError'.

D:/Moodle/moodlemobile2/src/core/emulator/providers/globalization.ts

    }

}

Typescript Error

Cannot find name 'require'.

D:/Moodle/moodlemobile2/src/core/emulator/providers/local-notifications.ts

delete notification.triggered;

this.scheduled[notification.id] = {

    notification: notification

Typescript Error

Cannot find name 'require'.

D:/Moodle/moodlemobile2/src/core/emulator/providers/local-notifications.ts

    }

    this.observers[eventName].push(callback);

}

Typescript Error

Cannot find name 'require'.

D:/Moodle/moodlemobile2/src/core/emulator/providers/push.ts

* successHandler gets called with an integer which is the current badge count

*/

getApplicationIconBadgeNumber(): Promise<number> {

Typescript Error

Cannot find name 'require'.

D:/Moodle/moodlemobile2/src/core/emulator/providers/push.ts

*/

finish(id?: string): Promise<any> {

    return Promise.reject('finish is only supported in mobile devices');

Typescript Error

Cannot find name 'FileError'.

D:/Moodle/moodlemobile2/src/core/settings/pages/space-usage/space-usage.ts

        // Ignore cancelled confirmation modal.

    });

});

Typescript Error

Cannot find name 'require'.

D:/Moodle/moodlemobile2/src/providers/app.ts

            return false;

        }

 

Typescript Error

Cannot find name 'require'.

D:/Moodle/moodlemobile2/src/providers/app.ts

    }

 

    /**

Typescript Error

Cannot find name 'Connection'.

D:/Moodle/moodlemobile2/src/providers/app.ts

*/

isNetworkAccessLimited(): boolean {

    const type = this.network.type;

Typescript Error

Cannot find name 'Connection'.

D:/Moodle/moodlemobile2/src/providers/app.ts

*/

isNetworkAccessLimited(): boolean {

    const type = this.network.type;

Typescript Error

Cannot find name 'Connection'.

D:/Moodle/moodlemobile2/src/providers/app.ts

        }

 

        try {

Typescript Error

Cannot find name 'Connection'.

D:/Moodle/moodlemobile2/src/providers/app.ts

        }

 

        try {

Typescript Error

Cannot find name 'Connection'.

D:/Moodle/moodlemobile2/src/providers/app.ts

        }

 

        try {

Typescript Error

Cannot find name 'Connection'.

D:/Moodle/moodlemobile2/src/providers/app.ts

        }

 

        try {

Typescript Error

Cannot find name 'require'.

D:/Moodle/moodlemobile2/src/providers/app.ts

        }

    }

 

Typescript Error

Property 'resolveLocalFileSystemURL' does not exist on type 'Window'.

D:/Moodle/moodlemobile2/src/providers/file.ts

    return this.file.resolveLocalFilesystemUrl(this.addBasePathIfNeeded(path));

}).then((entry) => {

    return <FileEntry> entry;

Typescript Error

Cannot find name 'Entry'.

D:/Moodle/moodlemobile2/src/providers/file.ts

* @param {string} path Path to the file/dir.

* @param {boolean} [isDir] True if directory, false if file.

* @return {Promise<any>} Promise resolved with metadata.

Typescript Error

Cannot find name 'require'.

D:/Moodle/moodlemobile2/src/providers/utils/utils.ts

// Clone the array and all the entries.

const newArray = [];

for (let i = 0; i < source.length; i++) {

Typescript Error

Cannot find name 'require'.

D:/Moodle/moodlemobile2/src/providers/utils/utils.ts

        }

    });

}

Typescript Error

Cannot find name 'require'.

D:/Moodle/moodlemobile2/src/providers/utils/utils.ts

*

* node-webkit: Using the default application configured.

* Android: Using the WebIntent plugin.




Ionic Framework: ^3.9.2

Ionic App Scripts: 3.1.8

Angular Core: 5.0.0

Angular Compiler CLI: 5.0.0

Node: 6.9.1

OS Platform: Windows 10

Navigator Platform: Win32

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.139 Safari/537.36


 
Average of ratings: -
Picture of Dani Palou
Re: Mobile error
Core developersMoodle HQParticularly helpful MoodlersPlugin developers

Hi Mohit,

did you run npm install before trying to build the app? Some of the errors like the require one could be caused because you miss some npm packages.

Maybe npm install throws an error in Windows?

Cheers,

Dani

 
Average of ratings: -
Picture of shaikh mujaahid
Re: Mobile error
 

Error
Close
Typescript Error
Cannot find module '../../../../configconstants'.
C:/Users/Shaikh/350/src/addon/messageoutput/airnotifier/providers/airnotifier.ts
}
/**
Typescript Error
Cannot find module '../../../configconstants'.
C:/Users/Shaikh/350/src/addon/pushnotifications/providers/pushnotifications.ts
static BADGE_TABLE = 'addon_pushnotifications_badge';
protected tablesSchema = [
{
Typescript Error
Cannot find module '../configconstants'.
C:/Users/Shaikh/350/src/classes/site.ts
/**
* Save the result to the cache.
Typescript Error
Cannot find module '../../../configconstants'.
C:/Users/Shaikh/350/src/core/compile/providers/compile.ts
import { CoreCourseResourcePrefetchHandlerBase } from '@core/course/classes/resource-prefetch-handler';
// Import all core modules that define components, directives and pipes.
Typescript Error
Cannot find module '../../../configconstants'.
C:/Users/Shaikh/350/src/core/contentlinks/providers/helper.ts
private initDelegate: CoreInitDelegate, eventsProvider: CoreEventsProvider, private textUtils: CoreTextUtilsProvider,
private sitePluginsProvider: CoreSitePluginsProvider) {
this.logger = logger.getInstance('CoreContentLinksHelperProvider');
Typescript Error
Cannot find module '../../../configconstants'.
C:/Users/Shaikh/350/src/core/emulator/providers/file.ts
/**
* Check if a directory exists in a certain path, directory.
*
Typescript Error
Cannot find module '../../../configconstants'.
C:/Users/Shaikh/350/src/core/emulator/providers/local-notifications.ts
protected tileBindingTemplate = '<text hint-style="base" hint-wrap="true">%s</text>' +
'<text hint-style="captionSubtle" hint-wrap="true">%s</text>';
protected tileTemplate = '<tile><visual branding="nameAndLogo">' +
Typescript Error
Cannot find module '../../../../configconstants'.
C:/Users/Shaikh/350/src/core/login/pages/site/site.ts
siteForm: FormGroup;
fixedSites: any[];
displayAsButtons = false;
Typescript Error
Cannot find module '../../../configconstants'.
C:/Users/Shaikh/350/src/core/login/providers/helper.ts
/**
* User's token.
Typescript Error
Cannot find module '../../../configconstants'.
C:/Users/Shaikh/350/src/core/mainmenu/providers/mainmenu.ts
* Url of the item.
* @type {string}
*/
Typescript Error
Cannot find module '../../../../configconstants'.
C:/Users/Shaikh/350/src/core/settings/pages/about/about.ts
versionName: string;
versionCode: number;
privacyPolicy: string;
Typescript Error
Cannot find module '../../../../configconstants'.
C:/Users/Shaikh/350/src/core/settings/pages/general/general.ts
languageCodes = [];
selectedLanguage: string;
rteSupported: boolean;
Typescript Error
Cannot find module '../../../configconstants'.
C:/Users/Shaikh/350/src/core/siteplugins/providers/siteplugins.ts
/**
* Name of the handler.
* @type {string}
Typescript Error
Cannot find module '../configconstants'.
C:/Users/Shaikh/350/src/directives/link.ts
// "no" -> Never auto-login.
// "check" -> Auto-login only if it points to the current site. Default value.
Typescript Error
Cannot find module '../configconstants'.
C:/Users/Shaikh/350/src/providers/lang.ts
constructor(private translate: TranslateService, private configProvider: CoreConfigProvider, platform: Platform,
private globalization: Globalization) {
// Set fallback language and language to use until the app determines the right language to use.
Typescript Error
Cannot find module '../configconstants'.
C:/Users/Shaikh/350/src/providers/sites.ts
code: number;
/**
Typescript Error
Cannot find module '../configconstants'.
C:/Users/Shaikh/350/src/providers/update-manager.ts
/**
* New name of the table. If not defined, "name" will be used.
Ionic Framework: ^3.9.2 Ionic App Scripts: 3.1.9 Angular Core: 5.2.10 Angular Compiler CLI: 5.2.10 Node: 8.12.0 OS Platform: Windows 7 Navigator Platform: Win32 User Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36

 
Average of ratings: -
Picture of Dani Palou
Re: Mobile error
Core developersMoodle HQParticularly helpful MoodlersPlugin developers

Please run "gulp" and make sure no error is raised.

 
Average of ratings: -
Picture of shaikh mujahid
Re: Mobile error
 

Thanks 👍

 
Average of ratings: -
Picture of shaikh mujahid
Re: Mobile error /enrollmet error
 

Admin not enrolled  for any courses to access user, but when user try moodle app then they access all courses without admin enrollment.see in attachment when user click on contents they access all activities without enrolled


 
Average of ratings: -
Picture of Dani Palou
Re: Mobile error /enrollmet error
Core developersMoodle HQParticularly helpful MoodlersPlugin developers

Hi,

please check that the course doesn't have guest access enabled. If the course allows guest access then the user can view it even if he isn't enrolled.

Cheers,

Dani

 
Average of ratings: -
Picture of Samuel Domingues
Re: Mobile error
 

I had the same error, you have to edit the tsconfig.json file and add this in the compilerOptions:


"typeRoots": [
"node_modules/@types"
]

 
Average of ratings: -
Picture of Mohit juyal
Re: Mobile error
 

Thanks, I'll do that

 
Average of ratings: -