Jump to content

Recommended Posts

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
Link to comment
https://forums.phpfreaks.com/topic/23689-help-with-school-website/
Share on other sites

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.
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
[quote author=Jocka link=topic=111225.msg450619#msg450619 date=1160597727]
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.
[/quote]

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
I have seen a few projects like this on sourceforge.

You might search around like: [url=http://sourceforge.net/search/?type_of_search=soft&words=school]http://sourceforge.net/search/?type_of_search=soft&words=school[/url]

You might get ideas or just use something you find there.
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 [b]'SELECT day, subject, assignment FROM homework'[/b] 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 [b]'WHERE year = ' . $year . 'AND class = ' . $class[/b] 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.
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
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
[code]

<?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>

[/code]

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
[code]

<?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";

}

?>

[/code]


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
[code]

<?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";

?>

[/code]

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


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.
[quote author=kevinritt link=topic=111225.msg451751#msg451751 date=1160799193]
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
[/quote]
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. 
[quote author=redarrow link=topic=111225.msg451777#msg451777 date=1160808459]
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.

[/quote]

This has been a big help. Thank you
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.