Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

cogmitting merged changes for lib.php (MDL-8675) and mod.html(MDL-8062)

  • Loading branch information...
commit 104189c1f4b1b7cf9e18fff06412247a518cfb31 1 parent a727be0
gbateson authored
Showing with 16 additions and 20 deletions.
  1. +1 −1  mod/hotpot/lib.php
  2. +15 −19 mod/hotpot/mod.html
View
2  mod/hotpot/lib.php
@@ -1683,7 +1683,7 @@ function insert_form($startblock, $endblock, $form_name, $form_fields, $keep_con
$replace .= '\\2';
}
if ($form_name) {
- $replace = '<form action="'.$CFG->wwwroot.'/mod/hotpot/attempt.php" method="post" name="'.$form_name.'"'.$CFG->frametarget.'>'.$replace.'</form>';
+ $replace = '<form action="'.$CFG->wwwroot.'/mod/hotpot/attempt.php" method="post" name="'.$form_name.'" '.$CFG->frametarget.'">'.$replace.'</form>';
}
if ($center) {
$replace = '<div style="margin-left:auto; margin-right:auto; text-align: center;">'.$replace.'</div>';
View
34 mod/hotpot/mod.html
@@ -34,29 +34,25 @@
function hotpot_lockoptions(form, master, subitems, offvalues) {
var disabled = false;
- var Frm = document.forms[form]; // document.getElementById(form);
- if (Frm) {
- var obj = Frm.elements[master];
- if (obj) {
- var v = '';
- if (obj.type=='select-one') {
- var v = obj.options[obj.selectedIndex].value;
- for (i=0; i<offvalues.length; i++) {
- if (v==offvalues[i]) {
- disabled = true;
- }
- }
- } else if (obj.type=='checkbox') {
- if (obj.checked==false) {
+ var obj = eval("document."+form+"."+master);
+ if (obj) {
+ var v = '';
+ if (obj.type=='select-one') {
+ var v = obj.options[obj.selectedIndex].value;
+ for (i=0; i<offvalues.length; i++) {
+ if (v==offvalues[i]) {
disabled = true;
}
}
+ } else if (obj.type=='checkbox') {
+ if (obj.checked==false) {
+ disabled = true;
+ }
}
+ }
+ if (document.getElementById) {
for (i=0; i<subitems.length; i++) {
- var obj = Frm.elements[subitems[i]];
- if (obj) {
- obj.disabled = disabled;
- }
+ eval("document."+form+"."+subitems[i]+".disabled="+disabled);
}
}
return(true);
@@ -375,7 +371,7 @@
// override the standard Moodle "setfocus" function,
// which gives a js error if the "name" field is hidden
function setfocus() {
- var f = document.getElementById('form');
+ var f = getElementById('form');
if (f) {
if (canfocus(f, 'namesource')) {
f.namesource.focus();
Please sign in to comment.
Something went wrong with that request. Please try again.