--- loncom/publisher/publisher.html 2004/04/15 19:32:37 1.38 +++ loncom/publisher/publisher.html 2009/12/14 15:37:38 1.41 @@ -82,18 +82,25 @@ function getcurseed() { } function getproblemtype() { - if (parent.LONCAPAToBePublished.document.lonhomework) { - var optionelement; - var valueIndex=0; - for (var optionIndex=0; - optionIndex < parent.LONCAPAToBePublished.document.lonhomework.problemtype.options.length; - optionIndex++) - { - optionElement=parent.LONCAPAToBePublished.document.lonhomework.problemtype.options[optionIndex]; - if (optionElement.selected) { - return optionElement.value; - } - } + if (parent.LONCAPAToBePublished.document.lonhomework + && + parent.LONCAPAToBePublished.document.lonhomework.problemtype) { + if (parent.LONCAPAToBePublished.document.lonhomework.problemtype.value) { + return parent.LONCAPAToBePublished.document.lonhomework.problemtype.value; + } + if (parent.LONCAPAToBePublished.document.lonhomework.problemtype.options) { + var optionelement; + var valueIndex=0; + for (var optionIndex=0; + optionIndex < parent.LONCAPAToBePublished.document.lonhomework.problemtype.options.length; + optionIndex++) + { + optionElement=parent.LONCAPAToBePublished.document.lonhomework.problemtype.options[optionIndex]; + if (optionElement.selected) { + return optionElement.value; + } + } + } } return 0; } @@ -106,23 +113,32 @@ function getpostdata() { } //--> + - -
- - -
+ + + + - - - - - - -
+
+
@@ -130,7 +146,7 @@ function getpostdata() {
+
@@ -141,20 +157,20 @@ function getpostdata() {
+ +
+
@@ -167,6 +183,7 @@ function getpostdata() { + @@ -176,9 +193,6 @@ function getpostdata() {
- -
+