How to tell if $query_var isset?

use the indentical comparison operator:

if(get_query_var('cls') !== '' && get_query_var('ch') !== '') {
    mcs_textbook_chapter($dialect, $cls, $ch);
} elseif(get_query_var('cls') !== '') {              
    mcs_textbook_chapter($dialect, $cls);
} else {
    mcs_textbook($dialect);
}