[rkward-cvs] SF.net SVN: rkward:[2729] trunk

m-eik at users.sourceforge.net m-eik at users.sourceforge.net
Sun Dec 20 23:05:31 UTC 2009


Revision: 2729
          http://rkward.svn.sourceforge.net/rkward/?rev=2729&view=rev
Author:   m-eik
Date:     2009-12-20 23:05:31 +0000 (Sun, 20 Dec 2009)

Log Message:
-----------
irt: migrated all remaining dialogs to js

Modified Paths:
--------------
    trunk/rkward/rkward/plugins/analysis/irt/polytomous/par_est_gpcm.js
    trunk/rkward/rkward/plugins/analysis/irt/tests/eRm_waldtest.js
    trunk/rkward/rkward/plugins/analysis/irt/tests/eRm_waldtest.xml
    trunk/rkward/rkward/plugins/analysis/irt/tests/ltm_cronbach_alpha.js
    trunk/rkward/rkward/plugins/analysis/irt/tests/ltm_cronbach_alpha.xml
    trunk/rkward/rkward/plugins/analysis/irt/tests/ltm_gof_rasch.js
    trunk/rkward/rkward/plugins/analysis/irt/tests/ltm_gof_rasch.xml
    trunk/rkward/rkward/plugins/analysis/irt/tests/ltm_item_fit.js
    trunk/rkward/rkward/plugins/analysis/irt/tests/ltm_item_fit.xml
    trunk/rkward/rkward/plugins/analysis/irt/tests/ltm_person_fit.js
    trunk/rkward/rkward/plugins/analysis/irt/tests/ltm_person_fit.xml
    trunk/rkward/rkward/plugins/analysis/irt/tests/ltm_unidimensional.js
    trunk/rkward/rkward/plugins/analysis/irt/tests/ltm_unidimensional.xml
    trunk/rkward/rkward/plugins/plots/irt/dichotomous/plot_ltm.js
    trunk/rkward/rkward/plugins/plots/irt/dichotomous/plot_ltm.xml
    trunk/rkward/rkward/plugins/plots/irt/dichotomous/plot_rasch.js
    trunk/rkward/rkward/plugins/plots/irt/dichotomous/plot_rasch.xml
    trunk/rkward/rkward/plugins/plots/irt/dichotomous/plot_tpm.js
    trunk/rkward/rkward/plugins/plots/irt/dichotomous/plot_tpm.xml
    trunk/rkward/rkward/plugins/plots/irt/polytomous/plot_grm.js
    trunk/rkward/rkward/plugins/plots/irt/polytomous/plot_grm.xml
    trunk/rkward/rkward/plugins/plots/irt/polytomous/plot_pcm.js
    trunk/rkward/rkward/plugins/plots/irt/polytomous/plot_pcm.xml
    trunk/rkward/rkward/plugins/plots/irt/polytomous/plot_rsm.js
    trunk/rkward/rkward/plugins/plots/irt/polytomous/plot_rsm.xml
    trunk/rkward/rkward/plugins/plots/irt/tests/eRm_plotLR.js
    trunk/rkward/rkward/plugins/plots/irt/tests/eRm_plotLR.xml
    trunk/rkward/tests/item_response_theory/RKTestStandard.Andersen_LR_plot.rkcommands.R
    trunk/rkward/tests/item_response_theory/RKTestStandard.Cronbach_alpha.rkcommands.R
    trunk/rkward/tests/item_response_theory/RKTestStandard.Wald_test.rkcommands.R
    trunk/rkward/tests/item_response_theory/RKTestStandard.goodnes-of-fit_Rasch.rkcommands.R
    trunk/rkward/tests/item_response_theory/RKTestStandard.item_fit_statistics.rkcommands.R
    trunk/rkward/tests/item_response_theory/RKTestStandard.person_fit_statistics.rkcommands.R
    trunk/rkward/tests/item_response_theory/RKTestStandard.plot_2PL.rkcommands.R
    trunk/rkward/tests/item_response_theory/RKTestStandard.plot_3PL.rkcommands.R
    trunk/rkward/tests/item_response_theory/RKTestStandard.plot_GRM.rkcommands.R
    trunk/rkward/tests/item_response_theory/RKTestStandard.plot_PCM.rkcommands.R
    trunk/rkward/tests/item_response_theory/RKTestStandard.plot_RSM.rkcommands.R
    trunk/rkward/tests/item_response_theory/RKTestStandard.plot_Rasch.rkcommands.R
    trunk/rkward/tests/item_response_theory/RKTestStandard.unidimensional.rkcommands.R

Removed Paths:
-------------
    trunk/rkward/rkward/plugins/analysis/irt/tests/eRm_waldtest.php
    trunk/rkward/rkward/plugins/analysis/irt/tests/ltm_cronbach_alpha.php
    trunk/rkward/rkward/plugins/analysis/irt/tests/ltm_gof_rasch.php
    trunk/rkward/rkward/plugins/analysis/irt/tests/ltm_item_fit.php
    trunk/rkward/rkward/plugins/analysis/irt/tests/ltm_person_fit.php
    trunk/rkward/rkward/plugins/analysis/irt/tests/ltm_unidimensional.php
    trunk/rkward/rkward/plugins/plots/irt/dichotomous/plot_ltm.php
    trunk/rkward/rkward/plugins/plots/irt/dichotomous/plot_rasch.php
    trunk/rkward/rkward/plugins/plots/irt/dichotomous/plot_tpm.php
    trunk/rkward/rkward/plugins/plots/irt/polytomous/plot_grm.php
    trunk/rkward/rkward/plugins/plots/irt/polytomous/plot_pcm.php
    trunk/rkward/rkward/plugins/plots/irt/polytomous/plot_rsm.php
    trunk/rkward/rkward/plugins/plots/irt/tests/eRm_plotLR.php

Property Changed:
----------------
    trunk/


Property changes on: trunk
___________________________________________________________________
Added: svn:ignore
   + *.project


Modified: trunk/rkward/rkward/plugins/analysis/irt/polytomous/par_est_gpcm.js
===================================================================
--- trunk/rkward/rkward/plugins/analysis/irt/polytomous/par_est_gpcm.js	2009-12-17 17:06:57 UTC (rev 2728)
+++ trunk/rkward/rkward/plugins/analysis/irt/polytomous/par_est_gpcm.js	2009-12-20 23:05:31 UTC (rev 2729)
@@ -10,7 +10,7 @@
 	var inp_items     = getValue("inp_items");
 	// reformat inp_items
 		if (inp_items)
-			inp_items = inp_items.split("\n").join(", ").replace(/(\w*)\[\["(\w*)"\]\]/g, '"$2"');
+			inp_items = inp_items.replace(/\n/g,', ').replace(/(\w*)\[\[|\]\]/g, '');
 	var constraint    = getValue("constraint");
 	var startval      = getValue("startval");
 	var startval_lst  = getValue("startval_lst");

Modified: trunk/rkward/rkward/plugins/analysis/irt/tests/eRm_waldtest.js
===================================================================
--- trunk/rkward/rkward/plugins/analysis/irt/tests/eRm_waldtest.js	2009-12-17 17:06:57 UTC (rev 2728)
+++ trunk/rkward/rkward/plugins/analysis/irt/tests/eRm_waldtest.js	2009-12-20 23:05:31 UTC (rev 2729)
@@ -1,31 +1,17 @@
-/* ------- This file generated by php2js from PHP code. --------
-Please check this file by hand, and remove this notice, afterwards.
-Messages:
-Note: Control statement without braces. This is bad style.
-Note: Control statement without braces. This is bad style.
-
----------------------------- */
-
-// globals
-var undefined;
-
 function preprocess () {
 	// we'll need the eRm package, so in case it's not loaded...
-
-	echo ('  require(eRm)\n');
+	echo ('require(eRm)\n');
 }
 
 function calculate () {
-	var rad_splitcr = "";
-	var splitvector = "";
 	// let's read all values into php variables for the sake of readable code
-	rad_splitcr    = getValue("rad_splitcr");
-	splitvector     = getValue("splitvector");
+	var rad_splitcr    = getValue("rad_splitcr");
+	var splitvector    = getValue("splitvector");
 
 	echo ('waldtest.res <- Waldtest(' + getValue("x"));
-	// check if any advanced control options must be inserted
-	if (rad_splitcr == "mean") echo(", splitcr=\"mean\"") ;
-	if (rad_splitcr == "vector") echo(", splitcr="+splitvector) ;
+		// check if any advanced control options must be inserted
+		if (rad_splitcr == "mean") echo(", splitcr=\"mean\"") ;
+		if (rad_splitcr == "vector" && splitvector) echo(", splitcr="+splitvector) ;
 	echo (')\n');
 }
 

Deleted: trunk/rkward/rkward/plugins/analysis/irt/tests/eRm_waldtest.php
===================================================================
--- trunk/rkward/rkward/plugins/analysis/irt/tests/eRm_waldtest.php	2009-12-17 17:06:57 UTC (rev 2728)
+++ trunk/rkward/rkward/plugins/analysis/irt/tests/eRm_waldtest.php	2009-12-20 23:05:31 UTC (rev 2729)
@@ -1,26 +0,0 @@
-<?
-function preprocess () {
-  // we'll need the eRm package, so in case it's not loaded...
-?>
-  require(eRm)
-<?}
-
-function calculate () {
-  // let's read all values into php variables for the sake of readable code
-  $rad_splitcr    = getRK_val("rad_splitcr");
-  $splitvector     = getRK_val("splitvector");
-
-?>waldtest.res <- Waldtest(<? getRK("x");
-                  // check if any advanced control options must be inserted
-                  if($rad_splitcr == "mean") echo(", splitcr=\"mean\"") ;
-                  if($rad_splitcr == "vector") echo(", splitcr=".$splitvector) ;
- ?>)
-<?}
-
-function printout () {
-?>
-rk.header ("Wald test (<? getRK("x"); ?>)")
-rk.print (waldtest.res)
-<?
-}
-?>
\ No newline at end of file

Modified: trunk/rkward/rkward/plugins/analysis/irt/tests/eRm_waldtest.xml
===================================================================
--- trunk/rkward/rkward/plugins/analysis/irt/tests/eRm_waldtest.xml	2009-12-17 17:06:57 UTC (rev 2728)
+++ trunk/rkward/rkward/plugins/analysis/irt/tests/eRm_waldtest.xml	2009-12-20 23:05:31 UTC (rev 2729)
@@ -1,6 +1,6 @@
 <!DOCTYPE rkplugin>
 <document>
-  <code file="eRm_waldtest.php" />
+  <code file="eRm_waldtest.js" />
   <!--<help file="eRm_waldtest.rkh" />-->
 
   <logic>

Modified: trunk/rkward/rkward/plugins/analysis/irt/tests/ltm_cronbach_alpha.js
===================================================================
--- trunk/rkward/rkward/plugins/analysis/irt/tests/ltm_cronbach_alpha.js	2009-12-17 17:06:57 UTC (rev 2728)
+++ trunk/rkward/rkward/plugins/analysis/irt/tests/ltm_cronbach_alpha.js	2009-12-20 23:05:31 UTC (rev 2729)
@@ -1,103 +1,69 @@
-/* ------- This file generated by php2js from PHP code. --------
-Please check this file by hand, and remove this notice, afterwards.
-Messages:
-Warning: '$' inside '"'-delimited string. This might be a variable name. Please check by hand!
-Warning: '$' inside '"'-delimited string. This might be a variable name. Please check by hand!
-Warning: '$' inside '"'-delimited string. This might be a variable name. Please check by hand!
-Warning: '$' inside '"'-delimited string. This might be a variable name. Please check by hand!
-Warning: '$' inside '"'-delimited string. This might be a variable name. Please check by hand!
-Note: Control statement without braces. This is bad style.
-Note: Control statement without braces. This is bad style.
-
----------------------------- */
-
-// globals
-var undefined;
-
 function preprocess () {
 	// we'll need the ltm package, so in case it's not loaded...
-
-	echo ('  require(ltm)\n');
+	echo ('require(ltm)\n');
 }
 
 function calculate () {
-	var data = "";
-	var chk_select = "";
-	var inp_items = "";
-	var spin_samples = "";
-	var chk_standard = "";
-	var chk_na = "";
-	var chk_bsci = "";
-	var spin_ci = "";
-	var options = "";
-	var cilo = "";
-	var cihi = "";
 	// let's read all values into php variables for the sake of readable code
-	data            = getValue("x");
-	chk_select      = getValue("chk_select");
-	inp_items       = getValue("inp_items");
-	spin_samples    = getValue("spin_samples");
-	chk_standard    = getValue("chk_standard");
-	chk_na          = getValue("chk_na");
-	chk_bsci        = getValue("chk_bsci");
-	spin_ci         = getValue("spin_ci");
-
-	// reformat $inp_items
+	var data            = getValue("x");
+	var chk_select      = getValue("chk_select");
+	var inp_items       = getValue("inp_items");
+	var spin_samples    = getValue("spin_samples");
+	var chk_standard    = getValue("chk_standard");
+	var chk_na          = getValue("chk_na");
+	var chk_bsci        = getValue("chk_bsci");
+	var spin_ci         = getValue("spin_ci");
+	// reformat inp_items
 	if (inp_items)
-		inp_items       = str_replace("\n", ", ", preg_replace("/(.+)\[\[(.+)\]\]/", "$2", inp_items));
+		inp_items   = inp_items.replace(/\n/g,', ').replace(/(\w*)\[\[|\]\]/g, '');
 
 	///////////////////////////////////
 	// check for selected options
-	options = new Array) ;
+	var cilo = "";
+	var cihi = "";
+	var options = new Array() ;
 	if (chk_standard == "standard")
-	options[] = "standardized=TRUE" ;
+	  options[options.length] = "standardized=TRUE" ;
 	if (chk_bsci == "bsci")
-		options[] = "CI=TRUE" ;
-		if (spin_ci != ".95") {
-			cilo = (1-spin_ci)/2 ;
-				cihi = 1-cilo ;
-				options[] = "probs=c($cilo, $cihi)" ;
-			}
-	if (spin_samples != "1000")
-	options[] = "B=$spin_samples" ;
+	  options[options.length] = "CI=TRUE" ;
+	if (spin_ci != .95) {
+	  cilo = (1-spin_ci)/2 ;
+	  cihi = 1-cilo ;
+	  options[options.length] = "probs=c("+cilo+", "+cihi+")" ;
+	}
+	if (spin_samples != 1000)
+	  options[options.length] = "B="+spin_samples ;
 	if (chk_na == "rm")
-		options[] = "na.rm=TRUE" ;
+	  options[options.length] = "na.rm=TRUE" ;
 
 
-		echo ('cronalpha.res <- cronbach.alpha(');
+	echo ('cronalpha.res <- cronbach.alpha(');
+	if (data && chk_select && inp_items)
+		echo ("subset("+data+", select=c("+inp_items+"))");
+	else
+		echo (data);
+	// check if any advanced control options must be inserted
+		if (options.length > 0) echo(", "+options.join(", "));
+	echo (')\n');
+	echo ('descript.res <- descript(');
 		if (data && chk_select && inp_items)
 			echo ("subset("+data+", select=c("+inp_items+"))");
-					else
-						echo (data);
-						// check if any advanced control options must be inserted
-						if (options) echo(", "+join(", ", options));
-								echo (')\n');
-								echo ('descript.res <- descript(');
-								if (data && chk_select && inp_items)
-								echo ("subset("+data+", select=c("+inp_items+"))");
-								else
-									echo (data);
-									echo (', chi.squared=FALSE, B=' + spin_samples + ')\n');
-								}
+		else
+			echo (data);
+	echo (', chi.squared=FALSE, B=' + spin_samples + ')\n');
+}
 
 function printout () {
-	var chk_select = "";
-	var spin_samples = "";
-	var chk_standard = "";
-	var chk_na = "";
-	var chk_bsci = "";
-	var spin_ci = "";
-	var inp_items = "";
-	chk_select      = getValue("chk_select");
-	spin_samples    = getValue("spin_samples");
-	chk_standard    = getValue("chk_standard");
-	chk_na          = getValue("chk_na");
-	chk_bsci        = getValue("chk_bsci");
-	spin_ci         = getValue("spin_ci");
-	inp_items       = getValue("inp_items");
-	// reformat $inp_items
+	var chk_select      = getValue("chk_select");
+	var spin_samples    = getValue("spin_samples");
+	var chk_standard    = getValue("chk_standard");
+	var chk_na          = getValue("chk_na");
+	var chk_bsci        = getValue("chk_bsci");
+	var spin_ci         = getValue("spin_ci");
+	var inp_items       = getValue("inp_items");
+	// reformat inp_items
 	if (inp_items)
-		inp_items       = str_replace("\n", ", ", preg_replace("/(.+)\[\[\"(.+)\"\]\]/", "$2", inp_items));
+		inp_items   = inp_items.replace(/\n/g,', ').replace(/(\w*)\[\["|"\]\]/g, '');
 
 	echo ('rk.header ("Cronbach\'s alpha")\n');
 	echo ('rk.print("for the \'' + getValue("x") + '\' data-set');

Deleted: trunk/rkward/rkward/plugins/analysis/irt/tests/ltm_cronbach_alpha.php
===================================================================
--- trunk/rkward/rkward/plugins/analysis/irt/tests/ltm_cronbach_alpha.php	2009-12-17 17:06:57 UTC (rev 2728)
+++ trunk/rkward/rkward/plugins/analysis/irt/tests/ltm_cronbach_alpha.php	2009-12-20 23:05:31 UTC (rev 2729)
@@ -1,83 +0,0 @@
-<?
-function preprocess () {
-  // we'll need the ltm package, so in case it's not loaded...
-?>
-  require(ltm)
-<?}
-
-function calculate () {
-  // let's read all values into php variables for the sake of readable code
-  $data            = getRK_val("x");
-  $chk_select      = getRK_val("chk_select");
-  $inp_items       = getRK_val("inp_items");
-  $spin_samples    = getRK_val("spin_samples");
-  $chk_standard    = getRK_val("chk_standard");
-  $chk_na          = getRK_val("chk_na");
-  $chk_bsci        = getRK_val("chk_bsci");
-  $spin_ci         = getRK_val("spin_ci");
-
-  // reformat $inp_items
-  if($inp_items)
-    $inp_items       = str_replace("\n", ", ", preg_replace("/(.+)\[\[(.+)\]\]/", "$2", $inp_items));
-
-  ///////////////////////////////////
-  // check for selected options
-  $options = array() ;
-  if($chk_standard == "standard")
-    $options[] = "standardized=TRUE" ;
-  if($chk_bsci == "bsci")
-    $options[] = "CI=TRUE" ;
-  if($spin_ci != ".95") {
-    $cilo = (1-$spin_ci)/2 ;
-    $cihi = 1-$cilo ;
-    $options[] = "probs=c($cilo, $cihi)" ;
-    }
-  if($spin_samples != "1000")
-    $options[] = "B=$spin_samples" ;
-  if($chk_na == "rm")
-    $options[] = "na.rm=TRUE" ;
-
-
-?>cronalpha.res <- cronbach.alpha(<?
-		  if($data && $chk_select && $inp_items)
-		    echo("subset(".$data.", select=c(".$inp_items."))");
-		  else
-		    echo($data);
-                  // check if any advanced control options must be inserted
-                  if($options) echo(", ".join(", ", $options));
- ?>)
-descript.res <- descript(<?
-		  if($data && $chk_select && $inp_items)
-		    echo("subset(".$data.", select=c(".$inp_items."))");
-		  else
-		    echo($data);
- ?>, chi.squared=FALSE, B=<? echo($spin_samples); ?>)
-<?}
-
-function printout () {
-  $chk_select      = getRK_val("chk_select");
-  $spin_samples    = getRK_val("spin_samples");
-  $chk_standard    = getRK_val("chk_standard");
-  $chk_na          = getRK_val("chk_na");
-  $chk_bsci        = getRK_val("chk_bsci");
-  $spin_ci         = getRK_val("spin_ci");
-  $inp_items       = getRK_val("inp_items");
-  // reformat $inp_items
-  if($inp_items)
-    $inp_items       = str_replace("\n", ", ", preg_replace("/(.+)\[\[\"(.+)\"\]\]/", "$2", $inp_items));
-?>
-rk.header ("Cronbach's alpha")
-rk.print("for the '<? getRK("x"); ?>' data-set<?
-  if($chk_select && $inp_items)
-    echo(" (subset: ".$inp_items.")");
- ?>")
-rk.print(paste("Items:",cronalpha.res$p,"<br />Sample units:",cronalpha.res$n,"<br /><strong>alpha:",round(cronalpha.res$alpha, digits=2),"</strong><? if($chk_standard) echo(" (standardized)"); ?>"))
-rk.print("Effects on alpha if items are removed:")
-rk.print(descript.res$alpha)
-<?
-if($chk_bsci) {?>
-rk.print("<? echo(($spin_ci * 100)."%"); ?> Confidence interval:")
-rk.print(cronalpha.res$ci)
-<?}
-}
-?>
\ No newline at end of file

Modified: trunk/rkward/rkward/plugins/analysis/irt/tests/ltm_cronbach_alpha.xml
===================================================================
--- trunk/rkward/rkward/plugins/analysis/irt/tests/ltm_cronbach_alpha.xml	2009-12-17 17:06:57 UTC (rev 2728)
+++ trunk/rkward/rkward/plugins/analysis/irt/tests/ltm_cronbach_alpha.xml	2009-12-20 23:05:31 UTC (rev 2729)
@@ -1,6 +1,6 @@
 <!DOCTYPE rkplugin>
 <document>
-  <code file="ltm_cronbach_alpha.php" />
+  <code file="ltm_cronbach_alpha.js" />
   <!--<help file="ltm_cronbach_alpha.rkh" />-->
 
   <logic>

Modified: trunk/rkward/rkward/plugins/analysis/irt/tests/ltm_gof_rasch.js
===================================================================
--- trunk/rkward/rkward/plugins/analysis/irt/tests/ltm_gof_rasch.js	2009-12-17 17:06:57 UTC (rev 2728)
+++ trunk/rkward/rkward/plugins/analysis/irt/tests/ltm_gof_rasch.js	2009-12-20 23:05:31 UTC (rev 2729)
@@ -1,27 +1,15 @@
-/* ------- This file generated by php2js from PHP code. --------
-Please check this file by hand, and remove this notice, afterwards.
-Messages:
-Note: Control statement without braces. This is bad style.
-
----------------------------- */
-
-// globals
-var undefined;
-
 function preprocess () {
 	// we'll need the ltm package, so in case it's not loaded...
-
-	echo ('  require(ltm)\n');
+	echo ('require(ltm)\n');
 }
 
 function calculate () {
-	var spin_samples = "";
 	// let's read all values into php variables for the sake of readable code
-	spin_samples    = getValue("spin_samples");
+	var spin_samples    = getValue("spin_samples");
 
 	echo ('GoFRasch.res <- GoF.rasch(' + getValue("x"));
-	// check if any advanced control options must be inserted
-	if (spin_samples != "49") echo(", B="+spin_samples);
+		// check if any advanced control options must be inserted
+		if (spin_samples != 49) echo(", B="+spin_samples);
 	echo (')\n');
 }
 

Deleted: trunk/rkward/rkward/plugins/analysis/irt/tests/ltm_gof_rasch.php
===================================================================
--- trunk/rkward/rkward/plugins/analysis/irt/tests/ltm_gof_rasch.php	2009-12-17 17:06:57 UTC (rev 2728)
+++ trunk/rkward/rkward/plugins/analysis/irt/tests/ltm_gof_rasch.php	2009-12-20 23:05:31 UTC (rev 2729)
@@ -1,24 +0,0 @@
-<?
-function preprocess () {
-  // we'll need the ltm package, so in case it's not loaded...
-?>
-  require(ltm)
-<?}
-
-function calculate () {
-  // let's read all values into php variables for the sake of readable code
-  $spin_samples    = getRK_val("spin_samples");
-
-?>GoFRasch.res <- GoF.rasch(<? getRK("x");
-                  // check if any advanced control options must be inserted
-                  if($spin_samples != "49") echo(", B=".$spin_samples);
- ?>)
-<?}
-
-function printout () {
-?>
-rk.header ("Goodness of Fit for Rasch Models (<? getRK("x"); ?>)")
-rk.print (GoFRasch.res)
-<?
-}
-?>
\ No newline at end of file

Modified: trunk/rkward/rkward/plugins/analysis/irt/tests/ltm_gof_rasch.xml
===================================================================
--- trunk/rkward/rkward/plugins/analysis/irt/tests/ltm_gof_rasch.xml	2009-12-17 17:06:57 UTC (rev 2728)
+++ trunk/rkward/rkward/plugins/analysis/irt/tests/ltm_gof_rasch.xml	2009-12-20 23:05:31 UTC (rev 2729)
@@ -1,6 +1,6 @@
 <!DOCTYPE rkplugin>
 <document>
-  <code file="ltm_gof_rasch.php" />
+  <code file="ltm_gof_rasch.js" />
   <!--<help file="ltm_gof_rasch.rkh" />-->
 
   <logic>

Modified: trunk/rkward/rkward/plugins/analysis/irt/tests/ltm_item_fit.js
===================================================================
--- trunk/rkward/rkward/plugins/analysis/irt/tests/ltm_item_fit.js	2009-12-17 17:06:57 UTC (rev 2728)
+++ trunk/rkward/rkward/plugins/analysis/irt/tests/ltm_item_fit.js	2009-12-20 23:05:31 UTC (rev 2729)
@@ -1,52 +1,33 @@
-/* ------- This file generated by php2js from PHP code. --------
-Please check this file by hand, and remove this notice, afterwards.
-Messages:
-Warning: '$' inside '"'-delimited string. This might be a variable name. Please check by hand!
-Warning: '$' inside '"'-delimited string. This might be a variable name. Please check by hand!
-Warning: '$' inside '"'-delimited string. This might be a variable name. Please check by hand!
-Note: Control statement without braces. This is bad style.
-
----------------------------- */
-
-// globals
-var undefined;
-
 function preprocess () {
 	// we'll need the ltm package, so in case it's not loaded...
-
-	echo ('  require(ltm)\n');
+	echo ('require(ltm)\n');
 }
 
 function calculate () {
-	var spin_groups = "";
-	var drop_sumgroups = "";
-	var rad_pvalue = "";
-	var spin_mc = "";
-	var options = "";
 	// let's read all values into php variables for the sake of readable code
-	spin_groups     = getValue("spin_groups");
-	drop_sumgroups  = getValue("drop_sumgroups");
-	rad_pvalue      = getValue("rad_pvalue");
-	spin_mc         = getValue("spin_mc");
+	var spin_groups     = getValue("spin_groups");
+	var drop_sumgroups  = getValue("drop_sumgroups");
+	var rad_pvalue      = getValue("rad_pvalue");
+	var spin_mc         = getValue("spin_mc");
 
 	///////////////////////////////////
 	// check for selected options
-	options = new Array) ;
-	if (spin_groups != "10")
-	options[] = "G=$spin_groups" ;
+	var options = new Array() ;
+	if (spin_groups != 10)
+		options[options.length] = "G="+spin_groups ;
 	if (drop_sumgroups != "median")
-		options[] = "FUN=$drop_sumgroups" ;
-		if (rad_pvalue == "montecarlo")
-			options[] = "simulate.p.value=TRUE" ;
-			if (rad_pvalue == "montecarlo" && spin_mc != "100" )
-				options[] = "B=$spin_mc" ;
+		options[options.length] = "FUN="+drop_sumgroups ;
+	if (rad_pvalue == "montecarlo")
+		options[options.length] = "simulate.p.value=TRUE" ;
+	if (rad_pvalue == "montecarlo" && spin_mc != 100 )
+		options[options.length] = "B="+spin_mc ;
 
 
-				echo ('itemfit.res <- item.fit(' + getValue("x"));
-					// check if any advanced control options must be inserted
-					if (options) echo(", "+join(", ", options));
-						echo (')\n');
-					}
+	echo ("itemfit.res <- item.fit(" + getValue("x"));
+		// check if any advanced control options must be inserted
+		if (options.length > 0) echo(", "+options.join(", "));
+	echo (')\n');
+}
 
 function printout () {
 	echo ('rk.header ("Item-fit statistics (' + getValue("x") + ')")\n');

Deleted: trunk/rkward/rkward/plugins/analysis/irt/tests/ltm_item_fit.php
===================================================================
--- trunk/rkward/rkward/plugins/analysis/irt/tests/ltm_item_fit.php	2009-12-17 17:06:57 UTC (rev 2728)
+++ trunk/rkward/rkward/plugins/analysis/irt/tests/ltm_item_fit.php	2009-12-20 23:05:31 UTC (rev 2729)
@@ -1,40 +0,0 @@
-<?
-function preprocess () {
-  // we'll need the ltm package, so in case it's not loaded...
-?>
-  require(ltm)
-<?}
-
-function calculate () {
-  // let's read all values into php variables for the sake of readable code
-  $spin_groups     = getRK_val("spin_groups");
-  $drop_sumgroups  = getRK_val("drop_sumgroups");
-  $rad_pvalue      = getRK_val("rad_pvalue");
-  $spin_mc         = getRK_val("spin_mc");
-
-  ///////////////////////////////////
-  // check for selected options
-  $options = array() ;
-  if($spin_groups != "10")
-    $options[] = "G=$spin_groups" ;
-  if($drop_sumgroups != "median")
-    $options[] = "FUN=$drop_sumgroups" ;
-  if($rad_pvalue == "montecarlo")
-    $options[] = "simulate.p.value=TRUE" ;
-  if($rad_pvalue == "montecarlo" && $spin_mc != "100" )
-    $options[] = "B=$spin_mc" ;
-
-
-?>itemfit.res <- item.fit(<? getRK("x");
-                  // check if any advanced control options must be inserted
-                  if($options) echo(", ".join(", ", $options));
- ?>)
-<?}
-
-function printout () {
-?>
-rk.header ("Item-fit statistics (<? getRK("x"); ?>)")
-rk.print (itemfit.res)
-<?
-}
-?>
\ No newline at end of file

Modified: trunk/rkward/rkward/plugins/analysis/irt/tests/ltm_item_fit.xml
===================================================================
--- trunk/rkward/rkward/plugins/analysis/irt/tests/ltm_item_fit.xml	2009-12-17 17:06:57 UTC (rev 2728)
+++ trunk/rkward/rkward/plugins/analysis/irt/tests/ltm_item_fit.xml	2009-12-20 23:05:31 UTC (rev 2729)
@@ -1,6 +1,6 @@
 <!DOCTYPE rkplugin>
 <document>
-  <code file="ltm_item_fit.php" />
+  <code file="ltm_item_fit.js" />
   <!--<help file="ltm_item_fit.rkh" />-->
 
   <logic>

Modified: trunk/rkward/rkward/plugins/analysis/irt/tests/ltm_person_fit.js
===================================================================
--- trunk/rkward/rkward/plugins/analysis/irt/tests/ltm_person_fit.js	2009-12-17 17:06:57 UTC (rev 2728)
+++ trunk/rkward/rkward/plugins/analysis/irt/tests/ltm_person_fit.js	2009-12-20 23:05:31 UTC (rev 2729)
@@ -1,54 +1,34 @@
-/* ------- This file generated by php2js from PHP code. --------
-Please check this file by hand, and remove this notice, afterwards.
-Messages:
-Warning: '$' inside '"'-delimited string. This might be a variable name. Please check by hand!
-Warning: '$' inside '"'-delimited string. This might be a variable name. Please check by hand!
-Warning: '$' inside '"'-delimited string. This might be a variable name. Please check by hand!
-Note: Control statement without braces. This is bad style.
-
----------------------------- */
-
-// globals
-var undefined;
-
 function preprocess () {
 	// we'll need the ltm package, so in case it's not loaded...
-
-	echo ('  require(ltm)\n');
+	echo ('require(ltm)\n');
 }
 
 function calculate () {
-	var rad_hypot = "";
-	var rad_resppat = "";
-	var mtx_resppat = "";
-	var rad_pvalue = "";
-	var spin_mc = "";
-	var options = "";
 	// let's read all values into php variables for the sake of readable code
-	rad_hypot       = getValue("rad_hypot");
-	rad_resppat     = getValue("rad_resppat");
-	mtx_resppat     = getValue("mtx_resppat");
-	rad_pvalue      = getValue("rad_pvalue");
-	spin_mc         = getValue("spin_mc");
+	var rad_hypot       = getValue("rad_hypot");
+	var rad_resppat     = getValue("rad_resppat");
+	var mtx_resppat     = getValue("mtx_resppat");
+	var rad_pvalue      = getValue("rad_pvalue");
+	var spin_mc         = getValue("spin_mc");
 
 	///////////////////////////////////
 	// check for selected options
-	options = new Array) ;
+	var options = new Array() ;
 	if (rad_hypot == "greater" || rad_hypot == "two.sided")
-	options[] = "alternative=\"$rad_hypot\"" ;
+		options[options.length] = "alternative=\""+rad_hypot+"\"" ;
 	if (rad_resppat == "resp_matrix" && mtx_resppat)
-		options[] = "resp.patterns=$mtx_resppat" ;
-		if (rad_pvalue == "montecarlo")
-			options[] = "simulate.p.value=TRUE" ;
-			if (rad_pvalue == "montecarlo" && spin_mc != "1000" )
-				options[] = "B=$spin_mc" ;
+		options[options.length] = "resp.patterns="+mtx_resppat ;
+	if (rad_pvalue == "montecarlo")
+		options[options.length] = "simulate.p.value=TRUE" ;
+	if (rad_pvalue == "montecarlo" && spin_mc != 1000 )
+		options[options.length] = "B="+spin_mc ;
 
 
-				echo ('personfit.res <- person.fit(' + getValue("x"));
-					// check if any advanced control options must be inserted
-					if (options) echo(", "+join(", ", options));
-						echo (')\n');
-					}
+	echo ('personfit.res <- person.fit(' + getValue("x"));
+		// check if any advanced control options must be inserted
+		if (options.length > 0) echo(", "+options.join(", "));
+	echo (')\n');
+}
 
 function printout () {
 	echo ('rk.header ("Person-fit statistics (' + getValue("x") + ')")\n');

Deleted: trunk/rkward/rkward/plugins/analysis/irt/tests/ltm_person_fit.php
===================================================================
--- trunk/rkward/rkward/plugins/analysis/irt/tests/ltm_person_fit.php	2009-12-17 17:06:57 UTC (rev 2728)
+++ trunk/rkward/rkward/plugins/analysis/irt/tests/ltm_person_fit.php	2009-12-20 23:05:31 UTC (rev 2729)
@@ -1,41 +0,0 @@
-<?
-function preprocess () {
-  // we'll need the ltm package, so in case it's not loaded...
-?>
-  require(ltm)
-<?}
-
-function calculate () {
-  // let's read all values into php variables for the sake of readable code
-  $rad_hypot       = getRK_val("rad_hypot");
-  $rad_resppat     = getRK_val("rad_resppat");
-  $mtx_resppat     = getRK_val("mtx_resppat");
-  $rad_pvalue      = getRK_val("rad_pvalue");
-  $spin_mc         = getRK_val("spin_mc");
-
-  ///////////////////////////////////
-  // check for selected options
-  $options = array() ;
-  if($rad_hypot == "greater" || $rad_hypot == "two.sided")
-    $options[] = "alternative=\"$rad_hypot\"" ;
-  if($rad_resppat == "resp_matrix" && $mtx_resppat)
-    $options[] = "resp.patterns=$mtx_resppat" ;
-  if($rad_pvalue == "montecarlo")
-    $options[] = "simulate.p.value=TRUE" ;
-  if($rad_pvalue == "montecarlo" && $spin_mc != "1000" )
-    $options[] = "B=$spin_mc" ;
-
-
-?>personfit.res <- person.fit(<? getRK("x");
-                  // check if any advanced control options must be inserted
-                  if($options) echo(", ".join(", ", $options));
- ?>)
-<?}
-
-function printout () {
-?>
-rk.header ("Person-fit statistics (<? getRK("x"); ?>)")
-rk.print (personfit.res)
-<?
-}
-?>
\ No newline at end of file

Modified: trunk/rkward/rkward/plugins/analysis/irt/tests/ltm_person_fit.xml
===================================================================
--- trunk/rkward/rkward/plugins/analysis/irt/tests/ltm_person_fit.xml	2009-12-17 17:06:57 UTC (rev 2728)
+++ trunk/rkward/rkward/plugins/analysis/irt/tests/ltm_person_fit.xml	2009-12-20 23:05:31 UTC (rev 2729)
@@ -1,6 +1,6 @@
 <!DOCTYPE rkplugin>
 <document>
-  <code file="ltm_person_fit.php" />
+  <code file="ltm_person_fit.js" />
   <!--<help file="ltm_person_fit.rkh" />-->
 
   <logic>

Modified: trunk/rkward/rkward/plugins/analysis/irt/tests/ltm_unidimensional.js
===================================================================
--- trunk/rkward/rkward/plugins/analysis/irt/tests/ltm_unidimensional.js	2009-12-17 17:06:57 UTC (rev 2728)
+++ trunk/rkward/rkward/plugins/analysis/irt/tests/ltm_unidimensional.js	2009-12-20 23:05:31 UTC (rev 2729)
@@ -1,42 +1,26 @@
-/* ------- This file generated by php2js from PHP code. --------
-Please check this file by hand, and remove this notice, afterwards.
-Messages:
-Warning: '$' inside '"'-delimited string. This might be a variable name. Please check by hand!
-Note: Control statement without braces. This is bad style.
-
----------------------------- */
-
-// globals
-var undefined;
-
 function preprocess () {
 	// we'll need the ltm package, so in case it's not loaded...
-
-	echo ('  require(ltm)\n');
+	echo ('require(ltm)\n');
 }
 
 function calculate () {
-	var spin_samples = "";
 	// let's read all values into php variables for the sake of readable code
-	spin_samples    = getValue("spin_samples");
+	var spin_samples    = getValue("spin_samples");
 
 	echo ('unidim.res <- unidimTest(' + getValue("x"));
-	// check if any options must be inserted
-	if (spin_samples != "100") echo(", B=$spin_samples") ;
+		// check if any options must be inserted
+		if (spin_samples != 100) echo(", B=" + spin_samples) ;
 	echo (')\n');
 }
 
 function printout () {
-	var save = "";
-	var save_name = "";
-	save         = getValue("chk_save");
-	save_name    = getValue("save_name");
+	var save         = getValue("chk_save");
+	var save_name    = getValue("save_name");
 
 	echo ('rk.header ("Unidimensionality check (' + getValue("x") + ')")\n');
 	echo ('rk.print (unidim.res)\n');
-// check if results are to be saved:
+	// check if results are to be saved:
 	if (save && save_name) {
-
 		echo ('# keep results in current workspace\n');
 		echo (save_name + ' <<- unidim.res\n');
 	}

Deleted: trunk/rkward/rkward/plugins/analysis/irt/tests/ltm_unidimensional.php
===================================================================
--- trunk/rkward/rkward/plugins/analysis/irt/tests/ltm_unidimensional.php	2009-12-17 17:06:57 UTC (rev 2728)
+++ trunk/rkward/rkward/plugins/analysis/irt/tests/ltm_unidimensional.php	2009-12-20 23:05:31 UTC (rev 2729)
@@ -1,32 +0,0 @@
-<?
-function preprocess () {
-  // we'll need the ltm package, so in case it's not loaded...
-?>
-  require(ltm)
-<?}
-
-function calculate () {
-  // let's read all values into php variables for the sake of readable code
-  $spin_samples    = getRK_val("spin_samples");
-
-?>unidim.res <- unidimTest(<? getRK("x");
-                  // check if any options must be inserted
-                  if($spin_samples != "100") echo(", B=$spin_samples") ;
- ?>)
-<?}
-
-function printout () {
-  $save         = getRK_val("chk_save");
-  $save_name    = getRK_val("save_name");
-?>
-rk.header ("Unidimensionality check (<? getRK("x"); ?>)")
-rk.print (unidim.res)
-<?
-// check if results are to be saved:
-if ($save && $save_name) {
-?>
-# keep results in current workspace
-<? echo($save_name); ?> <<- unidim.res
-<?}
-}
-?>
\ No newline at end of file

Modified: trunk/rkward/rkward/plugins/analysis/irt/tests/ltm_unidimensional.xml
===================================================================
--- trunk/rkward/rkward/plugins/analysis/irt/tests/ltm_unidimensional.xml	2009-12-17 17:06:57 UTC (rev 2728)
+++ trunk/rkward/rkward/plugins/analysis/irt/tests/ltm_unidimensional.xml	2009-12-20 23:05:31 UTC (rev 2729)
@@ -1,6 +1,6 @@
 <!DOCTYPE rkplugin>
 <document>
-  <code file="ltm_unidimensional.php" />
+  <code file="ltm_unidimensional.js" />
   <!--<help file="ltm_unidimensional.rkh" />-->
 
   <logic>

Modified: trunk/rkward/rkward/plugins/plots/irt/dichotomous/plot_ltm.js
===================================================================
--- trunk/rkward/rkward/plugins/plots/irt/dichotomous/plot_ltm.js	2009-12-17 17:06:57 UTC (rev 2728)
+++ trunk/rkward/rkward/plugins/plots/irt/dichotomous/plot_ltm.js	2009-12-20 23:05:31 UTC (rev 2729)
@@ -1,27 +1,11 @@
-/* ------- This file generated by php2js from PHP code. --------
-Please check this file by hand, and remove this notice, afterwards.
-Messages:
-Note: Control statement without braces. This is bad style.
-Note: Control statement without braces. This is bad style.
-Note: Control statement without braces. This is bad style.
-Note: Control statement without braces. This is bad style.
-Note: Control statement without braces. This is bad style.
-Note: Control statement without braces. This is bad style.
-Note: Control statement without braces. This is bad style.
-Note: Control statement without braces. This is bad style.
-
----------------------------- */
-
-// globals
-var undefined;
-
 function preprocess () {
 	// we'll need the ltm package, so in case it's not loaded...
+	echo ('require(ltm)\n');
+}
 
-	echo ('  require(ltm)\n');
+function calculate () {
 }
 
-
 function printout () {
 	doPrintout (true);
 }
@@ -33,81 +17,68 @@
 }
 
 function doPrintout (full) {
-	var plot_type = "";
-	var plot_type_item = "";
-	var inp_items = "";
-	var spin_from = "";
-	var spin_to = "";
-	var annotation = "";
-	var plot_options = "";
-	var plot_ops_main = "";
-	var plot_ops_type = "";
-	var plot_ops_xlab = "";
-	var plot_ops_ylab = "";
-	var options = "";
-	var arr_items = "";
 	// this function takes care of generating the code for the printout() section. If $full is set to true,
 	// it generates the full code, including headers. If $full is set to false, only the essentials will
 	// be generated.
 
 	// let's read all values into php variables for the sake of readable code
-	plot_type        = getValue("plot_type");
-	plot_type_item   = getValue("plot_type_item");
-	inp_items        = getValue("inp_items");
-	spin_from        = getValue("spin_from");
-	spin_to          = getValue("spin_to");
-	annotation       = getValue("annotation");
+	var plot_type        = getValue("plot_type");
+	var plot_type_item   = getValue("plot_type_item");
+	var inp_items        = getValue("inp_items");
+	var spin_from        = getValue("spin_from");
+	var spin_to          = getValue("spin_to");
+	var annotation       = getValue("annotation");
 
 	// in case there are generic plot options defined:
-	plot_options     = getValue("plotoptions.code.printout");
-	plot_ops_main    = getValue("plotoptions.main");
-	plot_ops_type    = getValue("plotoptions.pointtype");
-	plot_ops_xlab    = getValue("plotoptions.xlab");
-	plot_ops_ylab    = getValue("plotoptions.ylab");
+	var plot_options     = getValue("plotoptions.code.printout");
+	var plot_ops_main    = getValue("plotoptions.main");
+	var plot_ops_type    = getValue("plotoptions.pointtype");
+	var plot_ops_xlab    = getValue("plotoptions.xlab");
+	var plot_ops_ylab    = getValue("plotoptions.ylab");
 
 	///////////////////////////////////
 	// check for selected options
-	options = new Array) ;
+	var arr_items = "";
+	var options = new Array() ;
 	if (plot_type == "items" && plot_type_item == "ICC")
-	options[] = "type=\"ICC\"" ;
+		options[options.length] = "type=\"ICC\"" ;
 	if (plot_type == "items" && plot_type_item == "IIC")
-		options[] = "type=\"IIC\"" ;
-		// plot all items?
-		if (plot_type == "items" && inp_items) {
-			// for user convenience, we replace "-", ";" and space, split all input into an array
-			// and join it again, separated by commas:
-			inp_items = str_replace("-",":",inp_items);
-				arr_items = split('[ ;]', inp_items);
-				options[] = "items=c("+join(",", arr_items)+")";
-			}
+		options[options.length] = "type=\"IIC\"" ;
+	// plot all items?
+	if (plot_type == "items" && inp_items) {
+		// for user convenience, we replace "-", ";" and space, split all input into an array
+		// and join it again, separated by commas:
+		arr_items = inp_items.replace(/-/g,":").replace(/\s|;/g,",");
+		options[options.length] = "items=c("+arr_items+")";
+	}
 
 	// for the test information curve, items must be set to "0":
 	if (plot_type == "TIC")
-	options[] = "type=\"IIC\", items=0" ;
+		options[options.length] = "type=\"IIC\", items=0" ;
 	// there is no option for standard error curves yet, so we need some extra magic
 	// (see the "SEC" section in the plotting function below as well!)
 	if (plot_type == "SEC")
-		options[] = "type=\"IIC\", items=0, plot=FALSE" ;
-		// the scatterplot is ltm specific:
-		if (plot_type == "loadings")
-			options[] = "type=\"loadings\"" ;
+		options[options.length] = "type=\"IIC\", items=0, plot=FALSE" ;
+	// the scatterplot is ltm specific:
+	if (plot_type == "loadings")
+		options[options.length] = "type=\"loadings\"" ;
 
-			// more advanced options
-			// user defined zrange? we'll round it to two digits
-			if (spin_from != "-3.8" || spin_to != "3.8")
-				options[] = "zrange=c("+round(spin_from,2)+","+round(spin_to,2)+")" ;
-				// annotate lines and show legend?
-				if (annotation == "legend")
-					options[] = "legend=TRUE" ;
-					if (annotation == "plain")
-						options[] = "annot=FALSE" ;
+	// more advanced options
+	// user defined zrange? we'll round it to two digits
+	if (spin_from != -3.8 || spin_to != 3.8)
+		options[options.length] = "zrange=c("+(Math.round(spin_from*100)/100)+","+(Math.round(spin_to*100)/100)+")" ;
+	// annotate lines and show legend?
+	if (annotation == "legend")
+		options[options.length] = "legend=TRUE" ;
+	if (annotation == "plain")
+		options[options.length] = "annot=FALSE" ;
 
-						if (full) {
-							echo ('rk.header("Two parameter logistic model plot")\n');
-								echo ('\n');
-								echo ('rk.graph.on()\n');
-							}
-	// only the following section will be generated for $full==false
+	if (full) {
+		echo ('rk.header("Two parameter logistic model plot")\n');
+		echo ('\n');
+		echo ('rk.graph.on()\n');
+	}
+	// only the following section will be generated for full==false
 
 	// first we'll check wheter standard error curves should be plotted,
 	// because it takes two steps to draw them:
@@ -115,12 +86,12 @@
 	echo ('# two steps are needed to plot standard error curves\n');
 		echo ('# first some values are generated...\n');
 		echo ('res <- try(plot(' + getValue("x"));
-		if (options) echo(", "+join(", ", options));
+		if (options.length > 0) echo(", "+options.join(", "));
 		echo ('))\n');
 		echo ('\n');
 		echo ('# ... and then they\'re used to plot the curves:\n');
 		echo ('try(plot(res[,"z"], 1/sqrt(res[,"info"]), lwd=2');
-		// we give come defaults, but they can be changed via the embedded plot options:
+		// we give some defaults, but they can be changed via the embedded plot options:
 		if (!plot_ops_type) echo(", type=\"l\"");
 		if (!plot_ops_xlab) echo(", xlab=\"Ability\"");
 		if (!plot_ops_ylab) echo(", ylab=\"Standard Error\"");
@@ -131,11 +102,10 @@
 	// and this will be plotted if anything else than stadard error curves are chosen:
 	else {
 		echo ('try(plot(' + getValue("x"));
-		if (options) echo(", "+join(", ", options));
+		if (options.length > 0) echo(", "+options.join(", "));
 		if (plot_options) echo(plot_options);
 		echo ('))\n');
 	}
-	if (full) {
-	echo ('rk.graph.off()\n');
-	}
+
+	if (full) echo ('rk.graph.off()\n');
 }

Deleted: trunk/rkward/rkward/plugins/plots/irt/dichotomous/plot_ltm.php
===================================================================
--- trunk/rkward/rkward/plugins/plots/irt/dichotomous/plot_ltm.php	2009-12-17 17:06:57 UTC (rev 2728)
+++ trunk/rkward/rkward/plugins/plots/irt/dichotomous/plot_ltm.php	2009-12-20 23:05:31 UTC (rev 2729)
@@ -1,114 +0,0 @@
-<?
-function preprocess () {
-  // we'll need the ltm package, so in case it's not loaded...
-?>
-  require(ltm)
-<?}
-
-function calculate () {
-}
-
-function printout () {
-        doPrintout (true);
-}
-
-function preview () {
-        preprocess ();
-        calculate ();
-        doPrintout (false);
-}
-
-function doPrintout ($final) {
-        // this function takes care of generating the code for the printout() section. If $final is set to true,
-        // it generates the full code, including headers. If $final is set to false, only the essentials will
-        // be generated.
-
-  // let's read all values into php variables for the sake of readable code
-  $plot_type        = getRK_val("plot_type");
-  $plot_type_item   = getRK_val("plot_type_item");
-  $inp_items        = getRK_val("inp_items");
-  $spin_from        = getRK_val("spin_from");
-  $spin_to          = getRK_val("spin_to");
-  $annotation       = getRK_val("annotation");
-
-  // in case there are generic plot options defined:
-  $plot_options     = getRK_val("plotoptions.code.printout");
-  $plot_ops_main    = getRK_val("plotoptions.main");
-  $plot_ops_type    = getRK_val("plotoptions.pointtype");
-  $plot_ops_xlab    = getRK_val("plotoptions.xlab");
-  $plot_ops_ylab    = getRK_val("plotoptions.ylab");
-
-  ///////////////////////////////////
-  // check for selected options
-  $options = array() ;
-  if($plot_type == "items" && $plot_type_item == "ICC")
-    $options[] = "type=\"ICC\"" ;
-  if($plot_type == "items" && $plot_type_item == "IIC")
-    $options[] = "type=\"IIC\"" ;
-    // plot all items?
-    if($plot_type == "items" && $inp_items) {
-      // for user convenience, we replace "-", ";" and space, split all input into an array
-      // and join it again, separated by commas:
-      $inp_items = str_replace("-",":",$inp_items);
-      $arr_items = split('[ ;]', $inp_items);
-      $options[] = "items=c(".join(",", $arr_items).")"; }
-
-  // for the test information curve, items must be set to "0":
-  if($plot_type == "TIC")
-    $options[] = "type=\"IIC\", items=0" ;
-  // there is no option for standard error curves yet, so we need some extra magic
-  // (see the "SEC" section in the plotting function below as well!)
-  if($plot_type == "SEC")
-    $options[] = "type=\"IIC\", items=0, plot=FALSE" ;
-  // the scatterplot is ltm specific:
-  if($plot_type == "loadings")
-    $options[] = "type=\"loadings\"" ;
-
-  // more advanced options
-  // user defined zrange? we'll round it to two digits
-  if($spin_from != "-3.8" || $spin_to != "3.8")
-    $options[] = "zrange=c(".round($spin_from,2).",".round($spin_to,2).")" ;
-  // annotate lines and show legend?
-  if($annotation == "legend")
-    $options[] = "legend=TRUE" ;
-  if($annotation == "plain")
-    $options[] = "annot=FALSE" ;
-
-        if ($final) { ?>
-rk.header("Two parameter logistic model plot")
-
-rk.graph.on()
-<?       }
-        // only the following section will be generated for $final==false
-
-        // first we'll check wheter standard error curves should be plotted,
-        // because it takes two steps to draw them:
-       if ($plot_type == "SEC") { ?>
-# two steps are needed to plot standard error curves
-# first some values are generated...
-res <- try(plot(<? getRK("x");
-              if($options) echo(", ".join(", ", $options));
-          ?>))
-
-# ... and then they're used to plot the curves:
-try(plot(res[,"z"], 1/sqrt(res[,"info"]), lwd=2<?
-              // we give come defaults, but they can be changed via the embedded plot options:
-              if(!$plot_ops_type) echo(", type=\"l\"");
-              if(!$plot_ops_xlab) echo(", xlab=\"Ability\"");
-              if(!$plot_ops_ylab) echo(", ylab=\"Standard Error\"");
-              if(!$plot_ops_main) echo(", main=\"Stadard Error of Measurement\"");
-              if($plot_options) echo($plot_options);
-  ?>))
-<? }
-        // and this will be plotted if anything else than stadard error curves are chosen:
-        else { ?>
-try(plot(<? getRK("x");
-              if($options) echo(", ".join(", ", $options));
-              if($plot_options) echo($plot_options);
-          ?>))
-<? }
-        if ($final) { ?>
-rk.graph.off()
-<? }
-}
-?>
\ No newline at end of file

Modified: trunk/rkward/rkward/plugins/plots/irt/dichotomous/plot_ltm.xml
===================================================================
--- trunk/rkward/rkward/plugins/plots/irt/dichotomous/plot_ltm.xml	2009-12-17 17:06:57 UTC (rev 2728)
+++ trunk/rkward/rkward/plugins/plots/irt/dichotomous/plot_ltm.xml	2009-12-20 23:05:31 UTC (rev 2729)
@@ -1,6 +1,6 @@
 <!DOCTYPE rkplugin>
 <document>
-  <code file="plot_ltm.php" />
+  <code file="plot_ltm.js" />
   <!-- <help file="plot_ltm.rkh" /> -->
 
   <logic>

Modified: trunk/rkward/rkward/plugins/plots/irt/dichotomous/plot_rasch.js
===================================================================
--- trunk/rkward/rkward/plugins/plots/irt/dichotomous/plot_rasch.js	2009-12-17 17:06:57 UTC (rev 2728)
+++ trunk/rkward/rkward/plugins/plots/irt/dichotomous/plot_rasch.js	2009-12-20 23:05:31 UTC (rev 2729)
@@ -1,27 +1,11 @@
-/* ------- This file generated by php2js from PHP code. --------
-Please check this file by hand, and remove this notice, afterwards.
-Messages:
-Note: Control statement without braces. This is bad style.
-Note: Control statement without braces. This is bad style.
-Note: Control statement without braces. This is bad style.
-Note: Control statement without braces. This is bad style.
-Note: Control statement without braces. This is bad style.
-Note: Control statement without braces. This is bad style.
-Note: Control statement without braces. This is bad style.
-Note: Control statement without braces. This is bad style.
-
----------------------------- */
-
-// globals
-var undefined;
-
 function preprocess () {
 	// we'll need the ltm package, so in case it's not loaded...
+	echo ('require(ltm)\n');
+}
 
-	echo ('  require(ltm)\n');
+function calculate () {
 }
 
-
 function printout () {
 	doPrintout (true);
 }
@@ -33,86 +17,73 @@
 }
 
 function doPrintout (full) {
-	var plot_type = "";
-	var plot_type_item = "";
-	var inp_items = "";
-	var spin_from = "";
-	var spin_to = "";
-	var annotation = "";
-	var plot_options = "";
-	var plot_ops_main = "";
-	var plot_ops_type = "";
-	var plot_ops_xlab = "";
-	var plot_ops_ylab = "";
-	var options = "";
-	var arr_items = "";
 	// this function takes care of generating the code for the printout() section. If $full is set to true,
 	// it generates the full code, including headers. If $full is set to false, only the essentials will
 	// be generated.
 
 	// let's read all values into php variables for the sake of readable code
-	plot_type        = getValue("plot_type");
-	plot_type_item   = getValue("plot_type_item");
-	inp_items        = getValue("inp_items");
-	spin_from        = getValue("spin_from");
-	spin_to          = getValue("spin_to");
-	annotation       = getValue("annotation");
+	var plot_type        = getValue("plot_type");
+	var plot_type_item   = getValue("plot_type_item");
+	var inp_items        = getValue("inp_items");
+	var spin_from        = getValue("spin_from");
+	var spin_to          = getValue("spin_to");
+	var annotation       = getValue("annotation");
 
 	// in case there are generic plot options defined:
-	plot_options     = getValue("plotoptions.code.printout");
-	plot_ops_main    = getValue("plotoptions.main");
-	plot_ops_type    = getValue("plotoptions.pointtype");
-	plot_ops_xlab    = getValue("plotoptions.xlab");
-	plot_ops_ylab    = getValue("plotoptions.ylab");
+	var plot_options     = getValue("plotoptions.code.printout");
+	var plot_ops_main    = getValue("plotoptions.main");
+	var plot_ops_type    = getValue("plotoptions.pointtype");
+	var plot_ops_xlab    = getValue("plotoptions.xlab");
+	var plot_ops_ylab    = getValue("plotoptions.ylab");
 
 	///////////////////////////////////
 	// check for selected options
-	options = new Array) ;
+	var arr_items = "";
+	var options = new Array() ;
 	if (plot_type == "items" && plot_type_item == "ICC")
-	options[] = "type=\"ICC\"" ;
+		options[options.length] = "type=\"ICC\"" ;
 	if (plot_type == "items" && plot_type_item == "IIC")
-		options[] = "type=\"IIC\"" ;
-		// plot all items?
-		if (plot_type == "items" && inp_items) {
-			// for user convenience, we replace "-", ";" and space, split all input into an array
-			// and join it again, separated by commas:
-			inp_items = str_replace("-",":",inp_items);
-				arr_items = split('[ ;]', inp_items);
-				options[] = "items=c("+join(",", arr_items)+")";
-			}
+		options[options.length] = "type=\"IIC\"" ;
+	// plot all items?
+	if (plot_type == "items" && inp_items) {
+		// for user convenience, we replace "-", ";" and space, split all input into an array
+		// and join it again, separated by commas:
+		arr_items = inp_items.replace(/-/g,":").replace(/\s|;/g,",");
+		options[options.length] = "items=c("+arr_items+")";
+	}
 
 	// for the test information curve, items must be set to "0":
 	if (plot_type == "TIC")
-	options[] = "type=\"IIC\", items=0" ;
+		options[options.length] = "type=\"IIC\", items=0" ;
 	// there is no option for standard error curves yet, so we need some extra magic
 	// (see the "SEC" section in the plotting function below as well!)
 	if (plot_type == "SEC")
-		options[] = "type=\"IIC\", items=0, plot=FALSE" ;
+		options[options.length] = "type=\"IIC\", items=0, plot=FALSE" ;
 
-		// more advanced options
-		// user defined zrange? we'll round it to two digits
-		if (spin_from != "-3.8" || spin_to != "3.8")
-			options[] = "zrange=c("+round(spin_from,2)+","+round(spin_to,2)+")" ;
-			// annotate lines and show legend?
-			if (annotation == "legend")
-				options[] = "legend=TRUE" ;
-				if (annotation == "plain")
-					options[] = "annot=FALSE" ;
+	// more advanced options
+	// user defined zrange? we'll round it to two digits
+	if (spin_from != -3.8 || spin_to != 3.8)
+		options[options.length] = "zrange=c("+(Math.round(spin_from*100)/100)+","+(Math.round(spin_to*100)/100)+")" ;
+	// annotate lines and show legend?
+	if (annotation == "legend")
+		options[options.length] = "legend=TRUE" ;
+	if (annotation == "plain")
+		options[options.length] = "annot=FALSE" ;
 
-					if (full) {
-						echo ('rk.header("Rasch model plot")\n');
-							echo ('\n');
-							echo ('rk.graph.on()\n');
-						}
-	// only the following section will be generated for $full==false
+	if (full) {
+		echo ('rk.header("Rasch model plot")\n');
+		echo ('\n');
+		echo ('rk.graph.on()\n');
+	}
+	// only the following section will be generated for full==false
 
 	// first we'll check wheter standard error curves should be plotted,
 	// because it takes two steps to draw them:
 	if (plot_type == "SEC") {
-	echo ('# two steps are needed to plot standard error curves\n');
+		echo ('# two steps are needed to plot standard error curves\n');
 		echo ('# first some values are generated...\n');
 		echo ('res <- try(plot(' + getValue("x"));
-		if (options) echo(", "+join(", ", options));
+		if (options.length > 0) echo(", "+options.join(", "));
 		echo ('))\n');
 		echo ('\n');
 		echo ('# ... and then they\'re used to plot the curves:\n');
@@ -128,11 +99,10 @@
 	// and this will be plotted if anything else than stadard error curves are chosen:
 	else {
 		echo ('try(plot(' + getValue("x"));
-		if (options) echo(", "+join(", ", options));
+		if (options.length > 0) echo(", "+options.join(", "));
 		if (plot_options) echo(plot_options);
 		echo ('))\n');
 	}
-	if (full) {
-	echo ('rk.graph.off()\n');
-	}
+
+	if (full) echo ('rk.graph.off()\n');
 }

Deleted: trunk/rkward/rkward/plugins/plots/irt/dichotomous/plot_rasch.php
===================================================================
--- trunk/rkward/rkward/plugins/plots/irt/dichotomous/plot_rasch.php	2009-12-17 17:06:57 UTC (rev 2728)
+++ trunk/rkward/rkward/plugins/plots/irt/dichotomous/plot_rasch.php	2009-12-20 23:05:31 UTC (rev 2729)
@@ -1,111 +0,0 @@
-<?
-function preprocess () {
-  // we'll need the ltm package, so in case it's not loaded...
-?>
-  require(ltm)
-<?}
-
-function calculate () {
-}
-
-function printout () {
-        doPrintout (true);
-}
-
-function preview () {
-        preprocess ();
-        calculate ();
-        doPrintout (false);
-}
-
-function doPrintout ($final) {
-        // this function takes care of generating the code for the printout() section. If $final is set to true,
-        // it generates the full code, including headers. If $final is set to false, only the essentials will
-        // be generated.
-
-  // let's read all values into php variables for the sake of readable code
-  $plot_type        = getRK_val("plot_type");
-  $plot_type_item   = getRK_val("plot_type_item");
-  $inp_items        = getRK_val("inp_items");
-  $spin_from        = getRK_val("spin_from");
-  $spin_to          = getRK_val("spin_to");
-  $annotation       = getRK_val("annotation");
-
-  // in case there are generic plot options defined:
-  $plot_options     = getRK_val("plotoptions.code.printout");
-  $plot_ops_main    = getRK_val("plotoptions.main");
-  $plot_ops_type    = getRK_val("plotoptions.pointtype");
-  $plot_ops_xlab    = getRK_val("plotoptions.xlab");
-  $plot_ops_ylab    = getRK_val("plotoptions.ylab");
-
-  ///////////////////////////////////
-  // check for selected options
-  $options = array() ;
-  if($plot_type == "items" && $plot_type_item == "ICC")
-    $options[] = "type=\"ICC\"" ;
-  if($plot_type == "items" && $plot_type_item == "IIC")
-    $options[] = "type=\"IIC\"" ;
-    // plot all items?
-    if($plot_type == "items" && $inp_items) {
-      // for user convenience, we replace "-", ";" and space, split all input into an array
-      // and join it again, separated by commas:
-      $inp_items = str_replace("-",":",$inp_items);
-      $arr_items = split('[ ;]', $inp_items);
-      $options[] = "items=c(".join(",", $arr_items).")"; }
-
-  // for the test information curve, items must be set to "0":
-  if($plot_type == "TIC")
-    $options[] = "type=\"IIC\", items=0" ;
-  // there is no option for standard error curves yet, so we need some extra magic
-  // (see the "SEC" section in the plotting function below as well!)
-  if($plot_type == "SEC")
-    $options[] = "type=\"IIC\", items=0, plot=FALSE" ;
-
-  // more advanced options
-  // user defined zrange? we'll round it to two digits
-  if($spin_from != "-3.8" || $spin_to != "3.8")
-    $options[] = "zrange=c(".round($spin_from,2).",".round($spin_to,2).")" ;
-  // annotate lines and show legend?
-  if($annotation == "legend")
-    $options[] = "legend=TRUE" ;
-  if($annotation == "plain")
-    $options[] = "annot=FALSE" ;
-
-        if ($final) { ?>
-rk.header("Rasch model plot")
-
-rk.graph.on()
-<?       }
-        // only the following section will be generated for $final==false
-
-        // first we'll check wheter standard error curves should be plotted,
-        // because it takes two steps to draw them:
-       if ($plot_type == "SEC") { ?>
-# two steps are needed to plot standard error curves
-# first some values are generated...
-res <- try(plot(<? getRK("x");
-              if($options) echo(", ".join(", ", $options));
-          ?>))
-
-# ... and then they're used to plot the curves:
-try(plot(res[,"z"], 1/sqrt(res[,"info"]), lwd=2<?
-              // we give come defaults, but they can be changed via the embedded plot options:
-              if(!$plot_ops_type) echo(", type=\"l\"");
-              if(!$plot_ops_xlab) echo(", xlab=\"Ability\"");
-              if(!$plot_ops_ylab) echo(", ylab=\"Standard Error\"");
-              if(!$plot_ops_main) echo(", main=\"Stadard Error of Measurement\"");
-              if($plot_options) echo($plot_options);
-  ?>))
-<? }
-        // and this will be plotted if anything else than stadard error curves are chosen:
-        else { ?>
-try(plot(<? getRK("x");
-              if($options) echo(", ".join(", ", $options));
-              if($plot_options) echo($plot_options);
-          ?>))
-<? }
-        if ($final) { ?>
-rk.graph.off()
-<? }
-}
-?>
\ No newline at end of file

Modified: trunk/rkward/rkward/plugins/plots/irt/dichotomous/plot_rasch.xml
===================================================================
--- trunk/rkward/rkward/plugins/plots/irt/dichotomous/plot_rasch.xml	2009-12-17 17:06:57 UTC (rev 2728)
+++ trunk/rkward/rkward/plugins/plots/irt/dichotomous/plot_rasch.xml	2009-12-20 23:05:31 UTC (rev 2729)
@@ -1,6 +1,6 @@
 <!DOCTYPE rkplugin>
 <document>
-  <code file="plot_rasch.php" />
+  <code file="plot_rasch.js" />
   <!-- <help file="plot_rasch.rkh" /> -->
 
   <logic>

Modified: trunk/rkward/rkward/plugins/plots/irt/dichotomous/plot_tpm.js
===================================================================
--- trunk/rkward/rkward/plugins/plots/irt/dichotomous/plot_tpm.js	2009-12-17 17:06:57 UTC (rev 2728)
+++ trunk/rkward/rkward/plugins/plots/irt/dichotomous/plot_tpm.js	2009-12-20 23:05:31 UTC (rev 2729)
@@ -1,27 +1,11 @@
-/* ------- This file generated by php2js from PHP code. --------
-Please check this file by hand, and remove this notice, afterwards.
-Messages:
-Note: Control statement without braces. This is bad style.
-Note: Control statement without braces. This is bad style.
-Note: Control statement without braces. This is bad style.
-Note: Control statement without braces. This is bad style.
-Note: Control statement without braces. This is bad style.
-Note: Control statement without braces. This is bad style.
-Note: Control statement without braces. This is bad style.
-Note: Control statement without braces. This is bad style.
-
----------------------------- */
-
-// globals
-var undefined;
-
 function preprocess () {
 	// we'll need the ltm package, so in case it's not loaded...
+	echo ('require(ltm)\n');
+}
 
-	echo ('  require(ltm)\n');
+function calculate () {
 }
 
-
 function printout () {
 	doPrintout (true);
 }
@@ -33,91 +17,78 @@
 }
 
 function doPrintout (full) {
-	var plot_type = "";
-	var plot_type_item = "";
-	var inp_items = "";
-	var spin_from = "";
-	var spin_to = "";
-	var annotation = "";
-	var plot_options = "";
-	var plot_ops_main = "";
-	var plot_ops_type = "";
-	var plot_ops_xlab = "";
-	var plot_ops_ylab = "";
-	var options = "";
-	var arr_items = "";
-	// this function takes care of generating the code for the printout() section. If $full is set to true,
-	// it generates the full code, including headers. If $full is set to false, only the essentials will
+	// this function takes care of generating the code for the printout() section. If full is set to true,
+	// it generates the full code, including headers. If full is set to false, only the essentials will
 	// be generated.
 
 	// let's read all values into php variables for the sake of readable code
-	plot_type        = getValue("plot_type");
-	plot_type_item   = getValue("plot_type_item");
-	inp_items        = getValue("inp_items");
-	spin_from        = getValue("spin_from");
-	spin_to          = getValue("spin_to");
-	annotation       = getValue("annotation");
+	var plot_type        = getValue("plot_type");
+	var plot_type_item   = getValue("plot_type_item");
+	var inp_items        = getValue("inp_items");
+	var spin_from        = getValue("spin_from");
+	var spin_to          = getValue("spin_to");
+	var annotation       = getValue("annotation");
 
 	// in case there are generic plot options defined:
-	plot_options     = getValue("plotoptions.code.printout");
-	plot_ops_main    = getValue("plotoptions.main");
-	plot_ops_type    = getValue("plotoptions.pointtype");
-	plot_ops_xlab    = getValue("plotoptions.xlab");
-	plot_ops_ylab    = getValue("plotoptions.ylab");
+	var plot_options     = getValue("plotoptions.code.printout");
+	var plot_ops_main    = getValue("plotoptions.main");
+	var plot_ops_type    = getValue("plotoptions.pointtype");
+	var plot_ops_xlab    = getValue("plotoptions.xlab");
+	var plot_ops_ylab    = getValue("plotoptions.ylab");
 
 	///////////////////////////////////
 	// check for selected options
-	options = new Array) ;
+	var arr_items = "";
+	var options = new Array() ;
 	if (plot_type == "items" && plot_type_item == "ICC")
-	options[] = "type=\"ICC\"" ;
+		options[options.length] = "type=\"ICC\"" ;
 	if (plot_type == "items" && plot_type_item == "IIC")
-		options[] = "type=\"IIC\"" ;
-		// plot all items?
-		if (plot_type == "items" && inp_items) {
-			// for user convenience, we replace "-", ";" and space, split all input into an array
-			// and join it again, separated by commas:
-			inp_items = str_replace("-",":",inp_items);
-				arr_items = split('[ ;]', inp_items);
-				options[] = "items=c("+join(",", arr_items)+")";
-			}
+		options[options.length] = "type=\"IIC\"" ;
+	// plot all items?
+	if (plot_type == "items" && inp_items) {
+		// for user convenience, we replace "-", ";" and space, split all input into an array
+		// and join it again, separated by commas:
+		arr_items = inp_items.replace(/-/g,":").replace(/\s|;/g,",");
+		options[options.length] = "items=c("+arr_items+")";
+	}
 
 	// for the test information curve, items must be set to "0":
 	if (plot_type == "TIC")
-	options[] = "type=\"IIC\", items=0" ;
+		options[options.length] = "type=\"IIC\", items=0" ;
 	// there is no option for standard error curves yet, so we need some extra magic
 	// (see the "SEC" section in the plotting function below as well!)
 	if (plot_type == "SEC")
-		options[] = "type=\"IIC\", items=0, plot=FALSE" ;
+		options[options.length] = "type=\"IIC\", items=0, plot=FALSE" ;
 
-		// more advanced options
-		// user defined zrange? we'll round it to two digits
-		if (spin_from != "-3.8" || spin_to != "3.8")
-			options[] = "zrange=c("+round(spin_from,2)+","+round(spin_to,2)+")" ;
-			// annotate lines and show legend?
-			if (annotation == "legend")
-				options[] = "legend=TRUE" ;
-				if (annotation == "plain")
-					options[] = "annot=FALSE" ;
+	// more advanced options
+	// user defined zrange? we'll round it to two digits
+	if (spin_from != -3.8 || spin_to != 3.8)
+		options[options.length] = "zrange=c("+(Math.round(spin_from*100)/100)+","+(Math.round(spin_to*100)/100)+")" ;
+	// annotate lines and show legend?
+	if (annotation == "legend")
+		options[options.length] = "legend=TRUE" ;
+	if (annotation == "plain")
+		options[options.length] = "annot=FALSE" ;
 
-					if (full) {
-						echo ('rk.header("Birnbaum three parameter model plot")\n');
-							echo ('\n');
-							echo ('rk.graph.on()\n');
-						}
-	// only the following section will be generated for $full==false
+	if (full) {
+		echo ('rk.header("Birnbaum three parameter model plot")\n');
+		echo ('\n');
+		echo ('rk.graph.on()\n');
+	}
+	// only the following section will be generated for full==false
 
 	// first we'll check wheter standard error curves should be plotted,
 	// because it takes two steps to draw them:
 	if (plot_type == "SEC") {
-	echo ('# two steps are needed to plot standard error curves\n');
+		echo ('# two steps are needed to plot standard error curves\n');
 		echo ('# first some values are generated...\n');
 		echo ('res <- try(plot(' + getValue("x"));
-		if (options) echo(", "+join(", ", options));
+		if (options.length > 0) echo(", "+options.join(", "));
 		echo ('))\n');
 		echo ('\n');
 		echo ('# ... and then they\'re used to plot the curves:\n');
 		echo ('try(plot(res[,"z"], 1/sqrt(res[,"info"]), lwd=2');
-		// we give come defaults, but they can be changed via the embedded plot options:
+		// we give some defaults, but they can be changed via the embedded plot options:
 		if (!plot_ops_type) echo(", type=\"l\"");
 		if (!plot_ops_xlab) echo(", xlab=\"Ability\"");
 		if (!plot_ops_ylab) echo(", ylab=\"Standard Error\"");
@@ -128,11 +99,9 @@
 	// and this will be plotted if anything else than stadard error curves are chosen:
 	else {
 		echo ('try(plot(' + getValue("x"));
-		if (options) echo(", "+join(", ", options));
+		if (options.length > 0) echo(", "+options.join(", "));
 		if (plot_options) echo(plot_options);
 		echo ('))\n');
 	}
-	if (full) {
-	echo ('rk.graph.off()\n');
-	}
+	if (full) echo ('rk.graph.off()\n');
 }

Deleted: trunk/rkward/rkward/plugins/plots/irt/dichotomous/plot_tpm.php
===================================================================
--- trunk/rkward/rkward/plugins/plots/irt/dichotomous/plot_tpm.php	2009-12-17 17:06:57 UTC (rev 2728)
+++ trunk/rkward/rkward/plugins/plots/irt/dichotomous/plot_tpm.php	2009-12-20 23:05:31 UTC (rev 2729)
@@ -1,111 +0,0 @@
-<?
-function preprocess () {
-  // we'll need the ltm package, so in case it's not loaded...
-?>
-  require(ltm)
-<?}
-
-function calculate () {
-}
-
-function printout () {
-        doPrintout (true);
-}
-
-function preview () {
-        preprocess ();
-        calculate ();
-        doPrintout (false);
-}
-
-function doPrintout ($final) {
-        // this function takes care of generating the code for the printout() section. If $final is set to true,
-        // it generates the full code, including headers. If $final is set to false, only the essentials will
-        // be generated.
-
-  // let's read all values into php variables for the sake of readable code
-  $plot_type        = getRK_val("plot_type");
-  $plot_type_item   = getRK_val("plot_type_item");
-  $inp_items        = getRK_val("inp_items");
-  $spin_from        = getRK_val("spin_from");
-  $spin_to          = getRK_val("spin_to");
-  $annotation       = getRK_val("annotation");
-
-  // in case there are generic plot options defined:
-  $plot_options     = getRK_val("plotoptions.code.printout");
-  $plot_ops_main    = getRK_val("plotoptions.main");
-  $plot_ops_type    = getRK_val("plotoptions.pointtype");
-  $plot_ops_xlab    = getRK_val("plotoptions.xlab");
-  $plot_ops_ylab    = getRK_val("plotoptions.ylab");
-
-  ///////////////////////////////////
-  // check for selected options
-  $options = array() ;
-  if($plot_type == "items" && $plot_type_item == "ICC")
-    $options[] = "type=\"ICC\"" ;
-  if($plot_type == "items" && $plot_type_item == "IIC")
-    $options[] = "type=\"IIC\"" ;
-    // plot all items?
-    if($plot_type == "items" && $inp_items) {
-      // for user convenience, we replace "-", ";" and space, split all input into an array
-      // and join it again, separated by commas:
-      $inp_items = str_replace("-",":",$inp_items);
-      $arr_items = split('[ ;]', $inp_items);
-      $options[] = "items=c(".join(",", $arr_items).")"; }
-
-  // for the test information curve, items must be set to "0":
-  if($plot_type == "TIC")
-    $options[] = "type=\"IIC\", items=0" ;
-  // there is no option for standard error curves yet, so we need some extra magic
-  // (see the "SEC" section in the plotting function below as well!)
-  if($plot_type == "SEC")
-    $options[] = "type=\"IIC\", items=0, plot=FALSE" ;
-
-  // more advanced options
-  // user defined zrange? we'll round it to two digits
-  if($spin_from != "-3.8" || $spin_to != "3.8")
-    $options[] = "zrange=c(".round($spin_from,2).",".round($spin_to,2).")" ;
-  // annotate lines and show legend?
-  if($annotation == "legend")
-    $options[] = "legend=TRUE" ;
-  if($annotation == "plain")
-    $options[] = "annot=FALSE" ;
-
-        if ($final) { ?>
-rk.header("Birnbaum three parameter model plot")
-
-rk.graph.on()
-<?       }
-        // only the following section will be generated for $final==false
-
-        // first we'll check wheter standard error curves should be plotted,
-        // because it takes two steps to draw them:
-       if ($plot_type == "SEC") { ?>
-# two steps are needed to plot standard error curves
-# first some values are generated...
-res <- try(plot(<? getRK("x");
-              if($options) echo(", ".join(", ", $options));
-          ?>))
-
-# ... and then they're used to plot the curves:
-try(plot(res[,"z"], 1/sqrt(res[,"info"]), lwd=2<?
-              // we give come defaults, but they can be changed via the embedded plot options:
-              if(!$plot_ops_type) echo(", type=\"l\"");
-              if(!$plot_ops_xlab) echo(", xlab=\"Ability\"");
-              if(!$plot_ops_ylab) echo(", ylab=\"Standard Error\"");
-              if(!$plot_ops_main) echo(", main=\"Stadard Error of Measurement\"");
-              if($plot_options) echo($plot_options);
-  ?>))
-<? }
-        // and this will be plotted if anything else than stadard error curves are chosen:
-        else { ?>
-try(plot(<? getRK("x");
-              if($options) echo(", ".join(", ", $options));
-              if($plot_options) echo($plot_options);
-          ?>))
-<? }
-        if ($final) { ?>
-rk.graph.off()
-<? }
-}
-?>
\ No newline at end of file

Modified: trunk/rkward/rkward/plugins/plots/irt/dichotomous/plot_tpm.xml
===================================================================
--- trunk/rkward/rkward/plugins/plots/irt/dichotomous/plot_tpm.xml	2009-12-17 17:06:57 UTC (rev 2728)
+++ trunk/rkward/rkward/plugins/plots/irt/dichotomous/plot_tpm.xml	2009-12-20 23:05:31 UTC (rev 2729)
@@ -1,6 +1,6 @@
 <!DOCTYPE rkplugin>
 <document>
-  <code file="plot_tpm.php" />
+  <code file="plot_tpm.js" />
   <!-- <help file="plot_tpm.rkh" /> -->
 
   <logic>

Modified: trunk/rkward/rkward/plugins/plots/irt/polytomous/plot_grm.js
===================================================================
--- trunk/rkward/rkward/plugins/plots/irt/polytomous/plot_grm.js	2009-12-17 17:06:57 UTC (rev 2728)
+++ trunk/rkward/rkward/plugins/plots/irt/polytomous/plot_grm.js	2009-12-20 23:05:31 UTC (rev 2729)
@@ -1,28 +1,11 @@
-/* ------- This file generated by php2js from PHP code. --------
-Please check this file by hand, and remove this notice, afterwards.
-Messages:
-Warning: '$' inside '"'-delimited string. This might be a variable name. Please check by hand!
-Note: Control statement without braces. This is bad style.
-Note: Control statement without braces. This is bad style.
-Note: Control statement without braces. This is bad style.
-Note: Control statement without braces. This is bad style.
-Note: Control statement without braces. This is bad style.
-Note: Control statement without braces. This is bad style.
-Note: Control statement without braces. This is bad style.
-Note: Control statement without braces. This is bad style.
-
----------------------------- */
-
-// globals
-var undefined;
-
 function preprocess () {
 	// we'll need the ltm package, so in case it's not loaded...
+	echo ('require(ltm)\n');
+}
 
-	echo ('  require(ltm)\n');
+function calculate () {
 }
 
-
 function printout () {
 	doPrintout (true);
 }
@@ -34,95 +17,81 @@
 }
 
 function doPrintout (full) {
-	var plot_type = "";
-	var plot_type_item = "";
-	var inp_items = "";
-	var spin_from = "";
-	var spin_to = "";
-	var annotation = "";
-	var spin_categ = "";
-	var plot_options = "";
-	var plot_ops_main = "";
-	var plot_ops_type = "";
-	var plot_ops_xlab = "";
-	var plot_ops_ylab = "";
-	var options = "";
-	var arr_items = "";
-	// this function takes care of generating the code for the printout() section. If $full is set to true,
-	// it generates the full code, including headers. If $full is set to false, only the essentials will
+	// this function takes care of generating the code for the printout() section. If full is set to true,
+	// it generates the full code, including headers. If full is set to false, only the essentials will
 	// be generated.
 
 	// let's read all values into php variables for the sake of readable code
-	plot_type        = getValue("plot_type");
-	plot_type_item   = getValue("plot_type_item");
-	inp_items        = getValue("inp_items");
-	spin_from        = getValue("spin_from");
-	spin_to          = getValue("spin_to");
-	annotation       = getValue("annotation");
-	spin_categ       = getValue("spin_categ");
+	var plot_type        = getValue("plot_type");
+	var plot_type_item   = getValue("plot_type_item");
+	var inp_items        = getValue("inp_items");
+	var spin_from        = getValue("spin_from");
+	var spin_to          = getValue("spin_to");
+	var annotation       = getValue("annotation");
+	var spin_categ       = getValue("spin_categ");
 
 	// in case there are generic plot options defined:
-	plot_options     = getValue("plotoptions.code.printout");
-	plot_ops_main    = getValue("plotoptions.main");
-	plot_ops_type    = getValue("plotoptions.pointtype");
-	plot_ops_xlab    = getValue("plotoptions.xlab");
-	plot_ops_ylab    = getValue("plotoptions.ylab");
+	var plot_options     = getValue("plotoptions.code.printout");
+	var plot_ops_main    = getValue("plotoptions.main");
+	var plot_ops_type    = getValue("plotoptions.pointtype");
+	var plot_ops_xlab    = getValue("plotoptions.xlab");
+	var plot_ops_ylab    = getValue("plotoptions.ylab");
 
 	///////////////////////////////////
 	// check for selected options
-	options = new Array) ;
+	var arr_items = "";
+	var options = new Array() ;
 	if (plot_type == "items" && plot_type_item == "ICC")
-	options[] = "type=\"ICC\"" ;
+		options[options.length] = "type=\"ICC\"" ;
 	if (plot_type == "items" && plot_type_item == "IIC")
-		options[] = "type=\"IIC\"" ;
-		if (plot_type == "items" && plot_type_item == "OCCu")
-			options[] = "type=\"OCCu\"" ;
-			if (plot_type == "items" && plot_type_item == "OCCl")
-				options[] = "type=\"OCCl\"" ;
-				// plot all items?
-				if (plot_type == "items" && inp_items) {
-					// for user convenience, we replace "-", ";" and space, split all input into an array
-					// and join it again, separated by commas:
-					inp_items = str_replace("-",":",inp_items);
-						arr_items = split('[ ;]', inp_items);
-						options[] = "items=c("+join(",", arr_items)+")";
-					}
+		options[options.length] = "type=\"IIC\"" ;
+	if (plot_type == "items" && plot_type_item == "OCCu")
+		options[options.length] = "type=\"OCCu\"" ;
+	if (plot_type == "items" && plot_type_item == "OCCl")
+		options[options.length] = "type=\"OCCl\"" ;
+	// plot all items?
+	if (plot_type == "items" && inp_items) {
+		// for user convenience, we replace "-", ";" and space, split all input into an array
+		// and join it again, separated by commas:
+		arr_items = inp_items.replace(/-/g,":").replace(/\s|;/g,",");
+		options[options.length] = "items=c("+arr_items+")";
+	}
 	// plot all categories?
-	if (plot_type == "items" && spin_categ != "0")
-	options[] = "category=$spin_categ" ;
+	if (plot_type == "items" && spin_categ != 0)
+		options[options.length] = "category="+spin_categ ;
 
 	// for the test information curve, items must be set to "0":
 	if (plot_type == "TIC")
-		options[] = "type=\"IIC\", items=0" ;
-		// there is no option for standard error curves yet, so we need some extra magic
-		// (see the "SEC" section in the plotting function below as well!)
-		if (plot_type == "SEC")
-			options[] = "type=\"IIC\", items=0, plot=FALSE" ;
+		options[options.length] = "type=\"IIC\", items=0" ;
+	// there is no option for standard error curves yet, so we need some extra magic
+	// (see the "SEC" section in the plotting function below as well!)
+	if (plot_type == "SEC")
+		options[options.length] = "type=\"IIC\", items=0, plot=FALSE" ;
 
-			// more advanced options
-			// user defined zrange? we'll round it to two digits
-			if (spin_from != "-3.8" || spin_to != "3.8")
-				options[] = "zrange=c("+round(spin_from,2)+","+round(spin_to,2)+")" ;
-				// annotate lines and show legend?
-				if (annotation == "legend")
-					options[] = "legend=TRUE" ;
-					if (annotation == "plain")
-						options[] = "annot=FALSE" ;
+	// more advanced options
+	// user defined zrange? we'll round it to two digits
+	if (spin_from != -3.8 || spin_to != 3.8)
+		options[options.length] = "zrange=c("+(Math.round(spin_from*100)/100)+","+(Math.round(spin_to*100)/100)+")" ;
+	// annotate lines and show legend?
+	if (annotation == "legend")
+		options[options.length] = "legend=TRUE" ;
+	if (annotation == "plain")
+		options[options.length] = "annot=FALSE" ;
 
-						if (full) {
-							echo ('rk.header("Graded response model plot")\n');
-								echo ('\n');
-								echo ('rk.graph.on()\n');
-							}
+	if (full) {
+		echo ('rk.header("Graded response model plot")\n');
+		echo ('\n');
+		echo ('rk.graph.on()\n');
+	}
 	// only the following section will be generated for $full==false
 
 	// first we'll check wheter standard error curves should be plotted,
 	// because it takes two steps to draw them:
 	if (plot_type == "SEC") {
-	echo ('# two steps are needed to plot standard error curves\n');
+		echo ('# two steps are needed to plot standard error curves\n');
 		echo ('# first some values are generated...\n');
 		echo ('res <- try(plot(' + getValue("x"));
-		if (options) echo(", "+join(", ", options));
+		if (options.length > 0) echo(", "+options.join(", "));
 		echo ('))\n');
 		echo ('\n');
 		echo ('# ... and then they\'re used to plot the curves:\n');
@@ -138,11 +107,10 @@
 	// and this will be plotted if anything else than stadard error curves are chosen:
 	else {
 		echo ('try(plot(' + getValue("x"));
-		if (options) echo(", "+join(", ", options));
+		if (options.length > 0) echo(", "+options.join(", "));
 		if (plot_options) echo(plot_options);
 		echo ('))\n');
 	}
-	if (full) {
-	echo ('rk.graph.off()\n');
-	}
+
+	if (full) echo ('rk.graph.off()\n');
 }

Deleted: trunk/rkward/rkward/plugins/plots/irt/polytomous/plot_grm.php
===================================================================
--- trunk/rkward/rkward/plugins/plots/irt/polytomous/plot_grm.php	2009-12-17 17:06:57 UTC (rev 2728)
+++ trunk/rkward/rkward/plugins/plots/irt/polytomous/plot_grm.php	2009-12-20 23:05:31 UTC (rev 2729)
@@ -1,119 +0,0 @@
-<?
-function preprocess () {
-  // we'll need the ltm package, so in case it's not loaded...
-?>
-  require(ltm)
-<?}
-
-function calculate () {
-}
-
-function printout () {
-        doPrintout (true);
-}
-
-function preview () {
-        preprocess ();
-        calculate ();
-        doPrintout (false);
-}
-
-function doPrintout ($final) {
-        // this function takes care of generating the code for the printout() section. If $final is set to true,
-        // it generates the full code, including headers. If $final is set to false, only the essentials will
-        // be generated.
-
-  // let's read all values into php variables for the sake of readable code
-  $plot_type        = getRK_val("plot_type");
-  $plot_type_item   = getRK_val("plot_type_item");
-  $inp_items        = getRK_val("inp_items");
-  $spin_from        = getRK_val("spin_from");
-  $spin_to          = getRK_val("spin_to");
-  $annotation       = getRK_val("annotation");
-  $spin_categ       = getRK_val("spin_categ");
-
-  // in case there are generic plot options defined:
-  $plot_options     = getRK_val("plotoptions.code.printout");
-  $plot_ops_main    = getRK_val("plotoptions.main");
-  $plot_ops_type    = getRK_val("plotoptions.pointtype");
-  $plot_ops_xlab    = getRK_val("plotoptions.xlab");
-  $plot_ops_ylab    = getRK_val("plotoptions.ylab");
-
-  ///////////////////////////////////
-  // check for selected options
-  $options = array() ;
-  if($plot_type == "items" && $plot_type_item == "ICC")
-    $options[] = "type=\"ICC\"" ;
-  if($plot_type == "items" && $plot_type_item == "IIC")
-    $options[] = "type=\"IIC\"" ;
-  if($plot_type == "items" && $plot_type_item == "OCCu")
-    $options[] = "type=\"OCCu\"" ;
-  if($plot_type == "items" && $plot_type_item == "OCCl")
-    $options[] = "type=\"OCCl\"" ;
-    // plot all items?
-    if($plot_type == "items" && $inp_items) {
-      // for user convenience, we replace "-", ";" and space, split all input into an array
-      // and join it again, separated by commas:
-      $inp_items = str_replace("-",":",$inp_items);
-      $arr_items = split('[ ;]', $inp_items);
-      $options[] = "items=c(".join(",", $arr_items).")"; }
-    // plot all categories?
-    if($plot_type == "items" && $spin_categ != "0")
-      $options[] = "category=$spin_categ" ;
-
-  // for the test information curve, items must be set to "0":
-  if($plot_type == "TIC")
-    $options[] = "type=\"IIC\", items=0" ;
-  // there is no option for standard error curves yet, so we need some extra magic
-  // (see the "SEC" section in the plotting function below as well!)
-  if($plot_type == "SEC")
-    $options[] = "type=\"IIC\", items=0, plot=FALSE" ;
-
-  // more advanced options
-  // user defined zrange? we'll round it to two digits
-  if($spin_from != "-3.8" || $spin_to != "3.8")
-    $options[] = "zrange=c(".round($spin_from,2).",".round($spin_to,2).")" ;
-  // annotate lines and show legend?
-  if($annotation == "legend")
-    $options[] = "legend=TRUE" ;
-  if($annotation == "plain")
-    $options[] = "annot=FALSE" ;
-
-        if ($final) { ?>
-rk.header("Graded response model plot")
-
-rk.graph.on()
-<?       }
-        // only the following section will be generated for $final==false
-
-        // first we'll check wheter standard error curves should be plotted,
-        // because it takes two steps to draw them:
-       if ($plot_type == "SEC") { ?>
-# two steps are needed to plot standard error curves
-# first some values are generated...
-res <- try(plot(<? getRK("x");
-              if($options) echo(", ".join(", ", $options));
-          ?>))
-
-# ... and then they're used to plot the curves:
-try(plot(res[,"z"], 1/sqrt(res[,"test.info"]), lwd=2<?
-              // we give come defaults, but they can be changed via the embedded plot options:
-              if(!$plot_ops_type) echo(", type=\"l\"");
-              if(!$plot_ops_xlab) echo(", xlab=\"Ability\"");
-              if(!$plot_ops_ylab) echo(", ylab=\"Standard Error\"");
-              if(!$plot_ops_main) echo(", main=\"Stadard Error of Measurement\"");
-              if($plot_options) echo($plot_options);
-  ?>))
-<? }
-        // and this will be plotted if anything else than stadard error curves are chosen:
-        else { ?>
-try(plot(<? getRK("x");
-              if($options) echo(", ".join(", ", $options));
-              if($plot_options) echo($plot_options);
-          ?>))
-<? }
-        if ($final) { ?>
-rk.graph.off()
-<? }
-}
-?>
\ No newline at end of file

Modified: trunk/rkward/rkward/plugins/plots/irt/polytomous/plot_grm.xml
===================================================================
--- trunk/rkward/rkward/plugins/plots/irt/polytomous/plot_grm.xml	2009-12-17 17:06:57 UTC (rev 2728)
+++ trunk/rkward/rkward/plugins/plots/irt/polytomous/plot_grm.xml	2009-12-20 23:05:31 UTC (rev 2729)
@@ -1,6 +1,6 @@
 <!DOCTYPE rkplugin>
 <document>
-  <code file="plot_grm.php" />
+  <code file="plot_grm.js" />
   <!-- <help file="plot_grm.rkh" /> -->
 
   <logic>

Modified: trunk/rkward/rkward/plugins/plots/irt/polytomous/plot_pcm.js
===================================================================
--- trunk/rkward/rkward/plugins/plots/irt/polytomous/plot_pcm.js	2009-12-17 17:06:57 UTC (rev 2728)
+++ trunk/rkward/rkward/plugins/plots/irt/polytomous/plot_pcm.js	2009-12-20 23:05:31 UTC (rev 2729)
@@ -1,21 +1,11 @@
-/* ------- This file generated by php2js from PHP code. --------
-Please check this file by hand, and remove this notice, afterwards.
-Messages:
-Note: Control statement without braces. This is bad style.
-Note: Control statement without braces. This is bad style.
-
----------------------------- */
-
-// globals
-var undefined;
-
 function preprocess () {
 	// we'll need the eRm package, so in case it's not loaded...
+	echo ('require(eRm)\n');
+}
 
-	echo ('  require(eRm)\n');
+function calculate () {
 }
 
-
 function printout () {
 	doPrintout (true);
 }
@@ -27,81 +17,64 @@
 }
 
 function doPrintout (full) {
-	var inp_items = "";
-	var spin_abilfrom = "";
-	var spin_abilto = "";
-	var spin_probfrom = "";
-	var spin_probto = "";
-	var annotation = "";
-	var chk_ask = "";
-	var chk_mplot = "";
-	var plot_options = "";
-	var plot_ops_main = "";
-	var plot_ops_type = "";
-	var plot_ops_xlab = "";
-	var plot_ops_ylab = "";
-	var options = "";
-	var arr_items = "";
-	// this function takes care of generating the code for the printout() section. If $full is set to true,
-	// it generates the full code, including headers. If $full is set to false, only the essentials will
+	// this function takes care of generating the code for the printout() section. If full is set to true,
+	// it generates the full code, including headers. If full is set to false, only the essentials will
 	// be generated.
 
 	// let's read all values into php variables for the sake of readable code
-	inp_items        = getValue("inp_items");
-	spin_abilfrom    = getValue("spin_abilfrom");
-	spin_abilto      = getValue("spin_abilto");
-	spin_probfrom    = getValue("spin_probfrom");
-	spin_probto      = getValue("spin_probto");
-	annotation       = getValue("annotation");
-	chk_ask          = getValue("chk_ask");
-	chk_mplot        = getValue("chk_mplot");
+	var inp_items        = getValue("inp_items");
+	var spin_abilfrom    = getValue("spin_abilfrom");
+	var spin_abilto      = getValue("spin_abilto");
+	var spin_probfrom    = getValue("spin_probfrom");
+	var spin_probto      = getValue("spin_probto");
+	var annotation       = getValue("annotation");
+	var chk_ask          = getValue("chk_ask");
+	var chk_mplot        = getValue("chk_mplot");
 
 	// in case there are generic plot options defined:
-	plot_options     = getValue("plotoptions.code.printout");
-	plot_ops_main    = getValue("plotoptions.main");
-	plot_ops_type    = getValue("plotoptions.pointtype");
-	plot_ops_xlab    = getValue("plotoptions.xlab");
-	plot_ops_ylab    = getValue("plotoptions.ylab");
+	var plot_options     = getValue("plotoptions.code.printout");
+	var plot_ops_main    = getValue("plotoptions.main");
+	var plot_ops_type    = getValue("plotoptions.pointtype");
+	var plot_ops_xlab    = getValue("plotoptions.xlab");
+	var plot_ops_ylab    = getValue("plotoptions.ylab");
 
 	///////////////////////////////////
 	// check for selected options
-	options = new Array) ;
+	var arr_items = "";
+	var options = new Array() ;
 	// plot all items?
 	if (inp_items) {
-	// for user convenience, we replace "-", ";" and space, split all input into an array
-	// and join it again, separated by commas:
-	inp_items = str_replace("-",":",inp_items);
-		arr_items = split('[ ;]', inp_items);
-		options[] = "item.subset=c("+join(",", arr_items)+")";
+		// for user convenience, we replace "-", ";" and space, split all input into an array
+		// and join it again, separated by commas:
+		arr_items = inp_items.replace(/-/g,":").replace(/\s|;/g,",");
+		options[options.length] = "item.subset=c("+arr_items+")";
 	}
 	if (chk_mplot == "mplot")
-	options[] = "mplot=TRUE" ;
+		options[options.length] = "mplot=TRUE" ;
 	if (chk_ask != "ask")
-		options[] = "ask=FALSE" ;
+		options[options.length] = "ask=FALSE" ;
 
-		// more advanced options
-		// user defined ranges? we'll round it to two digits
-		if ((spin_abilfrom != "-4" || spin_abilto != "4") && spin_abilfrom < spin_abilto)
-				options[] = "xlim=c("+round(spin_abilfrom,2)+","+round(spin_abilto,2)+")" ;
-				if ((spin_probfrom != "0" || spin_probto != "1") && spin_probfrom < spin_probto)
-					options[] = "ylim=c("+round(spin_probfrom,2)+","+round(spin_probto,2)+")" ;
-					// annotate lines and show legend?
-					if (annotation == "plain")
-					options[] = "legpos=FALSE" ;
+	// more advanced options
+	// user defined ranges? we'll round it to two digits
+	if ((spin_abilfrom != -4 || spin_abilto != 4) && spin_abilfrom < spin_abilto)
+		options[options.length] = "xlim=c("+(Math.round(spin_abilfrom*100)/100)+","+(Math.round(spin_abilto*100)/100)+")" ;
+	if ((spin_probfrom != 0 || spin_probto != 1) && spin_probfrom < spin_probto)
+		options[options.length] = "ylim=c("+(Math.round(spin_probfrom*100)/100)+","+(Math.round(spin_probto*100)/100)+")" ;
+	// annotate lines and show legend?
+	if (annotation == "plain")
+		options[options.length] = "legpos=FALSE" ;
 
-					if (full) {
-						echo ('rk.header("Partial credit model plot")\n');
-							echo ('\n');
-							echo ('rk.graph.on()\n');
-						}
-	// only the following section will be generated for $full==false
+	if (full) {
+		echo ('rk.header("Partial credit model plot")\n');
+		echo ('\n');
+		echo ('rk.graph.on()\n');
+	}
+	// only the following section will be generated for full==false
 
-
 	echo ('try(plotICC(' + getValue("x"));
-	if (options) echo(", "+join(", ", options));
-		if (plot_options) echo(plot_options);
-		echo ('))\n');
-		if (full) {
-			echo ('rk.graph.off()\n');
-			}
+	if (options.length > 0) echo(", "+options.join(", "));
+	if (plot_options) echo(plot_options);
+	echo ('))\n');
+
+	if (full) echo ('rk.graph.off()\n');
 }

Deleted: trunk/rkward/rkward/plugins/plots/irt/polytomous/plot_pcm.php
===================================================================
--- trunk/rkward/rkward/plugins/plots/irt/polytomous/plot_pcm.php	2009-12-17 17:06:57 UTC (rev 2728)
+++ trunk/rkward/rkward/plugins/plots/irt/polytomous/plot_pcm.php	2009-12-20 23:05:31 UTC (rev 2729)
@@ -1,85 +0,0 @@
-<?
-function preprocess () {
-  // we'll need the eRm package, so in case it's not loaded...
-?>
-  require(eRm)
-<?}
-
-function calculate () {
-}
-
-function printout () {
-        doPrintout (true);
-}
-
-function preview () {
-        preprocess ();
-        calculate ();
-        doPrintout (false);
-}
-
-function doPrintout ($final) {
-        // this function takes care of generating the code for the printout() section. If $final is set to true,
-        // it generates the full code, including headers. If $final is set to false, only the essentials will
-        // be generated.
-
-  // let's read all values into php variables for the sake of readable code
-  $inp_items        = getRK_val("inp_items");
-  $spin_abilfrom    = getRK_val("spin_abilfrom");
-  $spin_abilto      = getRK_val("spin_abilto");
-  $spin_probfrom    = getRK_val("spin_probfrom");
-  $spin_probto      = getRK_val("spin_probto");
-  $annotation       = getRK_val("annotation");
-  $chk_ask          = getRK_val("chk_ask");
-  $chk_mplot        = getRK_val("chk_mplot");
-
-  // in case there are generic plot options defined:
-  $plot_options     = getRK_val("plotoptions.code.printout");
-  $plot_ops_main    = getRK_val("plotoptions.main");
-  $plot_ops_type    = getRK_val("plotoptions.pointtype");
-  $plot_ops_xlab    = getRK_val("plotoptions.xlab");
-  $plot_ops_ylab    = getRK_val("plotoptions.ylab");
-
-  ///////////////////////////////////
-  // check for selected options
-  $options = array() ;
-  // plot all items?
-  if($inp_items) {
-    // for user convenience, we replace "-", ";" and space, split all input into an array
-    // and join it again, separated by commas:
-    $inp_items = str_replace("-",":",$inp_items);
-    $arr_items = split('[ ;]', $inp_items);
-    $options[] = "item.subset=c(".join(",", $arr_items).")"; }
-  if($chk_mplot == "mplot")
-    $options[] = "mplot=TRUE" ;
-  if($chk_ask != "ask")
-    $options[] = "ask=FALSE" ;
-
-  // more advanced options
-  // user defined ranges? we'll round it to two digits
-  if(($spin_abilfrom != "-4" || $spin_abilto != "4") && $spin_abilfrom < $spin_abilto)
-    $options[] = "xlim=c(".round($spin_abilfrom,2).",".round($spin_abilto,2).")" ;
-  if(($spin_probfrom != "0" || $spin_probto != "1") && $spin_probfrom < $spin_probto)
-    $options[] = "ylim=c(".round($spin_probfrom,2).",".round($spin_probto,2).")" ;
-  // annotate lines and show legend?
-  if($annotation == "plain")
-    $options[] = "legpos=FALSE" ;
-
-        if ($final) { ?>
-rk.header("Partial credit model plot")
-
-rk.graph.on()
-<?       }
-        // only the following section will be generated for $final==false
-
-        ?>
-try(plotICC(<? getRK("x");
-              if($options) echo(", ".join(", ", $options));
-              if($plot_options) echo($plot_options);
-          ?>))
-<?
-        if ($final) { ?>
-rk.graph.off()
-<? }
-}
-?>
\ No newline at end of file

Modified: trunk/rkward/rkward/plugins/plots/irt/polytomous/plot_pcm.xml
===================================================================
--- trunk/rkward/rkward/plugins/plots/irt/polytomous/plot_pcm.xml	2009-12-17 17:06:57 UTC (rev 2728)
+++ trunk/rkward/rkward/plugins/plots/irt/polytomous/plot_pcm.xml	2009-12-20 23:05:31 UTC (rev 2729)
@@ -1,6 +1,6 @@
 <!DOCTYPE rkplugin>
 <document>
-  <code file="plot_pcm.php" />
+  <code file="plot_pcm.js" />
   <!-- <help file="plot_pcm.rkh" /> -->
 
   <dialog label="Plotting fitted partial credit model">

Modified: trunk/rkward/rkward/plugins/plots/irt/polytomous/plot_rsm.js
===================================================================
--- trunk/rkward/rkward/plugins/plots/irt/polytomous/plot_rsm.js	2009-12-17 17:06:57 UTC (rev 2728)
+++ trunk/rkward/rkward/plugins/plots/irt/polytomous/plot_rsm.js	2009-12-20 23:05:31 UTC (rev 2729)
@@ -1,21 +1,11 @@
-/* ------- This file generated by php2js from PHP code. --------
-Please check this file by hand, and remove this notice, afterwards.
-Messages:
-Note: Control statement without braces. This is bad style.
-Note: Control statement without braces. This is bad style.
-
----------------------------- */
-
-// globals
-var undefined;
-
 function preprocess () {
 	// we'll need the eRm package, so in case it's not loaded...
+	echo ('require(eRm)\n');
+}
 
-	echo ('  require(eRm)\n');
+function calculate () {
 }
 
-
 function printout () {
 	doPrintout (true);
 }
@@ -27,81 +17,64 @@
 }
 
 function doPrintout (full) {
-	var inp_items = "";
-	var spin_abilfrom = "";
-	var spin_abilto = "";
-	var spin_probfrom = "";
-	var spin_probto = "";
-	var annotation = "";
-	var chk_ask = "";
-	var chk_mplot = "";
-	var plot_options = "";
-	var plot_ops_main = "";
-	var plot_ops_type = "";
-	var plot_ops_xlab = "";
-	var plot_ops_ylab = "";
-	var options = "";
-	var arr_items = "";
-	// this function takes care of generating the code for the printout() section. If $full is set to true,
-	// it generates the full code, including headers. If $full is set to false, only the essentials will
+	// this function takes care of generating the code for the printout() section. If full is set to true,
+	// it generates the full code, including headers. If full is set to false, only the essentials will
 	// be generated.
 
 	// let's read all values into php variables for the sake of readable code
-	inp_items        = getValue("inp_items");
-	spin_abilfrom    = getValue("spin_abilfrom");
-	spin_abilto      = getValue("spin_abilto");
-	spin_probfrom    = getValue("spin_probfrom");
-	spin_probto      = getValue("spin_probto");
-	annotation       = getValue("annotation");
-	chk_ask          = getValue("chk_ask");
-	chk_mplot        = getValue("chk_mplot");
+	var inp_items        = getValue("inp_items");
+	var spin_abilfrom    = getValue("spin_abilfrom");
+	var spin_abilto      = getValue("spin_abilto");
+	var spin_probfrom    = getValue("spin_probfrom");
+	var spin_probto      = getValue("spin_probto");
+	var annotation       = getValue("annotation");
+	var chk_ask          = getValue("chk_ask");
+	var chk_mplot        = getValue("chk_mplot");
 
 	// in case there are generic plot options defined:
-	plot_options     = getValue("plotoptions.code.printout");
-	plot_ops_main    = getValue("plotoptions.main");
-	plot_ops_type    = getValue("plotoptions.pointtype");
-	plot_ops_xlab    = getValue("plotoptions.xlab");
-	plot_ops_ylab    = getValue("plotoptions.ylab");
+	var plot_options     = getValue("plotoptions.code.printout");
+	var plot_ops_main    = getValue("plotoptions.main");
+	var plot_ops_type    = getValue("plotoptions.pointtype");
+	var plot_ops_xlab    = getValue("plotoptions.xlab");
+	var plot_ops_ylab    = getValue("plotoptions.ylab");
 
 	///////////////////////////////////
 	// check for selected options
-	options = new Array) ;
+	var arr_items = "";
+	var options = new Array() ;
 	// plot all items?
 	if (inp_items) {
-	// for user convenience, we replace "-", ";" and space, split all input into an array
-	// and join it again, separated by commas:
-	inp_items = str_replace("-",":",inp_items);
-		arr_items = split('[ ;]', inp_items);
-		options[] = "item.subset=c("+join(",", arr_items)+")";
+		// for user convenience, we replace "-", ";" and space, split all input into an array
+		// and join it again, separated by commas:
+		arr_items = inp_items.replace(/-/g,":").replace(/\s|;/g,",");
+		options[options.length] = "item.subset=c("+arr_items+")";
 	}
 	if (chk_mplot == "mplot")
-	options[] = "mplot=TRUE" ;
+		options[options.length] = "mplot=TRUE" ;
 	if (chk_ask != "ask")
-		options[] = "ask=FALSE" ;
+		options[options.length] = "ask=FALSE" ;
 
-		// more advanced options
-		// user defined ranges? we'll round it to two digits
-		if ((spin_abilfrom != "-4" || spin_abilto != "4") && spin_abilfrom < spin_abilto)
-				options[] = "xlim=c("+round(spin_abilfrom,2)+","+round(spin_abilto,2)+")" ;
-				if ((spin_probfrom != "0" || spin_probto != "1") && spin_probfrom < spin_probto)
-					options[] = "ylim=c("+round(spin_probfrom,2)+","+round(spin_probto,2)+")" ;
-					// annotate lines and show legend?
-					if (annotation == "plain")
-					options[] = "legpos=FALSE" ;
+	// more advanced options
+	// user defined ranges? we'll round it to two digits
+	if ((spin_abilfrom != -4 || spin_abilto != 4) && spin_abilfrom < spin_abilto)
+		options[options.length] = "xlim=c("+(Math.round(spin_abilfrom*100)/100)+","+(Math.round(spin_abilto*100)/100)+")" ;
+	if ((spin_probfrom != 0 || spin_probto != 1) && spin_probfrom < spin_probto)
+		options[options.length] = "ylim=c("+(Math.round(spin_probfrom*100)/100)+","+(Math.round(spin_probto*100)/100)+")" ;
+	// annotate lines and show legend?
+	if (annotation == "plain")
+		options[options.length] = "legpos=FALSE" ;
 
-					if (full) {
-						echo ('rk.header("Rating scale model plot")\n');
-							echo ('\n');
-							echo ('rk.graph.on()\n');
-						}
-	// only the following section will be generated for $full==false
+	if (full) {
+		echo ('rk.header("Rating scale model plot")\n');
+		echo ('\n');
+		echo ('rk.graph.on()\n');
+	}
+	// only the following section will be generated for full==false
 
-
 	echo ('try(plotICC(' + getValue("x"));
-	if (options) echo(", "+join(", ", options));
-		if (plot_options) echo(plot_options);
-		echo ('))\n');
-		if (full) {
-			echo ('rk.graph.off()\n');
-			}
+	if (options.length > 0) echo(", "+options.join(", "));
+	if (plot_options) echo(plot_options);
+	echo ('))\n');
+
+		if (full) echo ('rk.graph.off()\n');
 }

Deleted: trunk/rkward/rkward/plugins/plots/irt/polytomous/plot_rsm.php
===================================================================
--- trunk/rkward/rkward/plugins/plots/irt/polytomous/plot_rsm.php	2009-12-17 17:06:57 UTC (rev 2728)
+++ trunk/rkward/rkward/plugins/plots/irt/polytomous/plot_rsm.php	2009-12-20 23:05:31 UTC (rev 2729)
@@ -1,85 +0,0 @@
-<?
-function preprocess () {
-  // we'll need the eRm package, so in case it's not loaded...
-?>
-  require(eRm)
-<?}
-
-function calculate () {
-}
-
-function printout () {
-        doPrintout (true);
-}
-
-function preview () {
-        preprocess ();
-        calculate ();
-        doPrintout (false);
-}
-
-function doPrintout ($final) {
-        // this function takes care of generating the code for the printout() section. If $final is set to true,
-        // it generates the full code, including headers. If $final is set to false, only the essentials will
-        // be generated.
-
-  // let's read all values into php variables for the sake of readable code
-  $inp_items        = getRK_val("inp_items");
-  $spin_abilfrom    = getRK_val("spin_abilfrom");
-  $spin_abilto      = getRK_val("spin_abilto");
-  $spin_probfrom    = getRK_val("spin_probfrom");
-  $spin_probto      = getRK_val("spin_probto");
-  $annotation       = getRK_val("annotation");
-  $chk_ask          = getRK_val("chk_ask");
-  $chk_mplot        = getRK_val("chk_mplot");
-
-  // in case there are generic plot options defined:
-  $plot_options     = getRK_val("plotoptions.code.printout");
-  $plot_ops_main    = getRK_val("plotoptions.main");
-  $plot_ops_type    = getRK_val("plotoptions.pointtype");
-  $plot_ops_xlab    = getRK_val("plotoptions.xlab");
-  $plot_ops_ylab    = getRK_val("plotoptions.ylab");
-
-  ///////////////////////////////////
-  // check for selected options
-  $options = array() ;
-  // plot all items?
-  if($inp_items) {
-    // for user convenience, we replace "-", ";" and space, split all input into an array
-    // and join it again, separated by commas:
-    $inp_items = str_replace("-",":",$inp_items);
-    $arr_items = split('[ ;]', $inp_items);
-    $options[] = "item.subset=c(".join(",", $arr_items).")"; }
-  if($chk_mplot == "mplot")
-    $options[] = "mplot=TRUE" ;
-  if($chk_ask != "ask")
-    $options[] = "ask=FALSE" ;
-
-  // more advanced options
-  // user defined ranges? we'll round it to two digits
-  if(($spin_abilfrom != "-4" || $spin_abilto != "4") && $spin_abilfrom < $spin_abilto)
-    $options[] = "xlim=c(".round($spin_abilfrom,2).",".round($spin_abilto,2).")" ;
-  if(($spin_probfrom != "0" || $spin_probto != "1") && $spin_probfrom < $spin_probto)
-    $options[] = "ylim=c(".round($spin_probfrom,2).",".round($spin_probto,2).")" ;
-  // annotate lines and show legend?
-  if($annotation == "plain")
-    $options[] = "legpos=FALSE" ;
-
-        if ($final) { ?>
-rk.header("Rating scale model plot")
-
-rk.graph.on()
-<?       }
-        // only the following section will be generated for $final==false
-
-        ?>
-try(plotICC(<? getRK("x");
-              if($options) echo(", ".join(", ", $options));
-              if($plot_options) echo($plot_options);
-          ?>))
-<?
-        if ($final) { ?>
-rk.graph.off()
-<? }
-}
-?>
\ No newline at end of file

Modified: trunk/rkward/rkward/plugins/plots/irt/polytomous/plot_rsm.xml
===================================================================
--- trunk/rkward/rkward/plugins/plots/irt/polytomous/plot_rsm.xml	2009-12-17 17:06:57 UTC (rev 2728)
+++ trunk/rkward/rkward/plugins/plots/irt/polytomous/plot_rsm.xml	2009-12-20 23:05:31 UTC (rev 2729)
@@ -1,6 +1,6 @@
 <!DOCTYPE rkplugin>
 <document>
-  <code file="plot_rsm.php" />
+  <code file="plot_rsm.js" />
   <!-- <help file="plot_rsm.rkh" /> -->
 
   <dialog label="Plotting fitted rating scale model">

Modified: trunk/rkward/rkward/plugins/plots/irt/tests/eRm_plotLR.js
===================================================================
--- trunk/rkward/rkward/plugins/plots/irt/tests/eRm_plotLR.js	2009-12-17 17:06:57 UTC (rev 2728)
+++ trunk/rkward/rkward/plugins/plots/irt/tests/eRm_plotLR.js	2009-12-20 23:05:31 UTC (rev 2729)
@@ -1,27 +1,11 @@
-/* ------- This file generated by php2js from PHP code. --------
-Please check this file by hand, and remove this notice, afterwards.
-Messages:
-Warning: '$' inside '"'-delimited string. This might be a variable name. Please check by hand!
-Warning: '$' inside '"'-delimited string. This might be a variable name. Please check by hand!
-Warning: multiline comments are not handled! Check by hand!
-Warning: '$' inside '"'-delimited string. This might be a variable name. Please check by hand!
-Warning: '$' inside '"'-delimited string. This might be a variable name. Please check by hand!
-Note: Control statement without braces. This is bad style.
-Note: Control statement without braces. This is bad style.
-Note: Control statement without braces. This is bad style.
-
----------------------------- */
-
-// globals
-var undefined;
-
 function preprocess () {
 	// we'll need the eRm package, so in case it's not loaded...
+	echo ('require(eRm)\n');
+}
 
-	echo ('  require(eRm)\n');
+function calculate () {
 }
 
-
 function printout () {
 	doPrintout (true);
 }
@@ -33,112 +17,84 @@
 }
 
 function doPrintout (full) {
-	var rad_splitcr = "";
-	var splitvector = "";
-	var inp_items = "";
-	var chk_se = "";
-	var chk_confint = "";
-	var spin_confint = "";
-	var chk_ctrline = "";
-	var spin_ctrline = "";
-	var spin_abilfrom = "";
-	var spin_abilto = "";
-	var annotation = "";
-	var plot_options = "";
-	var plot_ops_main = "";
-	var plot_ops_type = "";
-	var plot_ops_xlab = "";
-	var plot_ops_ylab = "";
-	var options_lrtest = "";
-	var options_plotgof = "";
-	var arr_items = "";
-	var  = "";

@@ Diff output truncated at 100000 characters. @@

This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the rkward-tracker mailing list