Skip to content

Commit

Permalink
requested changes
Browse files Browse the repository at this point in the history
  • Loading branch information
irinahpe committed Nov 29, 2023
1 parent 8a4cb70 commit 8344ed2
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 8 deletions.
9 changes: 4 additions & 5 deletions lang/en/ratingallocate.php
Original file line number Diff line number Diff line change
Expand Up @@ -175,12 +175,11 @@
$string['publish_allocation_group_desc_rating_in_progress'] =
'The rating phase is in progress. Please wait till the rating phase has ended and then start to create allocations, first.';
$string['publish_allocation_group_desc_ready'] = 'There are no allocations yet. Please see the modify allocation section.';
$string['publish_allocation_group_desc_ready_alloc_started'] = 'The allocations can now be published.
After publishing the allocations they can no longer be altered.
Please have a look at the current allocations by following the link in the reports section.
You can choose to create groups within your course for all allocations.
$string['publish_allocation_group_desc_ready_alloc_started'] = 'The allocations can now be published and you can choose to create groups within your course for all allocations.';
$string['publish_allocation_group_desc_ready_alloc_started_help'] = 'After publishing the allocations they can no longer be altered.
Please have a look at the current allocations by following the link in the reports section. <br/><br/>
If the same groups have already been created by this plugin, they will be purged before refilling them.
This can be done before and after publishing the allocations.';
Creating groups can be done before and after publishing the allocations.';
$string['publish_allocation_group_desc_published'] = 'The allocations are already published.
You can choose to create groups within your course for all allocations.
If the same groups have already been created by this plugin, they will be purged before refilling them.';
Expand Down
2 changes: 1 addition & 1 deletion locallib.php
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ public function get_raters_in_course(): array {
$raters = get_enrolled_users($this->context, 'mod/ratingallocate:give_rating');
$info = new info_module($cm);

// Only show raters who had the ability to access this activity. This funktion ignores the visibility setting,
// Only show raters who had the ability to access this activity. This function ignores the visibility setting,
// so the ratings and allocations are still shown, even when the activity is hidden.
$filteredraters = $info->filter_user_list($raters);

Expand Down
16 changes: 14 additions & 2 deletions renderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,8 @@ public function render_ratingallocate_allocation_status($coursemoduleid, $status
);
$buttondisteq = new single_button($distributeunallocatedurleq,
get_string('distributeequally', RATINGALLOCATE_MOD_NAME), 'get');
$buttondisteq->class = 'ratingallocate_front_page_buttons';

$buttondisteq->add_action(new confirm_action(
get_string('distribute_unallocated_equally_confirm', RATINGALLOCATE_MOD_NAME)));

Expand All @@ -156,6 +158,7 @@ public function render_ratingallocate_allocation_status($coursemoduleid, $status
);
$buttondistfill = new single_button($distributeunallocatedurlfill,
get_string('distributefill', RATINGALLOCATE_MOD_NAME), 'get');
$buttondistfill->class = 'ratingallocate_front_page_buttons';
$buttondistfill->add_action(new confirm_action(
get_string('distribute_unallocated_fill_confirm', RATINGALLOCATE_MOD_NAME)));

Expand Down Expand Up @@ -213,8 +216,14 @@ public function render_ratingallocate_publish_allocation($ratingallocateid, $cou
$descriptionbaseid = 'publish_allocation_group_desc_';
$description = get_string($descriptionbaseid . $status, RATINGALLOCATE_MOD_NAME);

if ($isready) {
$description = $this->format_text($description) . $this->help_icon('publish_allocation_group_desc_' . $status, RATINGALLOCATE_MOD_NAME);
} else {
$description = $this->format_text($description);
}

$this->add_table_row_triple($table,
$this->format_text($description),
$description,
$this->single_button(new moodle_url('/mod/ratingallocate/view.php', array('id' => $coursemoduleid,
'ratingallocateid' => $ratingallocateid,
'action' => ACTION_PUBLISH_ALLOCATIONS)), get_string('publish_allocation', RATINGALLOCATE_MOD_NAME), 'get',
Expand Down Expand Up @@ -818,7 +827,7 @@ public function statistics_table_for_ratingallocate(ratingallocate $ratingalloca

$cell = new html_table_cell();
$usersinchoice = $ratingallocate->get_raters_in_course();
$cell->text = count($usersinchoice) - count($memberships);
$cell->text = count($ratingallocate->get_undistributed_users());
$allocationrow[] = $cell;

$cell = new html_table_cell();
Expand Down Expand Up @@ -969,8 +978,11 @@ private function add_table_row_tuple(html_table $table, $first, $second) {
private function add_table_row_triple(html_table $table, $first, $second, $third) {
$row = new html_table_row();
$cell1 = new html_table_cell($first);
$cell1->attributes['class'] = 'ratingallocate_front_page_table_1';
$cell2 = new html_table_cell($second);
$cell2->attributes['class'] = 'ratingallocate_front_page_table_23';
$cell3 = new html_table_cell($third);
$cell3->attributes['class'] = 'ratingallocate_front_page_table_23';
$row->cells = array($cell1, $cell2, $cell3);
$table->data[] = $row;
}
Expand Down
17 changes: 17 additions & 0 deletions styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -124,3 +124,20 @@
.ratingallocate_ratings_table_container .no-overflow {
overflow: unset;
}

.ratingallocate_front_page_table_1 {
margin: auto;
width: 40%;
}

.ratingallocate_front_page_table_23 {
margin: auto;
width: 30%;
padding-left: 50px;
padding-right: 50px;
}

.ratingallocate_front_page_buttons {
margin: auto;
width: fit-content;
}

0 comments on commit 8344ed2

Please sign in to comment.