Skip to content
Snippets Groups Projects
suivi.js 1.79 KiB
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.

/**
 * Handle add/remove competency links.
 *
 * @module     tool_lp/competencies
 * @package    tool_lp
 * @copyright  2015 Damyon Wiese <damyon@moodle.com>
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
 */
define(['jquery'],
       function($, notification, ajax, templates, str, Picker, dragdrop, Pending) {

    

    /**
     * Pick a competency
     *
     * @method pickCompetency
     * @return {Promise}
     */
  
    function registerSelectAll(){
    	$('#iena-select-all').on('click', function(e){
    		console.log("on sélectionne tout");
    		select_all_studs(e);

    	})
    }

    function select_all_studs(e) {
		//e.preventDefault();
		var counter = 0;
		var checks = document.querySelectorAll("#table-body tr");
		for (var i = 0; i < checks.length; i++) {
			if ( checks[i].style.display != "none" || data.all_selected ) {
				var box = checks[i].querySelector("input[type='checkbox']");
				box.checked = !data.all_selected;
				counter++;
			}
		}
		if ( counter > 0 ) {
			
			
			data.all_selected = !data.all_selected;
		}
	}


	console.log("on passe par ici");
	//registerSelectAll();

  
});