Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3

Thread: Text transfer

  1. #1
    New to the CF scene
    Join Date
    Jan 2004
    Location
    Glasgow, Scotland
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Text transfer

    I am trying to help students with examination questions. The idea is to break the question down into parts (say 5). They are given clues to answer each part with subquestions. As they type up and complete the first part I want a button to transfer the text (I think from a textarea) to a visible holding bay at the bottom of the screen (another text area) As subsequent parts are completed they are added to Part One at the bottom of the screen, in order, until all five parts make a completed examination questions and can be printed.

    I hope I have done all this correctly as I have never tried a service like this before. Thank-you.

    Nick

  • #2
    Regular Coder
    Join Date
    Aug 2002
    Location
    São Paulo, Brazil
    Posts
    367
    Thanks
    0
    Thanked 0 Times in 0 Posts
    If I understood you correctly, you have a textarea where the students type the subanswers. When they click OK, you want to copy this text to another textarea and then clean the first to prepare it for the next subanswer.

    Do you have some code to show us? Maybe it will clear a little...
    /Daniel

  • #3
    Senior Coder coothead's Avatar
    Join Date
    Jan 2004
    Location
    chertsey, a small town 25 miles south west of london, england.
    Posts
    1,695
    Thanks
    0
    Thanked 232 Times in 227 Posts
    Hi there Nick102,

    Try this.....
    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
    <meta content="mshtml 6.00.2800.1264" name="generator" />
    <title>Exam Paper</title>
    <style type="text/css">
    /*<![CDATA[*/
    body{background-color:#aaaaff;}
    div#border{width:90%;border:solid 1px #000000;background-color:#ffffff;padding:2%;margin:auto;}
    #text{width:100%;height:100px;margin:auto;}
     /*]]>*/
    </style>
    <script type="text/javascript">
     //<![CDATA[
    var id=new Array('a','b','c','d','e','f')
    var i=0;
    function Exam()
    {
    var choice= document.getElementById("text").value;
    document.getElementById(id[i]).innerHTML='<p>'+choice+'<\/p>';
    if(i<4)
    {
    i++;
    }
    }
    //]]>
    </script>
    </head>
    <body>
    <div id="border">
    <div>
    <form action="#">
    <div>
    <textarea id="text"cols=""rows=""></textarea>
    </div>
    <div>
    <input type="button" value="process" onclick="Exam();"/>
    <input type="reset" />
    <input type="button" value="clear for printing" onclick="this.form.style.visibility='hidden'"/>
    </div>
    </form>
    </div>
    <div id="a"></div>
    <div id="b"></div>
    <div id="c"></div>
    <div id="d"></div>
    <div id="e"></div>
    </div>
    </body>
    </html>
    This script has been tested in IE 6, Mozilla 1.5, Netscape 7.1 and Opera 7.0

    cthead
    Last edited by coothead; 01-15-2004 at 06:19 PM.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •