473,503 Members | 1,662 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Foiling the cheaters

9 New Member
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:
Expand|Select|Wrap|Line Numbers
  1. //Define variables:
  2.  //Correct answer (use quotes for alpha-numeric, no quotes for numeric):
  3.  var corAns = 5;
  4.  
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.
Nov 22 '11 #1
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.
Nov 22 '11 #2
zorgi
431 Recognized Expert Contributor
You can try HTML scrambler. Here is one:

http://www.hypergurl.com/generators/htmlscrambler.html

Tools like firebug will still unscramble the code.

Server side scripting is probably best option.
Nov 22 '11 #3
systomx
9 New Member
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:
Expand|Select|Wrap|Line Numbers
  1. <body "oncontextmenu = return false;">
  2.  
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
Nov 22 '11 #4
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.
Nov 22 '11 #5
drhowarddrfine
7,435 Recognized Expert Expert
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.
Nov 22 '11 #6
systomx
9 New Member
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?
Nov 24 '11 #7
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.
Nov 27 '11 #8
intermension
2 New Member
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
Dec 1 '11 #9
systomx
9 New Member
Thanks, Richard. That would be great. It could save me a lot of work in hand-encoding the answers.

Systomx
Dec 1 '11 #10
drhowarddrfine
7,435 Recognized Expert Expert
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.
Dec 1 '11 #11
intermension
2 New Member
@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
Dec 1 '11 #12
systomx
9 New Member
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.
Dec 5 '11 #13

Sign in to post your reply or Sign up for a free account.

Similar topics

17
5887
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...
0
1609
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...
1
3260
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...
15
1860
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...
49
3121
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...
10
1975
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...
11
12086
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...
0
7201
marktang
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,...
0
7328
jinu1996
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...
0
7456
tracyyun
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...
1
5011
isladogs
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...
0
4672
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...
0
3166
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...
0
3153
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
734
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
379
bsmnconsultancy
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...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.