--- modules/gci/londocsgci.pm 2010/01/05 23:54:31 1.9
+++ modules/gci/londocsgci.pm 2010/01/15 18:21:08 1.11
@@ -2,7 +2,7 @@
# Custom Edit Course Routines for Assembly of Valid Concept Tests from
# Geoscience Concept Inventory.
#
-# $Id: londocsgci.pm,v 1.9 2010/01/05 23:54:31 gci Exp $
+# $Id: londocsgci.pm,v 1.11 2010/01/15 18:21:08 gci Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -243,7 +243,8 @@ sub listresources {
&Apache::lonhtmlcommon::row_closure(1).
&Apache::lonhtmlcommon::row_title(&mt('Close date')).
$endform.
- &Apache::lonhtmlcommon::end_pick_box().'
'.
+ &Apache::lonhtmlcommon::row_closure(1).
+ &Apache::lonhtmlcommon::end_pick_box().'
'.
''.
''.
'
');
@@ -309,7 +310,7 @@ sub display_questions {
'value="'.$fixed{$catname}.'" readonly="readonly" />').'';
} else {
$output .= '';
}
$output .= ''.
@@ -333,7 +334,7 @@ sub display_questions {
} elsif ($catname eq 'development') {
$output .= '';
} else {
- $output .= '{$item}) { $output .= ' checked="checked"'; }
$output .= ' onclick="countChecked('."'$catname'".');';
my $binname;
@@ -606,11 +607,13 @@ sub builder_javascript {
my $prereqjs = "
function checkPrereqs(caller,item,prereq,binname) {
var changedPrereq = 0;
- if (document.selecteditems.elements['item'+item].checked == false) {
+ element = document.getElementById('item'+item);
+ if (element.checked == false) {
return;
} else {
- if (!document.selecteditems.elements['item'+prereq].checked) {
- document.selecteditems.elements['item'+prereq].checked = true;
+ prereqelement = document.getElementById('item'+prereq);
+ if (!prereqelement.checked) {
+ prereqelement.checked = true;
changedPrereq = 1;
countChecked(binname);
}
@@ -695,13 +698,15 @@ function countChecked(binname) {
if (document.selecteditems.elements[i].value == binname) {
var itemname = document.selecteditems.elements[i].name;
var itemnum = itemname.substr(9);
- if (document.selecteditems.elements['item'+itemnum].checked) {
+ element = document.getElementById('item'+itemnum);
+ if (element.checked) {
count ++;
}
}
}
}
- document.selecteditems.elements['GCI_'+binname+'_count'].value = count;
+ countelement = document.getElementById('GCI_'+binname+'_count');
+ countelement.value = count;
}
function validTestCheck() {
@@ -709,7 +714,8 @@ function validTestCheck() {
for (var i=0; i<11; i++) {
var binname = 'GCI_bin'+i+'_count';
var j = i+1;
- if (document.selecteditems.elements[binname].value < 1) {
+ countelement = document.getElementById(binname);
+ if (countelement.value < 1) {
empty = empty +' '+j;
}
}
@@ -726,8 +732,6 @@ function setDocsPhase() {
if (document.choices.concepttest[i].checked) {
if (document.choices.concepttest[i].value == 'defchosen') {
document.choices.phase.value = 'storemap';
- alert("Setting value for phase to "+document.choices.phase.value);
-
}
}
}