wood burning stoves 2.0*
The moose likes JDBC and the fly likes How to restrict user against marking same event in multiple times Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "How to restrict user against marking same event in multiple times" Watch "How to restrict user against marking same event in multiple times" New topic
Author

How to restrict user against marking same event in multiple times

Harshal Gurav
Ranch Hand

Joined: May 29, 2008
Posts: 151
Hi
I am developing student feedback system for educational institution.
Main purpose about this application is to evaluate performance of faculty.
Each user will give userid and password and accordingly he/she will answer the set of question which are included under various event type. The result of this test(event) is stored in final database.
Now how can I restrict the student against giving multiple time same test.
Is it possible that once user marked particular test, the same test should not display them once he/she will log in next time.

Thanks and Regards
Harshal
[ July 29, 2008: Message edited by: Harshal Gurav ]
Amit Ghorpade
Bartender

Joined: Jun 06, 2007
Posts: 2716
    
    6

Yes its definitely possible, you'll need some business logic to do that.


SCJP, SCWCD.
|Asking Good Questions|
Harshal Gurav
Ranch Hand

Joined: May 29, 2008
Posts: 151
Hi Amit,
can you more specify the same.
Suppose in table markedevent i stored userid and event that marked by respective user.
i can compare userid of the logged user with userid in the markedevent
but markedevent table may consist of same userid for different event.
Also i have no input event variable so that i can compare it with userid with same event in markedevent table.

Thanks and user
Harshal
[ July 29, 2008: Message edited by: Harshal Gurav ]
Amit Ghorpade
Bartender

Joined: Jun 06, 2007
Posts: 2716
    
    6

Also i have no input event variable so that i can compare it with userid with same event in markedevent table.

Then how do you store the event in the table?.
Also I think a better approach would be to assign unique id's to the event so that manipulation becomes easy.

Hope this helps
Harshal Gurav
Ranch Hand

Joined: May 29, 2008
Posts: 151
Hi,
can anyone update me on above case?
Here is DATABASE STRUCTURE

1. User�consist of user information like username, password etc.

2. Groupid�consists of various groups like group of student, group of faculty. Users are divided into various groups.

3. questionid- consists of question of various types. Each question-id consist multiple question


4. Questionbank: consist of large no. of question for particular question-id. Here you can assume question-id=questiontype. Common between above two table is question-id(int).

5. event table�where various event are published. For each event there may be more than one question-id
e.g event�feedback of semester �4-- containing question-id like: question-id for economics batch, question-id for commerce batch


6. Final output table- consist of userid,question-id,question,answer marked by various user



7.markedevent- consist of userid with eventid of user who voted the perticular event.

my aim is that once any user marked particular event , he/she should not able to see the same event in next login time.
is there required any minor changes in the database structure?
Thanks and Regards
Harshal



[ July 29, 2008: Message edited by: Harshal Gurav ]
[ July 29, 2008: Message edited by: Harshal Gurav ]
Amit Ghorpade
Bartender

Joined: Jun 06, 2007
Posts: 2716
    
    6

Looks like this has turned into a database question,
So maybe one of the moderators will move it to its appropriate place.

CREATE TABLE markedevent
(
userid int(4) NOT NULL ,
eventid int(4) NOT NULL,
PRIMARY KEY ( userid)
);


When you have multiple eventid's(events), then you need to make the userid and the eventid as the combined primary key for this table.
And then retrieve using userid.


Hope this helps
Harshal Gurav
Ranch Hand

Joined: May 29, 2008
Posts: 151
Hi Amit,
Thanks for your post.

Thanks and Regards
Harshal
[ July 31, 2008: Message edited by: Harshal Gurav ]
Amit Ghorpade
Bartender

Joined: Jun 06, 2007
Posts: 2716
    
    6

You are welcome and hope it helps
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to restrict user against marking same event in multiple times