Hi Vinoth,
As mentioned in your email, I am starting this thread to discuss about how to contribute to the project.

1. The code is incomplete in many places and also the behaviour logic of the module is not clear. This is the reason why I wanted to talk or chat with you. Without this being clear, it's very difficult to contribute based on assumptions. For eg. you have date field as a requirement for contest node type. However, what is it used for? There is no code / explanation / todo comments in module that could explain this. If you could kindly summarize the workflow of the module, it would be great to work with.

2. Do you work with git? I am working on a git repo and it would easy for you to pull changes.

3. Currently, you are using a single view to select and display the winners. This can be split into two: one for selecting the winners and another for displaying the winners.

4. Winners are not stored in the database. The table for storing winners is not used in the module at all. I understand this needs to be coded. However, if there is a todo note on which event the winner has to selected and inserted into the database, it would be easy for me to work.

5. A nice to have feature will be to choose the content types that are eligible for applying to a contest. (do you have similar plans?)

Pls share your inputs.

thanks,
neokrish

CommentFileSizeAuthor
#14 simple_contest.tar_.gz24.27 KBneokrish

Comments

neokrish’s picture

Hi Vinoth,
any inputs on these?

thanks,
neokrish

vinoth.3v’s picture

I agree the documentation of this module is zero. It should be 50% at least :) but I am little busy on other projects. I will try to put time on this and port this module to D7.

quick answers to you

1. I agree. I'll update the dev version with some internal documentation soon.
2. currently no. I have to move to git.
3. We have the view "results_display_view" to display results. it is embeded in "simple_contest_node_winners_themed" function.
4. result table is used to integrate with views. views plays the action to display it.
5. I didn't get you. Could you please explain it little more?

Regards

cptX’s picture

Hi to all. I'm really interested in this module! I'm willing to cooperate with anyone interested in making this module working, but I cannot be a maintainer. I just want to make it work because I'm preparing a site that is based on this module's concept.

Το vinoth.3v:
I suggest to write some simple instructions with 10 simple steps or something about how can we make this module work. I have tried a lot but i can't make it work. There are a lot of bugs I think, but I would like to know your setup and how do you make it work.

Whoever wants to cooperate with me in order to make this work please just contact me.

neokrish’s picture

hi cptx,
just few days before I have worked on this module to create working version for my client. Right now, I am tightly screwed to create any documentation or list the changes. Next monday which is 21st, I will be able to spend sometime on documenting the changes. Meanwhile, I can update the github repo on which I was working with the latest code. Will update this thread when done.

cptX’s picture

Hi Neokrish,
this is good news! So you finally succeeded in making it work?

As I'm putting all my effort now in making this work, I really would like some hints at the moment just to help me unstuck. You won't be able to give me some simple hints before 21st? Just what the reference field is doing?

Thanks and I really appreciate your help!

neokrish’s picture

Reference field in the contest node type is used to store the participants for the contest. Right now, the module has hardcoded many settings and unless you read through the code, it's difficult to get the right content type and view to work with contest module. I will post a bit detailed setup either later today or tomorrow evening.

cptX’s picture

OK, thank you for your help.

Yesterday, I tried to reverse engineer the code but I haven't succeeded much. Another important problem with this module is that there are many bugs. For example, when you submit the simple contest settings form from the contest type you are creating, the selections are not stored. This has created much trouble to me already. Have you fixed this too?

What do you mean "hardcoded"? Do you mean that i have to create fields and views with specific machine names? If I use my custom names it won't work?

neokrish’s picture

Have you fixed this too?

Yes

What do you mean "hardcoded"? Do you mean that i have to create fields and views with specific machine names? If I use my custom names it won't work?

Yes, content type names, I remember are hardcoded with specific machine names.

cptX’s picture

Hi neokrish,
I found your repos in git. I downloaded it and I'll try it out to see what I will manage. Your post was from December 07, 2010. Is this your last code?

Update 1: Ok, this is not your code. It is the original one. Can you upload your code please?

Update 2: After some changes in the code I managed to solve the problem of not saving the settings in the contest content_type settings page.
Unfortunately, still I get no winners. I haven't yet understood what the reference field is doing. I can't understand why it is necessary. The program could select the winners directly from the corresponding view. Why should we select the nodes from the reference field? How should I configure the reference field in order to select automaticaly the winners?

vinoth.3v’s picture

HI cptX

I am rewriting the module to simplify to users and devs.
a quick answer: reference fields are used for the relationships between contest node and the participants nodes or users. It is not tested completely. I was used this code to quickly complete one project which is mainly based in this module.

to make the module work, the contest node type should be "contest" and the participant node type should be named "design". changing this to dynamic is what I am working on.
I hope I can commit the latest changes in near feature to CVS.

cptX’s picture

Hi vinoth.3v,

I tried your module, and as I couldn't make it work I'm trying to create my own from scratch.
What I can't understand in your module is the need for a reference field. As you define the view for the winner selection, there is no need to define a reference field because the module should select the N number of first winners from the defined view. Thus reference field shouldn't be necessary.

What do you mean by this:
"to make the module work, the contest node type should be "contest" and the participant node type should be named "design""
you mean that I have to name the contest node type and the participant node with these specific names?

vinoth.3v’s picture

HI cptX

Glad to see the new contest module. You are right. In most cases reference fields may not help much, I was used it for the following cases

1. To send E-mail notifications of all participants.
2. contest statistics

what I meant is, the current dev version has hard coded content type names (contest and design if the contest type is node).

As you said, I have to refine the logic behind the referenced fields.

-- Vinoth

cptX’s picture

Hi Vinoth,

I created a contest type named "contest" and the participant node type named "design". Still can't understand how to configure the reference field. Should the name of that field be specific-hardcoded? What type of nodes should that reference field refer to?

I also created 2 views:
- One for the winner selection: It has the fields Node: Body Body, Node: Title Title, Node: Nid Nid (filtered for design type)
- One for the contest results: Don't know what to put in there!

Then I created a contest putting some dates so that the today date to be between them. Again I don't know what to select in the reference field. Also there is a bug: when I select the contest as active when I save it and then reopen the contest there is no option selected. So I guess it is not saved as active.

Then I tried to create some designs in order to make them participate in the contest. The problem is that in the "Choose the contest: " list there is no contest available.

As you see I'm far far away from making it work, and unfortunately the code doesn't make any sense in of it's parts.

Can you please help me?

Thanks!

neokrish’s picture

StatusFileSize
new24.27 KB

Hi cptX,
As promised, I am back on Monday :-)

Github code is not yet updated. However, I am attaching the latest code from my dev machine with this comment. The code is working but no means close to any standard. There is still hardcoding on content type machine names which I had to work.

on line number 134 for simple_contest.module, I have hardcoded machine names.
Basically the site I worked for was conducting contest for fiction (short story), poem, and comic. So I had 3 contest type nodes for creating contest for three categories and three submission content types for submitting to the respective contests.

submission node type machine names:
fiction
comic
poetry

content node type machine names:
ss_contest
c_contest
p_contest

on line number 306 of simple_contest.module, I have hardcoded the view name to display winners, instead of using the view from the variables table.

I was little pressed for time while working on the module and did not work on these things.

Explanation about how the module works (from what I read through the code).

reference fields: holds the partcipants lists for that contest. For eg.
Contest titled "Comic contest for March" has a link to submit content in the form of node/add/comic?contest=c_contest. Once the comic submission content is created, the main contest node has a reference to this new submission in reference field.

date field: this has to be a 'from' and 'to' field. Using cron the module checks if the 'to' date for all active contests are below the present time at the time of cron. If yes, nothing is done or else winners are selected based the view selected in the contest content type.

Recurring contest and user contest does not seem to work. I have disabled user/* menu provided by the module as that is still not developed properly and also commented out a few lines with recurring contest which was giving some errors for me.

The module is still very raw. Now that we are three people looking a good contest module. I am willing to collobrate and contribute some coding time if we there is consent arrived among us on how we take the module from where it is now.

Thanks,
neokrish

cptX’s picture

Hi neokrish,
As I was struggling to reverse engineer this module (something that you have done successfully) I was in the dilemma if I should lose more time in understanding how this module works or starting my own module. Finally, I have started working on my own module, which has a bit different philosophy, and does some things the contest module does not. For example my module can also start a waiting-future contest not only finish a running one. Also, the module should create dynamically some views in order to present them to the first page and the contest page. I also need to have some sponsors presented automatically for every contest. Finally, after the end of every contest the winners should be selected automatically and presented in another view. Also, they should be emailed accordingly.

These already are too much for my programming experience but I think it is better for me to try build it from the bottom up than reversely. It's too difficult for me to work with code that can't understand completely and should change it in so much depth.

So, I appreciate so much your effort and there is really very useful code inside this module, but for the time being I will not try any more to use it, as I already lost enough time with it. We could cooperate though in developing some things that could be useful for all of us, e.g. how to send preformatted emails to the winners instead of these simplified emails this modules sends.

Macronomicus’s picture

@neokrish
Thanks for uploading that .. I will take it for a spin, have you heard anything back from the Mod maintainer or will you start a fork module?

I noticed there is a new Comit from 2011-Mar-01 for the module... any notes about whats changed there?

Cheers!

vinoth.3v’s picture

Simple contest has documentation now http://drupal.org/node/1074264

Thanks

vinoth.3v’s picture

Status: Active » Postponed (maintainer needs more info)