Quantcast
Channel: General developer forum
Viewing all 37662 articles
Browse latest View live

Loading jQuery plugin as AMD module?

$
0
0

by Conn Warwicker.  

I'm trying to use this plugin in my block:

https://github.com/mar10/jquery-ui-contextmenu


However, loading it with the $PAGE->require->js() ends up giving me a JS console error about the "define" function being mismatched.

I've had a look at how some other blocks are calling AMD modules, but have only found small, custom written ones.


What do I need to do to get this plugin to load correctly into Moodle 3.1?


Thanks.


Re: mod_assign Grader overriding in a theme.

$
0
0

by Gareth J Barnard.  

Thanks for your reply Richard.

As the file is in the /mod/assign/classes/output folder, I tried 'namespace theme_essential\output\mod_assign;' with the file in the same place but did not work - 'Purge all caches' etc.

Humm!  Perhaps a web-server restart..... nope! Humm!

Re: Loading jQuery plugin as AMD module?

$
0
0

by Gareth J Barnard.  

In a theme (same sort of thing) as the file has AMD stuff, then put the minified version in the build folder: https://github.com/gjb2048/moodle-theme_shoehorn/blob/master/amd/build/chartist.min.js - then you can initialise from your own JS: https://github.com/gjb2048/moodle-theme_shoehorn/blob/master/amd/src/shoehorn_chart.js#L2 and then call that: https://github.com/gjb2048/moodle-theme_shoehorn/blob/master/layout/tiles/additionaljs.php#L89 with '$PAGE->requires->js_call_amd'.

https://docs.moodle.org/dev/Javascript_Modules is worth a read.

https://docs.moodle.org/dev/jQuery#What_about_JQuery_UI_.3F is worth a read too given jQueryUI.

Re: How can I ensure output goes through active filters?

$
0
0

by Marcus Green.  

"pick another qtype, then play spot the difference with your code."

Thanks Tim, I should have that engraved on a plaque next to my laptop smile


Scorm

$
0
0

by Kritika Sood.  

How is SCORM content embedded in Moodle ?

Problems with parameters via REST/POST Protocol

$
0
0

by Jaime Peña.  

Hello, I need help with a specific issue, please.

My company has created a academy-management software which has certain interactions with Moodle: specifically, it uses a webservice to carry out certain tasks in our customers' Moodle databases (creating new courses and groups, creating new users, enrolling said users in the corresponding courses, etc.). The instructions are sent to the webservice via REST protocol calls (using JSON and POST), in which the needed information is sent.

The problem is as follows: usually, we send the webservice token (wstoken), function to be used (wsfunction) and method used (moodlewsrestformat=json) in the call/URL itself, but any additional parameters are sent in the BODY component of the POST call. It has always worked properly until now. Recently, one of our customers filed a complaint in which the functions were not working.

After testing, we've come to the conclusion that our customer's Moodle website ignores the parameters sent via the BODY component, and so, it always returns a "Invalid parameter value" exception. Using the Postman addon for Chrome we've tested that, truly enough, if we send the specific parameter as another parameter in the call/URL itself, it works correctly. 

We're in the dark as to why this might be happening. Can somebody please help us find out how to enable the reception of parameters via the BODY component of the POST call?

Thanks in advance

Re: mod_assign Grader overriding in a theme.

$
0
0

by Gareth J Barnard.  

Looking at MDL-41663 - I think there could be an issue with naming not being postfixed with '_renderable' in the filename - could be a core bug.

And indeed the line 'use \mod_assign\output\grading_app;' in /mod/assign/renderer.php preventing that class from being overridden.

Disable name requirement at signup

$
0
0

by Éva Rácz.  

Hi, I am working on a site where we do not want first and last names be required fields (we do not need them and don't want to have to register with authorities to handle the data). In moodle 2.2, I could do it by altering login/signup.php and login/signup_form.php (the fields are not displayed and in signup.php the values are set to be the same as the username), but making similar adjustments in 3.0 doesn't work.

What I did was:
  • added at line 85 of signup.php:
    $user->firstname = $user->username;
    $user->lastname = $user->username;
  • commented out lines 63-72 of signup_form.php

Result:
the name fields do not appear at signup, but the signup procedure cannot be completed because the page complains that there are still required fields to be filled in. 

What else should be modified? Is there a better way to do this instead of tinkering with the code? (Unfortunately I'm not really familiar with php, I just edit the code and hope for the best.)


Re: mod_assign Grader overriding in a theme.

$
0
0

by Gareth J Barnard.  

Bingo!  Another solution using older method in the theme's 'classes' folder:

use \mod_assign\output\grading_app;
class theme_essential_mod_assign_renderer extends mod_assign_renderer {
    /**
     * Defer to template..
     *
     * @param grading_app $app - All the data to render the grading app.
     */
    public function render_grading_app(grading_app $app) {
        $context = $app->export_for_template($this);
error_log('Overridden');
        return $this->render_from_template('mod_assign/grading_app', $context);
    }
}

Re: tool_pluginkenobi: Your guide to plugin creation

$
0
0

by Daniel Neis Araujo.  

Hello, Alexandre


did you finished the plugin?


Kind regards,

Daniel

Use of filters for file attachment scenarios

$
0
0

by Vivek Nirkhe.  

Hi we are looking handle a file with a particular extension/type and transform it whether the file is included in the descriptions or attached to assignments/quizzes etc.

I wanted to know if filters are invoked for files that are attached to assignments or quizzes? 

Thanks

- Vivek

Adding optional date selector to mod_form

$
0
0

by SVI eSolutions.  

Hi, I wished to add an optional "date_time_selector" to my mod form, which was rather easy, just add optional => true...

But I don't want it checked by default... I don't want to disable it either. 

I would like it to appear like the second one here... But all I get is like the first one or completely disabled...


Is there an attribute I can add? 

Does anyone have any suggestions, I thought this would be simple...

Re: Adding optional date selector to mod_form

Re: tool_pluginkenobi: Your guide to plugin creation

$
0
0

by Tomasz Muras.  

Nice idea, I missed that announcement and GSoC project.

I'd second Daniel's question - were you able to progress with it? I would totally "steal" the code generation for different plugins and include those as moosh generate-* commands.

Tomek


Cannot connect: Verify that your have typed correctly the URL and that your site uses Moodle 2.4 or later.

$
0
0

by Shadrack Ogechi.  

Hi,

I am running moodle 3.1.1. I have followed the process for customizing moodle mobile application using "creatingacustommoodlemobileapp-moodlemootspain2014" but am getting an error when connecting.

"Cannot connect: Verify that your have typed correctly the URL and that your site uses Moodle 2.4 or later.".

 I have installed a SSL certificate, enabled web services and followed steps for mobile access. Please assist. moodle running from

 https://startafrica.com/moodle. and on 

github 

"https://github.com/oshadrack/moodlemobile.git" moodle22 branch.


Kindly assist.

Many Thanks



Re: Use of filters for file attachment scenarios

$
0
0

by Justin Hunt.  

What do you mean by "attached?"

If you mean that it is linked to inside an html area then the answer is most likely "yes," though it really depends on the html area .

 The easiest way to check, assuming you have the standard multimedia plugins filter enabled, would be to add a link to a youtube video and see if it gets turned into a youtube player. If so, then filtering is working in that area.

How to change the header styles etc

$
0
0

by Jason De Donno.  

Hi

I want to change a few styles, so that I can create a new, slightly altered theme. My idea was to copy the "Clean" theme and rename it, then make some alterations, then use that as a new theme with the theme selector.

Can someone point me to an online guide that can help me with this?

Thanks

Jason

Re: How to change the header styles etc

Re: Use of filters for file attachment scenarios

$
0
0

by Vivek Nirkhe.  

Thanks Justin. By attachment, I mean the file that the student attaches to his/her assignment ("file submission"). Or it may be a file attached by the teacher to the assignment. 

Here is what we would like to do: when a student or teacher attaches a file, with a specific extension, we would like to display it in place so that it does not have to be downloaded. 

File submission

Re: How to change the header styles etc

$
0
0

by Richard Oelmann.  

Clean theme has a guide to cloning it in its own readme file. Follow that in the first instance and post back if you have any specific problems. 

Richard 

Viewing all 37662 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>