[K12OSN] Homework DropBox Idea

Jim Kronebusch jim at winonacotter.org
Mon Jul 25 14:05:47 UTC 2005


> directory structure like so   
> 
> /homework/compsci
> /homework/saps
> /homework/7a
> 
> one directory for each class, but no individual user folders inside. 
> 
> I want to give the kids responsibility to "hand-in" their assignments 
> into the appropriate folders.  BUT:
> 
> I don't want other classes to be able to mess with their files.  so 
> compsci kids can't mess with saps files, etc.  But I wanted 
> to take it 
> further and say that the compsci kids could hand in their 
> finished work 
> into the /homework/compsci folder, but not delete or change the file 
> once it is there

First of all, pardon my last message, I bumped send before typing :-)

With the help of this list about 2 years ago now I got our homework drop
folders setup.  I wanted a very simple to manage setup that didn't
require me updating class groups all the time (I have no class groups on
the server).  I have a folder called "Drop" under /home.  Under this I
have each teacher listed, under that I have their classes listed by
hour.  Example:

/home/Drop/Frisby/2hr
/home/Drop/Frisby/4hr
/home/Drop/Meurer/5hr

You get the point.  Drop has 2755 permissions with adm being the owner
and staff being the group.  Staff is assigned of course to all staff.
Each teacher folder has 2775 permissions with the teacher being the
owner and the teacher the group.  Each class folder (or hour) has 2773
permissions, with the teacher again as both the user and group.  This
allows all users of the system to navigate through the folder structure
to any drop folder.  They can drop to any drop folder.  They however
cannot delete or view any items from any drop folder unless they are the
teacher who owns the drop folder.  The reason I did things this way is
that there may be 3 compsci classes, this method avoided getting
homework from all three classes mixed together.

Next issue is that when dropped, the student still maintains ownership
of that file.  This could cause trouble for the teacher trying to
move/delete/modify the file, or allow the student to overwrite it at a
later date.  Plus this file still belongs to the student quota and not
the teachers.  With the help of the list I now have the following script
set via cron to run every minute.  This script takes the owner of the
teacher folder that houses the class drop folders and sets the
permissions of all files inside to be owned by the teacher.  Now the
student no longer has access to the file, the teacher has full
priveleges to modify and work with it, and it is now the teachers
responsibility to clean up the drop folders because the files there chew
up their quota.  Here is the script:

#!/bin/bash
for file in /home/Drop/*
do owner=$(ls -ld \
"$file"\
|awk '{print $3}')
chown -R $owner \
"$file"
Done

Very simple file, but very effective.  If you still want to break your
drop folders down in the order you specified above you would only need
minor changes to the script:

#!/bin/bash
for file in /homework/*
do owner=$(ls -ld \
"$file"\
|awk '{print $3}')
chown -R $owner \
"$file"
Done

Then just be sure the class folder is owned by the proper staff member.

Hope that helps.

P.S.  If anyone does this and also has Apple users writing via
Appletalk, do yourself a favor and create an .AppleDouble folder under
each drop folder and give 777 permissions.  This will eliminate the many
crazy problems with Appletalk and permissions.  And since no one knows
they are there I don't believe it causes much security problems.

-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.338 / Virus Database: 267.9.4/57 - Release Date: 7/22/2005
 


-- 
This message has been scanned for viruses and
dangerous content by the Cotter Technology 
Department, and is believed to be clean.




More information about the K12OSN mailing list