Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature 98: Assigning a number of papers #176

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions relis_app/controllers/Data_extraction.php
Original file line number Diff line number Diff line change
Expand Up @@ -968,6 +968,11 @@ function class_assignment_save()
$reviews_per_paper = 1;
$papers_all = $this->get_papers_for_classification();
$papers = $papers_all['papers_to_assign'];
if (isset($post_arr['assign_by_number_checkbox']) && $post_arr['assign_by_number_checkbox'] == 'on') {
$number_of_papers_to_assign = intval($post_arr['number_of_papers_to_assign']);
} else {
$number_of_papers_to_assign = count($papers);
}
// print_test($papers);
$papers_to_validate_nbr = round(count($papers) * $percentage / 100);
$operation_description = "Assign papers for classification";
Expand All @@ -978,7 +983,11 @@ function class_assignment_save()
$assign_papers = array();
$this->db2 = $this->load->database(project_db(), TRUE);
$operation_code = active_user_id() . "_" . time();
$assigned_count = 0;
foreach ($papers as $key => $value) {
if ($assigned_count >= $number_of_papers_to_assign) {
break;
}
if ($key < $papers_to_validate_nbr) {
//$assign_papers[$key]['paper']=$value['id'];
//$assign_papers[$key]['users']=array();
Expand All @@ -1002,6 +1011,7 @@ function class_assignment_save()
$j++;
}
}
$assigned_count++;
}
//exit;
// print_test();
Expand Down
10 changes: 10 additions & 0 deletions relis_app/controllers/Quality_assessment.php
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,11 @@ function qa_assignment_save()
$reviews_per_paper = 1;
$papers_all = $this->get_papers_for_qa();
$papers = $papers_all['papers_to_assign'];
if (isset($post_arr['assign_by_number_checkbox']) && $post_arr['assign_by_number_checkbox'] == 'on') {
$number_of_papers_to_assign = intval($post_arr['number_of_papers_to_assign']);
} else {
$number_of_papers_to_assign = count($papers);
}
// print_test($papers);
$papers_to_validate_nbr = round(count($papers) * $percentage / 100);
$operation_description = "Assign papers for QA";
Expand All @@ -255,7 +260,11 @@ function qa_assignment_save()
$assign_papers = array();
$this->db2 = $this->load->database(project_db(), TRUE);
$operation_code = active_user_id() . "_" . time();
$assigned_count = 0;
foreach ($papers as $key => $value) {
if ($assigned_count >= $number_of_papers_to_assign) {
break;
}
if ($key < $papers_to_validate_nbr) {
//$assign_papers[$key]['paper']=$value['id'];
//$assign_papers[$key]['users']=array();
Expand All @@ -279,6 +288,7 @@ function qa_assignment_save()
$j++;
}
}
$assigned_count++;
}
//exit;
// print_test();
Expand Down
13 changes: 12 additions & 1 deletion relis_app/controllers/Screening.php
Original file line number Diff line number Diff line change
Expand Up @@ -792,7 +792,7 @@ function get_papers_to_screen($source = 'all', $source_status = 'all', $current_
function save_assignment_screen()
{
$post_arr = $this->input->post();
// print_test($post_arr); exit;
// print_test($post_arr); exit;
$users = array();
$i = 1;
if (empty($post_arr['reviews_per_paper'])) {
Expand Down Expand Up @@ -822,11 +822,21 @@ function save_assignment_screen()
//Get all papers
// $papers=$this->get_papers_to_screen($papers_sources);
$papers = $this->get_papers_to_screen($papers_sources, $paper_source_status);
if (isset($post_arr['assign_by_number_checkbox']) && $post_arr['assign_by_number_checkbox'] == 'on') {
$number_of_papers_to_assign = intval($post_arr['number_of_papers_to_assign']);
} else {
$number_of_papers_to_assign = count($papers['to_assign']);
}
// print_test($papers); exit;
$assign_papers = array();
$this->db2 = $this->load->database(project_db(), TRUE);
$operation_code = active_user_id() . "_" . time();

$assigned_count = 0;
foreach ($papers['to_assign'] as $key => $value) {
if ($assigned_count >= $number_of_papers_to_assign) {
break;
}
$assign_papers[$key]['paper'] = $value['id'];
$assign_papers[$key]['users'] = array();
$assignment_save = array(
Expand All @@ -853,6 +863,7 @@ function save_assignment_screen()
$this->db2->insert($table_name, $assignment_save);
$j++;
}
$assigned_count++;
}
$operation_arr = array(
'operation_code' => $operation_code,
Expand Down
2 changes: 1 addition & 1 deletion relis_app/controllers/test/Unit_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ public function relis_unit_test($result = "html_report")
$this->quality_assessmentUnitTest->run_tests();
$this->data_extractionUnitTest->run_tests();
$this->reportingUnitTest->run_tests();
$this->elementUnitTest->run_tests();
$this->elementUnitTest->run_tests();
$this->homeUnitTest->run_tests();
$this->installUnitTest->run_tests();
$this->adminUnitTest->run_tests();
Expand Down
Loading
Loading