remove rfc button altogether first, put in correct experiment groups
This commit is contained in:
@ -47,8 +47,12 @@ button i.fa-spin {
|
||||
font-size: 80%;
|
||||
}
|
||||
|
||||
.button-two-only, .btn-group-two-only {
|
||||
width: 50%;
|
||||
}
|
||||
|
||||
button, .btn-group {
|
||||
width: 33.33333%;
|
||||
width: 50%;
|
||||
}
|
||||
|
||||
.btn-group {
|
||||
|
@ -28,10 +28,13 @@ class ExercisesController < ApplicationController
|
||||
1
|
||||
end
|
||||
|
||||
experimental_courses = {
|
||||
"java17" => "702cbd2a-c84c-4b37-923a-692d7d1532d0",
|
||||
"java1" => "0ea88ea9-979a-44a3-b0e4-84ba58e5a05e"
|
||||
def experimental_courses
|
||||
{
|
||||
java17: "702cbd2a-c84c-4b37-923a-692d7d1532d0",
|
||||
java1: "0ea88ea9-979a-44a3-b0e4-84ba58e5a05e"
|
||||
}
|
||||
end
|
||||
|
||||
|
||||
def experimental_course?(course_token)
|
||||
experimental_courses.has_value?(course_token)
|
||||
@ -183,23 +186,22 @@ class ExercisesController < ApplicationController
|
||||
user_got_enough_interventions = count_interventions_today >= max_intervention_count_per_day or user_got_intervention_in_exercise
|
||||
@is_experimental_course = @course_token and experimental_course?(@course_token)
|
||||
|
||||
user_intervention_group = UserGroupSeparator.getInterventionGroup(current_user)
|
||||
@rfc_group = UserGroupSeparator.getRequestforCommentGroup(current_user)
|
||||
@experiment_group = UserGroupSeparator.getInterventionGroup(current_user)
|
||||
|
||||
case user_intervention_group
|
||||
when :no_intervention
|
||||
|
||||
case @experiment_group
|
||||
# todo
|
||||
when :no_intervention_hide_rfc
|
||||
@hide_rfc_button = "true"
|
||||
when :no_intervention_stale_rfc
|
||||
when :break_intervention
|
||||
@show_break_interventions = (is_experimental_course and not user_solved_exercise and not user_got_enough_interventions) ? "true" : "false"
|
||||
when :rfc_intervention
|
||||
@show_rfc_interventions = (is_experimental_course and not user_solved_exercise and not user_got_enough_interventions) ? "true" : "false"
|
||||
end
|
||||
|
||||
case rfc_group
|
||||
when :hide_rfc
|
||||
@hide_rfc_button = "true"
|
||||
when :stale_rfc
|
||||
when :show_rfc
|
||||
end
|
||||
|
||||
|
||||
|
||||
@search = Search.new
|
||||
@search.exercise = @exercise
|
||||
@ -232,7 +234,7 @@ class ExercisesController < ApplicationController
|
||||
end
|
||||
else
|
||||
# no consumer, therefore implementation with internal user
|
||||
@course_token = java_course_token
|
||||
@course_token = "702cbd2a-c84c-4b37-923a-692d7d1532d0"
|
||||
end
|
||||
end
|
||||
private :set_course_token
|
||||
|
@ -15,8 +15,8 @@
|
||||
= render('editor_button', data: {:'data-placement' => 'top', :'data-tooltip' => true}, icon: 'fa fa-stop', id: 'stop', label: t('exercises.editor.stop'), title: t('shared.tooltips.shortcut', shortcut: 'ALT + r'))
|
||||
= render('editor_button', data: {:'data-placement' => 'top', :'data-tooltip' => true}, icon: 'fa fa-rocket', id: 'test', label: t('exercises.editor.test'), title: t('shared.tooltips.shortcut', shortcut: 'ALT + t'))
|
||||
= render('editor_button', data: {:'data-placement' => 'top', :'data-tooltip' => true}, icon: 'fa fa-trophy', id: 'assess', label: t('exercises.editor.score'), title: t('shared.tooltips.shortcut', shortcut: 'ALT + s'))
|
||||
- if not hide_rfc_button
|
||||
= render('editor_button', icon: 'fa fa-comment', id: 'requestComments', label: t('exercises.editor.requestComments'), title: t('exercises.editor.requestCommentsTooltip'))
|
||||
//- if not hide_rfc_button
|
||||
// = render('editor_button', icon: 'fa fa-comment', id: 'requestComments', label: t('exercises.editor.requestComments'), title: t('exercises.editor.requestCommentsTooltip'))
|
||||
- @files.each do |file|
|
||||
= render('editor_frame', exercise: exercise, file: file)
|
||||
#autosave-label
|
||||
|
@ -3,12 +3,20 @@ class UserGroupSeparator
|
||||
# seperates user into 20% no intervention, 20% break intervention, 60% rfc intervention
|
||||
def self.getInterventionGroup(user)
|
||||
lastDigitId = user.id % 10
|
||||
if lastDigitId < 2 # 0,1
|
||||
:no_intervention
|
||||
elsif lastDigitId < 4 # 2,3
|
||||
:break_intervention
|
||||
else # 4,5,6,7,8,9
|
||||
:rfc_intervention
|
||||
if lastDigitId < 1 # 0
|
||||
:rfc_intervention_stale_rfc
|
||||
elsif lastDigitId < 2 # 1
|
||||
:break_intervention_stale_rfc
|
||||
elsif lastDigitId < 3 # 2
|
||||
:no_intervention_stale_rfc
|
||||
elsif lastDigitId < 4 # 3
|
||||
:no_intervention_hide_rfc
|
||||
elsif lastDigitId < 5 # 4
|
||||
:break_intervention_show_rfc
|
||||
elsif lastDigitId < 6 # 5
|
||||
:no_intervention_show_rfc
|
||||
else # 6,7,8,9
|
||||
:rfc_intervention_show_rfc
|
||||
end
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user