Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
EIP
Project Forum
Project Forum
Commits
bb99390c
Commit
bb99390c
authored
Sep 28, 2022
by
Taico Aerts
Browse files
Merge branch 'development' into 'master'
Project Forum Hotfix Release v2.8.11 See merge request
!872
parents
37cab03d
15470cd0
Changes
9
Hide whitespace changes
Inline
Side-by-side
app/models/course_edition.rb
View file @
bb99390c
...
...
@@ -345,10 +345,20 @@ class CourseEdition < ApplicationRecord
).
uniq
end
# This method returns
# * Users who have specified experiments
# * For one or more experiments of the current round
# * Who have a course participation
# * Which is not rejected
# @return [Array]
def
participants_with_current_round_experiment_preference
User
.
joins
(
:experiment_preferences
).
where
(
experiment_preferences:
{
experiment_project:
current_round_experiments
experiment_project:
ce
.
current_round_experiments
}
).
joins
(
:course_participations
).
where
.
not
(
course_participations:
{
status: :rejected
}
).
uniq
end
...
...
app/models/experiment_project.rb
View file @
bb99390c
...
...
@@ -32,6 +32,10 @@ class ExperimentProject < ApplicationRecord
# Scopes
# ===========================================================================
scope
:sort_by_round_and_name
,
(
lambda
{
order
(
arel_table
[
:round
],
arel_table
[
:name
].
lower
)
})
scope
:sort_by_priority
,
(
lambda
{
|
user
,
course_edition
|
subquery
=
ExperimentPreference
.
where
(
user:
user
)
# TODO: The ExperimentPreference should be linked to the course edition, and this query should be updated accordingly as well
...
...
app/service/experiment_project_matcher.rb
View file @
bb99390c
...
...
@@ -21,7 +21,7 @@ module ExperimentProjectMatcher
experiments
=
course_edition
.
current_round_experiments
number_of_experiments_this_round
=
experiments
.
size
objective_weights
=
[]
weights
=
Array
.
new
(
number_of_
experiments_this_round
)
{
Array
.
new
(
number_of_
couples
)
}
weights
=
Array
.
new
(
number_of_
couples
)
{
Array
.
new
(
number_of_
experiments_this_round
)
}
assignments
=
[]
Rglpk
::
Problem
.
create
do
|
p
|
...
...
app/views/admin/course_editions/project_preferences/experiment_results/_experiment_results.erb
View file @
bb99390c
...
...
@@ -17,7 +17,7 @@
<div
class=
"col-md-12"
>
<%=
render
'admin/course_editions/project_preferences/experiment_results/grouping_details'
,
couples:
couple
s
%>
assignments:
assignment
s
%>
</div>
...
...
app/views/admin/course_editions/project_preferences/experiment_results/_grouping_details.html.erb
View file @
bb99390c
...
...
@@ -13,7 +13,7 @@
</td>
</tr>
<tr>
<td><strong>
<%=
couple
s
&
.
size
||
0
%>
</strong></td>
<td><strong>
<%=
assignment
s
&
.
size
||
0
%>
</strong></td>
<td>
couples created (including odd ones)
</td>
...
...
app/views/admin/experiment_preference_dashboard/show/_preferences.html.erb
View file @
bb99390c
...
...
@@ -13,7 +13,7 @@
<th>
Experiment
</th>
<th>
Priority
</th>
</tr>
</th>
</th
ead
>
<tbody>
<%
@user
.
round_course_edition_experiment_preferences
(
round
,
edition
).
order
(
:priority
).
each
do
|
preference
|
%>
...
...
app/views/admin/experiment_preference_dashboard/show/_student_preferences.html.erb
View file @
bb99390c
...
...
@@ -12,7 +12,7 @@
<tr>
<th>
Name
</th>
</tr>
</th>
</th
ead
>
<tbody>
<%
@user
.
course_edition_student_preferences
(
edition
).
each
do
|
preference
|
%>
...
...
app/views/admin/experiment_profiles/new/_form.html.erb
View file @
bb99390c
...
...
@@ -7,8 +7,10 @@
User
.
unscoped
.
role_student
.
sort_by_name
,
:id
,
:name
,
{
prompt:
true
,
selected:
false
},
{
class:
'selectize'
,
placeholder:
'All students'
}
%>
<%=
f
.
collection_select
:experiment_project_id
,
ExperimentProject
.
sort_by_name
,
:id
,
:name_with_round
,
<%=
f
.
grouped_collection_select
:experiment_project_id
,
CourseEdition
.
supporting_experiment_projects
.
relevance_ordered
,
->
(
ce
)
{
ce
.
experiment_projects
.
sort_by_round_and_name
},
:display_name
,
:id
,
:name_with_round
,
{
prompt:
true
,
selected:
false
},
{
class:
'selectize'
,
placeholder:
'All experiments'
}
%>
<%=
f
.
submit
class:
'btn btn-primary'
%>
...
...
app/views/layouts/admin/_subnavigation.html.erb
View file @
bb99390c
...
...
@@ -70,7 +70,7 @@
controllers:
[
:experiment_profiles
,
:experiment_projects
,
:experiment_preference_dashboard
],
items:
[
{
name: :experiment
,
name: :experiment
_project
,
url:
admin_experiment_projects_path
,
fa_icon: :flask
,
controllers:
[
:experiment_projects
],
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment