Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix JS error - incorrect questionid #13

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

nadavkav
Copy link

Make this question type work in Moodle 3.7

@@ -16,7 +16,7 @@ YUI.add('moodle-qtype_ddmatch-dragdrop', function(Y, NAME) {
return;
}

var containerid = 'div#q' + this.get('questionid'),
var containerid = 'div#' + this.get('questionid'),
Copy link

@nexterday nexterday Sep 23, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new question div ids for 3.7 are compound of 'question-' . $this->usageid . '-' . $this->slot; see

/**
 * When the question is rendered, this unique id is added to the
 * outer div of the question. It can be used to uniquely reference
 * the question from JavaScript.
 *
 * @return string id added to the outer <div class="que ..."> when the question is rendered.
 */
public function get_outer_question_div_unique_id() {
    return 'question-' . $this->usageid . '-' . $this->slot;
}

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the update! (@nexterday )

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It’s still working in Moodle 3.9.
Thanks a lot!

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You’re welcome.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello, sorry but I am now retired and stopped all programming work. Feel free to fork this repository and make any change you want.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants