myexperiment-hackers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[myexperiment-hackers] [3727] branches/packs/app: added checklist scores


From: noreply
Subject: [myexperiment-hackers] [3727] branches/packs/app: added checklist scores to pack rank calculation
Date: Thu, 26 Sep 2013 13:36:02 +0000 (UTC)

Revision
3727
Author
dgc
Date
2013-09-26 13:36:02 +0000 (Thu, 26 Sep 2013)

Log Message

added checklist scores to pack rank calculation

Modified Paths

Diff

Modified: branches/packs/app/controllers/packs_controller.rb (3726 => 3727)


--- branches/packs/app/controllers/packs_controller.rb	2013-09-26 13:05:21 UTC (rev 3726)
+++ branches/packs/app/controllers/packs_controller.rb	2013-09-26 13:36:02 UTC (rev 3727)
@@ -484,6 +484,9 @@
 
     checklist = @pack.research_object.run_checklist!(slug)
 
+    @pack.solr_index if Conf.solr_enable
+    @pack.update_contribution_rank
+
     redirect_to polymorphic_path(address@hidden, checklist])
   end
 

Modified: branches/packs/app/models/pack.rb (3726 => 3727)


--- branches/packs/app/models/pack.rb	2013-09-26 13:05:21 UTC (rev 3726)
+++ branches/packs/app/models/pack.rb	2013-09-26 13:36:02 UTC (rev 3727)
@@ -1061,9 +1061,12 @@
 
     boost = 0
 
-    # initial boost depends on viewings count
-    boost = contribution.viewings_count / 100 if contribution
+    # Take checklists into account
+    research_object.checklists.each { |checklist| boost += (checklist.score * 10) }
 
+    # Take viewings into account
+    boost += contribution.viewings_count / 100 if contribution
+
     # Take curation events into account
     boost += CurationEvent.curation_score(CurationEvent.find_all_by_object_type_and_object_id('Pack', id))
     

reply via email to

[Prev in Thread] Current Thread [Next in Thread]