开发者

hi can you tell me a technique where i can make a student not take a subject if he does not compli with the requirement? [closed]

开发者 https://www.devze.com 2023-02-07 21:58 出处:网络
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical andcannot be reasonably answered in its current form. For help clari
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 12 years ago.

i am creating a assessment system in which students can add subjects for enrollment but my problem is i want to make it that the system wont allow the student to take that subject if they have not taken the required subject before that.. for example a student want to take the subject physics 2 but before he ca开发者_JAVA技巧n take it he should first finish physics 1 how can i make that if he tries to take the subject physics 2 without finishing the physics 1 the system wont allow him to list the subject physics 2. can you please help me? and by the way i am using MySQL and PHP here.. thx guys..


At the very beginning: without anything to answer, there's no point in trying to find a valid answer. Please post a part or an example of the code you're talking about!

-- Just theory, don't know if this apply to you. --

First, let assume you initialize a class #student as $student. In $student, there's an array of the students' subjects, lets call them s[k]. This example shows the verification if physics 1 has been issued to the student and is currently set true - hence the student is able to attend physics 2.

$p2_permitted = ( isset($student->subjects["p1"]) && $student->subjects["p1"] == true ) ? true : false;
if ( $p2_permitted ) $student->subject["p2"] = true;

I guess you're loading the data from the db? So this would be like: load, parse + verify (is physics 2 permitted to be issued to student k?), modify + extend ( if the existence of physics 1 in the school-career of the student k permits the issueing of the "physics 2"-flag, let's do that), save (push back into the db).

0

精彩评论

暂无评论...
验证码 换一张
取 消