version 1.690, 2022/12/31 14:08:59
|
version 1.691, 2023/01/05 21:33:31
|
Line 6532 NROSTFORM
|
Line 6532 NROSTFORM
|
NWEBFORM |
NWEBFORM |
|
|
my @ids=&Apache::lonnet::current_machine_ids(); |
my @ids=&Apache::lonnet::current_machine_ids(); |
my (%select_menus,$rolehomes); |
my $machines_str = "'".join("','",@ids)."'"; |
my $numauthor = 0; |
my (%is_home,%toppath,$rolehomes); |
my $numcrsdirs = 0; |
|
my ($showstdprob,$showswitch,$switchlink); |
|
my $toppath = "/priv/$env{'user.domain'}/$env{'user.name'}"; |
|
my $exclude = &Apache::lonnet::priv_exclude(); |
|
if ($env{'user.author'}) { |
if ($env{'user.author'}) { |
$numauthor ++; |
|
$select_menus{'author'}->{'text'} = &Apache::lonnet::plaintext('au'); |
|
if (grep(/^\Q$env{'user.home'}\E$/,@ids)) { |
if (grep(/^\Q$env{'user.home'}\E$/,@ids)) { |
my $is_home = 1; |
$is_home{'author'} = 1; |
my %subdirs; |
|
&Apache::lonnet::recursedirs($is_home,1,'',$exclude,0,$toppath,'',\%subdirs); |
|
$select_menus{'author'}->{'default'} = '/'; |
|
my @ordered = (); |
|
foreach my $relpath (sort { lc($a) cmp lc($b) } (keys(%subdirs))) { |
|
$select_menus{'author'}->{'select2'}->{$relpath} = $relpath; |
|
push(@ordered,$relpath); |
|
} |
|
$select_menus{'author'}->{'order'} = \@ordered; |
|
$showstdprob = 'block'; |
|
} else { |
|
$rolehomes = '<input type="hidden" name="rolehome_author" value="'.$env{'user.home'}.'" />'."\n"; |
|
$select_menus{'author'}->{'select2'}->{'switch'} = &mt('Switch server required'); |
|
$select_menus{'author'}->{'default'} = 'switch'; |
|
$select_menus{'author'}->{'order'} = ['switch']; |
|
$showstdprob = 'none'; |
|
} |
} |
|
$rolehomes = '<input type="hidden" id="rolehome_author" name="rolehome_author" value="'.$env{'user.home'}.'" />'."\n"; |
} |
} |
my %roleshash = &Apache::lonnet::get_my_roles($env{'user.name'},$env{'user.domain'},'userroles', |
my %roleshash = &Apache::lonnet::get_my_roles($env{'user.name'},$env{'user.domain'},'userroles', |
['active'],['ca','aa']); |
['active'],['ca','aa']); |
my $crshome = $env{'course.'.$env{'request.course.id'}.'.home'}; |
my %by_roletype; |
my (%by_roletype,%at_home); |
|
if (keys(%roleshash)) { |
if (keys(%roleshash)) { |
foreach my $entry (keys(%roleshash)) { |
foreach my $entry (keys(%roleshash)) { |
my ($auname,$audom,$roletype) = split(/:/,$entry); |
my ($auname,$audom,$roletype) = split(/:/,$entry); |
my $key = $entry; |
my $key = $entry; |
$key =~ s/:/___/g; |
$key =~ s/:/___/g; |
$by_roletype{$roletype}{$auname.'___'.$audom} = 1; |
my $author = $auname.'___'.$audom; |
$select_menus{$key}->{'text'} = &Apache::lonnet::plaintext($roletype)." ($audom/$auname)"; |
$by_roletype{$roletype}{$author} = 1; |
my $rolehome = &Apache::lonnet::homeserver($auname,$audom); |
my $rolehome = &Apache::lonnet::homeserver($auname,$audom); |
if (grep(/^\Q$rolehome\E$/,@ids)) { |
$toppath{$author} = "/priv/$audom/$auname"; |
$at_home{$auname.'___'.$audom} = 1; |
if (grep(/^\Q$rolehome\E$/,@ids)) { |
my $is_home = 1; |
$is_home{$author} = 1; |
my (%subdirs,@ordered); |
|
my $toppath="/priv/$audom/$auname"; |
|
&Apache::lonnet::recursedirs($is_home,1,'',$exclude,0,$toppath,'',\%subdirs); |
|
$select_menus{$key}->{'default'} = '/'; |
|
foreach my $relpath (sort { lc($a) cmp lc($b) } (keys(%subdirs))) { |
|
$select_menus{$key}->{'select2'}->{$relpath} = $relpath; |
|
push(@ordered,$relpath); |
|
} |
|
$select_menus{$key}->{'order'} = \@ordered; |
|
} else { |
|
$rolehomes .= '<input type="hidden" name="rolehome_coauthor" value="'.$roletype.'='.$audom.'/'.$auname.'='.$rolehome.'" />'."\n"; |
|
$select_menus{$key}->{'select2'}->{'switch'} = &mt('Switch server required'); |
|
$select_menus{$key}->{'default'} = 'switch'; |
|
$select_menus{$key}->{'order'} = ['switch']; |
|
} |
|
$numauthor ++; |
|
} |
|
} |
|
my ($pickdir,$showtitle); |
|
if ($numauthor) { |
|
my @order; |
|
my $defrole; |
|
if ($env{'user.author'}) { |
|
push(@order,'author'); |
|
$defrole = 'author'; |
|
} |
|
if (keys(%by_roletype)) { |
|
foreach my $possrole ('ca','aa') { |
|
if (ref($by_roletype{$possrole}) eq 'HASH') { |
|
foreach my $author (sort { lc($a) cmp lc($b) } (keys(%{$by_roletype{$possrole}}))) { |
|
unless ($defrole) { |
|
$defrole = $author; |
|
if ($at_home{$author}) { |
|
$showstdprob = 'block'; |
|
} else { |
|
$showstdprob = 'none'; |
|
} |
|
} |
|
push(@order,$author.'___'.$possrole); |
|
} |
|
} |
|
} |
} |
|
$rolehomes .= '<input type="hidden" id="rolehome_coauthor_'.$roletype.'_'.$audom.'/'.$auname.'" '. |
|
'name="rolehome_coauthor" value="'.$roletype.'='.$audom.'/'.$auname.'='.$rolehome.'" />'."\n"; |
} |
} |
$select_menus{'course'}->{'text'} = &mt('Course Resource'); |
} |
if (grep(/^\Q$crshome\E$/,@ids)) { |
my $crshome = $env{'course.'.$env{'request.course.id'}.'.home'}; |
my $is_home = 1; |
if (grep(/^\Q$crshome\E$/,@ids)) { |
my %subdirs; |
$is_home{'course'} = 1; |
my $toppath="/priv/$coursedom/$coursenum"; |
} |
&Apache::lonnet::recursedirs($is_home,1,'',$exclude,0,$toppath,'',\%subdirs); |
$rolehomes .= '<input type="hidden" id="rolehome_course" name="rolehome_course" value="'.$crshome.'" />'."\n"; |
$numcrsdirs = keys(%subdirs); |
my $pickdir = $lt{'loca'}. |
$select_menus{'course'}->{'default'} = '/'; |
'<select name="authorrole" onchange="populateDirSelects(this.form,'."'authorrole','authorpath'".',1,1,0);">'."\n". |
my @ordered = (); |
'<option value="" selected="selected">'.&mt('Select').'</option>'."\n"; |
foreach my $relpath (sort { lc($a) cmp lc($b) } (keys(%subdirs))) { |
if ($env{'user.author'}) { |
$select_menus{'course'}->{'select2'}->{$relpath} = $relpath; |
$pickdir .= '<option value="author">'.&Apache::lonnet::plaintext('au').'</option>'."\n"; |
push(@ordered,$relpath); |
} |
} |
if (keys(%by_roletype)) { |
$select_menus{'course'}->{'order'} = \@ordered; |
foreach my $possrole ('ca','aa') { |
} else { |
if (ref($by_roletype{$possrole}) eq 'HASH') { |
$rolehomes .= '<input type="hidden" name="rolehome_course" value="'.$crshome.'" />'."\n"; |
my $roletitle = &Apache::lonnet::plaintext($possrole); |
$select_menus{'course'}->{'select2'}->{'switch'} = &mt('Switch server required'); |
foreach my $author (sort { lc($a) cmp lc($b) } (keys(%{$by_roletype{$possrole}}))) { |
$select_menus{'course'}->{'default'} = 'switch'; |
my ($none,$where,$auname,$audom) = split(/\//,$toppath{$author}); |
$select_menus{'course'}->{'order'} = ['switch']; |
$pickdir .= '<option value="'.$author.'___'.$possrole.'">'. |
} |
$roletitle." ($audom/$auname)</option>\n"; |
push(@order,'course'); |
|
$pickdir = $lt{'loca'}. |
|
&Apache::loncommon::linked_select_forms('courseresform','<br />'.$lt{'dire'}, |
|
$defrole,'authorrole','authorpath', |
|
\%select_menus,\@order,'toggleCrsResTitle();', |
|
'','priv').'<br />'; |
|
$showtitle = 'none'; |
|
} else { |
|
my $is_home; |
|
$showtitle = 'inline'; |
|
if (grep(/^\Q$crshome\E$/,@ids)) { |
|
$is_home = 1; |
|
$showstdprob = 'block'; |
|
$pickdir .= '<input type="hidden" name="authorrole" value="course" />'; |
|
my $toppath="/priv/$coursedom/$coursenum'}"; |
|
my %subdirs; |
|
&Apache::lonnet::recursedirs($is_home,1,'',$exclude,0,$toppath,'',\%subdirs); |
|
$numcrsdirs = keys(%subdirs); |
|
if ($numcrsdirs) { |
|
$pickdir .= $lt{'dire'}.' <select name="authorpath">'."\n". |
|
'<option value="/">/</option>'."\n"; |
|
foreach my $key (sort { lc($a) cmp lc($b) } (keys(%subdirs))) { |
|
$pickdir .= '<option value="'.$key.'">'.$key.'</option>'."\n"; |
|
} |
} |
$pickdir .= '</select>'; |
|
} else { |
|
$pickdir .= '<input type="hidden" name="authorpath" value="/" />'."\n"; |
|
} |
} |
} else { |
|
$showstdprob = 'none'; |
|
$rolehomes .= '<input type="hidden" name="rolehome_course" value="'.$crshome.'" />'."\n"; |
|
my @order; |
|
$select_menus{'course'}->{'text'} = &mt('Course Resource'); |
|
$select_menus{'course'}->{'select2'}->{'switch'} = &mt('Switch server required'); |
|
$select_menus{'course'}->{'default'} = 'switch'; |
|
$select_menus{'course'}->{'order'} = ['switch']; |
|
push(@order,'course'); |
|
my $defrole = 'course'; |
|
$pickdir = $lt{'loca'}. |
|
&Apache::loncommon::linked_select_forms('courseresform','<br />'.$lt{'dire'}, |
|
$defrole,'authorrole','authorpath', |
|
\%select_menus,\@order,'toggleCrsResTitle();', |
|
'','priv').'<br />'; |
|
$showtitle = 'none'; |
|
|
|
} |
} |
} |
} |
if ($showstdprob eq 'none') { |
$pickdir .= '<option value="course">'.&mt('Course Resource').'</option>'."\n". |
$showswitch = 'block'; |
'</select><br />'."\n". |
} else { |
$lt{'dire'}. |
$showswitch = 'none'; |
'<select name="authorpath" onchange="toggleCrsResTitle();">'. |
} |
'<option value=""></option>'. |
|
'</select><br />'."\n"; |
|
|
my %seltemplate_menus; |
my %seltemplate_menus; |
my @files = &Apache::lonhomework::get_template_list('problem'); |
my @files = &Apache::lonhomework::get_template_list('problem'); |
Line 6733 NWEBFORM
|
Line 6630 NWEBFORM
|
my $templatepreview = '<a href="#" target="sample" onclick="javascript:getExample(600,420,\'yes\',true); return false;">'. |
my $templatepreview = '<a href="#" target="sample" onclick="javascript:getExample(600,420,\'yes\',true); return false;">'. |
'<span id="newresexample">'.&mt('Example').'<span></a>'; |
'<span id="newresexample">'.&mt('Example').'<span></a>'; |
my $crsresform=(<<RESFORM); |
my $crsresform=(<<RESFORM); |
<a class="LC_menubuttons_link" href="javascript:toggleCrsRes('res','$numauthor','$numcrsdirs');"> |
<a class="LC_menubuttons_link" href="javascript:toggleCrsRes('res');"> |
$lt{'stpr'}</a>$help{'Course_Resource'} |
$lt{'stpr'}</a>$help{'Course_Resource'} |
<form action="/adm/coursedocs" method="post" name="courseresform"> |
<form action="/adm/coursedocs" method="post" name="courseresform"> |
<fieldset id="crsresform" style="display:none;"> |
<fieldset id="crsresform" style="display:none;"> |
Line 6741 NWEBFORM
|
Line 6638 NWEBFORM
|
<input type="hidden" name="active" value="bb" /> |
<input type="hidden" name="active" value="bb" /> |
<p> |
<p> |
$pickdir |
$pickdir |
<div id="newstdproblem" style="display:$showstdprob;"> |
<div id="newstdproblem" style="display:none;"> |
<span class="LC_nobreak">$lt{'news'}? |
<span class="LC_nobreak">$lt{'news'}? |
<label><input type="radio" name="newsubdir" value="0" onclick="toggleNewsubdir(this.form);" checked="checked" $disabled />No</label> |
<label><input type="radio" name="newsubdir" value="0" onclick="toggleNewsubdir(this.form);" checked="checked" $disabled />No</label> |
|
|
Line 6752 NWEBFORM
|
Line 6649 NWEBFORM
|
$lt{'fnam'} |
$lt{'fnam'} |
<input type="text" size="20" name="newresourcename" autocomplete="off" $disabled /> |
<input type="text" size="20" name="newresourcename" autocomplete="off" $disabled /> |
<p> |
<p> |
<div id="newresource" style="display:$showtitle"> |
<div id="newresource" style="display:none"> |
$lt{'addp'} |
$lt{'addp'} |
<label><input type="radio" name="newresourceadd" value="0" checked="checked" onclick="toggleNewInCourse(this.form);" $disabled /> |
<label><input type="radio" name="newresourceadd" value="0" checked="checked" onclick="toggleNewInCourse(this.form);" $disabled /> |
$lt{'no'}</label> |
$lt{'no'}</label> |
Line 6778 NWEBFORM
|
Line 6675 NWEBFORM
|
<input type="submit" name="newcrs" value="$lt{'crpr'}" $disabled /> |
<input type="submit" name="newcrs" value="$lt{'crpr'}" $disabled /> |
</span> |
</span> |
</div> |
</div> |
<div id="stdprobswitch" style="display:$showswitch;"> |
<div id="stdprobswitch" style="display:none;"> |
$rolehomes |
$rolehomes |
<input type="button" name="switchfornewprob" value="$lt{'swit'}" onclick="switchForProb();" /> |
<input type="button" name="switchfornewprob" value="$lt{'swit'}" onclick="switchForProb();" /> |
</div> |
</div> |
Line 6880 NGFFORM
|
Line 6777 NGFFORM
|
{'<img class="LC_noBorder LC_middle" src="/res/adm/pages/simpprob.png" alt="'.$lt{sipr}.'" onclick="javascript:makesmpproblem();" />'=>$newsmpproblemform}, |
{'<img class="LC_noBorder LC_middle" src="/res/adm/pages/simpprob.png" alt="'.$lt{sipr}.'" onclick="javascript:makesmpproblem();" />'=>$newsmpproblemform}, |
{'<img class="LC_noBorder LC_middle" src="/res/adm/pages/dropbox.png" alt="'.$lt{drbx}.'" onclick="javascript:makedropbox();" />'=>$newdropboxform}, |
{'<img class="LC_noBorder LC_middle" src="/res/adm/pages/dropbox.png" alt="'.$lt{drbx}.'" onclick="javascript:makedropbox();" />'=>$newdropboxform}, |
{'<img class="LC_noBorder LC_middle" src="/res/adm/pages/scoreupfrm.png" alt="'.$lt{scuf}.'" onclick="javascript:makeexamupload();" />'=>$newexuploadform}, |
{'<img class="LC_noBorder LC_middle" src="/res/adm/pages/scoreupfrm.png" alt="'.$lt{scuf}.'" onclick="javascript:makeexamupload();" />'=>$newexuploadform}, |
{'<img class="LC_noBorder LC_middle" src="/res/adm/pages/simpprob.png" alt="'.$lt{stpr}.'" onclick="javascript:toggleCrsRes(\'res\','."'$numauthor','$numcrsdirs'".');" />'=>$crsresform}, |
{'<img class="LC_noBorder LC_middle" src="/res/adm/pages/simpprob.png" alt="'.$lt{stpr}.'" onclick="javascript:toggleCrsRes(\'res\');" />'=>$crsresform}, |
); |
); |
$gradingform = &create_form_ul(&create_list_elements(@gradingforma)); |
$gradingform = &create_form_ul(&create_list_elements(@gradingforma)); |
|
|
Line 7516 sub editing_js {
|
Line 7413 sub editing_js {
|
tinc => 'Title in course', |
tinc => 'Title in course', |
sunm => 'Sub-directory name', |
sunm => 'Sub-directory name', |
edri => 'Editing rights unavailable for your current role.', |
edri => 'Editing rights unavailable for your current role.', |
|
sele => 'Select', |
|
swit => 'Switch server required', |
); |
); |
&js_escape(\%js_lt); |
&js_escape(\%js_lt); |
my $crstype = &Apache::loncommon::course_type(); |
my $crstype = &Apache::loncommon::course_type(); |
Line 7528 sub editing_js {
|
Line 7427 sub editing_js {
|
my $toplevelmain = &escape(&default_folderpath($coursenum,$coursedom,$navmapref)); |
my $toplevelmain = &escape(&default_folderpath($coursenum,$coursedom,$navmapref)); |
my $toplevelsupp = &supplemental_base(); |
my $toplevelsupp = &supplemental_base(); |
my $showfile_js = &Apache::loncommon::show_crsfiles_js(); |
my $showfile_js = &Apache::loncommon::show_crsfiles_js(); |
|
my @ids=&Apache::lonnet::current_machine_ids(); |
|
my $machines_str = "'".join("','",@ids)."'"; |
if ($env{'docs.exit.'.$env{'request.course.id'}} =~ /^direct_(.+)$/) { |
if ($env{'docs.exit.'.$env{'request.course.id'}} =~ /^direct_(.+)$/) { |
my $caller = $1; |
my $caller = $1; |
if ($caller =~ /^supplemental/) { |
if ($caller =~ /^supplemental/) { |
Line 7879 function toggleMap(caller) {
|
Line 7780 function toggleMap(caller) {
|
return; |
return; |
} |
} |
|
|
function toggleCrsRes(caller,numauthorrole,numcrsdirs) { |
function toggleCrsRes(caller) { |
var disp = 'none'; |
var disp = 'none'; |
if (document.getElementById('crsresform')) { |
if (document.getElementById('crsresform')) { |
if (caller == 'res') { |
if (caller == 'res') { |
var curr = document.getElementById('crsresform').style.display; |
var form = document.getElementById('crsresform'); |
|
var curr = form.style.display; |
if (curr == 'none') { |
if (curr == 'none') { |
disp='block'; |
disp='block'; |
numauthor = parseInt(numauthorrole); |
document.courseresform.authorrole.selectedIndex = 0; |
if (numauthor > 0) { |
document.courseresform.authorpath.selectedIndex = 0; |
document.courseresform.authorrole.selectedIndex = 0; |
document.courseresform.newresourceadd.selectedIndex = 0; |
select1priv_changed(); |
populateDirSelects(form,'authorrole','authorpath',1,0,0); |
document.courseresform.authorpath.selectedIndex = 0; |
toggleNewInCourse(document.courseresform); |
document.courseresform.newresourceadd.selectedIndex = 0; |
if (document.getElementById('newresource')) { |
toggleNewInCourse(document.courseresform); |
document.getElementById('newresource').style.display = 'none'; |
if (document.getElementById('newresource')) { |
|
document.getElementById('newresource').style.display = 'none'; |
|
} |
|
} else { |
|
if (numcrsdirs) { |
|
document.courseresform.authorpath.selectedIndex = 0; |
|
} |
|
} |
} |
if (document.courseresform.newresusetemp.length) { |
if (document.courseresform.newresusetemp.length) { |
document.courseresform.newresusetemp[0].checked = true; |
document.courseresform.newresusetemp[0].checked = true; |
Line 7953 function toggleNewsubdir(form) {
|
Line 7848 function toggleNewsubdir(form) {
|
|
|
function toggleCrsResTitle() { |
function toggleCrsResTitle() { |
if (document.getElementById('newresource')) { |
if (document.getElementById('newresource')) { |
if (document.courseresform.authorrole.options[document.courseresform.authorrole.selectedIndex].value == 'course') { |
var selloc = document.courseresform.authorrole.options[document.courseresform.authorrole.selectedIndex].value; |
|
if (selloc == 'course') { |
document.getElementById('newresource').style.display = 'inline'; |
document.getElementById('newresource').style.display = 'inline'; |
document.courseresform.newresourceadd[0].checked = true; |
document.courseresform.newresourceadd[0].checked = true; |
toggleNewInCourse(document.courseresform); |
toggleNewInCourse(document.courseresform); |
Line 8071 function toggleImportCrsres(caller) {
|
Line 7967 function toggleImportCrsres(caller) {
|
|
|
$showfile_js |
$showfile_js |
|
|
|
function populateDirSelects(form,locsel,dirsel,setdir,recurse,nonemptydir) { |
|
var location = form.elements[locsel].options[form.elements[locsel].selectedIndex].value; |
|
if ((setdir) && (dirsel != null) && (dirsel != 'undefined') && (dirsel != '')) { |
|
var selelem = form.elements[dirsel]; |
|
var i, numfiles = selelem.options.length -1; |
|
if (numfiles >=0) { |
|
for (i = numfiles; i >= 0; i--) { |
|
selelem.remove(i); |
|
} |
|
} |
|
if ((location == '') || (location == null) || (location == 'undefined')) { |
|
if (selelem.options.length == 0) { |
|
selelem.options[selelem.options.length] = new Option('',''); |
|
selelem.selectedIndex = 0; |
|
} |
|
if (document.getElementById('newstdproblem')) { |
|
document.getElementById('newstdproblem').style.display = 'none'; |
|
} |
|
return; |
|
} |
|
var machineIds = new Array($machines_str); |
|
var athome = 0; |
|
var role = location; |
|
if ((location == 'author') || (location == 'course')) { |
|
if (document.getElementById('rolehome_'+location)) { |
|
var currhome = document.getElementById('rolehome_'+location).value; |
|
if ((currhome != '') && (currhome != null) && (currhome != 'undefined')) { |
|
if (machineIds.includes(currhome)) { |
|
athome = 1; |
|
} |
|
} |
|
} |
|
} else { |
|
const roleinfo = location.split('___'); |
|
role = encodeURIComponent(roleinfo[0]+'./'+roleinfo[1]); |
|
if (document.getElementById('rolehome_coauthor_'+roleinfo[1]+'_'+roleinfo[0])) { |
|
var currhome = document.getElementById('rolehome_coauthor_'+roleinfo[1]+'_'+roleinfo[0]).value; |
|
if ((currhome != '') && (currhome != null) && (currhome != 'undefined')) { |
|
if (machineIds.includes(currhome)) { |
|
athome = 1; |
|
} |
|
} |
|
} |
|
} |
|
if (athome) { |
|
if (document.getElementById('stdprobswitch')) { |
|
document.getElementById('stdprobswitch').style.display = 'none'; |
|
} |
|
if (document.getElementById('newstdproblem')) { |
|
document.getElementById('newstdproblem').style.display = 'none'; |
|
} |
|
var http = new XMLHttpRequest(); |
|
var url = "/adm/courseauthor"; |
|
var params = "role="+role+"&rec="+recurse+"&nonempty="+nonemptydir; |
|
http.open("POST", url, true); |
|
http.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); |
|
http.onreadystatechange = function() { |
|
if (http.readyState == 4 && http.status == 200) { |
|
var data = JSON.parse(http.responseText); |
|
if (Array.isArray(data.dirs)) { |
|
var len = data.dirs.length; |
|
if (len) { |
|
if (len > 1) { |
|
selelem.options[selelem.options.length] = new Option('$js_lt{sele}',''); |
|
} |
|
} |
|
if (len) { |
|
var j; |
|
for (j = 0; j < len; j++) { |
|
selelem.options[selelem.options.length] = new Option(data.dirs[j],data.dirs[j]); |
|
} |
|
selelem.selectedIndex = 0; |
|
} |
|
} |
|
} |
|
} |
|
http.send(params); |
|
} else { |
|
selelem.options[selelem.options.length] = new Option('$js_lt{swit}','switch'); |
|
selelem.selectedIndex = 0; |
|
if (document.getElementById('stdprobswitch')) { |
|
document.getElementById('stdprobswitch').style.display = 'block'; |
|
} |
|
if (document.getElementById('newstdproblem')) { |
|
document.getElementById('newstdproblem').style.display = 'none'; |
|
} |
|
} |
|
} |
|
return; |
|
} |
|
|
function switchForProb() { |
function switchForProb() { |
if (document.courseresform.authorpath.options[document.courseresform.authorpath.selectedIndex].value == 'switch') { |
if (document.courseresform.authorpath.options[document.courseresform.authorpath.selectedIndex].value == 'switch') { |
var url = '/adm/switchserver?otherserver='; |
var url = '/adm/switchserver?otherserver='; |