Re: [PHP] Dhtml/javasript layer tips or software (0.T)

2006-08-20 Thread tedd

At 1:49 PM -0400 8/18/06, Robert Cummings wrote:

-snip-

 BTW, this is not PHP, but I'm feeling benevolent today ;)


You can get benevolent any time you want -- thanks for the code.  :-)

tedd
--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Dhtml/javasript layer tips or software (0.T)

2006-08-20 Thread tedd

At 1:49 PM -0400 8/18/06, Robert Cummings wrote:

-snip-
I'll leave it to you as an exercise to adapt it properly in PHP using
variables and loops instead of harded coded content :) BTW, this is not
PHP, but I'm feeling benevolent today ;)

Cheers,
Rob.


As a minor addition to Rob's code:

http://xn--ovg.com/a_exam

tedd
--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Dhtml/javasript layer tips or software (0.T)

2006-08-20 Thread Robert Cummings
On Sun, 2006-08-20 at 09:53 -0400, tedd wrote:
 At 1:49 PM -0400 8/18/06, Robert Cummings wrote:
 -snip-
 I'll leave it to you as an exercise to adapt it properly in PHP using
 variables and loops instead of harded coded content :) BTW, this is not
 PHP, but I'm feeling benevolent today ;)
 
 Cheers,
 Rob.
 
 As a minor addition to Rob's code:
 
 http://xn--ovg.com/a_exam

That's cool... but now I need to think of which circle of hell you
belong in for bastardizing my indentation and tabbing ;)

Cheers,
Rob.
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Dhtml/javasript layer tips or software (0.T)

2006-08-20 Thread tedd

At 10:36 AM -0400 8/20/06, Robert Cummings wrote:

On Sun, 2006-08-20 at 09:53 -0400, tedd wrote:

 At 1:49 PM -0400 8/18/06, Robert Cummings wrote:
 -snip-
 I'll leave it to you as an exercise to adapt it properly in PHP using
 variables and loops instead of harded coded content :) BTW, this is not
 PHP, but I'm feeling benevolent today ;)
 
 Cheers,
 Rob.

 As a minor addition to Rob's code:

 http://xn--ovg.com/a_exam


That's cool... but now I need to think of which circle of hell you
belong in for bastardizing my indentation and tabbing ;)

Cheers,
Rob.



Rob:

Ain't it cool that we all get to do our own thing? I certainly would 
not like conforming to someone else's formatting scheme -- mine may 
be more verbose, but it makes sense to me.


That's one of the advantages of freelancing, besides picking where 
you want to starve.


tedd

--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Dhtml/javasript layer tips or software (0.T)

2006-08-20 Thread Robert Cummings
On Sun, 2006-08-20 at 10:41 -0400, tedd wrote:
 At 10:36 AM -0400 8/20/06, Robert Cummings wrote:
 On Sun, 2006-08-20 at 09:53 -0400, tedd wrote:
   At 1:49 PM -0400 8/18/06, Robert Cummings wrote:
   -snip-
   I'll leave it to you as an exercise to adapt it properly in PHP using
   variables and loops instead of harded coded content :) BTW, this is not
   PHP, but I'm feeling benevolent today ;)
   
   Cheers,
   Rob.
 
   As a minor addition to Rob's code:
 
   http://xn--ovg.com/a_exam
 
 That's cool... but now I need to think of which circle of hell you
 belong in for bastardizing my indentation and tabbing ;)
 
 Cheers,
 Rob.
 
 
 Rob:
 
 Ain't it cool that we all get to do our own thing? I certainly would 
 not like conforming to someone else's formatting scheme -- mine may 
 be more verbose, but it makes sense to me.

You did notice I had a smiley right? It was meant in jest :)

 That's one of the advantages of freelancing, besides picking where 
 you want to starve.

Starve? Hmm, I'm not having that problem. Though I did when I first
started and had no customers *lol*. Mind you while I was startving I had
lots of time to write InterJinn.

Cheers,
Rob.
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Dhtml/javasript layer tips or software (0.T)

2006-08-19 Thread Robert Cummings
On Sat, 2006-08-19 at 12:32 +0700, Peter Lauri wrote:
 Now I get interested, what is KISS? :)

Keep it Simple Stupid. Generally a reminder not to over engineer
something :)

Cheers,
Rob.
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Dhtml/javasript layer tips or software (0.T)

2006-08-19 Thread Peter Lauri
I am a KISSER! :)

-Original Message-
From: Robert Cummings [mailto:[EMAIL PROTECTED] 
Sent: Saturday, August 19, 2006 1:26 PM
To: Peter Lauri
Cc: 'Ryan A'; 'php php'
Subject: RE: [PHP] Dhtml/javasript layer tips or software (0.T)

On Sat, 2006-08-19 at 12:32 +0700, Peter Lauri wrote:
 Now I get interested, what is KISS? :)

Keep it Simple Stupid. Generally a reminder not to over engineer
something :)

Cheers,
Rob.
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Dhtml/javasript layer tips or software (0.T)

2006-08-19 Thread Ryan A
Hey Rob,

 As it were though, an Ajax solution is more involved
 and his request
 didn't seem to indicate a need for it so I went with
 KISS :)

The simple solution is exactly what i needed, it may
not have a lot of bells and whistles but thats the
whole point. Easy to add and update. No points/scores
to keep track of so no was AJAX needed.

I didnt mind going in for a commerical solution as
they tend to have a better GUI output (for example
look at the dhtml popup softwares... a whole lot of
options ready for you with a single click, things that
would take you hours if not days to do by hand
coding), I am still interested if I can find something
like that otherwise your solution is perfect
alternative. 

Just need to figure out how to change the cells
background color when the hint is shown and change it
back when the hint is hidden again.

Thanks!
Ryan



--
- The faulty interface lies between the chair and the keyboard.
- Creativity is great, but plagiarism is faster!
- Smile, everyone loves a moron. :-)

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Dhtml/javasript layer tips or software (0.T)

2006-08-19 Thread Robert Cummings
On Sat, 2006-08-19 at 08:09 -0700, Ryan A wrote:

 Just need to figure out how to change the cells
 background color when the hint is shown and change it
 back when the hint is hidden again.

Just set the bckground colour of the div that contains the hint.

div style=background: #ff; padding: 15px;

Cheers,
Rob.
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Dhtml/javasript layer tips or software (0.T)

2006-08-19 Thread tedd

Just need to figure out how to change the cells
background color when the hint is shown and change it
back when the hint is hidden again.

Thanks!
Ryan


Use the DOM, Luke.

Or, use a style switcher, like:

http://www.sperling.com/examples/styleswitch/

Using css is a good way to accomplish this.

tedd
--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Dhtml/javasript layer tips or software (0.T)

2006-08-19 Thread Ryan A
  Just need to figure out how to change the cells
  background color when the hint is shown and change
 it
  back when the hint is hidden again.



 
 Just set the bckground colour of the div that
 contains the hint.
 
 div style=background: #ff; padding: 15px;


DUH! Of course... am totally duh! this week, 9 hour
working days and 4 company meetings + 2 presentations.

Thanks again,
Ryan 


--
- The faulty interface lies between the chair and the keyboard.
- Creativity is great, but plagiarism is faster!
- Smile, everyone loves a moron. :-)

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Dhtml/javasript layer tips or software (0.T)

2006-08-19 Thread Ryan A


--- tedd [EMAIL PROTECTED] wrote:

 Just need to figure out how to change the cells
 background color when the hint is shown and change
 it
 back when the hint is hidden again.
 
 Thanks!
 Ryan
 
 Use the DOM, Luke.
 
 Or, use a style switcher, like:
 
 http://www.sperling.com/examples/styleswitch/
 
 Using css is a good way to accomplish this.
 
 tedd

If I'm Luke, who are you?

Yoda? ;D

Thanks for the tip, I have already used the tip that
Rob gave me, so for now am happy and wont touch
anything!

cheers!

--
- The faulty interface lies between the chair and the keyboard.
- Creativity is great, but plagiarism is faster!
- Smile, everyone loves a moron. :-)

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Dhtml/javasript layer tips or software (0.T)

2006-08-19 Thread Ryan A
Hey!

 Robert,
 
 Isn't it to easy to cheat if you do like this? Just
 view the source and you
 have the answers. But, this is maybe not for
 examination, maybe just for
 learning. If it is examination, AJAX would be
 better, so that they can not
 find out the solution by just looking at the source.


Sorry for not explaining this earlier guys, this is
not for any test, its to teach young kids (ages 10-14)
maths in Swedish, the kids are from other countries
where Swedish is not their own language.

No testing, no keeping points or scores.

Thanks!
Ryan

--
- The faulty interface lies between the chair and the keyboard.
- Creativity is great, but plagiarism is faster!
- Smile, everyone loves a moron. :-)

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Dhtml/javasript layer tips or software (0.T)

2006-08-18 Thread Ray Hauge
On Friday 18 August 2006 10:30, Ryan A wrote:
 Hello,
 I am working on a php project that needs a little
 extra JS/DHTML solution. I am sure some of you might
 have come to use something like this before, please
 recommend a solution (commerial solutions are fine /
 willing to pay)

 Basically, I will have a page with around 10 questions
 for students and then two buttons for [HINT] and
 [SOLUTION]

 When either of these buttons/text is clicked the
 resulting text should be displayed in the side/bottom
 cell, the user should also be able to 'close' this
 resulting explanation.

 Note, on each page there will be around 10 questions,
 so each of these questions will have a hint  solution
 button/text.

 Thanks in advance,
 Ryan

 --
 - The faulty interface lies between the chair and the keyboard.
 - Creativity is great, but plagiarism is faster!
 - Smile, everyone loves a moron. :-)

 __
 Do You Yahoo!?
 Tired of spam?  Yahoo! Mail has the best spam protection around
 http://mail.yahoo.com

I find that the Yahoo User Interface Library is pretty nice.

http://developer.yahoo.com/yui/index.html

I'm not sure that you really need a library to do what you want though.  It 
could be as simple as using a div, and then the buttons change text with 
innerHTML (as long as you're not expecting to use that text after the 
submit).

-- 
Ray Hauge
Programmer/Systems Administrator
American Student Loan Services
www.americanstudentloan.com
1.800.575.1099

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Dhtml/javasript layer tips or software (0.T)

2006-08-18 Thread Robert Cummings
On Fri, 2006-08-18 at 08:30 -0700, Ryan A wrote:
 Hello,
 I am working on a php project that needs a little
 extra JS/DHTML solution. I am sure some of you might
 have come to use something like this before, please
 recommend a solution (commerial solutions are fine /
 willing to pay)
 
 Basically, I will have a page with around 10 questions
 for students and then two buttons for [HINT] and
 [SOLUTION]
 
 When either of these buttons/text is clicked the
 resulting text should be displayed in the side/bottom
 cell, the user should also be able to 'close' this
 resulting explanation.
 
 Note, on each page there will be around 10 questions,
 so each of these questions will have a hint  solution
 button/text.

Will you have two buttons for each question? So that you get the
hint/solution on a question by question basis? The solution is quite
simple:

html
head
script language=javascript type=text/javascript

var hints = new Array();
hints[1] = 'Hint for question 1';
hints[2] = 'Hint for question 2';
hints[3] = 'Hint for question 3';
hints[4] = 'Hint for question 4';
//...

var solutions = new Array();
solutions[1] = 'Solution for question 1';
solutions[2] = 'Solution for question 2';
solutions[3] = 'Solution for question 3';
solutions[4] = 'Solution for question 4';
//...

function showHint( id )
{
hideSolution();

var h = document.getElementById( 'questionHint' );
h.innerHTML = hints[id];
h.style.display = '';
}

function hideHint()
{
var h = document.getElementById( 'questionHint' );
h.style.display = 'none';
}

function showSolution( id )
{
hideHint();

var s = document.getElementById( 'questionSolution' );
s.innerHTML = solutions[id];
s.style.display = '';
}

function hideSolution()
{
var s = document.getElementById( 'questionSolution' );
s.style.display = 'none';
}
/script
/head
body
pblah blah blah blah blah blah/p

p
Question 1 ...
input type=submit value=Get Hint onclick=showHint( 1 ); return
false; /
input type=submit value=Get Solution onclick=showSolution( 1 );
return false; /
/p
p
Question 2 ...
input type=submit value=Get Hint onclick=showHint( 2 ); return
false; /
input type=submit value=Get Solution onclick=showSolution( 2 );
return false; /
/p
p
Question 3 ...
input type=submit value=Get Hint onclick=showHint( 3 ); return
false; /
input type=submit value=Get Solution onclick=showSolution( 3 );
return false; /
/p
p
Question 4 ...
input type=submit value=Get Hint onclick=showHint( 4 ); return
false; /
input type=submit value=Get Solution onclick=showSolution( 4 );
return false; /
/p
p.../p

p id=questionHint style=display: none;
/p

p id=questionSolution style=display: none;
/p

/body
/html


I'll leave it to you as an exercise to adapt it properly in PHP using
variables and loops instead of harded coded content :) BTW, this is not
PHP, but I'm feeling benevolent today ;)

Cheers,
Rob.
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Dhtml/javasript layer tips or software (0.T)

2006-08-18 Thread Ryan A
Hey Ray/Tedd,
Thanks for replying guys.


Ray, Checked out the Y! library, not really to my
needs and I really doubt I need a whole library to do
this.

Tedd,
 
 Ryan:
 
 You said:
 
 ... willing to pay.
 
 Music to my ears.
 

Happy to have helped ;D



 This does not do what you want, but I am sure it can
 be modified to do so.
 
 http://www.webbytedd.com/c1/
 

Problem is, it didnt work in FF, I checked in IE and
there was no problem.

What I need is real simple, possible just a DIV
tag as Ray pointed out, but with a little
functionality to close/show the hints and
suggestions.. and should look decent.
The reason I dont mind going in for a commerical
solution is they tend to have some better display
options and the code is totally generated, new
question new code generated, simple as that. When
things go wrong its a b1t*h to debug of course!

Thanks!
Ryan

--
- The faulty interface lies between the chair and the keyboard.
- Creativity is great, but plagiarism is faster!
- Smile, everyone loves a moron. :-)

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Dhtml/javasript layer tips or software (0.T)

2006-08-18 Thread Ryan A
Hey Tedd,

 Would this be something that would select
 questions/hints/and 
 solutions from a larger dB?

No db, this page would be generated via a DB query but
the answers have to already be on the local page and
accessable to the JS, I dont want to complicate
matters using AJAX either

 
 Also, would pop-ups? work -- I know you said you
 wanted data to the 
 side or below, but that requires a refresh of some
 type (ajax). 

Nope, I have little choice in the matter, this has
already been decided to have to show up in cell at the
side or bottom, no popups as this window itself will
be a popup.

 You might also look into tool-tips via css -- I
 think that would work.

Thanks, will do

 
 If you need any help, just ask.

Thanks, but thats always the case with you!

Cheers!
Ryan

--
- The faulty interface lies between the chair and the keyboard.
- Creativity is great, but plagiarism is faster!
- Smile, everyone loves a moron. :-)

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Dhtml/javasript layer tips or software (0.T)

2006-08-18 Thread Ryan A
Thanks Rob, 
I think thats exactly what was/is needed. Its real
simple and easy to modify.

 BTW, this is not PHP, 

Never said it was, didnt you notice my off topic (O.T)
in the subject? Theres enough spam on the list and I
didnt want to offend anyone so made sure I put it
there.

Will come back if I face problems, thanks for your
help once again.

Cheers!
Ryan


--- Robert Cummings [EMAIL PROTECTED] wrote:

 On Fri, 2006-08-18 at 08:30 -0700, Ryan A wrote:
  Hello,
  I am working on a php project that needs a little
  extra JS/DHTML solution. I am sure some of you
 might
  have come to use something like this before,
 please
  recommend a solution (commerial solutions are fine
 /
  willing to pay)
  
  Basically, I will have a page with around 10
 questions
  for students and then two buttons for [HINT] and
  [SOLUTION]
  
  When either of these buttons/text is clicked the
  resulting text should be displayed in the
 side/bottom
  cell, the user should also be able to 'close' this
  resulting explanation.
  
  Note, on each page there will be around 10
 questions,
  so each of these questions will have a hint 
 solution
  button/text.
 
 Will you have two buttons for each question? So that
 you get the
 hint/solution on a question by question basis? The
 solution is quite
 simple:
 
 html
 head
 script language=javascript
 type=text/javascript
 
 var hints = new Array();
 hints[1] = 'Hint for question 1';
 hints[2] = 'Hint for question 2';
 hints[3] = 'Hint for question 3';
 hints[4] = 'Hint for question 4';
 //...
 
 var solutions = new Array();
 solutions[1] = 'Solution for question 1';
 solutions[2] = 'Solution for question 2';
 solutions[3] = 'Solution for question 3';
 solutions[4] = 'Solution for question 4';
 //...
 
 function showHint( id )
 {
 hideSolution();
 
 var h = document.getElementById(
 'questionHint' );
 h.innerHTML = hints[id];
 h.style.display = '';
 }
 
 function hideHint()
 {
 var h = document.getElementById(
 'questionHint' );
 h.style.display = 'none';
 }
 
 function showSolution( id )
 {
 hideHint();
 
 var s = document.getElementById(
 'questionSolution' );
 s.innerHTML = solutions[id];
 s.style.display = '';
 }
 
 function hideSolution()
 {
 var s = document.getElementById(
 'questionSolution' );
 s.style.display = 'none';
 }
 /script
 /head
 body
 pblah blah blah blah blah blah/p
 
 p
 Question 1 ...
 input type=submit value=Get Hint
 onclick=showHint( 1 ); return
 false; /
 input type=submit value=Get Solution
 onclick=showSolution( 1 );
 return false; /
 /p
 p
 Question 2 ...
 input type=submit value=Get Hint
 onclick=showHint( 2 ); return
 false; /
 input type=submit value=Get Solution
 onclick=showSolution( 2 );
 return false; /
 /p
 p
 Question 3 ...
 input type=submit value=Get Hint
 onclick=showHint( 3 ); return
 false; /
 input type=submit value=Get Solution
 onclick=showSolution( 3 );
 return false; /
 /p
 p
 Question 4 ...
 input type=submit value=Get Hint
 onclick=showHint( 4 ); return
 false; /
 input type=submit value=Get Solution
 onclick=showSolution( 4 );
 return false; /
 /p
 p.../p
 
 p id=questionHint style=display: none;
 /p
 
 p id=questionSolution style=display: none;
 /p
 
 /body
 /html
 
 
 I'll leave it to you as an exercise to adapt it
 properly in PHP using
 variables and loops instead of harded coded content
 :) BTW, this is not
 PHP, but I'm feeling benevolent today ;)
 
 Cheers,
 Rob.
 -- 

..
 | InterJinn Application Framework -
 http://www.interjinn.com |

::
 | An application and templating framework for PHP.
 Boasting  |
 | a powerful, scalable system for accessing system
 services  |
 | such as forms, properties, sessions, and caches.
 InterJinn |
 | also provides an extremely flexible architecture
 for   |
 | creating re-usable components quickly and easily. 
 |

`'
 
 


--
- The faulty interface lies between the chair and the keyboard.
- Creativity is great, but plagiarism is faster!
- Smile, everyone loves a moron. :-)

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Dhtml/javasript layer tips or software (0.T)

2006-08-18 Thread Robert Cummings
On Sat, 2006-08-19 at 11:54 +0700, Peter Lauri wrote:
 Robert,
 
 Isn't it to easy to cheat if you do like this? Just view the source and you
 have the answers. But, this is maybe not for examination, maybe just for
 learning. If it is examination, AJAX would be better, so that they can not
 find out the solution by just looking at the source.

I did it based on what he requested. The fact that there's a show
hint/solution button in the first place suggests that they can view the
information. I guess it depends on whether the questions are part of an
exam, or self quiz in which case the hint and solution can be condusive
to further learning.

As you say though, if it were a test, I'd use Ajax and register the show
hint/solution request. Probably incurring full point loss for show
solution and partial point loss for show hint.

As it were though, an Ajax solution is more involved and his request
didn't seem to indicate a need for it so I went with KISS :)

Cheers,
Rob.
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Dhtml/javasript layer tips or software (0.T)

2006-08-18 Thread Peter Lauri
Now I get interested, what is KISS? :)

-Original Message-
From: Robert Cummings [mailto:[EMAIL PROTECTED] 
Sent: Saturday, August 19, 2006 12:14 PM
To: Peter Lauri
Cc: 'Ryan A'; 'php php'
Subject: RE: [PHP] Dhtml/javasript layer tips or software (0.T)

On Sat, 2006-08-19 at 11:54 +0700, Peter Lauri wrote:
 Robert,
 
 Isn't it to easy to cheat if you do like this? Just view the source and
you
 have the answers. But, this is maybe not for examination, maybe just for
 learning. If it is examination, AJAX would be better, so that they can not
 find out the solution by just looking at the source.

I did it based on what he requested. The fact that there's a show
hint/solution button in the first place suggests that they can view the
information. I guess it depends on whether the questions are part of an
exam, or self quiz in which case the hint and solution can be condusive
to further learning.

As you say though, if it were a test, I'd use Ajax and register the show
hint/solution request. Probably incurring full point loss for show
solution and partial point loss for show hint.

As it were though, an Ajax solution is more involved and his request
didn't seem to indicate a need for it so I went with KISS :)

Cheers,
Rob.
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Dhtml/javasript layer tips or software (0.T)

2006-08-18 Thread Peter Lauri
Robert,

Isn't it to easy to cheat if you do like this? Just view the source and you
have the answers. But, this is maybe not for examination, maybe just for
learning. If it is examination, AJAX would be better, so that they can not
find out the solution by just looking at the source.

/Peter


-Original Message-
From: Robert Cummings [mailto:[EMAIL PROTECTED] 
Sent: Saturday, August 19, 2006 12:49 AM
To: Ryan A
Cc: php php
Subject: Re: [PHP] Dhtml/javasript layer tips or software (0.T)

On Fri, 2006-08-18 at 08:30 -0700, Ryan A wrote:
 Hello,
 I am working on a php project that needs a little
 extra JS/DHTML solution. I am sure some of you might
 have come to use something like this before, please
 recommend a solution (commerial solutions are fine /
 willing to pay)
 
 Basically, I will have a page with around 10 questions
 for students and then two buttons for [HINT] and
 [SOLUTION]
 
 When either of these buttons/text is clicked the
 resulting text should be displayed in the side/bottom
 cell, the user should also be able to 'close' this
 resulting explanation.
 
 Note, on each page there will be around 10 questions,
 so each of these questions will have a hint  solution
 button/text.

Will you have two buttons for each question? So that you get the
hint/solution on a question by question basis? The solution is quite
simple:

html
head
script language=javascript type=text/javascript

var hints = new Array();
hints[1] = 'Hint for question 1';
hints[2] = 'Hint for question 2';
hints[3] = 'Hint for question 3';
hints[4] = 'Hint for question 4';
//...

var solutions = new Array();
solutions[1] = 'Solution for question 1';
solutions[2] = 'Solution for question 2';
solutions[3] = 'Solution for question 3';
solutions[4] = 'Solution for question 4';
//...

function showHint( id )
{
hideSolution();

var h = document.getElementById( 'questionHint' );
h.innerHTML = hints[id];
h.style.display = '';
}

function hideHint()
{
var h = document.getElementById( 'questionHint' );
h.style.display = 'none';
}

function showSolution( id )
{
hideHint();

var s = document.getElementById( 'questionSolution' );
s.innerHTML = solutions[id];
s.style.display = '';
}

function hideSolution()
{
var s = document.getElementById( 'questionSolution' );
s.style.display = 'none';
}
/script
/head
body
pblah blah blah blah blah blah/p

p
Question 1 ...
input type=submit value=Get Hint onclick=showHint( 1 ); return
false; /
input type=submit value=Get Solution onclick=showSolution( 1 );
return false; /
/p
p
Question 2 ...
input type=submit value=Get Hint onclick=showHint( 2 ); return
false; /
input type=submit value=Get Solution onclick=showSolution( 2 );
return false; /
/p
p
Question 3 ...
input type=submit value=Get Hint onclick=showHint( 3 ); return
false; /
input type=submit value=Get Solution onclick=showSolution( 3 );
return false; /
/p
p
Question 4 ...
input type=submit value=Get Hint onclick=showHint( 4 ); return
false; /
input type=submit value=Get Solution onclick=showSolution( 4 );
return false; /
/p
p.../p

p id=questionHint style=display: none;
/p

p id=questionSolution style=display: none;
/p

/body
/html


I'll leave it to you as an exercise to adapt it properly in PHP using
variables and loops instead of harded coded content :) BTW, this is not
PHP, but I'm feeling benevolent today ;)

Cheers,
Rob.
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Dhtml/javasript layer tips or software (0.T)

2006-08-18 Thread Larry Garfield
It is a small chocolate candy manufactured by the Hershey's corporation.

It's also the act of pressing one's lips against the body or lips of another, 
in a friendly, romantic, or sexual fashion.

It can also be a misspelling of a rock band that was popular a while back.

It is also an acronym for Keep It Simple, Stupid!

I leave the decision of which meaning was intended here as an exercise to the 
reader.

On Saturday 19 August 2006 00:32, Peter Lauri wrote:
 Now I get interested, what is KISS? :)

 -Original Message-
 From: Robert Cummings [mailto:[EMAIL PROTECTED]
 Sent: Saturday, August 19, 2006 12:14 PM
 To: Peter Lauri
 Cc: 'Ryan A'; 'php php'
 Subject: RE: [PHP] Dhtml/javasript layer tips or software (0.T)

 On Sat, 2006-08-19 at 11:54 +0700, Peter Lauri wrote:
  Robert,
 
  Isn't it to easy to cheat if you do like this? Just view the source and

 you

  have the answers. But, this is maybe not for examination, maybe just for
  learning. If it is examination, AJAX would be better, so that they can
  not find out the solution by just looking at the source.

 I did it based on what he requested. The fact that there's a show
 hint/solution button in the first place suggests that they can view the
 information. I guess it depends on whether the questions are part of an
 exam, or self quiz in which case the hint and solution can be condusive
 to further learning.

 As you say though, if it were a test, I'd use Ajax and register the show
 hint/solution request. Probably incurring full point loss for show
 solution and partial point loss for show hint.

 As it were though, an Ajax solution is more involved and his request
 didn't seem to indicate a need for it so I went with KISS :)

-- 
Larry Garfield  AIM: LOLG42
[EMAIL PROTECTED]   ICQ: 6817012

If nature has made any one thing less susceptible than all others of 
exclusive property, it is the action of the thinking power called an idea, 
which an individual may exclusively possess as long as he keeps it to 
himself; but the moment it is divulged, it forces itself into the possession 
of every one, and the receiver cannot dispossess himself of it.  -- Thomas 
Jefferson

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php