﻿// this script is added to the test pages when questiontype=2 (drag and drop)


	function verticalOnly(item) {
		item.toolManDragGroup.verticalOnly()
	}

	function speak(id, what) {
		var element = document.getElementById(id);
		element.innerHTML = 'Clicked ' + what;
	}

	function saveOrder() {
        var list = document.getElementById('optionslist');
        if (list==undefined)
         {return true;}
        else
        {
            var items = list.getElementsByTagName('li');
            var ids = '';
            var id = '';
            var hiddeninput = document.getElementById('hdnListOrder'); // the input field storing the order

            for (var i = 0; i < items.length; i++)  {
                if (i > 0) ids += ':'; 
                id = items[i].getAttribute("itemID");
                ids += id;
            }

            hiddeninput.value = ids;
            return true;
        }
    }
