I teach electrical engineering, and I have a series of 20 or so html/javascript tutorials for my students. Each page of each tutorial asks a question, which the student must answer. The answers are in the javascript, like this: -
//Define variables:
-
//Correct answer (use quotes for alpha-numeric, no quotes for numeric):
-
var corAns = 5;
-
Some of the students right click and select "view frame source" to extract the answers from my code.
Now, I realize that I can't totally protect my answers from being extracted, but I'm hoping to make it more difficult for them to cheat than to just honestly answer the questions.
So I'm asking for your suggestions as to how to throw up a few walls of protection. Please keep in mind that I've got about 300 HTML pages of tutorials, so I'd prefer some (perhaps search and replace) solution that doesn't involve my personally editing each individual page.
For those interested, you can see the tutorials at:
http://raise.spd.louisville.edu/systom/ECE252/252home.htm
Thanks for your help.
12 1966 Rabbit 12,516
Recognized Expert Moderator MVP
Since it's a school web server, it should have some sort of server side scripting set up right? You could do the validation on the server side.
If that is not an option, for security reasons or whatever, you can encode the javascript using base64. It's reversible without a password but not everyone knows how to do that and it offers a modicum of security.
Thanks for your responses, Rabbit and Zorgi. I'm hoping for something a bit simpler than you have suggested. I've experimented with modifying the body tag as shown below: -
<body "oncontextmenu = return false;">
-
This is nice and simple, and it seems to prevent most browsers from using right click or the drop-down menus to view my code, but I've been told that this technique is insulting to users.
Tom Cleaver
zorgi 431
Recognized Expert Contributor
Firebug still shows the code. They also can use browser main menu. Really, once they are viewing it through the browser you can not physically protect the code. Your best bet in that case is some form of encoding.
This is really a javascript question and not for html/css. What you could use is ROT-13 encoding which should be relatively simple to do if you know js.
Once again, thanks to all who have responded. Aside from server-side maneuvers, many of you have been suggesting encrypting. I don't need to encode an entire page, I just have to encode the answer. Is there an easy way to do that?
Rabbit 12,516
Recognized Expert Moderator MVP
An easy way is to find existing hashing code, and use that to hash your answers, store the hash, and then hash the student's answer and compare it to the stored hash. Just be aware that with a hash, you can't reverse it to get the original input.
Hi systomx,
If you can wait until Monday 5th December I will write you a small program that will traverse the folder directory you point it at, including sub directories if neccessary, pull the current answer out and create a record associating the filename, plaintext answer and cipher.
Then upon operator request, i.e. click a button, it will replace all the plaintext answers in your tutorials with the base64 encoded (tho you could use a stronger encryption / hashing / etc) answer.
From there you'd just need to link to a base64 decode plugin (jquery / javascript) /(heaps around i'll send you one) to decode the answer when checking your students work.
You can have access to the source code, and if you know how to compile a C# progam, you can compile it yourself to confirm there is nothing nefarious going on.
It's not much work to write something like that but I wont have any time till Sunday evening.
Richard
Thanks, Richard. That would be great. It could save me a lot of work in hand-encoding the answers.
Systomx
So you ignored the ROT-13 source I gave? We encode email addresses that way with simple javascript, no server side anything, to do exactly what you want. It's easy to do and can be done in a few minutes but....whatever.
@systomx
No worries. I wouldn't want to open, copy, encode, paste, save 300+ times either. I'll come back to you around midday NZST.
Richard
drhowarddrfine
I looked up the reference you suggested. It didn't quite meet my needs. One issue is that many of my answers are numeric, with students allowed to submit answers that are within a percentage of the correct answer. For example, if the answer is 100, and there is a 3% window, answers between 97 and 103 are accepted as correct.
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Milos Prudek |
last post by:
Hi,
is it technically possible to distribute a python project as a closed
source, i.e. encrypted?
I believe that *.pyc files do not work without *.py sources... and they can
be easily...
|
by: datapro01 |
last post by:
Running db2 8.1.1 on AIX 5.1
Recently created a Tools catalog and db on a test database server.
Since then a shell script that runs the offline backups has been
failing with the db2dasstm...
|
by: Raves |
last post by:
Hi,
I am developing a COM component in C# using a COM Callable Wrapper.
This com component works fine on my development machine(Win XP). I use
ASP pages to invoke this component.
When I try...
|
by: SFX |
last post by:
If I have a session ID (string) can I somehow obtain the session object
associated to that ID (it exist of course) ?
I know this sounds wicked but I have a situation in which I have to make a...
|
by: vfunc |
last post by:
If I have a large array 10,000+ elements then how do I reserve memory
for this ? Currently I get a segmentation fault. Dynamic reservation
is good, but allowing a chunk for the program is an...
| |
by: preethamkumark |
last post by:
- The program first creates a shared memory buffer containing an array
of 20 integers.
- Each slot of the buffer can have either 0 or 1, where 0 represents an
empty slot, and 1
represents an...
|
by: cmb3587 |
last post by:
I have two arrays and I'm trying to create a 3rd array that is the difference between the two arrays
Ex:
arrayA: 3 5 8 9
arrayB: 3 4 6 9
difference of A-B: 5 8
however, my...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
| |
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...
| |