Пример #1
0
 /**
  * EXPORT: Creates and outputs a ZIP file containing all the questions on the current paper.
  * @param array $questions - An array of questions to be exported.
  */
 public function export($questions)
 {
     $this->status_array = QuestionStatus::get_all_statuses($this->db, $this->string, true);
     $raf_data = $this->create_export_array($questions);
     $this->write_file();
     $this->write_zip_file();
     unlink($this->configObj->get('cfg_tmpdir') . $this->userID . '_raf.json');
     $this->zip_filename = $this->userID . '_raf.zip';
     $filepath = $this->configObj->get('cfg_tmpdir');
     // HTTP headers for Zip downloads.
     header("Content-Type: application/octet-stream");
     header("Content-Disposition: attachment; filename=\"" . $this->zip_filename . "\"");
     header("Content-Transfer-Encoding: binary");
     header("Content-Length: " . filesize($filepath . $this->zip_filename));
     ob_end_flush();
     @readfile($filepath . $this->zip_filename);
     unlink($filepath . $this->zip_filename);
 }
Пример #2
0
require_once '../include/sort.inc';
require_once '../lang/' . $language . '/include/question_types.inc';
require_once '../classes/stateutils.class.php';
require_once '../classes/moduleutils.class.php';
require_once '../classes/keywordutils.class.php';
require_once '../classes/dateutils.class.php';
require_once '../classes/question_status.class.php';
require_once '../classes/questionbank.class.php';
require_once '../classes/questionutils.class.php';
require_once '../include/errors.inc';
$type = check_var('type', 'GET', true, false, true);
$state = $stateutil->getState();
$_SESSION['nav_page'] = $_SERVER['SCRIPT_NAME'];
$_SESSION['nav_query'] = $_SERVER['QUERY_STRING'];
// Get question statuses
$status_array = QuestionStatus::get_all_statuses($mysqli, $string, true);
$statusSQL = '';
if (isset($_GET['status'])) {
    $statusSQL = " AND status = " . $_GET['status'];
}
if (isset($_GET['userid'])) {
    $userid = $_GET['userid'];
} else {
    $userid = '';
}
if (isset($_GET['keyword'])) {
    $keyword = $_GET['keyword'];
} else {
    $keyword = '';
}
if (isset($_GET['module'])) {
Пример #3
0
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Rogō.  If not, see <http://www.gnu.org/licenses/>.
/**
*
* @author Simon Wilkinson
* @version 1.0
* @copyright Copyright (c) 2014 The University of Nottingham
* @package
*/
require '../include/sysadmin_auth.inc';
require_once '../classes/question_status.class.php';
// Check if we have any faculties
$statuses = QuestionStatus::get_all_statuses($mysqli, $string);
?>
<!DOCTYPE html>
<html>
<head>
  <meta http-equiv="X-UA-Compatible" content="IE=edge" />
  <meta http-equiv="content-type" content="text/html;charset=<?php 
echo $configObject->get('cfg_page_charset');
?>
" />

  <title>Rog&#333;: <?php 
echo $string['questionstatuses'] . ' ' . $configObject->get('cfg_install_type');
?>
</title>
Пример #4
0
 private function load_performance_stats()
 {
     $this->stats = array('veryeasy' => 0, 'easy' => 0, 'moderate' => 0, 'hard' => 0, 'veryhard' => 0, 'highest' => 0, 'high' => 0, 'intermediate' => 0, 'low' => 0);
     $status_array = QuestionStatus::get_all_statuses($this->db, $this->string, true);
     $retired_in = '-1,' . implode(',', QuestionStatus::get_retired_status_ids($status_array));
     $sql = 'SELECT DISTINCT p, d, questions.q_id FROM questions, questions_modules, performance_main, performance_details WHERE questions.q_id = questions_modules.q_id AND questions.q_id = performance_main.q_id AND performance_main.id = performance_details.perform_id AND idMod = ? AND deleted IS NULL AND status NOT IN (' . $retired_in . ')';
     $result = $this->db->prepare($sql);
     $result->bind_param('i', $this->idMod);
     $result->execute();
     $result->bind_result($p, $d, $q_id);
     while ($result->fetch()) {
         if ($p >= 80 and $p <= 100) {
             $this->stats['veryeasy']++;
         } elseif ($p >= 60 and $p < 80) {
             $this->stats['easy']++;
         } elseif ($p >= 40 and $p < 60) {
             $this->stats['moderate']++;
         } elseif ($p >= 20 and $p < 40) {
             $this->stats['hard']++;
         } elseif ($p >= 0 and $p < 20) {
             $this->stats['veryhard']++;
         }
         if ($d >= 35 and $d <= 100) {
             $this->stats['highest']++;
         } elseif ($d >= 25 and $d < 35) {
             $this->stats['high']++;
         } elseif ($d >= 15 and $d < 25) {
             $this->stats['intermediate']++;
         } elseif ($d >= 0 and $d < 15) {
             $this->stats['low']++;
         }
     }
     $result->close();
 }
Пример #5
0
 public function __construct($studentsonly, $percent, $ordering, $absent, $sortby, $userObject, $propertyObj, $startdate, $enddate, $repcourse, $repmodule, $db, $string)
 {
     $this->db = $db;
     $this->demo = is_demo($userObject);
     $this->paperID = $propertyObj->get_property_id();
     $this->paper_type = $propertyObj->get_paper_type();
     $this->calendar_year = $propertyObj->get_calendar_year();
     $this->startdate = $startdate;
     $this->enddate = $enddate;
     $this->absent = $absent;
     $this->studentsonly = $studentsonly;
     $this->marking = $propertyObj->get_marking();
     $this->percent = $percent;
     $this->ordering = $ordering;
     $this->sortby = $sortby;
     $this->repcourse = $repcourse;
     $this->repmodule = $repmodule;
     $this->pass_mark = $propertyObj->get_pass_mark();
     $this->distinction_mark = $propertyObj->get_distinction_mark();
     $this->log_late = array();
     $this->q_medians = array();
     $this->random_q_ids = array();
     $this->config = Config::get_instance();
     $this->propertyObj = $propertyObj;
     $this->exclusions = new Exclusion($this->paperID, $this->db);
     $this->display_excluded = '';
     $this->user_no = 0;
     $this->marking_overrides = array();
     $this->string = $string;
     $unmarked_calculation = false;
     $unmarked_textbox = false;
     $this->question_statuses = QuestionStatus::get_all_statuses($db, array(), true);
 }