at-tools / moodle-block_massaction

The Mass Action block for Moodle 2
6 stars 12 forks source link

Add "Duplicate to" functionality #8

Closed Syxton closed 8 years ago

cdsmith-umn commented 8 years ago

@Syxton I'm looking at this and trying it out. I like the feature. One thing I noticed is that when you duplicate something, it actually moves the original copy to the "Duplicate to" destination and leaves the new copy in the section where the original was prior to the duplication. Was that intended? It seems counter-intuitive to me. (I had expected the new copy to be in the "Duplicate to" destination, with the original left in the original section.) How do you feel about my changing that behaviour?

Syxton commented 8 years ago

I actually hadn't noticed that..oops. Absolutely needs to change.

cdsmith-umn commented 8 years ago

@Syxton No problem. I'll get it changed.

cdsmith-umn commented 8 years ago

This has been merged into Mass Actions and is available from the master branch now. Thank you! (Credit given in the README)

Syxton commented 8 years ago

I'm getting a 'Target section does not exist' error when I tested this.

cdsmith-umn commented 8 years ago

I'll investigate

Syxton commented 8 years ago

I also noticed that the Move to box isn't being populated with sections.

cdsmith-umn commented 8 years ago

I have the first problem solved. Working on the Move to box

Syxton commented 8 years ago

module.js line 87

    // add to move-to-section
    var section_option      = document.createElement('option');
    section_option.text     = section_text;
    section_option.value    = section_number;
    section_moveto.options[section_moveto.options.length] = section_option;

    // add to duplicate-to-section
    var section_option      = document.createElement('option');
    section_option.text     = section_text;
    section_option.value    = section_number;
    section_dupto.options[section_dupto.options.length] = section_option;
Syxton commented 8 years ago

not exactly sure why I couldn't reuse that variable....

cdsmith-umn commented 8 years ago

Yep. I just found the problem myself. I'll have it up on Github momentarily.

cdsmith-umn commented 8 years ago

The fix is up on Github now.