summaryrefslogtreecommitdiff
path: root/testapp/static/exam/js/add_questionpaper.js
blob: 6185dd511e1c021d6f2652fc0573b71fa449909a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
function load_data()
{
    var url_root = document.getElementById('url_root').value;
    var value = document.getElementById('mode').value;
    var pathArray = window.location.pathname.split( '/' );
    length = pathArray.length;
    var digit = parseInt(pathArray[length-2]);

    if (! isNaN(digit) && value == 'Automatic') 
    {
         window.location = url_root + "/exam/manage/designquestionpaper/automatic/" + digit;
    }
    else if(!isNaN(digit) && value == 'Manual')
    {
         window.location = url_root + "/exam/manage/designquestionpaper/manual/" + digit;
    }
    else if(value == 'Automatic')
    {
         window.location = window.location.pathname + "automatic";
    }
    else if( value == 'Manual')
    {
         window.location = window.location.pathname + "manual";
    }
}