Scores All Test/Inventory Scorer Works only on PC

Discussion in 'Javascript' started by Brad, Oct 19, 2003.

  1. Brad

    Brad Guest

    I have a question for this newsgroup. Why is it that the JavaScript
    Program below
    runs only on PC browsers and not on MAC browsers? Please reply to
    if you have a solution to make it run in MAC
    browsers.
    Thanks. This post itself may be read as a text web page
    by going to http://www.concentric.net/~cyberper/forPost.htm .

    Below is a digitally signed copy of the code for the Universal
    Inventory/Test Scorer
    (JavaScript version). This code is signed, so you can know that this is
    code
    from me, Brad Jesness. This digital signature is well-known to be the
    only one
    I use and the fact that it is mine is shown by my listing it and signing
    with it
    on mypubKey2.htm (http://www.concentric.net/~cyberper/mypubKey2.htm)
    web page on my web site.

    To use this program, you either have to Copy the code below into NotePad
    and
    save it as something.htm or go to the html/javascript web page on this
    site.

    Let me tell you what this program does. It is a scores-all type
    program, that scores
    any objective test or personality inventory automatically, once you give
    it the
    scoring system and then the student/client responses. It's only
    limitations are that it
    runs only on PC browsers (for some unknown reason) and the
    client/student answers
    are limited to one response per item.

    So you can try the program out, let me describe how a test scoring
    system would look
    and then how a set of student answers would look. :Let me give you a
    sample
    scoring system of a test with only 10 items. Items must be T or F OR a,
    b , c, d, ...
    This test has the following correct answers: #1: T #2: F #3: a #4:
    b #5: d #6: f
    #7: c #8: e #9:F and #10:T Here it is:

    001
    0010
    002
    0000
    0020
    003
    0030
    004
    0000
    0040
    005
    0000
    0000
    0000
    0050
    006
    0000
    0000
    0000
    0000
    0000
    0060
    007
    0000
    0000
    0070
    008
    0000
    0000
    0000
    0000
    0080
    009
    0000
    0090
    010
    0100
    011
    0000

    Student answers would look like:

    T
    F
    a
    b
    d
    f
    c
    e
    F
    T

    To do it, you paste in the Scoring System (with one extra bogus item or
    scale added -- as I
    have done) and you click the "DoIt" Button. When you paste the scoring
    system, begin
    with the first character and copy only up through the last character
    (similarly for the student
    answers). After the first click of the button, copy and paste in the
    student answers and
    click the DoIt button again. The test or personality inventory is
    scored automatically.

    An example of a scoring system and answers for a personality inventory,
    like the MMPI-2
    may be found on my http://www.concentric.net/~cyberper/quick_start.htm
    web page.

    The PGP software used to sign this code below yields code that runs just
    fine, but is
    not optimally readable. Here and below the signed copy, I provide code
    segments
    in a more readable form, which one can substitute for portions of code
    that
    got segmented and less readable by the PGP software.

    The following lines at the top of the code can be substituted, so the
    code is more
    readable:
    <!--
    <html>
    <head>
    <title>JavaScript Universal Test/Inventory Scorer</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <script language="javascript">
    var myArray;
    var pssArray = new Array();
    var fpssArray = new Array();
    var ansArray = new Array();
    var results = new Array();
    var noIS = 0;
    var whStr = 0;
    var time = 1;
    var impStr;
    var myRegEx1;
    var b;
    var theLet = new
    Array("x","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z");
    var fval = "";

    [snip]
    -->
    Other lines of more readable code (to substitute for the similar code in
    the signed copy)
    are provided below the signed block. Here is the full body of signed
    code that
    is the JS Scorer program itself (and some directions):

    [BELOW IS THE BEGINNING OF THE SIGNED BLOCK OF CODE]

    -----BEGIN PGP SIGNED MESSAGE-----
    Hash: SHA1

    <!-- (Remove this comment tag and these instructions here at the
    top; also remove the end comment tag (the last line of this code).)
    Copy everything from the top html tag through the end html tag,
    inclusive. Paste into NotePad. Save as something.htm (when saving
    either switch the bottom box to "All Files" or put quotes around
    "something.htm"). This is the Universal Test/Inventory Scorer
    (JavaScript version, requiring no downloads or plug-ins).

    <html>
    <head>
    <title>JavaScript Universal Test/Inventory Scorer</title>
    <meta http-equiv="Content-Type" content="text/html;
    charset=iso-8859-1">
    <script language="javascript">
    var myArray;
    var pssArray = new Array();
    var fpssArray = new Array();
    var ansArray = new Array();
    var results = new Array();
    var noIS = 0;
    var whStr = 0;
    var time = 1;
    var impStr;
    var myRegEx1;
    var b;
    var theLet = new
    Array("x","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o",
    "p","q","r","s","t","u","v","w","x","y","z");
    var fval = "";
    var myRegEx2;
    var temp = new Array();
    var temp2;
    var ssLines = new Array();
    var l;


    function DoIt()
    {
    temp[0] = new Array("hi","there");
    ansArray[0] = "a";
    if(time>1)
    {
    DoIt2();

    document.form2.myTextarea.value = fval;
    return;

    }
    else
    {
    impStr = document.form2.myTextarea.value

    temp2= new Array();
    myRegEx1 = /\n/
    b = impStr.split(myRegEx1)
    myArray = new Array(b.length);
    myRegEx2 = /\b.*\b/


    for (var i=0; i<b.length; i++)
    {

    myArray = b;
    myArray = myRegEx2.exec(myArray)

    }

    for (var i=0; i<myArray.length; i++)
    {


    if((myArray).toString().length == 3)
    {

    ssLines[noIS] = whStr;
    temp[noIS] = temp2;

    fpssArray = temp;
    noIS += 1;
    whStr = 0;
    temp2 = new Array("hi","there");


    }
    else
    { if((myArray).toString().length > 3)
    {
    whStr += 1;


    temp2[whStr] = (myArray).toString()



    }

    }



    }
    time = time + 1;
    document.form2.myTextarea.value = "";
    }
    return;
    }

    function DoIt2()
    {
    impStr = document.form2.myTextarea.value
    myRegEx1 = /\n/
    b = impStr.split(myRegEx1)

    ansArray = new Array(b.length + 1);
    myRegEx2 = /\b.*\b/


    for (var i=0; i<b.length; i++)
    {
    l = i+1;
    ansArray[l] = b;
    ansArray[l] = myRegEx2.exec(ansArray[l])

    }

    for(i=1;i<=noIS;i++)
    {
    results = 0;
    for(var j=1;j<=ssLines;j++)
    {

    var tempx;
    for(var
    m=0;m<Math.floor(((fpssArray[j].toString()).length)/3);m++)
    {

    tempx =
    parseInt(parseFloat(((fpssArray[j]).toString()).substring((m*3),(m*
    3)+3)) + .9);

    if(ansArray[tempx] == "T") {ansArray[tempx] = "a";}
    if(ansArray[tempx] == "F") {ansArray[tempx] = "b";}
    if(ansArray[tempx] == theLet[j]) {results = results + 1;}
    }

    }
    }

    for(var i=1;i<=noIS;i++)
    {
    fval += "Scale/Item " + i + " Score: " + results +
    "\n";

    }
    return;

    }
    </script>
    </head>

    <body bgcolor="#FFFFFF" text="#000000">
    <center><h1>Universal Objective Test/Inventory Scorer</h1>
    <h2> This scores any objective test or personality inventory
    automatically.<br>
    (The only restriction is that each test or inventory item can have
    only 1<br> answer (i.e. one response); for inventories, items may
    count on <br>
    more than one scale and/or be weighted -- by entering an item <br>
    number more than once in the scoring system.)</h2></center>
    <form name="form2" method="post" action="">
    <p><font size="4">In the textarea you paste the scoring system THEN
    click the DoIt button;
    paste the answers <br>and click the DoIt button again. The scoring
    system must be in a particular format
    which is described <br>at the bottom of this page. Just as with the
    Java version, client/student answers must simply <br>
    be a,b,c, ... or T or F and one answer per line in a raw text file
    (like NotePad, TextPad, <br>
    or SimpleText) -- with no extra spaces or returns anywhere. <br>Each
    'answer' is an answer to a test/inventory item; of course, they are
    in order.</font> </p>
    <p>
    <form name="form2" method="post" action="">

    <textarea name="myTextarea" rows="25" cols="100" wrap="OFF"
    scroll="yes"></textarea>
    </p>
    <p>
    <input type="button" name="myButton" value="DoIt"
    onClick="DoIt();">
    </p>
    </form>
    <br>
    <p align="center"><font size="5">Modified Directions for Making
    &quot;Scoring
    System Text File&quot;<br>
    for The JavaScript Version of the Universal (Generalized) <br>
    Inventory/Test Scorer</font></p>
    <p align="left"><font size="4">You should begin by reading all the
    directions on
    my <a
    href="http://www.concentric.net/~cyberper/quick_start.htm">quick_start
    ..htm</a> and <br>
    <a
    href="http://www.concentric.net/~cyberper/ANNOUNCEMENT.htm">ANNOUNCEME
    NT.htm</a> web pages.&nbsp; The directions
    for how the student/client <br>
    answers are to be formatted for the JS version of the Scorer are
    identical to
    the <br>
    directions for the Java version.</font></p>
    <p align="left"><font size="4">Regarding the &quot;scoring system
    text
    file&quot;, you should begin by following the <br>
    directions on the two web pages mentioned above.&nbsp; Making the
    scoring file <br>
    for the Java version is an excellent way to begin to make the scoring
    system <br>
    file for this JS version. These directions are also on the 2 web
    pages noted
    above.</font></p>
    <p align="left"><font size="4">After you have followed those
    directions for
    making the scoring system file <br>
    you should then make the following modifications:</font></p>
    <p align="left"><font size="4">&nbsp;&nbsp;&nbsp;&nbsp; ** Remove all
    the blank
    (empty) LINES between the scoring for the <br>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; individual
    test
    items/inventory scales.&nbsp; No blank LINES are to be <br>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; in the scoring
    file for
    the JS version.</font></p>
    <p align="left"><font size="4">&nbsp;&nbsp;&nbsp;&nbsp; ** Add a
    scoring section
    for a last BOGUS item.&nbsp; It should look like this: </font></p>
    <p align="left"><font
    size="4">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&
    nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    084<br>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs
    p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    0000</font></p>
    <p align="left"><font
    size="4">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    (in this example, the test had 83 items OR the inventory had 83
    scales) </font></p>
    <p align="left"><font size="4">&nbsp;&nbsp;&nbsp; ** Leave the cursor
    right
    after this final set of 4 zeros (0000) -- you do NOT <br>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; do two returns as
    you do for
    the Java scoring system file. </font></p>
    <p align="left"><font size="4">That's it. </font></p>
    <p align="left"><font size="4">You paste the scoring system (with
    modifications
    noted). Click the DoIt button. <br>
    Paste in the student/client answers and Click the DoIt button AGAIN.
    <br>
    No need for a third button click, like in the Java version.<br>
    <br>
    <br>
    To use for a second student/client, Click Reload Button on the
    browser, then CLICK <br>
    BEHIND the address in the browser's address blank and hold down the
    Shift key <br>
    and hit RETURN. This procedure ensures a clean new loading of the
    program. <br>
    <br>
    **********************<br>
    <br>
    All users of this JavaScript Scorer program are to be individually
    granted <br>
    permission to use it AND it is for THEIR USE ONLY. Furthermore, <br>
    all users of either version of the program are asked to go to my main
    web <br>
    page and read it.&nbsp; This is <a
    href="http://www.concentric.net/~cyberper/index.htm">index.htm</a> or
    (equivalently, <a
    href="http://www.concentric.net/~cyberper/it.html">it.html</a>).</font
    ></p>

    <p align="left">&nbsp;</p>

    </body>
    </html>

    - -->

    -----BEGIN PGP SIGNATURE-----
    Version: PGPfreeware 6.5.8 for non-commercial use <http://www.pgp.com>

    iQA/AwUBP4tlv75mfd8AI17qEQLZGwCgkQY3S8mM1m3EGIb8wLw1zk0KfbUAn2cW
    0Izo3SIB7j+KsHu6dStZShQt
    =ruhs
    -----END PGP SIGNATURE-----


    [ABOVE IS THE END OF SIGNED BLOCK OF CODE]

    For somewhat better readability, you might want to substitute the
    following code for code at
    the bottom of the signed copy:

    <!--

    <form name="form2" method="post" action="">

    <textarea name="myTextarea" rows="25" cols="100" wrap="OFF"
    scroll="yes"></textarea>
    </p>
    <p>
    <input type="button" name="myButton" value="DoIt" onClick="DoIt();">
    </p>
    </form>
    <br>
    <p align="center"><font size="5">Modified Directions for Making
    &quot;Scoring
    System Text File&quot;<br>
    for The JavaScript Version of the Universal (Generalized) <br>
    Inventory/Test Scorer</font></p>
    <p align="left"><font size="4">You should begin by reading all the
    directions on
    my <a
    href="http://www.concentric.net/~cyberper/quick_start.htm">quick_start.htm</a>
    and <br>
    <a
    href="http://www.concentric.net/~cyberper/ANNOUNCEMENT.htm">ANNOUNCEMENT.htm</a>
    web pages.&nbsp; The directions
    for how the student/client <br>
    answers are to be formatted for the JS version of the Scorer are
    identical to
    the <br>
    directions for the Java version.</font></p>
    <p align="left"><font size="4">Regarding the &quot;scoring system text
    file&quot;, you should begin by following the <br>
    directions on the two web pages mentioned above.&nbsp; Making the
    scoring file <br>
    for the Java version is an excellent way to begin to make the scoring
    system <br>
    file for this JS version. These directions are also on the 2 web pages
    noted
    above.</font></p>
    <p align="left"><font size="4">After you have followed those directions
    for
    making the scoring system file <br>
    you should then make the following modifications:</font></p>
    <p align="left"><font size="4">&nbsp;&nbsp;&nbsp;&nbsp; ** Remove all
    the blank
    (empty) LINES between the scoring for the <br>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; individual test
    items/inventory scales.&nbsp; No blank LINES are to be <br>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; in the scoring
    file for
    the JS version.</font></p>
    <p align="left"><font size="4">&nbsp;&nbsp;&nbsp;&nbsp; ** Add a scoring
    section
    for a last BOGUS item.&nbsp; It should look like this: </font></p>
    <p align="left">
    <font size="4">
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    084<br>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    0000</font></p>
    <p align="left"><font
    size="4">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    (in this example, the test had 83 items OR the inventory had 83 scales)
    </font></p>
    <p align="left"><font size="4">&nbsp;&nbsp;&nbsp; ** Leave the cursor
    right
    after this final set of 4 zeros (0000) -- you do NOT <br>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; do two returns as you
    do for
    the Java scoring system file. </font></p>
    <p align="left"><font size="4">That's it. </font></p>
    <p align="left"><font size="4">You paste the scoring system (with
    modifications
    noted). Click the DoIt button. <br>
    Paste in the student/client answers and Click the DoIt button AGAIN.
    <br>
    No need for a third button click, like in the Java version.<br>
    <br>
    <br>
    To use for a second student/client, Click Reload Button on the browser,
    then CLICK <br>
    BEHIND the address in the browser's address blank and hold down the
    Shift key <br>
    and hit RETURN. This procedure ensures a clean new loading of the
    program. <br>
    <br>
    **********************<br>
    <br>
    All users of this JavaScript Scorer program are to be individually
    granted <br>
    permission to use it AND it is for THEIR USE ONLY. Furthermore, <br>
    all users of either version of the program are asked to go to my main
    web <br>
    page and read it.&nbsp; This is <a
    href="http://www.concentric.net/~cyberper/index.htm">index.htm</a> or
    (equivalently, <a
    href="http://www.concentric.net/~cyberper/it.html">it.html</a>).</font></p>
    <p align="left">&nbsp;</p>

    </body>
    </html>
    -->
     
    Brad, Oct 19, 2003
    #1
    1. Advertising

  2. Brad wrote:

    > I have a question for this newsgroup.


    Sorry, but the newsgroup is unavailable. I will answer, OK?

    > Why is it that the JavaScript Program below
    > runs only on PC browsers and not on MAC browsers? Please reply to
    >


    No, I won't. Write here, read here.

    > [snip]
    > Below is a digitally signed copy of the code for the Universal
    > Inventory/Test Scorer
    > (JavaScript version).
    > [More than 400 lines of code]


    You may try `javascript:' in the location bar of the browsers you are
    testing with (which?) and read the FAQ before abusing this newsgroup as
    a trash can for your bloated code.


    PointedEars
     
    Thomas 'PointedEars' Lahn, Oct 19, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Inventory in ASP.

    , Jan 21, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    3,091
    =?Utf-8?B?RWx0b24gVw==?=
    Jan 21, 2006
  2. David Tuman

    directory inventory

    David Tuman, Feb 10, 2004, in forum: C++
    Replies:
    3
    Views:
    428
    Christoph Rabel
    Feb 10, 2004
  3. lalalala

    inventory databasing

    lalalala, May 26, 2006, in forum: Java
    Replies:
    1
    Views:
    812
    IchBin
    May 26, 2006
  4. judith
    Replies:
    9
    Views:
    859
    Ian Wilson
    Nov 16, 2006
  5. Lisa Fong
    Replies:
    0
    Views:
    352
    Lisa Fong
    Feb 16, 2007
Loading...

Share This Page