[LON-CAPA-cvs] cvs: rat /client parameter.html loncom/publisher packages.tab

www lon-capa-cvs@mail.lon-capa.org
Thu, 10 Jul 2003 08:34:43 -0000


www		Thu Jul 10 04:34:43 2003 EDT

  Modified files:              
    /loncom/publisher	packages.tab 
    /rat/client	parameter.html 
  Log:
  Bug #1733:
  
  Choice box for different string-type parameters, including question type.
  
  Needs documentation of what each type does.
  
  Was unsure of the possible values for "Exam Type" and decided that those
  are "online" and "checkout" for now.
  
  
Index: loncom/publisher/packages.tab
diff -u loncom/publisher/packages.tab:1.20 loncom/publisher/packages.tab:1.21
--- loncom/publisher/packages.tab:1.20	Wed Jul  9 06:03:53 2003
+++ loncom/publisher/packages.tab	Thu Jul 10 04:34:42 2003
@@ -15,7 +15,7 @@
 part&problemstyle&display:Exam Type
 part&problemstyle&type:string_examtype
 part&acc&display:Client IP/Name Access Control
-part&acc&type:string
+part&acc&type:string_ip
 part&problemstatus&type:string_yesno
 part&problemstatus&default:yes
 part&problemstatus&display:Show Problem Status
Index: rat/client/parameter.html
diff -u rat/client/parameter.html:1.24 rat/client/parameter.html:1.25
--- rat/client/parameter.html:1.24	Thu May 22 19:13:58 2003
+++ rat/client/parameter.html	Thu Jul 10 04:34:43 2003
@@ -3,7 +3,7 @@
 The LearningOnline Network with CAPA
 Parameter Input Window
 //
-// $Id: parameter.html,v 1.24 2003/05/22 23:13:58 www Exp $
+// $Id: parameter.html,v 1.25 2003/07/10 08:34:43 www Exp $
 //
 // Copyright Michigan State University Board of Trustees
 //
@@ -304,6 +304,11 @@
    draw();
 }
 
+function radiostringeval(newval) {
+   svalue=newval;
+   draw();
+}
+
 function intervaldis() {
     csecs=svalue;
     cdays=Math.floor(csecs/86400);
@@ -520,12 +525,74 @@
          tablestart('Default value or none');
          choicewrite('</table>');         
       } else {
-        if (pscat=='any') {
+        if ((pscat=='any') || (pscat=='') || (typeof(pscat)=='undefined')) {
            tablestart('Text');
+	   choicewrite('<tr bgcolor="#AAFFAA"><td>Value:</td><td colspan=2>');
+           choicewrite('<input name="stringval" size="20" value="'+svalue+
+                    '" type="text" onChange="parent.stringeval()">');
+        }
+        if (pscat=='yesno') {
+           tablestart('Yes/No');
+	   choicewrite('<tr bgcolor="#AAFFAA"><td>Value:</td><td colspan=2>');
+           choicewrite('<input name="stringval" value="yes"'+
+                  ' type="radio" onChange="parent.radiostringeval(\'yes\')"');
+           if (svalue=='yes') { choicewrite(' checked'); }
+           choicewrite('> Yes<br />');
+           choicewrite('<input name="stringval" value="no"'+
+                  ' type="radio" onChange="parent.radiostringeval(\'no\')"');
+           if (svalue=='no') { choicewrite(' checked'); }
+           choicewrite('> No<br />');
+        }
+        if (pscat=='examtype') {
+           tablestart('Exam Type');
+	   choicewrite('<tr bgcolor="#AAFFAA"><td>Value:</td><td colspan=2>');
+           choicewrite('<input name="stringval" value="online"'+
+                ' type="radio" onChange="parent.radiostringeval(\'online\')"');
+           if (svalue=='online') { choicewrite(' checked'); }
+           choicewrite('> Online<br />');
+           choicewrite('<input name="stringval" value="checkout"'+
+              ' type="radio" onChange="parent.radiostringeval(\'checkout\')"');
+           if (svalue=='checkout') { choicewrite(' checked'); }
+           choicewrite('> Check out<br />');
+       }
+        if (pscat=='questiontype') {
+           tablestart('Question Type');
+	   choicewrite('<tr bgcolor="#AAFFAA"><td>Value:</td><td colspan=2>');
+           choicewrite('<input name="stringval" value="problem"'+
+               ' type="radio" onChange="parent.radiostringeval(\'problem\')"');
+           if (svalue=='problem') { choicewrite(' checked'); }
+           choicewrite('> Standard Problem<br />');
+           choicewrite('<input name="stringval" value="quiz"'+
+                  ' type="radio" onChange="parent.radiostringeval(\'quiz\')"');
+           if (svalue=='quiz') { choicewrite(' checked'); }
+           choicewrite('> Quiz<br />');
+           choicewrite('<input name="stringval" value="exam"'+
+                  ' type="radio" onChange="parent.radiostringeval(\'exam\')"');
+           if (svalue=='exam') { choicewrite(' checked'); }
+           choicewrite('> Exam<br />');
+           choicewrite('<input name="stringval" value="assess"'+
+                ' type="radio" onChange="parent.radiostringeval(\'assess\')"');
+           if (svalue=='assess') { choicewrite(' checked'); }
+           choicewrite('> Assessment<br />');
+           choicewrite('<input name="stringval" value="survey"'+
+                ' type="radio" onChange="parent.radiostringeval(\'survey\')"');
+           if (svalue=='survey') { choicewrite(' checked'); }
+           choicewrite('> Survey<br />');
+           choicewrite('<input name="stringval" value="form"'+
+                  ' type="radio" onChange="parent.radiostringeval(\'form\')"');
+           if (svalue=='form') { choicewrite(' checked'); }
+           choicewrite('> Input Form<br />');
+           choicewrite('<input name="stringval" value="library"'+
+               ' type="radio" onChange="parent.radiostringeval(\'library\')"');
+           if (svalue=='library') { choicewrite(' checked'); }
+           choicewrite('> Library<br />');
+        }
+        if (pscat=='ip') {
+           tablestart('IP Number/Name');
+	   choicewrite('<tr bgcolor="#AAFFAA"><td>Value:</td><td colspan=2>');
+           choicewrite('<input name=stringval size=20 value="'+svalue+
+                    '" onChange="parent.stringeval()">');
         }
-        choicewrite('<tr bgcolor="#AAFFAA"><td>Value:</td><td colspan=2>');
-        choicewrite('<input name=stringval size=20 value="'+svalue+
-                    '" name=stringval onChange="parent.stringeval()">');
         choicewrite('</td></table>');
       }
    }