--- loncom/interface/lonextresedit.pm 2017/11/30 01:52:14 1.20
+++ loncom/interface/lonextresedit.pm 2018/01/31 14:51:05 1.24
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Documents
#
-# $Id: lonextresedit.pm,v 1.20 2017/11/30 01:52:14 raeburn Exp $
+# $Id: lonextresedit.pm,v 1.24 2018/01/31 14:51:05 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -98,7 +98,7 @@ sub handler {
}
my %ltitools;
if ($type eq 'tool') {
- %ltitools = &Apache::lonnet::get_domain_ltitools($cdom);
+ %ltitools = &Apache::lonnet::get_domain_lti($cdom,'consumer');
}
my $js = &Apache::lonhtmlcommon::scripttag(&extedit_javascript());
my $pathitem = '{$toolhash{'id'}}->{'crsconf'}) eq 'HASH') {
if ($ltitools->{$toolhash{'id'}}->{'crsconf'}->{'title'}) {
$crstitle = $toolhash{'crstitle'};
@@ -495,6 +549,7 @@ sub extedit_form {
}
}
$toolelem = ''.$image.' '.$tooltitle.'
';
+ $gradablestyle = 'display:inline';
}
}
}
@@ -527,6 +582,7 @@ sub extedit_form {
$crslabel = $env{'course.'.$cdom.'_'.$cnum.'.internal.coursecode'};
$crstitle = $env{'course.'.$cdom.'_'.$cnum.'.description'};
$crsappend = '';
+ $chknogrd = ' checked="checked"';
}
$toolelem .= '
'.
+ ''.
+ ''.&mt('Gradable').' '.
+ ''.(' 'x2).
+ '
';
}
my $chooser = $toolelem;
if ($type eq 'ext') {
@@ -621,7 +683,7 @@ sub display_editor {
}
my %ltitools;
if ($type eq 'tool') {
- %ltitools = &Apache::lonnet::get_domain_ltitools($cdom);
+ %ltitools = &Apache::lonnet::get_domain_lti($cdom,'consumer');
}
$js = &Apache::lonhtmlcommon::scripttag(&extedit_javascript());
my $args = { 'force_register' => $env{'form.register'} };
@@ -656,7 +718,7 @@ sub extedit_javascript {
" var ltitoolsLink = new Array($num);\n".
" var ltitoolsExplain = new Array($num);\n".
" var ltitoolsLabel = new Array($num);\n".
- " var ltitoolsTitle = new Array($num);\n";
+ " var ltitoolsTitle = new Array($num);\n".
" var ltitoolsAppend = new Array($num);\n";
my $i = 0;
foreach my $key (sort { $a <=> $b } keys(%{$toolsref})) {
@@ -673,6 +735,7 @@ sub extedit_javascript {
} else {
$providerurl = $toolsref->{$key}->{'url'};
}
+ $providerurl = &LONCAPA::map::qtunescape($providerurl);
$toolsjs .= ' ltitools['.$i.'] = '."'$key';\n".
' ltitoolsTarget['.$i.'] = '."'$target';\n".
' ltitoolsWidth['.$i.'] = '."'$width';\n".
@@ -842,6 +905,32 @@ function setExternal(extform,residx,type
} else {
info += ':';
}
+ var gradablediv = prefix+'toolgradablediv';
+ if (residx > 0) {
+ gradablediv += '_'+residx;
+ }
+ if (document.getElementById(gradablediv)) {
+ if (document.getElementById(gradablediv).style.display == 'inline') {
+ if (extform.exttoolgradable.length) {
+ for (var i=0; i 0) {
eval("extform.importdetail.value=title+'='+info+'='+residx;extform.submit();");
@@ -893,6 +982,7 @@ function updateExttool(caller,form,suppl
labeldiv = prefix+'toolcrslabeldiv';
titlediv = prefix+'toolcrstitlediv';
appenddiv = prefix+'toolcrsappenddiv';
+ gradablediv = prefix+'toolgradablediv';
providerurl = prefix+'toolproviderurl';
labelinput = prefix+'toolcrslabel';
titleinput = prefix+'toolcrstitle';
@@ -930,6 +1020,9 @@ function updateExttool(caller,form,suppl
if (document.getElementById(appenddiv)) {
document.getElementById(appenddiv).style.display = 'none';
}
+ if (document.getElementById(gradablediv)) {
+ document.getElementById(gradablediv).style.display = 'none';
+ }
} else {
if (ltitools.length > 0) {
for (var j=0; j';
+ document.getElementById(providerurl).innerHTML = ' ('+ltitoolsUrl[j]+')
';
}
}
} else {
document.getElementById(appenddiv).style.display = 'none';
if (document.getElementById(providerurl)) {
- document.getElementById(providerurl).innerHTML.value = '';
+ document.getElementById(providerurl).innerHTML = '';
}
}
}
+ if (document.getElementById(gradablediv)) {
+ if (supplementalflag != 1) {
+ document.getElementById(gradablediv).style.display = 'inline';
+ }
+ }
break;
}
}