Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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

  • Loading branch information...
commit 104189c1f4b1b7cf9e18fff06412247a518cfb31 1 parent a727be0
gbateson authored

Showing 2 changed files with 16 additions and 20 deletions. Show diff stats Hide diff stats

  1. +1 1  mod/hotpot/lib.php
  2. +15 19 mod/hotpot/mod.html
2  mod/hotpot/lib.php
@@ -1683,7 +1683,7 @@ function insert_form($startblock, $endblock, $form_name, $form_fields, $keep_con
1683 1683 $replace .= '\\2';
1684 1684 }
1685 1685 if ($form_name) {
1686   - $replace = '<form action="'.$CFG->wwwroot.'/mod/hotpot/attempt.php" method="post" name="'.$form_name.'"'.$CFG->frametarget.'>'.$replace.'</form>';
  1686 + $replace = '<form action="'.$CFG->wwwroot.'/mod/hotpot/attempt.php" method="post" name="'.$form_name.'" '.$CFG->frametarget.'">'.$replace.'</form>';
1687 1687 }
1688 1688 if ($center) {
1689 1689 $replace = '<div style="margin-left:auto; margin-right:auto; text-align: center;">'.$replace.'</div>';
34 mod/hotpot/mod.html
@@ -34,29 +34,25 @@
34 34
35 35 function hotpot_lockoptions(form, master, subitems, offvalues) {
36 36 var disabled = false;
37   - var Frm = document.forms[form]; // document.getElementById(form);
38   - if (Frm) {
39   - var obj = Frm.elements[master];
40   - if (obj) {
41   - var v = '';
42   - if (obj.type=='select-one') {
43   - var v = obj.options[obj.selectedIndex].value;
44   - for (i=0; i<offvalues.length; i++) {
45   - if (v==offvalues[i]) {
46   - disabled = true;
47   - }
48   - }
49   - } else if (obj.type=='checkbox') {
50   - if (obj.checked==false) {
  37 + var obj = eval("document."+form+"."+master);
  38 + if (obj) {
  39 + var v = '';
  40 + if (obj.type=='select-one') {
  41 + var v = obj.options[obj.selectedIndex].value;
  42 + for (i=0; i<offvalues.length; i++) {
  43 + if (v==offvalues[i]) {
51 44 disabled = true;
52 45 }
53 46 }
  47 + } else if (obj.type=='checkbox') {
  48 + if (obj.checked==false) {
  49 + disabled = true;
  50 + }
54 51 }
  52 + }
  53 + if (document.getElementById) {
55 54 for (i=0; i<subitems.length; i++) {
56   - var obj = Frm.elements[subitems[i]];
57   - if (obj) {
58   - obj.disabled = disabled;
59   - }
  55 + eval("document."+form+"."+subitems[i]+".disabled="+disabled);
60 56 }
61 57 }
62 58 return(true);
@@ -375,7 +371,7 @@
375 371 // override the standard Moodle "setfocus" function,
376 372 // which gives a js error if the "name" field is hidden
377 373 function setfocus() {
378   - var f = document.getElementById('form');
  374 + var f = getElementById('form');
379 375 if (f) {
380 376 if (canfocus(f, 'namesource')) {
381 377 f.namesource.focus();

0 comments on commit 104189c

Please sign in to comment.
Something went wrong with that request. Please try again.