Jump to content


Photo

Help with school website


  • Please log in to reply
10 replies to this topic

#1 kevinritt

kevinritt
  • Members
  • PipPipPip
  • Advanced Member
  • 108 posts
  • LocationBoston, MA

Posted 11 October 2006 - 06:30 PM

Hi,
I am maintaining a school's website. What I would like to do is give the teachers the ability to enter homework on a daily basis. The homework postings would be on the site for the week. For example, on Monday a teacher may enter Monday and Tuesday's homework and then the rest of the week's homework on Wednesday and so on. My question is would I use a form for the teachers to enter homework and have the form post to the homework page? Would this work? I don't need to store the homework in a database but if I could that would be great. I am not looking for anything too complex. Any suggestions would be great.
Thanks
;D

#2 Jocka

Jocka
  • Members
  • PipPipPip
  • Advanced Member
  • 344 posts
  • LocationDallas, Texas

Posted 11 October 2006 - 08:15 PM

You could do it a few ways really.

1. You could store the homework in the database using a form.
2. You could use a form to create a homework FILE.
3. You could just let them upload a file and read the file from the server

Either way would be fine. But you should make sure only the teachers can submit the homework. Give them a password or something.

#3 Barand

Barand
  • Moderators
  • Sen . ( ile || sei )
  • 18,021 posts

Posted 11 October 2006 - 09:43 PM

Thay lets the teachers upload homework assignments. The other side of the coin is that pupils then need to view them. I can only go by my experience of school homework here. I'll describe the scenario tht applied when I was at school. Some, all or none may apply in your case.

Firstly, students are grouped by year. Within each year group there were different "streams". So at my school we had

Year 1, stream A
Year 1, stream B
Year 2, stream A
Year 2, stream B
Year 3, stream A
Year 3, stream B
Year 4, stream A
Year 4, stream B
Year 5, stream Literary
Year 5, stream Science

In year 2, for example, we had Bingo Roberts for Latin, but in year 3 it was Codface Jackson, so there are different teachers setting assignments on different nights for different subjects for different streams and different years.

So a student wanting to pick up his/her homework assignments has to be identifed to a specific group
If you are still using mysql_ functions, STOP! Use mysqli_ or PDO. The longer you leave it the more you will have to rewrite.

Donations gratefully received






moon.png

|baaGrid| easy data tables - and more
|baaChart| easy line, column and pie charts

#4 kevinritt

kevinritt
  • Members
  • PipPipPip
  • Advanced Member
  • 108 posts
  • LocationBoston, MA

Posted 12 October 2006 - 04:14 AM

You could do it a few ways really.

1. You could store the homework in the database using a form.
2. You could use a form to create a homework FILE.
3. You could just let them upload a file and read the file from the server

Either way would be fine. But you should make sure only the teachers can submit the homework. Give them a password or something.


I imagined it would be something like the teacher fills in a form for each day and subjust(e.g. Monday: English, science, etc) and submits the form. What I'm not clear on is how do I get the homework to show on the homework page? What calls the homework? Sorry for my ignorance.

Thanks
;D

#5 Firemankurt

Firemankurt
  • Members
  • PipPipPip
  • Advanced Member
  • 56 posts
  • LocationWashington State

Posted 12 October 2006 - 06:45 AM

I have seen a few projects like this on sourceforge.

You might search around like: http://sourceforge.n...ft&words=school

You might get ideas or just use something you find there.

#6 nickholt1972

nickholt1972
  • Members
  • PipPipPip
  • Advanced Member
  • 30 posts
  • LocationBury, Lancs, UK

Posted 12 October 2006 - 11:48 AM

I would imagine you'd have a form which has a secure login (this would involve a relatively simple selection of php scripts), the form fields would be something like Day, Subject and Assignment (where the teacher details the homework). On SUBMIT, that would scurry off to a database and populate a table (call it homework) with fields something like id, day, subject, assignment).
Then the students would view a page, lets call it viewhomework.php which would include a 'SELECT day, subject, assignment FROM homework' statement which would display the information from the database.

Then further to Barand's suggestion, you could have the students selecting their year and stream or class and via a couple of drop-down boxes could view their homework only. This would involve an extra couple of fields for the teachers to fill in and an additional 'WHERE year = ' . $year . 'AND class = ' . $class where $year and $class are the variable names assigned to the choices the student entered when filtering for his/her own homework.

Its quite a straightforward script really (if you know a bit about PHP), so shouldn't be too difficult.
Nick Holt - Future Guru

#7 kevinritt

kevinritt
  • Members
  • PipPipPip
  • Advanced Member
  • 108 posts
  • LocationBoston, MA

Posted 14 October 2006 - 04:13 AM

OK-I'm starting to get it. One final question (I hope) I want the teachers to submit homework for each day of the week (Monday, Tuesday, etc) How will the database know to call the most current entries? In other words, Monday's homework won't be called up a week later - a different 'Monday' homework will be called up. This way students can go to the 'Homework' page and see the most current homework without having to enter a date.
Thanks
;D

#8 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 14 October 2006 - 05:13 AM

First lets get some teachers only three in this example

mat    <<   teacher
john   <<   teacher
chris  <<    teacher

Lets add id's to the teachers names.

002 mat
003 john
004 chris

Lets add a password for the teachers.

id   name  password
002  mat    monkey
003  john   rabit
004  chris  frog

So now we got the login information for the teachers we got id teacher password.

lets create a database for the login table for the teachers were going to call the database school_work  in shool_work got the field called teachers

Database_name school_work 

This is field name teachers

id smallint(3)  UNSIGNED ZEROFILL Yes NULL
name varchar(50)  Yes NULL
password varchar(50)  Yes NULL

Now we got the database information for teachers lets do the form for the teachers to login.

login_form.php

<?php session_start();?>

<html>
<head></head>
<title>login form</title>

<body>

<table border="0" bordercolor="black" align="center">

<td align="center">

<h1>The Best School In The World Please Login </h1>

</td>

</table>

<p><br><br></p>


<table border="1" bordercolor="black" align="center">

<td align="center">

<form method="POST" action="login_result.php">
<br>
<b>Please Enter Name</b>
<br>
<br>
<input type="text" name="name">
<br>
<br>
<b>Please Enter Password</b>
<br>
<input type="password" name="password">
<br>
<br>
<input type="submit" name="submit" value="Login now">
<br>
<br>
</td>
</table>
</form>
</body>
</html>


Now we have the form to post teacher information to login.

Now we need to create the login script so the teacher get's to his or her privert member page.

login_result.php

<?php session_start();

// set the posts and add trim and addslashes for database sec

$name=trim(addslashes($_POST['name']));
$password=trim(addslashes($_POST['password']));

// valadate form post

if(($name=="none") && $password=="none")){
echo"Sorry please fill in all the form";
}

//select the databse where name = name and password = password

$query1="SELECT * FROM teachers WHERE name='$name' AND password='$password'";

// query the select statement or faill

$result1=mysql_query($query1)or die ("query1 problam");

// if the user exist then set the session otherwise echo message

if(mysql_num_rows($result1)==1){

// setting the session for id and name if user is valadated 
$id=$_SESSION['id'];
$name=$_SESSION['name'];

header("location: member_teacher.php");

}else{

// send a message if the teacher is not in the database.

echo "Sorry please contact the head of the school to get added to the database";

}

?>



Now we need to add to the database a field for the students to login and access there homework.

Database_name school_work 

This is field name student

id smallint(3)  UNSIGNED ZEROFILL Yes NULL
name varchar(50)  Yes NULL
password varchar(50)  Yes NULL

login_result.php

<?php session_start();

// set the posts and add trim and addslashes for database sec

$name=trim(addslashes($_POST['name']));
$password=trim(addslashes($_POST['password']));

// valadate form post

if(($name=="none") && $password=="none")){
echo"Sorry please fill in all the form";
}

//select the databse where name = name and password = password

$query1="SELECT * FROM teachers WHERE name='$name' AND password='$password'";

// query the select statement or faill

$result1=mysql_query($query1)or die ("query1 problam");

// if the user exist then set the session otherwise echo message

if(mysql_num_rows($result1)==1){

// setting the session for id and name if user is valadated 
$id=$_SESSION['id'];
$name=$_SESSION['name'];

header("location: member_teacher.php");

}else{

// send a message if the teacher is not in the database.

echo "Sorry please contact the head of the school to get added to the database";

}


$query1="SELECT * FROM student WHERE name='$name' AND password='$password'";

// query the select statement or faill

$result1=mysql_query($query1)or die ("query1 problam");

// if the user exist then set the session otherwise echo message

if(mysql_num_rows($result1)==1){

// setting the session for id and name if user is valadated 
$id=$_SESSION['id'];
$name=$_SESSION['name'];

header("location: member_student.php");

}else{

// send a message if the student is not in the database.

echo "Sorry please contact your teacher to be added to the database";

?>



Now if the student logsin the student goto there members page which will be member_student.php or if the teacher logsin the teacher goes to member_teacher.php

Now we now that a teacher or a student can login from one form we now need to create a database field called
home_work for the teacher to post homework to the students.

database field name homework

id smallint(3)  UNSIGNED ZEROFILL Yes NULL
teacher_name varchar(50)  Yes NULL
date_added int(7)  Yes NULL
time_added int(7)  Yes NULL
end_date   int(7) YRS NULL
tittle varchar(150)  Yes NULL
description varchar(250)  Yes NULL
url1 varchar(100)  Yes NULL
url2 varchar(100)  Yes NULL
url3 varchar(100)  Yes NULL 
email varchar(50)  Yes NULL

id for the student id for teacher to submit to.

teacher_name is the teachers name for the student to see who it's from.

date_added is the date the teacher submitted the homework.

time_added is the time the teacher submitted the homework.

end_date is the date that the teacher wants the homework back.

title is the title of the home work.

description is the description of the homework need doing.

url1 to url3 is were the student can find futher information on
the homework the students needs to do.

email will be the students email address so the student gets a email about
the homework they need to complete



Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc

#9 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 14 October 2006 - 06:47 AM

i hope my above example gives you a good idear of what i was doing and you understand i was trying to do all you need with a simple solution so that the teacher can send homework to the students via a form when the teacher logsin and then the student gets a email then the student logsin then see what the teacher wants all the best redarrow.

Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc

#10 .josh

.josh
  • Staff Alumni
  • .josh
  • 14,871 posts

Posted 14 October 2006 - 06:56 AM

OK-I'm starting to get it. One final question (I hope) I want the teachers to submit homework for each day of the week (Monday, Tuesday, etc) How will the database know to call the most current entries? In other words, Monday's homework won't be called up a week later - a different 'Monday' homework will be called up. This way students can go to the 'Homework' page and see the most current homework without having to enter a date.
Thanks
;D

you would have a timestamp field in your database. you would do a query based on the timestamp. a week ago monday's 24hour timestamp range is different from this upcoming monday's timestamp range. 
Did I help you? Feeling generous? Buy me lunch! 
Please, take the time and do some research and find out how much it would have cost you to get your help from a decent paid-for source. A "roll-of-the-dice" freelancer will charge you $5-$15/hr. A decent entry level freelancer will charge you around $15-30/hr. A professional will charge you anywhere from $50-$100/hr. An agency will charge anywhere from $100-$250/hr. Think about all this when soliciting for help here. Think about how much money you are making from the work you are asking for help on. No, we do not expect you to pay for the help given here, but donating a few bucks is a fraction of the cost of what you would have paid, shows your appreciation, helps motivate people to keep offering help without the pricetag, and helps make this a higher quality free-help community :)

#11 kevinritt

kevinritt
  • Members
  • PipPipPip
  • Advanced Member
  • 108 posts
  • LocationBoston, MA

Posted 14 October 2006 - 03:20 PM

i hope my above example gives you a good idear of what i was doing and you understand i was trying to do all you need with a simple solution so that the teacher can send homework to the students via a form when the teacher logsin and then the student gets a email then the student logsin then see what the teacher wants all the best redarrow.


This has been a big help. Thank you





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users