예제 #1
0
 public function valuation($task_set_id, $solution_id)
 {
     $this->_add_mathjax();
     $solution = new Solution();
     $solution->select('`solutions`.*');
     $solution->select_subquery('(SELECT SUM(`points_total`) AS `points` FROM `task_task_set_rel` WHERE `task_set_id` = `task_sets`.`id` AND `task_task_set_rel`.`bonus_task` = 0)', 'task_set_total_points');
     $solution->include_related('task_set', '*', TRUE, TRUE);
     $solution->include_related('task_set/course', 'name');
     $solution->include_related('task_set/course/period', 'name');
     $solution->include_related('task_set/group', 'name');
     $solution->include_related('student', array('fullname', 'email'));
     $solution->include_related('teacher', array('fullname', 'email'));
     $solution->where('student_id IS NOT NULL');
     $solution->where('task_set_id', $task_set_id);
     $solution->get_by_id($solution_id);
     $group = new Group();
     $group->where_related('participant', 'student_id', $solution->student_id);
     $group->where_related('participant/course/task_set', 'id', $task_set_id);
     $group->get();
     $project_selection = new Project_selection();
     $project_selection->select('`project_selections`.*, `task_task_task_set_rel`.`internal_comment` AS `task_join_internal_comment`');
     $project_selection->include_related('task', '*', TRUE, TRUE);
     $project_selection->include_related('task/task_set', array('id', 'name'));
     $project_selection->where('task_set_id', $solution->task_set_id);
     $project_selection->where('student_id', $solution->student_id);
     $project_selection->where('task_task_sets.id', $solution->task_set_id);
     $project_selection->get();
     $this->load->helper('tests');
     $test_types_subtypes = get_all_supported_test_types_and_subtypes();
     $this->parser->add_js_file('jquery.activeform.js');
     $this->parser->add_js_file('admin_solutions/valuation.js');
     $this->parser->add_css_file('admin_solutions.css', array('media' => ''));
     $this->_add_prettify();
     $this->parser->parse('backend/solutions/valuation.tpl', array('solution' => $solution, 'group' => $group, 'test_types' => $test_types_subtypes['types'], 'test_subtypes' => $test_types_subtypes['subtypes'], 'project_selection' => $project_selection, 'add_url' => $this->uri->assoc_to_uri($this->uri->ruri_to_assoc(5))));
 }