major whitespace cleanup - fixed \r\n line-ending
This commit is contained in:
+71
-71
@@ -1,71 +1,71 @@
|
||||
Moodle - FirstClass authentication module
|
||||
-----------------------------------------
|
||||
This module uses the FirstClass Flexible Provisining Protocol (FPP) to communicate between the FirstClass server
|
||||
and the Moodle host.
|
||||
|
||||
Installation
|
||||
------------
|
||||
|
||||
1. Enable FPP on the FirstClass server
|
||||
FPP is not doumented in the FirstClass documentation and is not enable by default.
|
||||
To enable the protocol you need to edit the file \FCPO\Server\Netinfo. Open the file and insert the
|
||||
following lines.
|
||||
|
||||
// TCP port for Flexible Provisioning Protocol (FPP).
|
||||
TCPFPPPORT = 3333
|
||||
|
||||
|
||||
2. Create an account on the FirstClass server with privilege "Subadministrator".
|
||||
Using the FPP protocoll this module logs in to the FirstClass server and issuess batch admin commands.
|
||||
Batch admin command can only be issued in the context of a user with subadministrative privileges.
|
||||
|
||||
Default account name is "fcMoodle".
|
||||
|
||||
|
||||
3. Check that the FPP protocoll is working by running a Telnet session. If everyting is working you
|
||||
should get a "+0" answer from the server.
|
||||
|
||||
> telnet yourhost.domain.com 3333
|
||||
+0
|
||||
|
||||
Check that the "fcMoodle" is working by entering the following sequens of commands:
|
||||
|
||||
> telnet yourhost.domain.com 3333
|
||||
+0
|
||||
fcMoodle
|
||||
+0
|
||||
|
||||
the_password_you_gave_fcmoodle
|
||||
+0
|
||||
|
||||
Get user some_user_id 1201
|
||||
|
||||
1201 0 some_user_id
|
||||
+0
|
||||
|
||||
|
||||
|
||||
4. On the Moodle host go to the directory where you have installed Moodle.
|
||||
Open the folder "auth", where all other authentication modules are installed,
|
||||
and create a new directory with the name "fc".
|
||||
|
||||
Copy the files "config.html", "fcFPP.php" and "lib.php" to the "auth" directory.
|
||||
|
||||
Now you need to add som strings to the language file. This distribution contains
|
||||
string for the English (en) and Swedish (sv) translation.
|
||||
|
||||
Open the file "auth.php" in the folder "lang/sv" and paste the text from the file
|
||||
"auth.php - sv.txt" at the end of the file above the line "?>"
|
||||
|
||||
Open the file "auth.php" in the folder "lang/en" and paste the text from the file
|
||||
"auth.php - en.txt" at the end of the file above the line "?>"
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Moodle - FirstClass authentication module
|
||||
-----------------------------------------
|
||||
This module uses the FirstClass Flexible Provisining Protocol (FPP) to communicate between the FirstClass server
|
||||
and the Moodle host.
|
||||
|
||||
Installation
|
||||
------------
|
||||
|
||||
1. Enable FPP on the FirstClass server
|
||||
FPP is not doumented in the FirstClass documentation and is not enable by default.
|
||||
To enable the protocol you need to edit the file \FCPO\Server\Netinfo. Open the file and insert the
|
||||
following lines.
|
||||
|
||||
// TCP port for Flexible Provisioning Protocol (FPP).
|
||||
TCPFPPPORT = 3333
|
||||
|
||||
|
||||
2. Create an account on the FirstClass server with privilege "Subadministrator".
|
||||
Using the FPP protocoll this module logs in to the FirstClass server and issuess batch admin commands.
|
||||
Batch admin command can only be issued in the context of a user with subadministrative privileges.
|
||||
|
||||
Default account name is "fcMoodle".
|
||||
|
||||
|
||||
3. Check that the FPP protocoll is working by running a Telnet session. If everyting is working you
|
||||
should get a "+0" answer from the server.
|
||||
|
||||
> telnet yourhost.domain.com 3333
|
||||
+0
|
||||
|
||||
Check that the "fcMoodle" is working by entering the following sequens of commands:
|
||||
|
||||
> telnet yourhost.domain.com 3333
|
||||
+0
|
||||
fcMoodle
|
||||
+0
|
||||
|
||||
the_password_you_gave_fcmoodle
|
||||
+0
|
||||
|
||||
Get user some_user_id 1201
|
||||
|
||||
1201 0 some_user_id
|
||||
+0
|
||||
|
||||
|
||||
|
||||
4. On the Moodle host go to the directory where you have installed Moodle.
|
||||
Open the folder "auth", where all other authentication modules are installed,
|
||||
and create a new directory with the name "fc".
|
||||
|
||||
Copy the files "config.html", "fcFPP.php" and "lib.php" to the "auth" directory.
|
||||
|
||||
Now you need to add som strings to the language file. This distribution contains
|
||||
string for the English (en) and Swedish (sv) translation.
|
||||
|
||||
Open the file "auth.php" in the folder "lang/sv" and paste the text from the file
|
||||
"auth.php - sv.txt" at the end of the file above the line "?>"
|
||||
|
||||
Open the file "auth.php" in the folder "lang/en" and paste the text from the file
|
||||
"auth.php - en.txt" at the end of the file above the line "?>"
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
+217
-217
@@ -1,218 +1,218 @@
|
||||
<?php
|
||||
/************************************************************************/
|
||||
/* fcFPP: Php class for FirstClass Flexible Provisining Protocol */
|
||||
/* ============================================================= */
|
||||
/* */
|
||||
/* Copyright (c) 2004 SKERIA Utveckling, Teknous */
|
||||
/* http://skeria.skelleftea.se */
|
||||
/* */
|
||||
/* Flexible Provisioning Protocol is a real-time, IP based protocol */
|
||||
/* which provides direct access to the scriptable remote administration */
|
||||
/* subsystem of the core FirstClass Server. Using FPP, it is possible to*/
|
||||
/* implement automated provisioning and administration systems for */
|
||||
/* FirstClass, avoiding the need for a point and click GUI. FPP can also*/
|
||||
/* be used to integrate FirstClass components into a larger unified */
|
||||
/* system. */
|
||||
/* */
|
||||
/* This program is free software. You can redistribute it and/or modify */
|
||||
/* it under the terms of the GNU General Public License as published by */
|
||||
/* the Free Software Foundation; either version 2 of the License. */
|
||||
/************************************************************************/
|
||||
/* Author: Torsten Anderson, [email protected]
|
||||
*/
|
||||
|
||||
class fcFPP
|
||||
{
|
||||
var $_hostname; // hostname of FirstClass server we are connection to
|
||||
var $_port; // port on which fpp is running
|
||||
var $_conn = 0; // socket we are connecting on
|
||||
var $_debug = FALSE; // set to true to see some debug info
|
||||
|
||||
// class constructor
|
||||
function fcFPP($host="localhost", $port="3333")
|
||||
{
|
||||
$this->_hostname = $host;
|
||||
$this->_port = $port;
|
||||
$this->_user = "";
|
||||
$this->_pwd = "";
|
||||
}
|
||||
|
||||
// open a connection to the FirstClass server
|
||||
function open()
|
||||
{
|
||||
if($this->_debug) echo "Connecting to host ";
|
||||
$host = $this->_hostname;
|
||||
$port = $this->_port;
|
||||
|
||||
if($this->_debug) echo "[$host:$port]..";
|
||||
|
||||
// open the connection to the FirstClass server
|
||||
$conn = fsockopen($host, $port, $errno, $errstr, 5);
|
||||
if(!$conn)
|
||||
{
|
||||
echo "connection failed!".$errno. $errstr;
|
||||
return false;
|
||||
}
|
||||
|
||||
// We are connected
|
||||
if($this->_debug) echo "connected!";
|
||||
|
||||
// Read connection message.
|
||||
$line = fgets ($conn); //+0
|
||||
$line = fgets ($conn); //new line
|
||||
|
||||
// store the connection in this class, so we can use it later
|
||||
$this->_conn = & $conn;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// close any open connections
|
||||
function close()
|
||||
{
|
||||
// get the current connection
|
||||
$conn = &$this->_conn;
|
||||
|
||||
// close it if it's open
|
||||
if($conn)
|
||||
{
|
||||
fclose($conn);
|
||||
|
||||
// cleanup the variable
|
||||
unset($this->_conn);
|
||||
return true;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// Authenticate to the FirstClass server
|
||||
function login($userid, $passwd)
|
||||
{
|
||||
// we did have a connection right?!
|
||||
if($this->_conn)
|
||||
{
|
||||
# Send username
|
||||
fputs($this->_conn,"$userid\r\n");
|
||||
|
||||
$line = fgets ($this->_conn); //new line
|
||||
$line = fgets ($this->_conn); //+0
|
||||
$line = fgets ($this->_conn); //new line
|
||||
|
||||
# Send password
|
||||
fputs($this->_conn,"$passwd\r\n");
|
||||
$line = fgets ($this->_conn); //new line
|
||||
$line = fgets ($this->_conn); //+0
|
||||
$line = fgets ($this->_conn); //+0 or message
|
||||
|
||||
if($this->_debug) echo $line;
|
||||
|
||||
if (preg_match ("/^\+0/", $line)) { //+0, user with subadmin privileges
|
||||
$this->_user = $userid;
|
||||
$this->_pwd = $passwd;
|
||||
return TRUE;
|
||||
} elseif (preg_match ("/^\Sorry/",$line)){ //Denied access but a valid user and password
|
||||
return TRUE;
|
||||
} else { //Invalid user or password
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// Get the list of groups the user is a member of
|
||||
function getGroups($userid){
|
||||
|
||||
$groups = array();
|
||||
|
||||
// we must be logged in as a user with subadmin privileges
|
||||
if($this->_conn AND $this->_user) {
|
||||
# Send BA-command to get groups
|
||||
fputs($this->_conn,"GET USER '" . $userid . "' 4 -1\r");
|
||||
$line = "";
|
||||
while (!$line) {
|
||||
$line = trim(fgets ($this->_conn));
|
||||
}
|
||||
$n = 0;
|
||||
while ($line AND !preg_match("/^\+0/", $line) AND $line != "-1003") {
|
||||
list( , , $groups[$n++]) = explode(" ",$line,3);
|
||||
$line = trim(fgets ($this->_conn));
|
||||
}
|
||||
if($this->_debug) echo "getGroups:" . implode(",",$groups);
|
||||
}
|
||||
|
||||
return $groups;
|
||||
}
|
||||
|
||||
// Check if the user is member of any of the groups.
|
||||
// Return the list of groups the user is member of.
|
||||
function isMemberOf($userid, $groups){
|
||||
|
||||
$usergroups = array_map("strtolower",$this->getGroups($userid));
|
||||
$groups = array_map("strtolower",$groups);
|
||||
|
||||
$result = array_intersect($groups,$usergroups);
|
||||
|
||||
if($this->_debug) echo "isMemberOf:" . implode(",",$result);
|
||||
|
||||
return $result;
|
||||
|
||||
}
|
||||
|
||||
function getUserInfo($userid, $field){
|
||||
|
||||
$userinfo = "";
|
||||
|
||||
if($this->_conn AND $this->_user) {
|
||||
# Send BA-command to get data
|
||||
fputs($this->_conn,"GET USER '" . $userid . "' " . $field . "\r");
|
||||
$line = "";
|
||||
while (!$line) {
|
||||
$line = trim(fgets ($this->_conn));
|
||||
}
|
||||
$n = 0;
|
||||
while ($line AND !preg_match("/^\+0/", $line)) {
|
||||
list( , , $userinfo) = explode(" ",$line,3);
|
||||
$line = trim(fgets ($this->_conn));
|
||||
}
|
||||
if($this->_debug) echo "getUserInfo:" . $userinfo;
|
||||
}
|
||||
|
||||
return str_replace('\r',' ',trim($userinfo,'"'));
|
||||
|
||||
}
|
||||
|
||||
function getResume($userid){
|
||||
|
||||
$resume = "";
|
||||
|
||||
$pattern = "/\[.+:.+\..+\]/"; // Remove references to pictures in resumes
|
||||
|
||||
if($this->_conn AND $this->_user) {
|
||||
# Send BA-command to get data
|
||||
fputs($this->_conn,"GET RESUME '" . $userid . "' 6\r");
|
||||
$line = "";
|
||||
while (!$line) {
|
||||
$line = trim(fgets ($this->_conn));
|
||||
}
|
||||
$n = 0;
|
||||
while ($line AND !preg_match("/^\+0/", $line)) {
|
||||
$resume .= preg_replace($pattern,"",str_replace('\r',"\n",trim($line,'6 ')));
|
||||
$line = trim(fgets ($this->_conn));
|
||||
//print $line;
|
||||
|
||||
}
|
||||
if($this->_debug) echo "getResume:" . $resume;
|
||||
}
|
||||
|
||||
return $resume;
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
<?php
|
||||
/************************************************************************/
|
||||
/* fcFPP: Php class for FirstClass Flexible Provisining Protocol */
|
||||
/* ============================================================= */
|
||||
/* */
|
||||
/* Copyright (c) 2004 SKERIA Utveckling, Teknous */
|
||||
/* http://skeria.skelleftea.se */
|
||||
/* */
|
||||
/* Flexible Provisioning Protocol is a real-time, IP based protocol */
|
||||
/* which provides direct access to the scriptable remote administration */
|
||||
/* subsystem of the core FirstClass Server. Using FPP, it is possible to*/
|
||||
/* implement automated provisioning and administration systems for */
|
||||
/* FirstClass, avoiding the need for a point and click GUI. FPP can also*/
|
||||
/* be used to integrate FirstClass components into a larger unified */
|
||||
/* system. */
|
||||
/* */
|
||||
/* This program is free software. You can redistribute it and/or modify */
|
||||
/* it under the terms of the GNU General Public License as published by */
|
||||
/* the Free Software Foundation; either version 2 of the License. */
|
||||
/************************************************************************/
|
||||
/* Author: Torsten Anderson, [email protected]
|
||||
*/
|
||||
|
||||
class fcFPP
|
||||
{
|
||||
var $_hostname; // hostname of FirstClass server we are connection to
|
||||
var $_port; // port on which fpp is running
|
||||
var $_conn = 0; // socket we are connecting on
|
||||
var $_debug = FALSE; // set to true to see some debug info
|
||||
|
||||
// class constructor
|
||||
function fcFPP($host="localhost", $port="3333")
|
||||
{
|
||||
$this->_hostname = $host;
|
||||
$this->_port = $port;
|
||||
$this->_user = "";
|
||||
$this->_pwd = "";
|
||||
}
|
||||
|
||||
// open a connection to the FirstClass server
|
||||
function open()
|
||||
{
|
||||
if($this->_debug) echo "Connecting to host ";
|
||||
$host = $this->_hostname;
|
||||
$port = $this->_port;
|
||||
|
||||
if($this->_debug) echo "[$host:$port]..";
|
||||
|
||||
// open the connection to the FirstClass server
|
||||
$conn = fsockopen($host, $port, $errno, $errstr, 5);
|
||||
if(!$conn)
|
||||
{
|
||||
echo "connection failed!".$errno. $errstr;
|
||||
return false;
|
||||
}
|
||||
|
||||
// We are connected
|
||||
if($this->_debug) echo "connected!";
|
||||
|
||||
// Read connection message.
|
||||
$line = fgets ($conn); //+0
|
||||
$line = fgets ($conn); //new line
|
||||
|
||||
// store the connection in this class, so we can use it later
|
||||
$this->_conn = & $conn;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// close any open connections
|
||||
function close()
|
||||
{
|
||||
// get the current connection
|
||||
$conn = &$this->_conn;
|
||||
|
||||
// close it if it's open
|
||||
if($conn)
|
||||
{
|
||||
fclose($conn);
|
||||
|
||||
// cleanup the variable
|
||||
unset($this->_conn);
|
||||
return true;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// Authenticate to the FirstClass server
|
||||
function login($userid, $passwd)
|
||||
{
|
||||
// we did have a connection right?!
|
||||
if($this->_conn)
|
||||
{
|
||||
# Send username
|
||||
fputs($this->_conn,"$userid\r\n");
|
||||
|
||||
$line = fgets ($this->_conn); //new line
|
||||
$line = fgets ($this->_conn); //+0
|
||||
$line = fgets ($this->_conn); //new line
|
||||
|
||||
# Send password
|
||||
fputs($this->_conn,"$passwd\r\n");
|
||||
$line = fgets ($this->_conn); //new line
|
||||
$line = fgets ($this->_conn); //+0
|
||||
$line = fgets ($this->_conn); //+0 or message
|
||||
|
||||
if($this->_debug) echo $line;
|
||||
|
||||
if (preg_match ("/^\+0/", $line)) { //+0, user with subadmin privileges
|
||||
$this->_user = $userid;
|
||||
$this->_pwd = $passwd;
|
||||
return TRUE;
|
||||
} elseif (preg_match ("/^\Sorry/",$line)){ //Denied access but a valid user and password
|
||||
return TRUE;
|
||||
} else { //Invalid user or password
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// Get the list of groups the user is a member of
|
||||
function getGroups($userid){
|
||||
|
||||
$groups = array();
|
||||
|
||||
// we must be logged in as a user with subadmin privileges
|
||||
if($this->_conn AND $this->_user) {
|
||||
# Send BA-command to get groups
|
||||
fputs($this->_conn,"GET USER '" . $userid . "' 4 -1\r");
|
||||
$line = "";
|
||||
while (!$line) {
|
||||
$line = trim(fgets ($this->_conn));
|
||||
}
|
||||
$n = 0;
|
||||
while ($line AND !preg_match("/^\+0/", $line) AND $line != "-1003") {
|
||||
list( , , $groups[$n++]) = explode(" ",$line,3);
|
||||
$line = trim(fgets ($this->_conn));
|
||||
}
|
||||
if($this->_debug) echo "getGroups:" . implode(",",$groups);
|
||||
}
|
||||
|
||||
return $groups;
|
||||
}
|
||||
|
||||
// Check if the user is member of any of the groups.
|
||||
// Return the list of groups the user is member of.
|
||||
function isMemberOf($userid, $groups){
|
||||
|
||||
$usergroups = array_map("strtolower",$this->getGroups($userid));
|
||||
$groups = array_map("strtolower",$groups);
|
||||
|
||||
$result = array_intersect($groups,$usergroups);
|
||||
|
||||
if($this->_debug) echo "isMemberOf:" . implode(",",$result);
|
||||
|
||||
return $result;
|
||||
|
||||
}
|
||||
|
||||
function getUserInfo($userid, $field){
|
||||
|
||||
$userinfo = "";
|
||||
|
||||
if($this->_conn AND $this->_user) {
|
||||
# Send BA-command to get data
|
||||
fputs($this->_conn,"GET USER '" . $userid . "' " . $field . "\r");
|
||||
$line = "";
|
||||
while (!$line) {
|
||||
$line = trim(fgets ($this->_conn));
|
||||
}
|
||||
$n = 0;
|
||||
while ($line AND !preg_match("/^\+0/", $line)) {
|
||||
list( , , $userinfo) = explode(" ",$line,3);
|
||||
$line = trim(fgets ($this->_conn));
|
||||
}
|
||||
if($this->_debug) echo "getUserInfo:" . $userinfo;
|
||||
}
|
||||
|
||||
return str_replace('\r',' ',trim($userinfo,'"'));
|
||||
|
||||
}
|
||||
|
||||
function getResume($userid){
|
||||
|
||||
$resume = "";
|
||||
|
||||
$pattern = "/\[.+:.+\..+\]/"; // Remove references to pictures in resumes
|
||||
|
||||
if($this->_conn AND $this->_user) {
|
||||
# Send BA-command to get data
|
||||
fputs($this->_conn,"GET RESUME '" . $userid . "' 6\r");
|
||||
$line = "";
|
||||
while (!$line) {
|
||||
$line = trim(fgets ($this->_conn));
|
||||
}
|
||||
$n = 0;
|
||||
while ($line AND !preg_match("/^\+0/", $line)) {
|
||||
$resume .= preg_replace($pattern,"",str_replace('\r',"\n",trim($line,'6 ')));
|
||||
$line = trim(fgets ($this->_conn));
|
||||
//print $line;
|
||||
|
||||
}
|
||||
if($this->_debug) echo "getResume:" . $resume;
|
||||
}
|
||||
|
||||
return $resume;
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
+154
-154
@@ -1,154 +1,154 @@
|
||||
<?php // $Id$
|
||||
|
||||
// FirstClass authentication using FirstClass Flexible Provisining Protocol
|
||||
|
||||
/* Author: Torsten Anderson, [email protected]
|
||||
|
||||
CHANGELOG
|
||||
|
||||
README
|
||||
Module will authenticate user against FirstClass server and check if user belongs to any of
|
||||
the defined creator groups.
|
||||
User authenticates using their existing FirstClass username and password.
|
||||
Where possible userdata is copied from the FirstClass directory to Moodle. You may
|
||||
want to modify this.
|
||||
Module requires the fcFPP class to do it's jobb.
|
||||
*/
|
||||
|
||||
|
||||
require('fcFPP.php');
|
||||
|
||||
|
||||
function auth_user_login ($username, $password) {
|
||||
/// Returns true if the username and password work
|
||||
/// and false if they don't
|
||||
|
||||
global $CFG;
|
||||
|
||||
$hostname = $CFG->auth_fchost;
|
||||
$port = $CFG->auth_fcfppport;
|
||||
|
||||
$retval = FALSE;
|
||||
|
||||
if (!$username or !$password) { // Don't allow blank usernames or passwords
|
||||
return $retval;
|
||||
}
|
||||
|
||||
|
||||
$fpp = new fcFPP($hostname,$port);
|
||||
if ($fpp->open()) {
|
||||
if ($fpp->login($username,$password)){
|
||||
$retval = TRUE;
|
||||
}
|
||||
}
|
||||
$fpp->close();
|
||||
|
||||
return $retval;
|
||||
|
||||
|
||||
}
|
||||
|
||||
function auth_get_userinfo($username){
|
||||
// Get user information from FirstCLass server and return it in an array.
|
||||
// Localize this routine to fit your needs.
|
||||
|
||||
/*
|
||||
Moodle FirstCLass fieldID in UserInfo form
|
||||
------ -----------------------------------
|
||||
firstname 1202
|
||||
lastname 1204
|
||||
email 1252
|
||||
icq -
|
||||
phone1 1206
|
||||
phone2 1207 (Fax)
|
||||
institution -
|
||||
department -
|
||||
address 1205
|
||||
city -
|
||||
country -
|
||||
lang -
|
||||
timezone 8030 (Not used yet. Need to figure out how FC codes timezones)
|
||||
|
||||
description Get data from users resume. Pictures will be removed.
|
||||
|
||||
*/
|
||||
|
||||
global $CFG;
|
||||
|
||||
$hostname = $CFG->auth_fchost;
|
||||
$port = $CFG->auth_fcfppport;
|
||||
$userid = $CFG->auth_fcuserid;
|
||||
$passwd = $CFG->auth_fcpasswd;
|
||||
|
||||
$userinfo = array();
|
||||
|
||||
$fpp = new fcFPP($hostname,$port);
|
||||
if ($fpp->open()) {
|
||||
if ($fpp->login($userid,$passwd)){
|
||||
|
||||
$userinfo['firstname'] = $fpp->getUserInfo($username,"1202");
|
||||
$userinfo['lastname'] = $fpp->getUserInfo($username,"1204");
|
||||
$userinfo['email'] = strtok($fpp->getUserInfo($username,"1252"),',');
|
||||
$userinfo['phone1'] = $fpp->getUserInfo($username,"1206");
|
||||
$userinfo['phone2'] = $fpp->getUserInfo($username,"1207");
|
||||
$userinfo['description'] = $fpp->getResume($username);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
$fpp->close();
|
||||
|
||||
foreach($userinfo as $key => $value) {
|
||||
if (!$value) {
|
||||
unset($userinfo[$key]);
|
||||
}
|
||||
}
|
||||
|
||||
return $userinfo;
|
||||
|
||||
}
|
||||
|
||||
|
||||
function auth_iscreator($username=0) {
|
||||
//Get users group membership from the FirstClass server user and check if
|
||||
// user is member of one of the groups of creators.
|
||||
|
||||
global $CFG, $USER;
|
||||
|
||||
if (! $CFG->auth_fccreators) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (! $username) {
|
||||
$username=$USER->username;
|
||||
}
|
||||
|
||||
$fcgroups = array();
|
||||
|
||||
$hostname = $CFG->auth_fchost;
|
||||
$port = $CFG->auth_fcfppport;
|
||||
$userid = $CFG->auth_fcuserid;
|
||||
$passwd = $CFG->auth_fcpasswd;
|
||||
|
||||
$fpp = new fcFPP($hostname,$port);
|
||||
if ($fpp->open()) {
|
||||
if ($fpp->login($userid,$passwd)){
|
||||
$fcgroups = $fpp->getGroups($username);
|
||||
}
|
||||
}
|
||||
$fpp->close();
|
||||
|
||||
|
||||
if ((! $fcgroups)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$creators = explode(";",$CFG->auth_fccreators);
|
||||
|
||||
foreach($creators as $creator) {
|
||||
If (in_array($creator, $fcgroups)) return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
<?php // $Id$
|
||||
|
||||
// FirstClass authentication using FirstClass Flexible Provisining Protocol
|
||||
|
||||
/* Author: Torsten Anderson, [email protected]
|
||||
|
||||
CHANGELOG
|
||||
|
||||
README
|
||||
Module will authenticate user against FirstClass server and check if user belongs to any of
|
||||
the defined creator groups.
|
||||
User authenticates using their existing FirstClass username and password.
|
||||
Where possible userdata is copied from the FirstClass directory to Moodle. You may
|
||||
want to modify this.
|
||||
Module requires the fcFPP class to do it's jobb.
|
||||
*/
|
||||
|
||||
|
||||
require('fcFPP.php');
|
||||
|
||||
|
||||
function auth_user_login ($username, $password) {
|
||||
/// Returns true if the username and password work
|
||||
/// and false if they don't
|
||||
|
||||
global $CFG;
|
||||
|
||||
$hostname = $CFG->auth_fchost;
|
||||
$port = $CFG->auth_fcfppport;
|
||||
|
||||
$retval = FALSE;
|
||||
|
||||
if (!$username or !$password) { // Don't allow blank usernames or passwords
|
||||
return $retval;
|
||||
}
|
||||
|
||||
|
||||
$fpp = new fcFPP($hostname,$port);
|
||||
if ($fpp->open()) {
|
||||
if ($fpp->login($username,$password)){
|
||||
$retval = TRUE;
|
||||
}
|
||||
}
|
||||
$fpp->close();
|
||||
|
||||
return $retval;
|
||||
|
||||
|
||||
}
|
||||
|
||||
function auth_get_userinfo($username){
|
||||
// Get user information from FirstCLass server and return it in an array.
|
||||
// Localize this routine to fit your needs.
|
||||
|
||||
/*
|
||||
Moodle FirstCLass fieldID in UserInfo form
|
||||
------ -----------------------------------
|
||||
firstname 1202
|
||||
lastname 1204
|
||||
email 1252
|
||||
icq -
|
||||
phone1 1206
|
||||
phone2 1207 (Fax)
|
||||
institution -
|
||||
department -
|
||||
address 1205
|
||||
city -
|
||||
country -
|
||||
lang -
|
||||
timezone 8030 (Not used yet. Need to figure out how FC codes timezones)
|
||||
|
||||
description Get data from users resume. Pictures will be removed.
|
||||
|
||||
*/
|
||||
|
||||
global $CFG;
|
||||
|
||||
$hostname = $CFG->auth_fchost;
|
||||
$port = $CFG->auth_fcfppport;
|
||||
$userid = $CFG->auth_fcuserid;
|
||||
$passwd = $CFG->auth_fcpasswd;
|
||||
|
||||
$userinfo = array();
|
||||
|
||||
$fpp = new fcFPP($hostname,$port);
|
||||
if ($fpp->open()) {
|
||||
if ($fpp->login($userid,$passwd)){
|
||||
|
||||
$userinfo['firstname'] = $fpp->getUserInfo($username,"1202");
|
||||
$userinfo['lastname'] = $fpp->getUserInfo($username,"1204");
|
||||
$userinfo['email'] = strtok($fpp->getUserInfo($username,"1252"),',');
|
||||
$userinfo['phone1'] = $fpp->getUserInfo($username,"1206");
|
||||
$userinfo['phone2'] = $fpp->getUserInfo($username,"1207");
|
||||
$userinfo['description'] = $fpp->getResume($username);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
$fpp->close();
|
||||
|
||||
foreach($userinfo as $key => $value) {
|
||||
if (!$value) {
|
||||
unset($userinfo[$key]);
|
||||
}
|
||||
}
|
||||
|
||||
return $userinfo;
|
||||
|
||||
}
|
||||
|
||||
|
||||
function auth_iscreator($username=0) {
|
||||
//Get users group membership from the FirstClass server user and check if
|
||||
// user is member of one of the groups of creators.
|
||||
|
||||
global $CFG, $USER;
|
||||
|
||||
if (! $CFG->auth_fccreators) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (! $username) {
|
||||
$username=$USER->username;
|
||||
}
|
||||
|
||||
$fcgroups = array();
|
||||
|
||||
$hostname = $CFG->auth_fchost;
|
||||
$port = $CFG->auth_fcfppport;
|
||||
$userid = $CFG->auth_fcuserid;
|
||||
$passwd = $CFG->auth_fcpasswd;
|
||||
|
||||
$fpp = new fcFPP($hostname,$port);
|
||||
if ($fpp->open()) {
|
||||
if ($fpp->login($userid,$passwd)){
|
||||
$fcgroups = $fpp->getGroups($username);
|
||||
}
|
||||
}
|
||||
$fpp->close();
|
||||
|
||||
|
||||
if ((! $fcgroups)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$creators = explode(";",$CFG->auth_fccreators);
|
||||
|
||||
foreach($creators as $creator) {
|
||||
If (in_array($creator, $fcgroups)) return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
+23
-23
@@ -1,23 +1,23 @@
|
||||
Moodle Language Packs
|
||||
|
||||
This directory contains the standard packaged Moodle language files,
|
||||
for making the Moodle interface appear in different interfaces.
|
||||
|
||||
The default language for Moodle is the English language, under the
|
||||
Unicode scheme (UTF8).
|
||||
|
||||
To add more languages to Moodle, you can either:
|
||||
|
||||
1) use the Moodle languages GUI in the interface to fetch
|
||||
new languages and install them in your 'dataroot' directory.
|
||||
|
||||
2) download them and unzip the packs in this directory manually
|
||||
|
||||
|
||||
For more information, see the Moodle Documentation:
|
||||
|
||||
http://docs.moodle.org/en/Translation
|
||||
|
||||
|
||||
Cheers,
|
||||
Moodle Development Team
|
||||
Moodle Language Packs
|
||||
|
||||
This directory contains the standard packaged Moodle language files,
|
||||
for making the Moodle interface appear in different interfaces.
|
||||
|
||||
The default language for Moodle is the English language, under the
|
||||
Unicode scheme (UTF8).
|
||||
|
||||
To add more languages to Moodle, you can either:
|
||||
|
||||
1) use the Moodle languages GUI in the interface to fetch
|
||||
new languages and install them in your 'dataroot' directory.
|
||||
|
||||
2) download them and unzip the packs in this directory manually
|
||||
|
||||
|
||||
For more information, see the Moodle Documentation:
|
||||
|
||||
http://docs.moodle.org/en/Translation
|
||||
|
||||
|
||||
Cheers,
|
||||
Moodle Development Team
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<p align="center"><b>Quick Grade</b></p>
|
||||
|
||||
<p>With quickgrading enabled you can quickly grade multiple assignments on one page.</p>
|
||||
|
||||
<p>Just change the grades and comments and use the Save button at the bottom to save
|
||||
all your changes for that page at once.</p>
|
||||
|
||||
<p>The normal grading buttons on the right still work too in case you need more space.
|
||||
Your quickgrading preference is saved and will apply to all assignments in all courses.</p>
|
||||
|
||||
<p align="center"><b>Quick Grade</b></p>
|
||||
|
||||
<p>With quickgrading enabled you can quickly grade multiple assignments on one page.</p>
|
||||
|
||||
<p>Just change the grades and comments and use the Save button at the bottom to save
|
||||
all your changes for that page at once.</p>
|
||||
|
||||
<p>The normal grading buttons on the right still work too in case you need more space.
|
||||
Your quickgrading preference is saved and will apply to all assignments in all courses.</p>
|
||||
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
<p align="center"><b>Import PowerPoint HTML</b></p>
|
||||
<p> HOW TO USE</p>
|
||||
<p>All of the PowerPoint slides get imported as Branch Tables with Previous and Next answers.</p>
|
||||
<p>
|
||||
<ol>
|
||||
<li>Open up your PowerPoint presentation.</li>
|
||||
<li>Save it As a Web Page (no special options)</li>
|
||||
<li>The result of step 3 should be a htm file and a folder with all of the slides converted to web pages.<br />
|
||||
ZIP THE FOLDER only.</li>
|
||||
<li>Go to your moodle site and add a new lesson.</li>
|
||||
<li>After saving the lesson settings you should see 4 options under "What would you like to do first?" Click on "Import PowerPoint"</li>
|
||||
<li>Use to the "Browse..." button to find your zip file from step 3. Then click on "Upload this file"</li>
|
||||
<li>If everything worked, the next screen should just display a continue button.</li>
|
||||
</ol>
|
||||
</p>
|
||||
<p>If any images were in your PowerPoint, they would have been saved as course files in moddata/XY where X is your lesson's name and Y is a number (usually 0). Also, during the import process, files are created in your moodle data directory inside temp/lesson. These files are not deleted by importppt.php as of yet.</p>
|
||||
<p align="center"> </p>
|
||||
|
||||
<p align="center"><b>Import PowerPoint HTML</b></p>
|
||||
<p> HOW TO USE</p>
|
||||
<p>All of the PowerPoint slides get imported as Branch Tables with Previous and Next answers.</p>
|
||||
<p>
|
||||
<ol>
|
||||
<li>Open up your PowerPoint presentation.</li>
|
||||
<li>Save it As a Web Page (no special options)</li>
|
||||
<li>The result of step 3 should be a htm file and a folder with all of the slides converted to web pages.<br />
|
||||
ZIP THE FOLDER only.</li>
|
||||
<li>Go to your moodle site and add a new lesson.</li>
|
||||
<li>After saving the lesson settings you should see 4 options under "What would you like to do first?" Click on "Import PowerPoint"</li>
|
||||
<li>Use to the "Browse..." button to find your zip file from step 3. Then click on "Upload this file"</li>
|
||||
<li>If everything worked, the next screen should just display a continue button.</li>
|
||||
</ol>
|
||||
</p>
|
||||
<p>If any images were in your PowerPoint, they would have been saved as course files in moddata/XY where X is your lesson's name and Y is a number (usually 0). Also, during the import process, files are created in your moodle data directory inside temp/lesson. These files are not deleted by importppt.php as of yet.</p>
|
||||
<p align="center"> </p>
|
||||
|
||||
|
||||
@@ -1,28 +1,28 @@
|
||||
<p align="center"><b>Question Option</b></p>
|
||||
|
||||
<p>A few of the Question Types have an option which is activated by clicking on
|
||||
the checkbox. The question types and the meaning of the options are
|
||||
detailed below.</p>
|
||||
|
||||
<ol>
|
||||
<li><p><b>Multichoice</b> There is variant of Multichoice questions called
|
||||
<b>"Multichoice Multianswer"</b> questions. If the Question
|
||||
Option is selected then the student is required to select all the
|
||||
correct answers from the set of answers. The question may or may not tell
|
||||
the student <i>how many</i> correct answers there are. For example "Which of the
|
||||
following were US Presidents?" does not, while "Select the two US
|
||||
presidents from the following list." does. The actual number of correct
|
||||
answers can be from <b>one</b> up to the number of choices. (A Multichoice
|
||||
Multianswer question with one correct answer <b>is</b> different from a
|
||||
Multichoice question as the former allows the student the possibility of
|
||||
choosing more than one answer while the latter does not.)</p></li>
|
||||
|
||||
<li>
|
||||
<p><b>Short Answer</b> There are two different comparison systems available
|
||||
for the Short Answer type of question: the simple system is used by default;
|
||||
the "Regular Expressions" system is used if the "Use Regular
|
||||
Expressions" option box is checked. For more information, please read
|
||||
the Lesson question types help file.</p>
|
||||
</li>
|
||||
</ol>
|
||||
<p>The other Question Types do not use the Question Option.</p>
|
||||
<p align="center"><b>Question Option</b></p>
|
||||
|
||||
<p>A few of the Question Types have an option which is activated by clicking on
|
||||
the checkbox. The question types and the meaning of the options are
|
||||
detailed below.</p>
|
||||
|
||||
<ol>
|
||||
<li><p><b>Multichoice</b> There is variant of Multichoice questions called
|
||||
<b>"Multichoice Multianswer"</b> questions. If the Question
|
||||
Option is selected then the student is required to select all the
|
||||
correct answers from the set of answers. The question may or may not tell
|
||||
the student <i>how many</i> correct answers there are. For example "Which of the
|
||||
following were US Presidents?" does not, while "Select the two US
|
||||
presidents from the following list." does. The actual number of correct
|
||||
answers can be from <b>one</b> up to the number of choices. (A Multichoice
|
||||
Multianswer question with one correct answer <b>is</b> different from a
|
||||
Multichoice question as the former allows the student the possibility of
|
||||
choosing more than one answer while the latter does not.)</p></li>
|
||||
|
||||
<li>
|
||||
<p><b>Short Answer</b> There are two different comparison systems available
|
||||
for the Short Answer type of question: the simple system is used by default;
|
||||
the "Regular Expressions" system is used if the "Use Regular
|
||||
Expressions" option box is checked. For more information, please read
|
||||
the Lesson question types help file.</p>
|
||||
</li>
|
||||
</ol>
|
||||
<p>The other Question Types do not use the Question Option.</p>
|
||||
|
||||
@@ -1,225 +1,225 @@
|
||||
<p align="center"><b>Question Types</b></p>
|
||||
|
||||
<p>The types of Questions currently supported by the Lesson module are:
|
||||
|
||||
<ol>
|
||||
<li><p><b>Multichoice</b> This is the default question type. Multichoice questions
|
||||
are popular questions where the student is asked to choose one answer from a
|
||||
set of alternatives. The correct answer takes the student further into the
|
||||
lesson, the wrong answers do not. The wrong answers are sometimes called the
|
||||
"distractors" and the utility of these questions often rely more
|
||||
on the quality of the distractors than either the questions themselves or their
|
||||
correct answers.</p>
|
||||
|
||||
<p> Each answer can optionally have a response. If no response is
|
||||
entered for an answer then the default response "That's the Correct
|
||||
Answer" or "That's the Wrong Answer" is shown to the student. </p>
|
||||
|
||||
<p>It is possible to have more than one correct answer to a multichoice question.
|
||||
The different correct answers may give the student different responses and
|
||||
jump to different (forward) pages in the lesson but
|
||||
do not vary in their grades, (that is, some answers are <b>not</b> more correct
|
||||
than others, at least in terms of grade.) It is possible for all the answers
|
||||
to be correct and they might take the student to different (forward) parts of
|
||||
the lesson depending on which one is chosen.</p>
|
||||
|
||||
<p>There is variant of Multichoice questions called <b>"Multichoice
|
||||
Multianswer"</b> questions. These require the student to select all the
|
||||
correct answers from the set of answers. The question may or may not tell
|
||||
the student how many correct answers there are. For example "Which of the
|
||||
following were US Presidents?" does not, while "Select the two US
|
||||
presidents from the following list." does. The actual number of correct
|
||||
answers can be from <b>one</b> up to the number of choices. (A Multichoice
|
||||
Multianswer question with one correct answer <b>is</b> different from a
|
||||
Multichoice question as the former allows the student the possibility of
|
||||
choosing more than one answer while the latter does not.)</p>
|
||||
|
||||
<p>Again the correct answers are flagged using forward jumps, the wrong answers
|
||||
by same page or backward jumps. When there is more than one correct answer
|
||||
the jumps should all go to the same page, similarly with the wrong answers.
|
||||
If that is <b>not</b> the case a warning is given on the teacher's view of
|
||||
the lesson. The correct response, if required, should be given on the first
|
||||
correct answer and the wrong response, if required, should be on the first
|
||||
wrong answer. Responses on the other answers are ignored (without warning). </p></li>
|
||||
|
||||
<li><p><b>Short Answer</b> </p>
|
||||
<p>The student is prompted for a short piece of text.
|
||||
This is checked against one or more answers. Answers can be either correct
|
||||
or wrong. Each answer can optionally have a response. If no response is
|
||||
entered for an answer then the default response "That's the Correct
|
||||
Answer" or "That's the Wrong Answer" is shown to the student.
|
||||
If the text entered does not match any of the answers the question is wrong
|
||||
and the student is shown the default wrong response.</p>
|
||||
<p><strong>There are two different comparison systems</strong> available for the
|
||||
Short Answer type of question: the simple system is used by default; the
|
||||
"Regular Expressions" system is used if the "Use Regular
|
||||
Expressions" option box is checked. </p>
|
||||
<ul>
|
||||
<li><strong>Simple analysis</strong>
|
||||
<p>In this (default) system of analysis, the comparisons ignore the case of the text. The
|
||||
asterisk (*) character can be used in answers as a "wild card"
|
||||
character. It stands for any number of characters (including no characters
|
||||
at all). For example, the answer "Long*" will match
|
||||
"longer", "longest" and "long". If one of
|
||||
the answers is just "*" (a single *) this answer will match
|
||||
anything, it is normally used as the last "catch-all" answer. The
|
||||
matching process goes through the answers in the order they appear on the
|
||||
screen. Once a match is found the process stops and the corresponding
|
||||
result (and response, if present) is returned. So, if for example the
|
||||
answers are Longest, Long* and * (in that order), the input
|
||||
"longer" will match the second answer and, in this case, the
|
||||
third answer, although a match, is ignored.</p>
|
||||
<p> If an asterisk (*) is actually needed in an answer, it should be entered as
|
||||
\*, backslash asterisk.</p>
|
||||
</li>
|
||||
</ul>
|
||||
<ul>
|
||||
<li><strong>Regular Expressions analysis</strong>
|
||||
<p>This system gives you access to a more powerful but more complicated system for
|
||||
analysing the student's answers. For a complete introduction to Regular Expressions,
|
||||
see these sites <a href="http://www.zend.com/zend/tut/tutorial-delin2.php" target="_blank">regular-expressions
|
||||
tutorial</a> or <a href="http://perso.wanadoo.fr/joseph.rezeau/eao/developpement/expandRegexpToString.htm#"
|
||||
target="_blank">rezeau.org</a>. </p>
|
||||
<h3>Correct answer matching a regular expression pattern </h3>
|
||||
<p>It is not possible to give complete examples of the vast possibilities offered
|
||||
by this system, and the following are just some possibilities. </p>
|
||||
<p><strong>Example 1.</strong> Suppose your question is "What are the colors
|
||||
of the French flag?". In the Answer 1 frame you type this regular
|
||||
expression: "<span class="c_computeroutput">it’s blue, white(,| and)
|
||||
red</span>/i". This will match any of those four student answers:</p>
|
||||
<ul>
|
||||
<li>it’s blue, white, red</li>
|
||||
<li>it’s blue, white and red</li>
|
||||
<li>It’s blue, white, red</li>
|
||||
<li>It’s blue, white and red </li>
|
||||
</ul>
|
||||
<p>Please note that by default a regular expression match is case sensitive; to
|
||||
make the match case insensitive you must add the <strong>/i</strong> parameter
|
||||
right at the end of your expression.</p>
|
||||
<p><strong>Example 2</strong>. Question: "What is blue, or red, or yellow?".
|
||||
Answer: "(|it's )a colou?r". This will match:</p>
|
||||
<ul>
|
||||
<li>a colour</li>
|
||||
<li> a color</li>
|
||||
<li>it's a colour</li>
|
||||
<li>it's a color</li>
|
||||
</ul>
|
||||
<p>Notes.- The beginning of this regular expression "(|it's )" will
|
||||
match either nothing or "it's " (i.e. "it's" followed by
|
||||
a space). The ? (question-mark) means: preceding character zero or one time;
|
||||
it is used here to match British English as well as US spelling.</p>
|
||||
<p><strong>Example 3.</strong> Question: "Name an animal whose name is made
|
||||
of 3 letters and the middle letter is the vowel <em>a</em>". Anwer:
|
||||
"[bcr]at". This will match: bat, cat and rat. </p>
|
||||
<h3>Detecting missing required words or character strings</h3>
|
||||
<p>Regular expressions alone cannot detect absent character strings, so you have to
|
||||
add a little code in your Answer to take care of this. Any Teacher Answer which
|
||||
begins with a double hyphen will analyse the student’s answer to find out
|
||||
whether the following string is present or absent. If present, the analysis
|
||||
continues to the next question; if absent, the analysis stops and the relevant
|
||||
Response message is displayed.</p>
|
||||
<p><strong>Example 4. </strong></p>
|
||||
<ul>
|
||||
<li>Answer 2: <span class="c_computeroutput">--.*blue.*</span>/i</li>
|
||||
<li>student answer: "it's red and white" </li>
|
||||
<li>Response 2: <span class="c_computeroutput">The color of the sky is missing!</span></li>
|
||||
<li>Jump 2: <span class="c_computeroutput">this page</span></li>
|
||||
</ul>
|
||||
<p>Here, the . (dot) stands for “any character” and the * (asterisk)
|
||||
means “preceding special character repeated any number of times”.
|
||||
The Answer2 regular expression above means: check whether the character string
|
||||
"blue", preceded with anything and followed by anything is absent
|
||||
from the student's answer. Please note that the use of the asterisk is different
|
||||
in the Simple analysis system and in the Regular Expressions system.</p>
|
||||
<p><strong>Example 5.</strong> Question: "Name an animal whose name is made of
|
||||
3 letters and the middle letter is the vowel <em>a</em>". Teacher Answer: "--[b|c|r]". Response: "Your answer should start with one of these letters: b, c or r" </p>
|
||||
<h3>Detecting unwanted (incorrect) words or character strings</h3>
|
||||
<p>You may want to detect, in the student's answer, the presence of one or several
|
||||
words which should be <strong>not</strong> be there (because they are wrong) and
|
||||
to single them out with a specific response. Just start your teacher Answer by a
|
||||
double plus sign (++). </p>
|
||||
<p><strong>Example 6. </strong></p>
|
||||
<ul>
|
||||
<li>Answer 3: ++(yellow|black|orange|green|black|pink)/i</li>
|
||||
<li>student answer: "it's blue, orange and white" </li>
|
||||
<li>Response 3: One or more colors are wrong!</li>
|
||||
<li>Jump 3: this page</li></ul>
|
||||
<p>If any of these (wrong) colors is detected in the student’s answer,
|
||||
then the negative feedback message (Response 3) will be displayed and the
|
||||
wrong strings will be colored red (or the color of the .incorrect class if
|
||||
it exists in a CSS stylesheet of your active theme).</p>
|
||||
<p><strong>Example 7</strong>. Question: "Name an animal whose name is made
|
||||
of 3 letters and the middle letter is the vowel <em>a</em>". Teacher
|
||||
Answer: "++hat". Response: "You might wear one made of an
|
||||
animal's skin, but a hat can't be considered as an animal." </p>
|
||||
<h3>Escaping special characters </h3>
|
||||
<p>If you need to use characters which are part of the regular expressions set
|
||||
of <em>special characters</em>, you need to "escape" them (i.e. precede
|
||||
them with a backslash). E.g. if you want to accept the answer "My computer
|
||||
cost 1000$", you must write the regular expression as "My computer cost
|
||||
1000\$". The special characters which must be escaped are .^$*()[]+?|</p>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<li><p><b>True/False</b> The answer to this type of question only has two options,
|
||||
true or false. The student is prompted to choose which is the correct
|
||||
option. This type of question is basically a Multichoice question with just
|
||||
two choices.</p></li>
|
||||
|
||||
<li><p><b>Matching</b> These are quite powerful and flexible questions. They
|
||||
consist of a list of names or statements which must be correctly matched
|
||||
against other list of names or statements. For example "Match the
|
||||
Capital with the Country" with the two lists Japan, Canada, Italy and
|
||||
Tokyo, Ottawa, Rome. It is possible to have repeated entries in one of the
|
||||
lists but care should be taken to make the repeats identical. For example
|
||||
"Identify the type of these creatures" with the lists Sparrow,
|
||||
Cow, Ant, Dog and Bird, Animal, Insect, Animal. </p>
|
||||
|
||||
<p>When creating this type of question the items for the first list go into the
|
||||
Answer boxes and items for the second list go into the Response boxes. Once
|
||||
created a more sensible labeling scheme is shown. When the student
|
||||
successfully matches the items the jump on the first answer is used. An
|
||||
unsuccessful answer jumps to the page on the second answer. The question does
|
||||
<b>not</b> support custom responses, the student is told how many matches
|
||||
are correct or if all the matches are correct.</p>
|
||||
|
||||
<p>Unlike the Multichoice question where the choices are shown in a random
|
||||
order, the first list of items is <b>not</b> shuffled but shown in the same
|
||||
order as entered. This allows for <b>"Ordered"</b> questions to be
|
||||
constructed. Consider the question " Put the following into the order
|
||||
they were born, the earliest first" with the lists 1., 2., 3., 4. and
|
||||
Longfellow, Lawrence, Lowell, Larkin. The second list is shuffed before
|
||||
being used in the question, of course.</p></li>
|
||||
|
||||
<li><p><b>Numerical</b> This type of question requires a number as the answer.
|
||||
In it's simplest form it requires just one answer to be specified. For
|
||||
example "What is 2 plus 2?" with the answer 4 given a forward
|
||||
jump. However, it is better to specify a range because the internal rounding
|
||||
of numerical values can make single numeric comparisons rather hit or miss.
|
||||
Thus, if the question were "What is 10 divided by 3" it would be
|
||||
necessary to give the answer as <b>"Minimum:Maximum"</b>, that
|
||||
is <b>two</b> values separated by a colon (:). Thus if 3.33:3.34 is given as the
|
||||
acceptable range for the answer, then the answers 3.33, 3.333, 3.3333...
|
||||
would all be taken as correct answers. "Wrong" answers would
|
||||
include 3.3 (less than the minimum) and 3.4 (greater than the maximum).</p>
|
||||
|
||||
<p>More than one correct answer is allowed and the answers can be either single
|
||||
or pair of values. Note that the order in which the answers are tested is
|
||||
Answer 1, Answer 2... so some care needs to taken if the desired response
|
||||
is to appear. For example the question "When was Larkin born?"
|
||||
could have the single value of 1922, the exact answer, and the pair of
|
||||
values 1920:1929, the 20's, as the less exact answer.The order in which
|
||||
these values should be tested is, obviously, 1922 then 1920:1929. The
|
||||
first answer might have the response "That's exactly right"
|
||||
while the other answer's response might be "That's close, you've got
|
||||
the right decade"</p>
|
||||
|
||||
<p>Wrong answers can be given but depending on their actual range, care should
|
||||
be taken to place them after the correct answers. For example in adding the
|
||||
wrong answer 3:4 to the "10 divided by 3" question it needs to come
|
||||
after the correct answer. That is the answers are ordered 3.33:3.34 (the
|
||||
"correct" answer) then 3:4 (the "wrong" answer, but
|
||||
not wildly wrong answer!).</p></li>
|
||||
</ul>
|
||||
|
||||
<p align="center"><b>Question Types</b></p>
|
||||
|
||||
<p>The types of Questions currently supported by the Lesson module are:
|
||||
|
||||
<ol>
|
||||
<li><p><b>Multichoice</b> This is the default question type. Multichoice questions
|
||||
are popular questions where the student is asked to choose one answer from a
|
||||
set of alternatives. The correct answer takes the student further into the
|
||||
lesson, the wrong answers do not. The wrong answers are sometimes called the
|
||||
"distractors" and the utility of these questions often rely more
|
||||
on the quality of the distractors than either the questions themselves or their
|
||||
correct answers.</p>
|
||||
|
||||
<p> Each answer can optionally have a response. If no response is
|
||||
entered for an answer then the default response "That's the Correct
|
||||
Answer" or "That's the Wrong Answer" is shown to the student. </p>
|
||||
|
||||
<p>It is possible to have more than one correct answer to a multichoice question.
|
||||
The different correct answers may give the student different responses and
|
||||
jump to different (forward) pages in the lesson but
|
||||
do not vary in their grades, (that is, some answers are <b>not</b> more correct
|
||||
than others, at least in terms of grade.) It is possible for all the answers
|
||||
to be correct and they might take the student to different (forward) parts of
|
||||
the lesson depending on which one is chosen.</p>
|
||||
|
||||
<p>There is variant of Multichoice questions called <b>"Multichoice
|
||||
Multianswer"</b> questions. These require the student to select all the
|
||||
correct answers from the set of answers. The question may or may not tell
|
||||
the student how many correct answers there are. For example "Which of the
|
||||
following were US Presidents?" does not, while "Select the two US
|
||||
presidents from the following list." does. The actual number of correct
|
||||
answers can be from <b>one</b> up to the number of choices. (A Multichoice
|
||||
Multianswer question with one correct answer <b>is</b> different from a
|
||||
Multichoice question as the former allows the student the possibility of
|
||||
choosing more than one answer while the latter does not.)</p>
|
||||
|
||||
<p>Again the correct answers are flagged using forward jumps, the wrong answers
|
||||
by same page or backward jumps. When there is more than one correct answer
|
||||
the jumps should all go to the same page, similarly with the wrong answers.
|
||||
If that is <b>not</b> the case a warning is given on the teacher's view of
|
||||
the lesson. The correct response, if required, should be given on the first
|
||||
correct answer and the wrong response, if required, should be on the first
|
||||
wrong answer. Responses on the other answers are ignored (without warning). </p></li>
|
||||
|
||||
<li><p><b>Short Answer</b> </p>
|
||||
<p>The student is prompted for a short piece of text.
|
||||
This is checked against one or more answers. Answers can be either correct
|
||||
or wrong. Each answer can optionally have a response. If no response is
|
||||
entered for an answer then the default response "That's the Correct
|
||||
Answer" or "That's the Wrong Answer" is shown to the student.
|
||||
If the text entered does not match any of the answers the question is wrong
|
||||
and the student is shown the default wrong response.</p>
|
||||
<p><strong>There are two different comparison systems</strong> available for the
|
||||
Short Answer type of question: the simple system is used by default; the
|
||||
"Regular Expressions" system is used if the "Use Regular
|
||||
Expressions" option box is checked. </p>
|
||||
<ul>
|
||||
<li><strong>Simple analysis</strong>
|
||||
<p>In this (default) system of analysis, the comparisons ignore the case of the text. The
|
||||
asterisk (*) character can be used in answers as a "wild card"
|
||||
character. It stands for any number of characters (including no characters
|
||||
at all). For example, the answer "Long*" will match
|
||||
"longer", "longest" and "long". If one of
|
||||
the answers is just "*" (a single *) this answer will match
|
||||
anything, it is normally used as the last "catch-all" answer. The
|
||||
matching process goes through the answers in the order they appear on the
|
||||
screen. Once a match is found the process stops and the corresponding
|
||||
result (and response, if present) is returned. So, if for example the
|
||||
answers are Longest, Long* and * (in that order), the input
|
||||
"longer" will match the second answer and, in this case, the
|
||||
third answer, although a match, is ignored.</p>
|
||||
<p> If an asterisk (*) is actually needed in an answer, it should be entered as
|
||||
\*, backslash asterisk.</p>
|
||||
</li>
|
||||
</ul>
|
||||
<ul>
|
||||
<li><strong>Regular Expressions analysis</strong>
|
||||
<p>This system gives you access to a more powerful but more complicated system for
|
||||
analysing the student's answers. For a complete introduction to Regular Expressions,
|
||||
see these sites <a href="http://www.zend.com/zend/tut/tutorial-delin2.php" target="_blank">regular-expressions
|
||||
tutorial</a> or <a href="http://perso.wanadoo.fr/joseph.rezeau/eao/developpement/expandRegexpToString.htm#"
|
||||
target="_blank">rezeau.org</a>. </p>
|
||||
<h3>Correct answer matching a regular expression pattern </h3>
|
||||
<p>It is not possible to give complete examples of the vast possibilities offered
|
||||
by this system, and the following are just some possibilities. </p>
|
||||
<p><strong>Example 1.</strong> Suppose your question is "What are the colors
|
||||
of the French flag?". In the Answer 1 frame you type this regular
|
||||
expression: "<span class="c_computeroutput">it’s blue, white(,| and)
|
||||
red</span>/i". This will match any of those four student answers:</p>
|
||||
<ul>
|
||||
<li>it’s blue, white, red</li>
|
||||
<li>it’s blue, white and red</li>
|
||||
<li>It’s blue, white, red</li>
|
||||
<li>It’s blue, white and red </li>
|
||||
</ul>
|
||||
<p>Please note that by default a regular expression match is case sensitive; to
|
||||
make the match case insensitive you must add the <strong>/i</strong> parameter
|
||||
right at the end of your expression.</p>
|
||||
<p><strong>Example 2</strong>. Question: "What is blue, or red, or yellow?".
|
||||
Answer: "(|it's )a colou?r". This will match:</p>
|
||||
<ul>
|
||||
<li>a colour</li>
|
||||
<li> a color</li>
|
||||
<li>it's a colour</li>
|
||||
<li>it's a color</li>
|
||||
</ul>
|
||||
<p>Notes.- The beginning of this regular expression "(|it's )" will
|
||||
match either nothing or "it's " (i.e. "it's" followed by
|
||||
a space). The ? (question-mark) means: preceding character zero or one time;
|
||||
it is used here to match British English as well as US spelling.</p>
|
||||
<p><strong>Example 3.</strong> Question: "Name an animal whose name is made
|
||||
of 3 letters and the middle letter is the vowel <em>a</em>". Anwer:
|
||||
"[bcr]at". This will match: bat, cat and rat. </p>
|
||||
<h3>Detecting missing required words or character strings</h3>
|
||||
<p>Regular expressions alone cannot detect absent character strings, so you have to
|
||||
add a little code in your Answer to take care of this. Any Teacher Answer which
|
||||
begins with a double hyphen will analyse the student’s answer to find out
|
||||
whether the following string is present or absent. If present, the analysis
|
||||
continues to the next question; if absent, the analysis stops and the relevant
|
||||
Response message is displayed.</p>
|
||||
<p><strong>Example 4. </strong></p>
|
||||
<ul>
|
||||
<li>Answer 2: <span class="c_computeroutput">--.*blue.*</span>/i</li>
|
||||
<li>student answer: "it's red and white" </li>
|
||||
<li>Response 2: <span class="c_computeroutput">The color of the sky is missing!</span></li>
|
||||
<li>Jump 2: <span class="c_computeroutput">this page</span></li>
|
||||
</ul>
|
||||
<p>Here, the . (dot) stands for “any character” and the * (asterisk)
|
||||
means “preceding special character repeated any number of times”.
|
||||
The Answer2 regular expression above means: check whether the character string
|
||||
"blue", preceded with anything and followed by anything is absent
|
||||
from the student's answer. Please note that the use of the asterisk is different
|
||||
in the Simple analysis system and in the Regular Expressions system.</p>
|
||||
<p><strong>Example 5.</strong> Question: "Name an animal whose name is made of
|
||||
3 letters and the middle letter is the vowel <em>a</em>". Teacher Answer: "--[b|c|r]". Response: "Your answer should start with one of these letters: b, c or r" </p>
|
||||
<h3>Detecting unwanted (incorrect) words or character strings</h3>
|
||||
<p>You may want to detect, in the student's answer, the presence of one or several
|
||||
words which should be <strong>not</strong> be there (because they are wrong) and
|
||||
to single them out with a specific response. Just start your teacher Answer by a
|
||||
double plus sign (++). </p>
|
||||
<p><strong>Example 6. </strong></p>
|
||||
<ul>
|
||||
<li>Answer 3: ++(yellow|black|orange|green|black|pink)/i</li>
|
||||
<li>student answer: "it's blue, orange and white" </li>
|
||||
<li>Response 3: One or more colors are wrong!</li>
|
||||
<li>Jump 3: this page</li></ul>
|
||||
<p>If any of these (wrong) colors is detected in the student’s answer,
|
||||
then the negative feedback message (Response 3) will be displayed and the
|
||||
wrong strings will be colored red (or the color of the .incorrect class if
|
||||
it exists in a CSS stylesheet of your active theme).</p>
|
||||
<p><strong>Example 7</strong>. Question: "Name an animal whose name is made
|
||||
of 3 letters and the middle letter is the vowel <em>a</em>". Teacher
|
||||
Answer: "++hat". Response: "You might wear one made of an
|
||||
animal's skin, but a hat can't be considered as an animal." </p>
|
||||
<h3>Escaping special characters </h3>
|
||||
<p>If you need to use characters which are part of the regular expressions set
|
||||
of <em>special characters</em>, you need to "escape" them (i.e. precede
|
||||
them with a backslash). E.g. if you want to accept the answer "My computer
|
||||
cost 1000$", you must write the regular expression as "My computer cost
|
||||
1000\$". The special characters which must be escaped are .^$*()[]+?|</p>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<li><p><b>True/False</b> The answer to this type of question only has two options,
|
||||
true or false. The student is prompted to choose which is the correct
|
||||
option. This type of question is basically a Multichoice question with just
|
||||
two choices.</p></li>
|
||||
|
||||
<li><p><b>Matching</b> These are quite powerful and flexible questions. They
|
||||
consist of a list of names or statements which must be correctly matched
|
||||
against other list of names or statements. For example "Match the
|
||||
Capital with the Country" with the two lists Japan, Canada, Italy and
|
||||
Tokyo, Ottawa, Rome. It is possible to have repeated entries in one of the
|
||||
lists but care should be taken to make the repeats identical. For example
|
||||
"Identify the type of these creatures" with the lists Sparrow,
|
||||
Cow, Ant, Dog and Bird, Animal, Insect, Animal. </p>
|
||||
|
||||
<p>When creating this type of question the items for the first list go into the
|
||||
Answer boxes and items for the second list go into the Response boxes. Once
|
||||
created a more sensible labeling scheme is shown. When the student
|
||||
successfully matches the items the jump on the first answer is used. An
|
||||
unsuccessful answer jumps to the page on the second answer. The question does
|
||||
<b>not</b> support custom responses, the student is told how many matches
|
||||
are correct or if all the matches are correct.</p>
|
||||
|
||||
<p>Unlike the Multichoice question where the choices are shown in a random
|
||||
order, the first list of items is <b>not</b> shuffled but shown in the same
|
||||
order as entered. This allows for <b>"Ordered"</b> questions to be
|
||||
constructed. Consider the question " Put the following into the order
|
||||
they were born, the earliest first" with the lists 1., 2., 3., 4. and
|
||||
Longfellow, Lawrence, Lowell, Larkin. The second list is shuffed before
|
||||
being used in the question, of course.</p></li>
|
||||
|
||||
<li><p><b>Numerical</b> This type of question requires a number as the answer.
|
||||
In it's simplest form it requires just one answer to be specified. For
|
||||
example "What is 2 plus 2?" with the answer 4 given a forward
|
||||
jump. However, it is better to specify a range because the internal rounding
|
||||
of numerical values can make single numeric comparisons rather hit or miss.
|
||||
Thus, if the question were "What is 10 divided by 3" it would be
|
||||
necessary to give the answer as <b>"Minimum:Maximum"</b>, that
|
||||
is <b>two</b> values separated by a colon (:). Thus if 3.33:3.34 is given as the
|
||||
acceptable range for the answer, then the answers 3.33, 3.333, 3.3333...
|
||||
would all be taken as correct answers. "Wrong" answers would
|
||||
include 3.3 (less than the minimum) and 3.4 (greater than the maximum).</p>
|
||||
|
||||
<p>More than one correct answer is allowed and the answers can be either single
|
||||
or pair of values. Note that the order in which the answers are tested is
|
||||
Answer 1, Answer 2... so some care needs to taken if the desired response
|
||||
is to appear. For example the question "When was Larkin born?"
|
||||
could have the single value of 1922, the exact answer, and the pair of
|
||||
values 1920:1929, the 20's, as the less exact answer.The order in which
|
||||
these values should be tested is, obviously, 1922 then 1920:1929. The
|
||||
first answer might have the response "That's exactly right"
|
||||
while the other answer's response might be "That's close, you've got
|
||||
the right decade"</p>
|
||||
|
||||
<p>Wrong answers can be given but depending on their actual range, care should
|
||||
be taken to place them after the correct answers. For example in adding the
|
||||
wrong answer 3:4 to the "10 divided by 3" question it needs to come
|
||||
after the correct answer. That is the answers are ordered 3.33:3.34 (the
|
||||
"correct" answer) then 3:4 (the "wrong" answer, but
|
||||
not wildly wrong answer!).</p></li>
|
||||
</ul>
|
||||
|
||||
|
||||
@@ -1,34 +1,34 @@
|
||||
<p align="center"><b>Upload groups</b></p>
|
||||
|
||||
<p>This facility allows the batch upload of groups into Moodle.</p>
|
||||
|
||||
|
||||
<ul>
|
||||
<li>Each line of the file contains one record</li>
|
||||
<li>Each record is a series of data separated by commas</li>
|
||||
<li>The first record of the file is special, and contains a list of fieldnames. This defines the format of the rest of the file.
|
||||
<blockquote>
|
||||
<p><strong>Required fieldnames:</strong> these fields must be included in the first record, and defined for each user</p>
|
||||
<p></p>
|
||||
<font color="#990000" face="Courier New, Courier, mono">groupname</font></p>
|
||||
</p>
|
||||
<p><strong>Default fieldnames:</strong> these are optional - if they are not included then the values are taken from the current language and current course</p>
|
||||
<p><font color="#990000" face="Courier New, Courier, mono">idnumber, coursename, lang</font> </p>
|
||||
<p><strong>Optional fieldnames: </strong>all of these are completely optional. </p>
|
||||
<p> <font color="#990000" face="Courier New, Courier, mono">description, picture, hidepicture</font></p>
|
||||
</blockquote>
|
||||
</li>
|
||||
<li>Commas within the data should be encoded as &#44 - the script will automatically decode these back to commas. </li>
|
||||
<li>For Boolean fields, use 0 for false and 1 for true. </li>
|
||||
<li>Either idnumber or coursename can be used to identify the course. Idnumber overrides coursename. If neither is specified, the groups will be added to the current course.
|
||||
<li>Coursename is the course shortname.</li>
|
||||
<li>Note: If a group is already registered in the Moodle database for a particular course, this script will return the
|
||||
group name for that group. Teachers are only allowed to upload groups in courses they are authorized to edit.</li>
|
||||
</ul>
|
||||
|
||||
<p>Here is an example of a valid import file:</p>
|
||||
<p><font size="-1" face="Courier New, Courier, mono"></font>groupname,idnumber,lang,description,picture <br />
|
||||
group1, Phil101, en, this group requires extra attention!, 0 <br />
|
||||
group2, Math243, , ,
|
||||
</font></p>
|
||||
|
||||
<p align="center"><b>Upload groups</b></p>
|
||||
|
||||
<p>This facility allows the batch upload of groups into Moodle.</p>
|
||||
|
||||
|
||||
<ul>
|
||||
<li>Each line of the file contains one record</li>
|
||||
<li>Each record is a series of data separated by commas</li>
|
||||
<li>The first record of the file is special, and contains a list of fieldnames. This defines the format of the rest of the file.
|
||||
<blockquote>
|
||||
<p><strong>Required fieldnames:</strong> these fields must be included in the first record, and defined for each user</p>
|
||||
<p></p>
|
||||
<font color="#990000" face="Courier New, Courier, mono">groupname</font></p>
|
||||
</p>
|
||||
<p><strong>Default fieldnames:</strong> these are optional - if they are not included then the values are taken from the current language and current course</p>
|
||||
<p><font color="#990000" face="Courier New, Courier, mono">idnumber, coursename, lang</font> </p>
|
||||
<p><strong>Optional fieldnames: </strong>all of these are completely optional. </p>
|
||||
<p> <font color="#990000" face="Courier New, Courier, mono">description, picture, hidepicture</font></p>
|
||||
</blockquote>
|
||||
</li>
|
||||
<li>Commas within the data should be encoded as &#44 - the script will automatically decode these back to commas. </li>
|
||||
<li>For Boolean fields, use 0 for false and 1 for true. </li>
|
||||
<li>Either idnumber or coursename can be used to identify the course. Idnumber overrides coursename. If neither is specified, the groups will be added to the current course.
|
||||
<li>Coursename is the course shortname.</li>
|
||||
<li>Note: If a group is already registered in the Moodle database for a particular course, this script will return the
|
||||
group name for that group. Teachers are only allowed to upload groups in courses they are authorized to edit.</li>
|
||||
</ul>
|
||||
|
||||
<p>Here is an example of a valid import file:</p>
|
||||
<p><font size="-1" face="Courier New, Courier, mono"></font>groupname,idnumber,lang,description,picture <br />
|
||||
group1, Phil101, en, this group requires extra attention!, 0 <br />
|
||||
group2, Math243, , ,
|
||||
</font></p>
|
||||
|
||||
|
||||
+28
-28
@@ -1,28 +1,28 @@
|
||||
<?php
|
||||
|
||||
$string['createSequence'] = 'Create new sequence';
|
||||
$string['editSequence'] = 'Edit selected sequence';
|
||||
$string['error'] = 'Sorry, an unknown error has occured.';
|
||||
$string['introduction'] = 'Introduction';
|
||||
$string['lams'] = '-- LAMS - Learning Activity Management System --';
|
||||
$string['lamsoutline'] = 'LAMS Outline';
|
||||
$string['lesson']="learning session";
|
||||
$string['modulename'] = 'LAMS';
|
||||
$string['modulenameplural'] = 'LAMS';
|
||||
$string['notsetup'] = 'NOT_SET_UP';
|
||||
$string['openauthor'] = 'Open LAMS Author';
|
||||
$string['openlearner'] = 'Open LAMS Learner';
|
||||
$string['openmonitor'] = 'Open LAMS Monitor';
|
||||
$string['refreshSequenceList'] = 'Refresh sequence list';
|
||||
$string['selectExistingSequence'] = 'Select an existing sequence or create a new sequence.';
|
||||
$string['sequence'] = 'Select Sequence';
|
||||
$string['serverid'] = 'Enter the server ID received from <a href=http://www.lamsinternational.com target=_blank>LAMS international</a>.';
|
||||
$string['serverkey'] = 'Enter the server key received from <a href=http://www.lamsinternational.com target=_blank>LAMS international</a>.';
|
||||
$string['serverurl'] = 'Enter the basic URL used to access the LAMS server. For example http://localhost:8080/lams';
|
||||
$string['useSequence'] = 'Use selected sequence';
|
||||
$string['visibletostudents'] = 'Show activity to students';
|
||||
$string['wikistartederror'] = 'Wiki already has entries - can\'t change.';
|
||||
$string['workspace'] = 'Select Workspace';
|
||||
$string['wrongversionrange'] = '$a is not a correct range!';
|
||||
|
||||
?>
|
||||
<?php
|
||||
|
||||
$string['createSequence'] = 'Create new sequence';
|
||||
$string['editSequence'] = 'Edit selected sequence';
|
||||
$string['error'] = 'Sorry, an unknown error has occured.';
|
||||
$string['introduction'] = 'Introduction';
|
||||
$string['lams'] = '-- LAMS - Learning Activity Management System --';
|
||||
$string['lamsoutline'] = 'LAMS Outline';
|
||||
$string['lesson']="learning session";
|
||||
$string['modulename'] = 'LAMS';
|
||||
$string['modulenameplural'] = 'LAMS';
|
||||
$string['notsetup'] = 'NOT_SET_UP';
|
||||
$string['openauthor'] = 'Open LAMS Author';
|
||||
$string['openlearner'] = 'Open LAMS Learner';
|
||||
$string['openmonitor'] = 'Open LAMS Monitor';
|
||||
$string['refreshSequenceList'] = 'Refresh sequence list';
|
||||
$string['selectExistingSequence'] = 'Select an existing sequence or create a new sequence.';
|
||||
$string['sequence'] = 'Select Sequence';
|
||||
$string['serverid'] = 'Enter the server ID received from <a href=http://www.lamsinternational.com target=_blank>LAMS international</a>.';
|
||||
$string['serverkey'] = 'Enter the server key received from <a href=http://www.lamsinternational.com target=_blank>LAMS international</a>.';
|
||||
$string['serverurl'] = 'Enter the basic URL used to access the LAMS server. For example http://localhost:8080/lams';
|
||||
$string['useSequence'] = 'Use selected sequence';
|
||||
$string['visibletostudents'] = 'Show activity to students';
|
||||
$string['wikistartederror'] = 'Wiki already has entries - can\'t change.';
|
||||
$string['workspace'] = 'Select Workspace';
|
||||
$string['wrongversionrange'] = '$a is not a correct range!';
|
||||
|
||||
?>
|
||||
|
||||
@@ -1,65 +1,65 @@
|
||||
|
||||
<?php
|
||||
// only display this help message if we are being forced to change
|
||||
if ($forcepassword) {
|
||||
notify( get_string('forcepasswordchangenotice') );
|
||||
}
|
||||
?>
|
||||
<p><b><?php print_string("allfieldsrequired") ?></b></p>
|
||||
<?php
|
||||
if (empty($frm->username)) {
|
||||
$frm->username = "";
|
||||
}
|
||||
if (empty($frm->password)) {
|
||||
$frm->password = "";
|
||||
}
|
||||
if (empty($frm->newpassword1)) {
|
||||
$frm->newpassword1 = "";
|
||||
}
|
||||
if (empty($frm->newpassword2)) {
|
||||
$frm->newpassword2 = "";
|
||||
}
|
||||
?>
|
||||
<form action="change_password.php" method="post" name="form" id="form">
|
||||
<table cellpadding="10">
|
||||
|
||||
<tr valign="top">
|
||||
<td><?php print_string("username") ?>:</td>
|
||||
<td>
|
||||
<?php if (has_capability('moodle/user:update',get_context_instance(CONTEXT_SYSTEM, SITEID)) || empty($frm->username)) { ?>
|
||||
<input type="text" name="username" size="25" value="<?php p($frm->username) ?>" alt="<?php print_string("username") ?>" />
|
||||
<?php } else { ?>
|
||||
<input type="hidden" name="username" value="<?php p($frm->username)?>" /> <?php p($frm->username)?>
|
||||
<?php } ?>
|
||||
<?php if (!empty($err->username)) { formerr($err->username); } ?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<?php if (!ihas_capability('moodle/user:update',get_context_instance(CONTEXT_SYSTEM, SITEID))) { ?>
|
||||
<tr valign="top">
|
||||
<td><?php print_string("oldpassword") ?>:</td>
|
||||
<td><input type="password" name="password" size="25" value="<?php p($frm->password) ?>" alt="<?php print_string("password") ?>" />
|
||||
<?php if (!empty($err->password)) { formerr($err->password); } ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
|
||||
<tr valign="top">
|
||||
<td><?php print_string("newpassword") ?>:</td>
|
||||
<td><input type="password" name="newpassword1" size="25" value="<?php p($frm->newpassword1) ?>" alt="<?php print_string("newpassword") ?>" />
|
||||
<?php if (!empty($err->newpassword1)) { formerr($err->newpassword1); } ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr valign="top">
|
||||
<td><?php print_string("newpassword") ?> (<?php print_string("again") ?>):</td>
|
||||
<td><input type="password" name="newpassword2" size="25" value="<?php p($frm->newpassword2) ?>" alt="<?php print_string("newpassword") ?> (<?php print_string("again") ?>)" />
|
||||
<?php if (!empty($err->newpassword2)) { formerr($err->newpassword2); } ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td><input type="hidden" name="id" value="<?php p($frm->id)?>" />
|
||||
<input type="submit" value="<?php print_string("changepassword") ?>" /></td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
|
||||
<?php
|
||||
// only display this help message if we are being forced to change
|
||||
if ($forcepassword) {
|
||||
notify( get_string('forcepasswordchangenotice') );
|
||||
}
|
||||
?>
|
||||
<p><b><?php print_string("allfieldsrequired") ?></b></p>
|
||||
<?php
|
||||
if (empty($frm->username)) {
|
||||
$frm->username = "";
|
||||
}
|
||||
if (empty($frm->password)) {
|
||||
$frm->password = "";
|
||||
}
|
||||
if (empty($frm->newpassword1)) {
|
||||
$frm->newpassword1 = "";
|
||||
}
|
||||
if (empty($frm->newpassword2)) {
|
||||
$frm->newpassword2 = "";
|
||||
}
|
||||
?>
|
||||
<form action="change_password.php" method="post" name="form" id="form">
|
||||
<table cellpadding="10">
|
||||
|
||||
<tr valign="top">
|
||||
<td><?php print_string("username") ?>:</td>
|
||||
<td>
|
||||
<?php if (has_capability('moodle/user:update',get_context_instance(CONTEXT_SYSTEM, SITEID)) || empty($frm->username)) { ?>
|
||||
<input type="text" name="username" size="25" value="<?php p($frm->username) ?>" alt="<?php print_string("username") ?>" />
|
||||
<?php } else { ?>
|
||||
<input type="hidden" name="username" value="<?php p($frm->username)?>" /> <?php p($frm->username)?>
|
||||
<?php } ?>
|
||||
<?php if (!empty($err->username)) { formerr($err->username); } ?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<?php if (!ihas_capability('moodle/user:update',get_context_instance(CONTEXT_SYSTEM, SITEID))) { ?>
|
||||
<tr valign="top">
|
||||
<td><?php print_string("oldpassword") ?>:</td>
|
||||
<td><input type="password" name="password" size="25" value="<?php p($frm->password) ?>" alt="<?php print_string("password") ?>" />
|
||||
<?php if (!empty($err->password)) { formerr($err->password); } ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
|
||||
<tr valign="top">
|
||||
<td><?php print_string("newpassword") ?>:</td>
|
||||
<td><input type="password" name="newpassword1" size="25" value="<?php p($frm->newpassword1) ?>" alt="<?php print_string("newpassword") ?>" />
|
||||
<?php if (!empty($err->newpassword1)) { formerr($err->newpassword1); } ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr valign="top">
|
||||
<td><?php print_string("newpassword") ?> (<?php print_string("again") ?>):</td>
|
||||
<td><input type="password" name="newpassword2" size="25" value="<?php p($frm->newpassword2) ?>" alt="<?php print_string("newpassword") ?> (<?php print_string("again") ?>)" />
|
||||
<?php if (!empty($err->newpassword2)) { formerr($err->newpassword2); } ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td><input type="hidden" name="id" value="<?php p($frm->id)?>" />
|
||||
<input type="submit" value="<?php print_string("changepassword") ?>" /></td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
|
||||
@@ -1,82 +1,82 @@
|
||||
<?php
|
||||
if (empty($form->resubmit)) {
|
||||
$form->resubmit = 0; //upload&rev: =1
|
||||
}
|
||||
if (empty($form->maxbytes)) {
|
||||
$form->maxbytes = $CFG->assignment_maxbytes;
|
||||
}
|
||||
if (empty($form->emailteachers)) {
|
||||
$form->emailteachers = '';
|
||||
}
|
||||
//allow multiple files (from new upload type)
|
||||
if (empty($form->var1)) {
|
||||
$form->var1 = 0;
|
||||
}
|
||||
//email to students (from upload&review)
|
||||
if (empty($form->var2)) {
|
||||
$form->var2 = '';
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<table align="center" cellpadding="5" cellspacing="0">
|
||||
|
||||
<tr valign="top">
|
||||
<td align="right"><b><?php print_string("maximumsize", "assignment") ?>:</b></td>
|
||||
<td>
|
||||
<?php
|
||||
$choices = get_max_upload_sizes($CFG->maxbytes, $this->course->maxbytes);
|
||||
choose_from_menu ($choices, "maxbytes", $form->maxbytes, "");
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right"><b><?php print_string("allowmultiple", "assignment") ?>:</b></td>
|
||||
<td>
|
||||
<?php
|
||||
$options[0] = get_string("no"); $options[1] = get_string("yes");
|
||||
choose_from_menu($options, "var1", $form->var1, "");
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td align="right"><b><?php print_string("allowresubmit", "assignment") ?>:</b></td>
|
||||
<td>
|
||||
<?php
|
||||
$options[0] = get_string("no"); $options[1] = get_string("yes");
|
||||
choose_from_menu($options, "resubmit", $form->resubmit, ""); //that's how it's un U&R
|
||||
// choose_from_menu($options, "var2", $form->var2, "");
|
||||
helpbutton("resubmit", get_string("allowresubmit", "assignment"), "assignment");
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td align="right"><b><?php print_string("emailteachers", "assignment") ?>:</b></td>
|
||||
<td>
|
||||
<?php
|
||||
$options[0] = get_string("no"); $options[1] = get_string("yes");
|
||||
choose_from_menu($options, "emailteachers", $form->emailteachers, "");
|
||||
helpbutton("emailteachers", get_string("emailteachers", "assignment"), "assignment");
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right"><b><?php print_string("emailstudents", "assignment") ?>:</b></td>
|
||||
<td>
|
||||
<?php
|
||||
$options[0] = get_string("no"); $options[1] = get_string("yes");
|
||||
choose_from_menu($options, "var2", $form->var2, "");
|
||||
// choose_from_menu($options, "emailstudents", $form->emailstudents, "");
|
||||
helpbutton("emailstudents", get_string("emailstudents", "assignment"), "assignment");
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
|
||||
<center>
|
||||
<br />
|
||||
<input type="submit" value="<?php print_string("continue") ?>" />
|
||||
</center>
|
||||
<?php
|
||||
if (empty($form->resubmit)) {
|
||||
$form->resubmit = 0; //upload&rev: =1
|
||||
}
|
||||
if (empty($form->maxbytes)) {
|
||||
$form->maxbytes = $CFG->assignment_maxbytes;
|
||||
}
|
||||
if (empty($form->emailteachers)) {
|
||||
$form->emailteachers = '';
|
||||
}
|
||||
//allow multiple files (from new upload type)
|
||||
if (empty($form->var1)) {
|
||||
$form->var1 = 0;
|
||||
}
|
||||
//email to students (from upload&review)
|
||||
if (empty($form->var2)) {
|
||||
$form->var2 = '';
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<table align="center" cellpadding="5" cellspacing="0">
|
||||
|
||||
<tr valign="top">
|
||||
<td align="right"><b><?php print_string("maximumsize", "assignment") ?>:</b></td>
|
||||
<td>
|
||||
<?php
|
||||
$choices = get_max_upload_sizes($CFG->maxbytes, $this->course->maxbytes);
|
||||
choose_from_menu ($choices, "maxbytes", $form->maxbytes, "");
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right"><b><?php print_string("allowmultiple", "assignment") ?>:</b></td>
|
||||
<td>
|
||||
<?php
|
||||
$options[0] = get_string("no"); $options[1] = get_string("yes");
|
||||
choose_from_menu($options, "var1", $form->var1, "");
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td align="right"><b><?php print_string("allowresubmit", "assignment") ?>:</b></td>
|
||||
<td>
|
||||
<?php
|
||||
$options[0] = get_string("no"); $options[1] = get_string("yes");
|
||||
choose_from_menu($options, "resubmit", $form->resubmit, ""); //that's how it's un U&R
|
||||
// choose_from_menu($options, "var2", $form->var2, "");
|
||||
helpbutton("resubmit", get_string("allowresubmit", "assignment"), "assignment");
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td align="right"><b><?php print_string("emailteachers", "assignment") ?>:</b></td>
|
||||
<td>
|
||||
<?php
|
||||
$options[0] = get_string("no"); $options[1] = get_string("yes");
|
||||
choose_from_menu($options, "emailteachers", $form->emailteachers, "");
|
||||
helpbutton("emailteachers", get_string("emailteachers", "assignment"), "assignment");
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right"><b><?php print_string("emailstudents", "assignment") ?>:</b></td>
|
||||
<td>
|
||||
<?php
|
||||
$options[0] = get_string("no"); $options[1] = get_string("yes");
|
||||
choose_from_menu($options, "var2", $form->var2, "");
|
||||
// choose_from_menu($options, "emailstudents", $form->emailstudents, "");
|
||||
helpbutton("emailstudents", get_string("emailstudents", "assignment"), "assignment");
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
|
||||
<center>
|
||||
<br />
|
||||
<input type="submit" value="<?php print_string("continue") ?>" />
|
||||
</center>
|
||||
|
||||
+133
-133
@@ -1,133 +1,133 @@
|
||||
rem
|
||||
rem Table structure for table chat
|
||||
rem
|
||||
|
||||
drop TABLE prefix_chat;
|
||||
CREATE TABLE prefix_chat (
|
||||
id number(10) primary key,
|
||||
course number(10) default '0' not null,
|
||||
name varchar2(255) default '' not null,
|
||||
intro varchar2(1024) NOT NULL,
|
||||
keepdays number(11) default '0' not null,
|
||||
studentlogs number(4) default '0' not null,
|
||||
chattime number(10) default '0' not null,
|
||||
schedule number(4) default '0' not null,
|
||||
timemodified number(10) default '0' not null
|
||||
);
|
||||
|
||||
|
||||
COMMENT on table prefix_chat is 'Each of these is a chat room';
|
||||
|
||||
drop sequence p_chat_seq;
|
||||
create sequence p_chat_seq;
|
||||
|
||||
create or replace trigger p_chat_trig
|
||||
before insert on prefix_chat
|
||||
referencing new as new_row
|
||||
for each row
|
||||
begin
|
||||
select p_chat_seq.nextval into :new_row.id from dual;
|
||||
end;
|
||||
.
|
||||
/
|
||||
|
||||
insert into prefix_chat(course,name,intro,keepdays,studentlogs,chattime,schedule,timemodified) values(1,'name 1','intro 1',1,1,1,1,1);
|
||||
insert into prefix_chat(course,name,intro,keepdays,studentlogs,chattime,schedule,timemodified) values(2,'name 2','intro 2',2,2,2,2,2);
|
||||
insert into prefix_chat(course,name,intro,keepdays,studentlogs,chattime,schedule,timemodified) values(3,'name 3','intro 3',3,3,3,3,3);
|
||||
insert into prefix_chat(course,name,intro,keepdays,studentlogs,chattime,schedule,timemodified) values(4,'name 4','intro 4',4,4,4,4,4);
|
||||
|
||||
select * from prefix_chat;
|
||||
|
||||
rem --------------------------------------------------------
|
||||
rem
|
||||
rem Table structure for table chat_messages
|
||||
rem
|
||||
|
||||
drop TABLE prefix_chat_messages;
|
||||
CREATE TABLE prefix_chat_messages (
|
||||
id number(10) primary key,
|
||||
chatid number(10) default '0' not null,
|
||||
userid number(10) default '0' not null,
|
||||
system number(1) default '0' not null,
|
||||
message varchar2(1024) NOT NULL,
|
||||
timestamp number(10) default '0' not null
|
||||
);
|
||||
|
||||
COMMENT on table prefix_chat_messages is 'Stores all the actual chat messages';
|
||||
|
||||
create index timemodifiedchat on prefix_chat_messages(timestamp,chatid);
|
||||
|
||||
drop sequence p_chat_messages_seq;
|
||||
create sequence p_chat_messages_seq;
|
||||
|
||||
create or replace trigger p_chat_messages_trig
|
||||
before insert on prefix_chat_messages
|
||||
referencing new as new_row
|
||||
for each row
|
||||
begin
|
||||
select p_chat_messages_seq.nextval into :new_row.id from dual;
|
||||
end;
|
||||
.
|
||||
/
|
||||
|
||||
insert into prefix_chat_messages (chatid,userid,system,message,timestamp) values(1,1,1,'message1',1);
|
||||
insert into prefix_chat_messages (chatid,userid,system,message,timestamp) values(2,2,2,'message2',2);
|
||||
insert into prefix_chat_messages (chatid,userid,system,message,timestamp) values(3,3,3,'message3',3);
|
||||
insert into prefix_chat_messages (chatid,userid,system,message,timestamp) values(4,4,4,'message4',4);
|
||||
|
||||
select * from prefix_chat_messages;
|
||||
|
||||
rem --------------------------------------------------------
|
||||
|
||||
rem
|
||||
rem Table structure for table chat_users
|
||||
rem
|
||||
|
||||
drop TABLE prefix_chat_users;
|
||||
CREATE TABLE prefix_chat_users (
|
||||
id number(10) primary key,
|
||||
chatid number(11) default '0' not null,
|
||||
userid number(11) default '0' not null,
|
||||
version varchar2(16) default '' not null,
|
||||
ip varchar2(15) default '' not null,
|
||||
firstping number(10) default '0' not null,
|
||||
lastping number(10) default '0' not null,
|
||||
lastmessageping number(10) default '0' not null,
|
||||
sid varchar2(32) default '' not null,
|
||||
course number(10) default '0' not null,
|
||||
lang varchar2(10) default '' not null
|
||||
);
|
||||
|
||||
create index userid on prefix_chat_users(userid);
|
||||
create index lastping on prefix_chat_users(lastping);
|
||||
|
||||
drop sequence p_chat_users_seq;
|
||||
create sequence p_chat_users_seq;
|
||||
|
||||
create or replace trigger p_chat_users_trig
|
||||
before insert on prefix_chat_users
|
||||
referencing new as new_row
|
||||
for each row
|
||||
begin
|
||||
select p_chat_users_seq.nextval into :new_row.id from dual;
|
||||
end;
|
||||
.
|
||||
/
|
||||
|
||||
COMMENT on table prefix_chat_users is 'Keeps track of which users are in which chat rooms';
|
||||
|
||||
insert into prefix_chat_users (chatid,userid,version,ip,firstping,lastping,lastmessageping,sid) values(1,1,'version1','ip1',1,1,1,'sid1');
|
||||
insert into prefix_chat_users (chatid,userid,version,ip,firstping,lastping,lastmessageping,sid) values(2,2,'version2','ip2',2,2,2,'sid2');
|
||||
insert into prefix_chat_users (chatid,userid,version,ip,firstping,lastping,lastmessageping,sid) values(3,3,'version3','ip3',3,3,3,'sid3');
|
||||
insert into prefix_chat_users (chatid,userid,version,ip,firstping,lastping,lastmessageping,sid) values(4,4,'version4','ip4',4,4,4,'sid4');
|
||||
|
||||
select * from prefix_chat_users;
|
||||
|
||||
delete from prefix_log_display where module='chat';
|
||||
|
||||
INSERT INTO prefix_log_display (module, action, mtable, field) VALUES ('chat', 'view', 'chat', 'name');
|
||||
INSERT INTO prefix_log_display (module, action, mtable, field) VALUES ('chat', 'add', 'chat', 'name');
|
||||
INSERT INTO prefix_log_display (module, action, mtable, field) VALUES ('chat', 'update', 'chat', 'name');
|
||||
INSERT INTO prefix_log_display (module, action, mtable, field) VALUES ('chat', 'report', 'chat', 'name');
|
||||
|
||||
select * from prefix_log_display where module='chat' order by 1,2,3,4;
|
||||
rem
|
||||
rem Table structure for table chat
|
||||
rem
|
||||
|
||||
drop TABLE prefix_chat;
|
||||
CREATE TABLE prefix_chat (
|
||||
id number(10) primary key,
|
||||
course number(10) default '0' not null,
|
||||
name varchar2(255) default '' not null,
|
||||
intro varchar2(1024) NOT NULL,
|
||||
keepdays number(11) default '0' not null,
|
||||
studentlogs number(4) default '0' not null,
|
||||
chattime number(10) default '0' not null,
|
||||
schedule number(4) default '0' not null,
|
||||
timemodified number(10) default '0' not null
|
||||
);
|
||||
|
||||
|
||||
COMMENT on table prefix_chat is 'Each of these is a chat room';
|
||||
|
||||
drop sequence p_chat_seq;
|
||||
create sequence p_chat_seq;
|
||||
|
||||
create or replace trigger p_chat_trig
|
||||
before insert on prefix_chat
|
||||
referencing new as new_row
|
||||
for each row
|
||||
begin
|
||||
select p_chat_seq.nextval into :new_row.id from dual;
|
||||
end;
|
||||
.
|
||||
/
|
||||
|
||||
insert into prefix_chat(course,name,intro,keepdays,studentlogs,chattime,schedule,timemodified) values(1,'name 1','intro 1',1,1,1,1,1);
|
||||
insert into prefix_chat(course,name,intro,keepdays,studentlogs,chattime,schedule,timemodified) values(2,'name 2','intro 2',2,2,2,2,2);
|
||||
insert into prefix_chat(course,name,intro,keepdays,studentlogs,chattime,schedule,timemodified) values(3,'name 3','intro 3',3,3,3,3,3);
|
||||
insert into prefix_chat(course,name,intro,keepdays,studentlogs,chattime,schedule,timemodified) values(4,'name 4','intro 4',4,4,4,4,4);
|
||||
|
||||
select * from prefix_chat;
|
||||
|
||||
rem --------------------------------------------------------
|
||||
rem
|
||||
rem Table structure for table chat_messages
|
||||
rem
|
||||
|
||||
drop TABLE prefix_chat_messages;
|
||||
CREATE TABLE prefix_chat_messages (
|
||||
id number(10) primary key,
|
||||
chatid number(10) default '0' not null,
|
||||
userid number(10) default '0' not null,
|
||||
system number(1) default '0' not null,
|
||||
message varchar2(1024) NOT NULL,
|
||||
timestamp number(10) default '0' not null
|
||||
);
|
||||
|
||||
COMMENT on table prefix_chat_messages is 'Stores all the actual chat messages';
|
||||
|
||||
create index timemodifiedchat on prefix_chat_messages(timestamp,chatid);
|
||||
|
||||
drop sequence p_chat_messages_seq;
|
||||
create sequence p_chat_messages_seq;
|
||||
|
||||
create or replace trigger p_chat_messages_trig
|
||||
before insert on prefix_chat_messages
|
||||
referencing new as new_row
|
||||
for each row
|
||||
begin
|
||||
select p_chat_messages_seq.nextval into :new_row.id from dual;
|
||||
end;
|
||||
.
|
||||
/
|
||||
|
||||
insert into prefix_chat_messages (chatid,userid,system,message,timestamp) values(1,1,1,'message1',1);
|
||||
insert into prefix_chat_messages (chatid,userid,system,message,timestamp) values(2,2,2,'message2',2);
|
||||
insert into prefix_chat_messages (chatid,userid,system,message,timestamp) values(3,3,3,'message3',3);
|
||||
insert into prefix_chat_messages (chatid,userid,system,message,timestamp) values(4,4,4,'message4',4);
|
||||
|
||||
select * from prefix_chat_messages;
|
||||
|
||||
rem --------------------------------------------------------
|
||||
|
||||
rem
|
||||
rem Table structure for table chat_users
|
||||
rem
|
||||
|
||||
drop TABLE prefix_chat_users;
|
||||
CREATE TABLE prefix_chat_users (
|
||||
id number(10) primary key,
|
||||
chatid number(11) default '0' not null,
|
||||
userid number(11) default '0' not null,
|
||||
version varchar2(16) default '' not null,
|
||||
ip varchar2(15) default '' not null,
|
||||
firstping number(10) default '0' not null,
|
||||
lastping number(10) default '0' not null,
|
||||
lastmessageping number(10) default '0' not null,
|
||||
sid varchar2(32) default '' not null,
|
||||
course number(10) default '0' not null,
|
||||
lang varchar2(10) default '' not null
|
||||
);
|
||||
|
||||
create index userid on prefix_chat_users(userid);
|
||||
create index lastping on prefix_chat_users(lastping);
|
||||
|
||||
drop sequence p_chat_users_seq;
|
||||
create sequence p_chat_users_seq;
|
||||
|
||||
create or replace trigger p_chat_users_trig
|
||||
before insert on prefix_chat_users
|
||||
referencing new as new_row
|
||||
for each row
|
||||
begin
|
||||
select p_chat_users_seq.nextval into :new_row.id from dual;
|
||||
end;
|
||||
.
|
||||
/
|
||||
|
||||
COMMENT on table prefix_chat_users is 'Keeps track of which users are in which chat rooms';
|
||||
|
||||
insert into prefix_chat_users (chatid,userid,version,ip,firstping,lastping,lastmessageping,sid) values(1,1,'version1','ip1',1,1,1,'sid1');
|
||||
insert into prefix_chat_users (chatid,userid,version,ip,firstping,lastping,lastmessageping,sid) values(2,2,'version2','ip2',2,2,2,'sid2');
|
||||
insert into prefix_chat_users (chatid,userid,version,ip,firstping,lastping,lastmessageping,sid) values(3,3,'version3','ip3',3,3,3,'sid3');
|
||||
insert into prefix_chat_users (chatid,userid,version,ip,firstping,lastping,lastmessageping,sid) values(4,4,'version4','ip4',4,4,4,'sid4');
|
||||
|
||||
select * from prefix_chat_users;
|
||||
|
||||
delete from prefix_log_display where module='chat';
|
||||
|
||||
INSERT INTO prefix_log_display (module, action, mtable, field) VALUES ('chat', 'view', 'chat', 'name');
|
||||
INSERT INTO prefix_log_display (module, action, mtable, field) VALUES ('chat', 'add', 'chat', 'name');
|
||||
INSERT INTO prefix_log_display (module, action, mtable, field) VALUES ('chat', 'update', 'chat', 'name');
|
||||
INSERT INTO prefix_log_display (module, action, mtable, field) VALUES ('chat', 'report', 'chat', 'name');
|
||||
|
||||
select * from prefix_log_display where module='chat' order by 1,2,3,4;
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
<html>
|
||||
<body>
|
||||
<html>
|
||||
<body>
|
||||
|
||||
@@ -1,72 +1,72 @@
|
||||
<?php // $Id$
|
||||
|
||||
$nomoodlecookie = true; // Session not needed!
|
||||
|
||||
require('../../../config.php');
|
||||
require('../lib.php');
|
||||
|
||||
$chat_sid = required_param('chat_sid', PARAM_ALPHANUM);
|
||||
|
||||
if (!$chatuser = get_record('chat_users', 'sid', $chat_sid)) {
|
||||
error('Not logged in!');
|
||||
}
|
||||
|
||||
chat_force_language($chatuser->lang);
|
||||
|
||||
ob_start();
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
<!--
|
||||
|
||||
scroll_active = true;
|
||||
function empty_field_and_submit() {
|
||||
var cf = document.getElementById('sendform');
|
||||
var inpf = document.getElementById('inputform');
|
||||
cf.chat_msgidnr.value = parseInt(cf.chat_msgidnr.value) + 1;
|
||||
cf.chat_message.value = inpf.chat_message.value;
|
||||
inpf.chat_message.value='';
|
||||
cf.submit();
|
||||
inpf.chat_message.focus();
|
||||
return false;
|
||||
}
|
||||
function prepareusers() {
|
||||
var frm = window.parent.frames;
|
||||
for(i = 0; i < frm.length; ++i) {
|
||||
if(frm[i].name == "users") {
|
||||
window.userFrame = frm[i];
|
||||
window.userHREF = frm[i].location.href;
|
||||
window.setTimeout("reloadusers();", <?php echo $CFG->chat_refresh_userlist; ?> * 1000);
|
||||
}
|
||||
}
|
||||
}
|
||||
function reloadusers() {
|
||||
if(window.userFrame) {
|
||||
window.userFrame.location.href = window.userFrame.location.href;
|
||||
window.setTimeout("reloadusers();", <?php echo $CFG->chat_refresh_userlist; ?> * 1000);
|
||||
}
|
||||
}
|
||||
// -->
|
||||
</script>
|
||||
<?php
|
||||
|
||||
$meta = ob_get_clean();
|
||||
// TODO: there will be two onload in body tag, does it matter?
|
||||
print_header('', '', '', 'inputform.chat_message', $meta, false, ' ', '', false, 'onload="setfocus(); prepareusers();"');
|
||||
|
||||
?>
|
||||
|
||||
<form action="../empty.php" method="get" target="empty" id="inputform"
|
||||
onsubmit="return empty_field_and_submit();">
|
||||
>><input type="text" name="chat_message" size="60" value="" />
|
||||
<?php helpbutton("chatting", get_string("helpchatting", "chat"), "chat", true, false); ?>
|
||||
</form>
|
||||
|
||||
<form action="<?php echo "http://$CFG->chat_serverhost:$CFG->chat_serverport/"; ?>" method="get" target="empty" id="sendform">
|
||||
<input type="hidden" name="win" value="message" />
|
||||
<input type="hidden" name="chat_message" value="" />
|
||||
<input type="hidden" name="chat_msgidnr" value="0" />
|
||||
<input type="hidden" name="chat_sid" value="<?php echo $chat_sid ?>" />
|
||||
</form>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
<?php // $Id$
|
||||
|
||||
$nomoodlecookie = true; // Session not needed!
|
||||
|
||||
require('../../../config.php');
|
||||
require('../lib.php');
|
||||
|
||||
$chat_sid = required_param('chat_sid', PARAM_ALPHANUM);
|
||||
|
||||
if (!$chatuser = get_record('chat_users', 'sid', $chat_sid)) {
|
||||
error('Not logged in!');
|
||||
}
|
||||
|
||||
chat_force_language($chatuser->lang);
|
||||
|
||||
ob_start();
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
<!--
|
||||
|
||||
scroll_active = true;
|
||||
function empty_field_and_submit() {
|
||||
var cf = document.getElementById('sendform');
|
||||
var inpf = document.getElementById('inputform');
|
||||
cf.chat_msgidnr.value = parseInt(cf.chat_msgidnr.value) + 1;
|
||||
cf.chat_message.value = inpf.chat_message.value;
|
||||
inpf.chat_message.value='';
|
||||
cf.submit();
|
||||
inpf.chat_message.focus();
|
||||
return false;
|
||||
}
|
||||
function prepareusers() {
|
||||
var frm = window.parent.frames;
|
||||
for(i = 0; i < frm.length; ++i) {
|
||||
if(frm[i].name == "users") {
|
||||
window.userFrame = frm[i];
|
||||
window.userHREF = frm[i].location.href;
|
||||
window.setTimeout("reloadusers();", <?php echo $CFG->chat_refresh_userlist; ?> * 1000);
|
||||
}
|
||||
}
|
||||
}
|
||||
function reloadusers() {
|
||||
if(window.userFrame) {
|
||||
window.userFrame.location.href = window.userFrame.location.href;
|
||||
window.setTimeout("reloadusers();", <?php echo $CFG->chat_refresh_userlist; ?> * 1000);
|
||||
}
|
||||
}
|
||||
// -->
|
||||
</script>
|
||||
<?php
|
||||
|
||||
$meta = ob_get_clean();
|
||||
// TODO: there will be two onload in body tag, does it matter?
|
||||
print_header('', '', '', 'inputform.chat_message', $meta, false, ' ', '', false, 'onload="setfocus(); prepareusers();"');
|
||||
|
||||
?>
|
||||
|
||||
<form action="../empty.php" method="get" target="empty" id="inputform"
|
||||
onsubmit="return empty_field_and_submit();">
|
||||
>><input type="text" name="chat_message" size="60" value="" />
|
||||
<?php helpbutton("chatting", get_string("helpchatting", "chat"), "chat", true, false); ?>
|
||||
</form>
|
||||
|
||||
<form action="<?php echo "http://$CFG->chat_serverhost:$CFG->chat_serverport/"; ?>" method="get" target="empty" id="sendform">
|
||||
<input type="hidden" name="win" value="message" />
|
||||
<input type="hidden" name="chat_message" value="" />
|
||||
<input type="hidden" name="chat_msgidnr" value="0" />
|
||||
<input type="hidden" name="chat_sid" value="<?php echo $chat_sid ?>" />
|
||||
</form>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
||||
+93
-93
@@ -1,93 +1,93 @@
|
||||
rem
|
||||
rem Table structure for table choice
|
||||
rem
|
||||
|
||||
drop TABLE prefix_choice;
|
||||
CREATE TABLE prefix_choice (
|
||||
id number(10) primary key,
|
||||
course number(10) default '0' not null,
|
||||
name varchar2(255) default '' not null,
|
||||
text varchar2(1024) NOT NULL,
|
||||
format number(2) default '0' not null,
|
||||
answer1 varchar2(255) default 'Yes' not null,
|
||||
answer2 varchar2(255) default 'No' not null,
|
||||
answer3 varchar2(255) default NULL,
|
||||
answer4 varchar2(255) default NULL,
|
||||
answer5 varchar2(255) default NULL,
|
||||
answer6 varchar2(255) default NULL,
|
||||
publish number(2) default '0' not null,
|
||||
timemodified number(10) default '0' not null
|
||||
);
|
||||
|
||||
COMMENT on table prefix_choice is 'Available choices are stored here.';
|
||||
|
||||
drop sequence p_choice_seq;
|
||||
create sequence p_choice_seq;
|
||||
|
||||
create or replace trigger p_choice_trig
|
||||
before insert on prefix_choice
|
||||
referencing new as new_row
|
||||
for each row
|
||||
begin
|
||||
select p_choice_seq.nextval into :new_row.id from dual;
|
||||
end;
|
||||
.
|
||||
/
|
||||
|
||||
insert into prefix_choice(course,name,text,format,answer1,answer2,answer3,answer4,answer5,answer6,publish,timemodified) values(1,'name1','text1',1,'1','1','1','1','1','1',1,1);
|
||||
insert into prefix_choice(course,name,text,format,answer1,answer2,answer3,answer4,answer5,answer6,publish,timemodified) values(2,'name2','text2',2,'2','2','2','2','2','2',2,2);
|
||||
insert into prefix_choice(course,name,text,format,answer1,answer2,answer3,answer4,answer5,answer6,publish,timemodified) values(3,'name3','text3',3,'3','3','3','3','3','3',3,3);
|
||||
insert into prefix_choice(course,name,text,format,answer1,answer2,answer3,answer4,answer5,answer6,publish,timemodified) values(4,'name4','text4',4,'4','4','4','4','4','4',4,4);
|
||||
|
||||
select * from prefix_choice order by 1,2;
|
||||
|
||||
rem --------------------------------------------------------
|
||||
|
||||
rem
|
||||
rem Table structure for table choice_answers
|
||||
rem
|
||||
|
||||
drop TABLE prefix_choice_answers;
|
||||
CREATE TABLE prefix_choice_answers (
|
||||
id number(10) primary key,
|
||||
choice number(10) default '0' not null,
|
||||
userid number(10) default '0' not null,
|
||||
answer number(4) default '0' not null,
|
||||
timemodified number(10) default '0' not null
|
||||
);
|
||||
|
||||
comment on table prefix_choice_answers is 'Answers for each choice';
|
||||
|
||||
drop sequence p_choice_answers_seq;
|
||||
create sequence p_choice_answers_seq;
|
||||
|
||||
create or replace trigger p_choice_answers_trig
|
||||
before insert on prefix_choice_answers
|
||||
referencing new as new_row
|
||||
for each row
|
||||
begin
|
||||
select p_choice_answers_seq.nextval into :new_row.id from dual;
|
||||
end;
|
||||
.
|
||||
/
|
||||
|
||||
insert into prefix_choice_answers (choice,userid,answer,timemodified) values(1,1,1,1);
|
||||
insert into prefix_choice_answers (choice,userid,answer,timemodified) values(2,2,2,2);
|
||||
insert into prefix_choice_answers (choice,userid,answer,timemodified) values(3,3,3,3);
|
||||
insert into prefix_choice_answers (choice,userid,answer,timemodified) values(4,4,4,4);
|
||||
|
||||
select * from prefix_choice_answers order by 1,2;
|
||||
|
||||
rem
|
||||
rem Dumping data for table log_display
|
||||
rem
|
||||
|
||||
delete from prefix_log_display where module = 'choice';
|
||||
INSERT INTO prefix_log_display (module, action, mtable, field) VALUES ('choice', 'view', 'choice', 'name');
|
||||
INSERT INTO prefix_log_display (module, action, mtable, field) VALUES ('choice', 'update', 'choice', 'name');
|
||||
INSERT INTO prefix_log_display (module, action, mtable, field) VALUES ('choice', 'add', 'choice', 'name');
|
||||
INSERT INTO prefix_log_display (module, action, mtable, field) VALUES ('choice', 'report', 'choice', 'name');
|
||||
|
||||
|
||||
|
||||
|
||||
rem
|
||||
rem Table structure for table choice
|
||||
rem
|
||||
|
||||
drop TABLE prefix_choice;
|
||||
CREATE TABLE prefix_choice (
|
||||
id number(10) primary key,
|
||||
course number(10) default '0' not null,
|
||||
name varchar2(255) default '' not null,
|
||||
text varchar2(1024) NOT NULL,
|
||||
format number(2) default '0' not null,
|
||||
answer1 varchar2(255) default 'Yes' not null,
|
||||
answer2 varchar2(255) default 'No' not null,
|
||||
answer3 varchar2(255) default NULL,
|
||||
answer4 varchar2(255) default NULL,
|
||||
answer5 varchar2(255) default NULL,
|
||||
answer6 varchar2(255) default NULL,
|
||||
publish number(2) default '0' not null,
|
||||
timemodified number(10) default '0' not null
|
||||
);
|
||||
|
||||
COMMENT on table prefix_choice is 'Available choices are stored here.';
|
||||
|
||||
drop sequence p_choice_seq;
|
||||
create sequence p_choice_seq;
|
||||
|
||||
create or replace trigger p_choice_trig
|
||||
before insert on prefix_choice
|
||||
referencing new as new_row
|
||||
for each row
|
||||
begin
|
||||
select p_choice_seq.nextval into :new_row.id from dual;
|
||||
end;
|
||||
.
|
||||
/
|
||||
|
||||
insert into prefix_choice(course,name,text,format,answer1,answer2,answer3,answer4,answer5,answer6,publish,timemodified) values(1,'name1','text1',1,'1','1','1','1','1','1',1,1);
|
||||
insert into prefix_choice(course,name,text,format,answer1,answer2,answer3,answer4,answer5,answer6,publish,timemodified) values(2,'name2','text2',2,'2','2','2','2','2','2',2,2);
|
||||
insert into prefix_choice(course,name,text,format,answer1,answer2,answer3,answer4,answer5,answer6,publish,timemodified) values(3,'name3','text3',3,'3','3','3','3','3','3',3,3);
|
||||
insert into prefix_choice(course,name,text,format,answer1,answer2,answer3,answer4,answer5,answer6,publish,timemodified) values(4,'name4','text4',4,'4','4','4','4','4','4',4,4);
|
||||
|
||||
select * from prefix_choice order by 1,2;
|
||||
|
||||
rem --------------------------------------------------------
|
||||
|
||||
rem
|
||||
rem Table structure for table choice_answers
|
||||
rem
|
||||
|
||||
drop TABLE prefix_choice_answers;
|
||||
CREATE TABLE prefix_choice_answers (
|
||||
id number(10) primary key,
|
||||
choice number(10) default '0' not null,
|
||||
userid number(10) default '0' not null,
|
||||
answer number(4) default '0' not null,
|
||||
timemodified number(10) default '0' not null
|
||||
);
|
||||
|
||||
comment on table prefix_choice_answers is 'Answers for each choice';
|
||||
|
||||
drop sequence p_choice_answers_seq;
|
||||
create sequence p_choice_answers_seq;
|
||||
|
||||
create or replace trigger p_choice_answers_trig
|
||||
before insert on prefix_choice_answers
|
||||
referencing new as new_row
|
||||
for each row
|
||||
begin
|
||||
select p_choice_answers_seq.nextval into :new_row.id from dual;
|
||||
end;
|
||||
.
|
||||
/
|
||||
|
||||
insert into prefix_choice_answers (choice,userid,answer,timemodified) values(1,1,1,1);
|
||||
insert into prefix_choice_answers (choice,userid,answer,timemodified) values(2,2,2,2);
|
||||
insert into prefix_choice_answers (choice,userid,answer,timemodified) values(3,3,3,3);
|
||||
insert into prefix_choice_answers (choice,userid,answer,timemodified) values(4,4,4,4);
|
||||
|
||||
select * from prefix_choice_answers order by 1,2;
|
||||
|
||||
rem
|
||||
rem Dumping data for table log_display
|
||||
rem
|
||||
|
||||
delete from prefix_log_display where module = 'choice';
|
||||
INSERT INTO prefix_log_display (module, action, mtable, field) VALUES ('choice', 'view', 'choice', 'name');
|
||||
INSERT INTO prefix_log_display (module, action, mtable, field) VALUES ('choice', 'update', 'choice', 'name');
|
||||
INSERT INTO prefix_log_display (module, action, mtable, field) VALUES ('choice', 'add', 'choice', 'name');
|
||||
INSERT INTO prefix_log_display (module, action, mtable, field) VALUES ('choice', 'report', 'choice', 'name');
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<div align="center">
|
||||
<table>
|
||||
<tr><td>Title: </td><td>[[title]]</td></tr>
|
||||
<tr><td>Caption: </td><td>[[caption]]</td></tr>
|
||||
</table>
|
||||
<hr>
|
||||
[[image]]
|
||||
<div align="center">
|
||||
<table>
|
||||
<tr><td>Title: </td><td>[[title]]</td></tr>
|
||||
<tr><td>Caption: </td><td>[[caption]]</td></tr>
|
||||
</table>
|
||||
<hr>
|
||||
[[image]]
|
||||
</div>
|
||||
@@ -1,41 +1,41 @@
|
||||
/****** List View CSS ******/
|
||||
|
||||
#pictures {
|
||||
width: 750px;
|
||||
}
|
||||
|
||||
.picture {
|
||||
padding: 5px;
|
||||
border-style: solid;
|
||||
border-width: thin;
|
||||
border-color: #779;
|
||||
background-color: white;
|
||||
|
||||
display:table-cell;display:inline-table;display:inline-block;
|
||||
}
|
||||
|
||||
.pictureframe {
|
||||
padding: 5px;
|
||||
|
||||
display:table-cell;display:inline-table;display:inline-block;
|
||||
}
|
||||
|
||||
.picturediv {
|
||||
display: inline;
|
||||
width: 150px;
|
||||
height: 200px;
|
||||
}
|
||||
|
||||
.inline {
|
||||
display: inline;
|
||||
}
|
||||
|
||||
/***** Single View CSS *****/
|
||||
|
||||
.caption {
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
#singleimage {
|
||||
width: 700px;
|
||||
/****** List View CSS ******/
|
||||
|
||||
#pictures {
|
||||
width: 750px;
|
||||
}
|
||||
|
||||
.picture {
|
||||
padding: 5px;
|
||||
border-style: solid;
|
||||
border-width: thin;
|
||||
border-color: #779;
|
||||
background-color: white;
|
||||
|
||||
display:table-cell;display:inline-table;display:inline-block;
|
||||
}
|
||||
|
||||
.pictureframe {
|
||||
padding: 5px;
|
||||
|
||||
display:table-cell;display:inline-table;display:inline-block;
|
||||
}
|
||||
|
||||
.picturediv {
|
||||
display: inline;
|
||||
width: 150px;
|
||||
height: 200px;
|
||||
}
|
||||
|
||||
.inline {
|
||||
display: inline;
|
||||
}
|
||||
|
||||
/***** Single View CSS *****/
|
||||
|
||||
.caption {
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
#singleimage {
|
||||
width: 700px;
|
||||
}
|
||||
@@ -1,41 +1,41 @@
|
||||
var maxHeight = 550;
|
||||
var maxListHeight = 120;
|
||||
|
||||
function init() {
|
||||
if (document.getElementById("singleimage")) single();
|
||||
/*else if (document.getElementById("pictures")) list();*/
|
||||
}
|
||||
|
||||
function list() {
|
||||
imageDivs = document.getElementsByName("listimage");
|
||||
for (i=0; i < imageDivs.length; i++) {
|
||||
currentHeight = imageDivs[i].offsetHeight;
|
||||
currentWidth = imageDivs[i].offsetWidth;
|
||||
|
||||
if (currentHeight > maxListHeight) {
|
||||
ratio = maxListHeight / currentHeight;
|
||||
imageDivs[i].style.width = (currentWidth*ratio) + 'px';
|
||||
imageDivs[i].style.height = (currentHeight*ratio) + 'px';
|
||||
imageDivs[i].firstChild.style.height = '100%';
|
||||
imageDivs[i].firstChild.style.width = '100%';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function single() {
|
||||
var imageDiv = document.getElementById("singleimage");
|
||||
|
||||
if (imageDiv) {
|
||||
currentHeight = imageDiv.offsetHeight;
|
||||
currentWidth = imageDiv.offsetWidth;
|
||||
|
||||
if (currentHeight > maxHeight) {
|
||||
ratio = maxHeight / currentHeight;
|
||||
imageDiv.style.width = (currentWidth*ratio) + 'px';
|
||||
imageDiv.style.height = (currentHeight*ratio) + 'px';
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var maxHeight = 550;
|
||||
var maxListHeight = 120;
|
||||
|
||||
function init() {
|
||||
if (document.getElementById("singleimage")) single();
|
||||
/*else if (document.getElementById("pictures")) list();*/
|
||||
}
|
||||
|
||||
function list() {
|
||||
imageDivs = document.getElementsByName("listimage");
|
||||
for (i=0; i < imageDivs.length; i++) {
|
||||
currentHeight = imageDivs[i].offsetHeight;
|
||||
currentWidth = imageDivs[i].offsetWidth;
|
||||
|
||||
if (currentHeight > maxListHeight) {
|
||||
ratio = maxListHeight / currentHeight;
|
||||
imageDivs[i].style.width = (currentWidth*ratio) + 'px';
|
||||
imageDivs[i].style.height = (currentHeight*ratio) + 'px';
|
||||
imageDivs[i].firstChild.style.height = '100%';
|
||||
imageDivs[i].firstChild.style.width = '100%';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function single() {
|
||||
var imageDiv = document.getElementById("singleimage");
|
||||
|
||||
if (imageDiv) {
|
||||
currentHeight = imageDiv.offsetHeight;
|
||||
currentWidth = imageDiv.offsetWidth;
|
||||
|
||||
if (currentHeight > maxHeight) {
|
||||
ratio = maxHeight / currentHeight;
|
||||
imageDiv.style.width = (currentWidth*ratio) + 'px';
|
||||
imageDiv.style.height = (currentHeight*ratio) + 'px';
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
window.onload = init;
|
||||
@@ -1,8 +1,8 @@
|
||||
<div class="picturediv">
|
||||
<table class="pictureframe"><tr><td>
|
||||
<table class="picture">
|
||||
<tr><td><div name="listimage">[[image]]</div></td></tr>
|
||||
<tr><td align="right">##edit## ##delete## ##approve##</td></tr>
|
||||
</table>
|
||||
</td></tr></table>
|
||||
</div>
|
||||
<div class="picturediv">
|
||||
<table class="pictureframe"><tr><td>
|
||||
<table class="picture">
|
||||
<tr><td><div name="listimage">[[image]]</div></td></tr>
|
||||
<tr><td align="right">##edit## ##delete## ##approve##</td></tr>
|
||||
</table>
|
||||
</td></tr></table>
|
||||
</div>
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
<div align="center">
|
||||
<div align="center">
|
||||
<div align="center" id="pictures">
|
||||
@@ -1,8 +1,8 @@
|
||||
<div align="center">
|
||||
<table id="single">
|
||||
<tr><td align="center"><h3>[[title]]</h3></td></tr>
|
||||
<tr><td align="center"><div id="singleimage">[[image]]</div></td></tr>
|
||||
<tr><td align="center"><span class="caption">[[caption]]</span></td></tr>
|
||||
<tr><td align="center">##Edit## ##More## ##Delete## ##Approve##</td></tr>
|
||||
</table>
|
||||
<div align="center">
|
||||
<table id="single">
|
||||
<tr><td align="center"><h3>[[title]]</h3></td></tr>
|
||||
<tr><td align="center"><div id="singleimage">[[image]]</div></td></tr>
|
||||
<tr><td align="center"><span class="caption">[[caption]]</span></td></tr>
|
||||
<tr><td align="center">##Edit## ##More## ##Delete## ##Approve##</td></tr>
|
||||
</table>
|
||||
</div>
|
||||
@@ -214,4 +214,4 @@ INSERT INTO prefix_log_display (module, action, mtable, field) VALUES ('forum',
|
||||
INSERT INTO prefix_log_display (module, action, mtable, field) VALUES ('forum', 'subscribe', 'forum', 'name');
|
||||
INSERT INTO prefix_log_display (module, action, mtable, field) VALUES ('forum', 'unsubscribe', 'forum', 'name');
|
||||
|
||||
select * from prefix_log_display where module = 'forum';
|
||||
select * from prefix_log_display where module = 'forum';
|
||||
|
||||
+2878
-2878
File diff suppressed because it is too large
Load Diff
+540
-540
File diff suppressed because it is too large
Load Diff
+1445
-1445
File diff suppressed because it is too large
Load Diff
+59
-59
@@ -1,59 +1,59 @@
|
||||
# phpMyAdmin MySQL-Dump
|
||||
# version 2.2.1
|
||||
# http://phpwizard.net/phpMyAdmin/
|
||||
# http://phpmyadmin.sourceforge.net/ (download page)
|
||||
#
|
||||
# Host: localhost
|
||||
# Generation Time: Nov 14, 2001 at 04:44 PM
|
||||
# Server version: 3.23.36
|
||||
# PHP Version: 4.0.6
|
||||
# Database : `moodle`
|
||||
# --------------------------------------------------------
|
||||
|
||||
#
|
||||
# Table structure for table `journal`
|
||||
#
|
||||
|
||||
CREATE TABLE prefix_journal (
|
||||
id int(10) unsigned NOT NULL auto_increment,
|
||||
course int(10) unsigned NOT NULL default '0',
|
||||
name varchar(255) NOT NULL default '',
|
||||
intro text NOT NULL default '',
|
||||
introformat tinyint(2) NOT NULL default '0',
|
||||
days smallint(5) unsigned NOT NULL default '7',
|
||||
assessed int(10) NOT NULL default '0',
|
||||
timemodified int(10) unsigned NOT NULL default '0',
|
||||
PRIMARY KEY (id),
|
||||
KEY course (course)
|
||||
) TYPE=MyISAM;
|
||||
# --------------------------------------------------------
|
||||
|
||||
#
|
||||
# Table structure for table `journal_entries`
|
||||
#
|
||||
|
||||
CREATE TABLE prefix_journal_entries (
|
||||
id int(10) unsigned NOT NULL auto_increment,
|
||||
journal int(10) unsigned NOT NULL default '0',
|
||||
userid int(10) unsigned NOT NULL default '0',
|
||||
modified int(10) unsigned NOT NULL default '0',
|
||||
text text NOT NULL default '',
|
||||
format tinyint(2) NOT NULL default '0',
|
||||
rating int(10) default '0',
|
||||
comment text default '',
|
||||
teacher int(10) unsigned NOT NULL default '0',
|
||||
timemarked int(10) unsigned NOT NULL default '0',
|
||||
mailed int(1) unsigned NOT NULL default '0',
|
||||
PRIMARY KEY (id),
|
||||
KEY journal (journal),
|
||||
KEY userid (userid)
|
||||
) TYPE=MyISAM COMMENT='All the journal entries of all people';
|
||||
|
||||
#
|
||||
# Dumping data for table `log_display`
|
||||
#
|
||||
|
||||
INSERT INTO prefix_log_display (module, action, mtable, field) VALUES ('journal', 'view', 'journal', 'name');
|
||||
INSERT INTO prefix_log_display (module, action, mtable, field) VALUES ('journal', 'add entry', 'journal', 'name');
|
||||
INSERT INTO prefix_log_display (module, action, mtable, field) VALUES ('journal', 'update entry', 'journal', 'name');
|
||||
INSERT INTO prefix_log_display (module, action, mtable, field) VALUES ('journal', 'view responses', 'journal', 'name');
|
||||
# phpMyAdmin MySQL-Dump
|
||||
# version 2.2.1
|
||||
# http://phpwizard.net/phpMyAdmin/
|
||||
# http://phpmyadmin.sourceforge.net/ (download page)
|
||||
#
|
||||
# Host: localhost
|
||||
# Generation Time: Nov 14, 2001 at 04:44 PM
|
||||
# Server version: 3.23.36
|
||||
# PHP Version: 4.0.6
|
||||
# Database : `moodle`
|
||||
# --------------------------------------------------------
|
||||
|
||||
#
|
||||
# Table structure for table `journal`
|
||||
#
|
||||
|
||||
CREATE TABLE prefix_journal (
|
||||
id int(10) unsigned NOT NULL auto_increment,
|
||||
course int(10) unsigned NOT NULL default '0',
|
||||
name varchar(255) NOT NULL default '',
|
||||
intro text NOT NULL default '',
|
||||
introformat tinyint(2) NOT NULL default '0',
|
||||
days smallint(5) unsigned NOT NULL default '7',
|
||||
assessed int(10) NOT NULL default '0',
|
||||
timemodified int(10) unsigned NOT NULL default '0',
|
||||
PRIMARY KEY (id),
|
||||
KEY course (course)
|
||||
) TYPE=MyISAM;
|
||||
# --------------------------------------------------------
|
||||
|
||||
#
|
||||
# Table structure for table `journal_entries`
|
||||
#
|
||||
|
||||
CREATE TABLE prefix_journal_entries (
|
||||
id int(10) unsigned NOT NULL auto_increment,
|
||||
journal int(10) unsigned NOT NULL default '0',
|
||||
userid int(10) unsigned NOT NULL default '0',
|
||||
modified int(10) unsigned NOT NULL default '0',
|
||||
text text NOT NULL default '',
|
||||
format tinyint(2) NOT NULL default '0',
|
||||
rating int(10) default '0',
|
||||
comment text default '',
|
||||
teacher int(10) unsigned NOT NULL default '0',
|
||||
timemarked int(10) unsigned NOT NULL default '0',
|
||||
mailed int(1) unsigned NOT NULL default '0',
|
||||
PRIMARY KEY (id),
|
||||
KEY journal (journal),
|
||||
KEY userid (userid)
|
||||
) TYPE=MyISAM COMMENT='All the journal entries of all people';
|
||||
|
||||
#
|
||||
# Dumping data for table `log_display`
|
||||
#
|
||||
|
||||
INSERT INTO prefix_log_display (module, action, mtable, field) VALUES ('journal', 'view', 'journal', 'name');
|
||||
INSERT INTO prefix_log_display (module, action, mtable, field) VALUES ('journal', 'add entry', 'journal', 'name');
|
||||
INSERT INTO prefix_log_display (module, action, mtable, field) VALUES ('journal', 'update entry', 'journal', 'name');
|
||||
INSERT INTO prefix_log_display (module, action, mtable, field) VALUES ('journal', 'view responses', 'journal', 'name');
|
||||
|
||||
+89
-89
@@ -1,89 +1,89 @@
|
||||
rem
|
||||
rem Table structure for table journal
|
||||
rem
|
||||
|
||||
drop TABLE prefix_journal;
|
||||
CREATE TABLE prefix_journal (
|
||||
id number(10) primary key,
|
||||
course number(10) default '0' not null,
|
||||
name varchar(255) default NULL,
|
||||
intro varchar2(1024),
|
||||
days number(5) default '7' not null,
|
||||
assessed number(10) default '0' not null,
|
||||
timemodified number(10) default '0' not null
|
||||
);
|
||||
|
||||
drop sequence p_journal_seq;
|
||||
create sequence p_journal_seq;
|
||||
|
||||
create or replace trigger p_journal_trig
|
||||
before insert on prefix_journal
|
||||
referencing new as new_row
|
||||
for each row
|
||||
begin
|
||||
select p_journal_seq.nextval into :new_row.id from dual;
|
||||
end;
|
||||
.
|
||||
/
|
||||
|
||||
insert into prefix_journal(course,name,intro,days,assessed,timemodified) values(1,'1','1',1,1,1);
|
||||
insert into prefix_journal(course,name,intro,days,assessed,timemodified) values(2,'2','2',2,2,2);
|
||||
insert into prefix_journal(course,name,intro,days,assessed,timemodified) values(3,'3','3',3,3,3);
|
||||
insert into prefix_journal(course,name,intro,days,assessed,timemodified) values(4,'4','4',4,4,4);
|
||||
|
||||
select * from prefix_journal order by 1,2;
|
||||
|
||||
rem --------------------------------------------------------
|
||||
|
||||
rem
|
||||
rem Table structure for table journal_entries
|
||||
rem
|
||||
|
||||
drop TABLE prefix_journal_entries;
|
||||
CREATE TABLE prefix_journal_entries (
|
||||
id number(10) primary key,
|
||||
journal number(10) default '0' not null,
|
||||
userid number(10) default '0' not null,
|
||||
modified number(10) default '0' not null,
|
||||
text varchar2(1024) NOT NULL,
|
||||
format number(2) default '0' not null,
|
||||
rating number(10) default '0',
|
||||
commentt varchar2(1024),
|
||||
teacher number(10) default '0' not null,
|
||||
timemarked number(10) default '0' not null,
|
||||
mailed number(1) default '0' not null
|
||||
);
|
||||
|
||||
comment on table prefix_journal_entries is 'All the journal entries of all people';
|
||||
|
||||
drop sequence p_journal_entries_seq;
|
||||
create sequence p_journal_entries_seq;
|
||||
|
||||
create or replace trigger p_journal_entries_trig
|
||||
before insert on prefix_journal_entries
|
||||
referencing new as new_row
|
||||
for each row
|
||||
begin
|
||||
select p_journal_entries_seq.nextval into :new_row.id from dual;
|
||||
end;
|
||||
.
|
||||
/
|
||||
|
||||
insert into prefix_journal_entries(journal,userid,modified,text,format,rating,commentt,teacher,timemarked,mailed) values(1,1,1,'1',1,1,'1',1,1,1);
|
||||
insert into prefix_journal_entries(journal,userid,modified,text,format,rating,commentt,teacher,timemarked,mailed) values(2,2,2,'2',2,2,'2',2,2,2);
|
||||
insert into prefix_journal_entries(journal,userid,modified,text,format,rating,commentt,teacher,timemarked,mailed) values(3,3,3,'3',3,3,'3',3,3,3);
|
||||
insert into prefix_journal_entries(journal,userid,modified,text,format,rating,commentt,teacher,timemarked,mailed) values(4,4,4,'4',4,4,'4',4,4,4);
|
||||
|
||||
select * from prefix_journal_entries order by 1,2;
|
||||
|
||||
rem
|
||||
rem Dumping data for table log_display
|
||||
rem
|
||||
delete from prefix_log_display where module = 'journal';
|
||||
INSERT INTO prefix_log_display (module, action, mtable, field) VALUES ('journal', 'view', 'journal', 'name');
|
||||
INSERT INTO prefix_log_display (module, action, mtable, field) VALUES ('journal', 'add entry', 'journal', 'name');
|
||||
INSERT INTO prefix_log_display (module, action, mtable, field) VALUES ('journal', 'update entry', 'journal', 'name');
|
||||
INSERT INTO prefix_log_display (module, action, mtable, field) VALUES ('journal', 'view responses', 'journal', 'name');
|
||||
|
||||
col module format a10
|
||||
select * from prefix_log_display where module = 'journal';
|
||||
rem
|
||||
rem Table structure for table journal
|
||||
rem
|
||||
|
||||
drop TABLE prefix_journal;
|
||||
CREATE TABLE prefix_journal (
|
||||
id number(10) primary key,
|
||||
course number(10) default '0' not null,
|
||||
name varchar(255) default NULL,
|
||||
intro varchar2(1024),
|
||||
days number(5) default '7' not null,
|
||||
assessed number(10) default '0' not null,
|
||||
timemodified number(10) default '0' not null
|
||||
);
|
||||
|
||||
drop sequence p_journal_seq;
|
||||
create sequence p_journal_seq;
|
||||
|
||||
create or replace trigger p_journal_trig
|
||||
before insert on prefix_journal
|
||||
referencing new as new_row
|
||||
for each row
|
||||
begin
|
||||
select p_journal_seq.nextval into :new_row.id from dual;
|
||||
end;
|
||||
.
|
||||
/
|
||||
|
||||
insert into prefix_journal(course,name,intro,days,assessed,timemodified) values(1,'1','1',1,1,1);
|
||||
insert into prefix_journal(course,name,intro,days,assessed,timemodified) values(2,'2','2',2,2,2);
|
||||
insert into prefix_journal(course,name,intro,days,assessed,timemodified) values(3,'3','3',3,3,3);
|
||||
insert into prefix_journal(course,name,intro,days,assessed,timemodified) values(4,'4','4',4,4,4);
|
||||
|
||||
select * from prefix_journal order by 1,2;
|
||||
|
||||
rem --------------------------------------------------------
|
||||
|
||||
rem
|
||||
rem Table structure for table journal_entries
|
||||
rem
|
||||
|
||||
drop TABLE prefix_journal_entries;
|
||||
CREATE TABLE prefix_journal_entries (
|
||||
id number(10) primary key,
|
||||
journal number(10) default '0' not null,
|
||||
userid number(10) default '0' not null,
|
||||
modified number(10) default '0' not null,
|
||||
text varchar2(1024) NOT NULL,
|
||||
format number(2) default '0' not null,
|
||||
rating number(10) default '0',
|
||||
commentt varchar2(1024),
|
||||
teacher number(10) default '0' not null,
|
||||
timemarked number(10) default '0' not null,
|
||||
mailed number(1) default '0' not null
|
||||
);
|
||||
|
||||
comment on table prefix_journal_entries is 'All the journal entries of all people';
|
||||
|
||||
drop sequence p_journal_entries_seq;
|
||||
create sequence p_journal_entries_seq;
|
||||
|
||||
create or replace trigger p_journal_entries_trig
|
||||
before insert on prefix_journal_entries
|
||||
referencing new as new_row
|
||||
for each row
|
||||
begin
|
||||
select p_journal_entries_seq.nextval into :new_row.id from dual;
|
||||
end;
|
||||
.
|
||||
/
|
||||
|
||||
insert into prefix_journal_entries(journal,userid,modified,text,format,rating,commentt,teacher,timemarked,mailed) values(1,1,1,'1',1,1,'1',1,1,1);
|
||||
insert into prefix_journal_entries(journal,userid,modified,text,format,rating,commentt,teacher,timemarked,mailed) values(2,2,2,'2',2,2,'2',2,2,2);
|
||||
insert into prefix_journal_entries(journal,userid,modified,text,format,rating,commentt,teacher,timemarked,mailed) values(3,3,3,'3',3,3,'3',3,3,3);
|
||||
insert into prefix_journal_entries(journal,userid,modified,text,format,rating,commentt,teacher,timemarked,mailed) values(4,4,4,'4',4,4,'4',4,4,4);
|
||||
|
||||
select * from prefix_journal_entries order by 1,2;
|
||||
|
||||
rem
|
||||
rem Dumping data for table log_display
|
||||
rem
|
||||
delete from prefix_log_display where module = 'journal';
|
||||
INSERT INTO prefix_log_display (module, action, mtable, field) VALUES ('journal', 'view', 'journal', 'name');
|
||||
INSERT INTO prefix_log_display (module, action, mtable, field) VALUES ('journal', 'add entry', 'journal', 'name');
|
||||
INSERT INTO prefix_log_display (module, action, mtable, field) VALUES ('journal', 'update entry', 'journal', 'name');
|
||||
INSERT INTO prefix_log_display (module, action, mtable, field) VALUES ('journal', 'view responses', 'journal', 'name');
|
||||
|
||||
col module format a10
|
||||
select * from prefix_log_display where module = 'journal';
|
||||
|
||||
+40
-40
@@ -1,40 +1,40 @@
|
||||
# phpMyAdmin MySQL-Dump
|
||||
# version 2.2.1
|
||||
# http://phpwizard.net/phpMyAdmin/
|
||||
# http://phpmyadmin.sourceforge.net/ (download page)
|
||||
#
|
||||
# Host: localhost
|
||||
# Generation Time: Nov 14, 2001 at 04:43 PM
|
||||
# Server version: 3.23.36
|
||||
# PHP Version: 4.0.6
|
||||
# Database : `moodle`
|
||||
# --------------------------------------------------------
|
||||
|
||||
#
|
||||
# Table structure for table `resource`
|
||||
#
|
||||
|
||||
CREATE TABLE prefix_resource (
|
||||
id int(10) unsigned NOT NULL auto_increment,
|
||||
course int(10) unsigned NOT NULL default '0',
|
||||
name varchar(255) NOT NULL default '',
|
||||
type varchar(30) NOT NULL default '',
|
||||
reference varchar(255) NOT NULL default '',
|
||||
summary text NOT NULL default '',
|
||||
alltext text NOT NULL default '',
|
||||
popup text NOT NULL default '',
|
||||
options varchar(255) NOT NULL default '',
|
||||
timemodified int(10) unsigned NOT NULL default '0',
|
||||
PRIMARY KEY (id),
|
||||
UNIQUE KEY id (id),
|
||||
KEY `course` (`course`)
|
||||
) TYPE=MyISAM;
|
||||
|
||||
|
||||
#
|
||||
# Dumping data for table `log_display`
|
||||
#
|
||||
|
||||
INSERT INTO prefix_log_display (module, action, mtable, field) VALUES ('resource', 'view', 'resource', 'name');
|
||||
INSERT INTO prefix_log_display (module, action, mtable, field) VALUES ('resource', 'update', 'resource', 'name');
|
||||
INSERT INTO prefix_log_display (module, action, mtable, field) VALUES ('resource', 'add', 'resource', 'name');
|
||||
# phpMyAdmin MySQL-Dump
|
||||
# version 2.2.1
|
||||
# http://phpwizard.net/phpMyAdmin/
|
||||
# http://phpmyadmin.sourceforge.net/ (download page)
|
||||
#
|
||||
# Host: localhost
|
||||
# Generation Time: Nov 14, 2001 at 04:43 PM
|
||||
# Server version: 3.23.36
|
||||
# PHP Version: 4.0.6
|
||||
# Database : `moodle`
|
||||
# --------------------------------------------------------
|
||||
|
||||
#
|
||||
# Table structure for table `resource`
|
||||
#
|
||||
|
||||
CREATE TABLE prefix_resource (
|
||||
id int(10) unsigned NOT NULL auto_increment,
|
||||
course int(10) unsigned NOT NULL default '0',
|
||||
name varchar(255) NOT NULL default '',
|
||||
type varchar(30) NOT NULL default '',
|
||||
reference varchar(255) NOT NULL default '',
|
||||
summary text NOT NULL default '',
|
||||
alltext text NOT NULL default '',
|
||||
popup text NOT NULL default '',
|
||||
options varchar(255) NOT NULL default '',
|
||||
timemodified int(10) unsigned NOT NULL default '0',
|
||||
PRIMARY KEY (id),
|
||||
UNIQUE KEY id (id),
|
||||
KEY `course` (`course`)
|
||||
) TYPE=MyISAM;
|
||||
|
||||
|
||||
#
|
||||
# Dumping data for table `log_display`
|
||||
#
|
||||
|
||||
INSERT INTO prefix_log_display (module, action, mtable, field) VALUES ('resource', 'view', 'resource', 'name');
|
||||
INSERT INTO prefix_log_display (module, action, mtable, field) VALUES ('resource', 'update', 'resource', 'name');
|
||||
INSERT INTO prefix_log_display (module, action, mtable, field) VALUES ('resource', 'add', 'resource', 'name');
|
||||
|
||||
+45
-45
@@ -1,45 +1,45 @@
|
||||
rem
|
||||
rem Table structure for table resource
|
||||
rem
|
||||
|
||||
drop TABLE prefix_resource;
|
||||
CREATE TABLE prefix_resource (
|
||||
id number(10) primary key,
|
||||
course number(10) default '0' not null,
|
||||
name varchar2(255) default '' not null,
|
||||
type number(4) default '0' not null,
|
||||
reference varchar2(255) default NULL,
|
||||
summary varchar2(1024) NOT NULL,
|
||||
alltext varchar2(1024) NOT NULL,
|
||||
timemodified number(10) default '0' not null
|
||||
);
|
||||
|
||||
drop sequence p_resource_seq;
|
||||
create sequence p_resource_seq;
|
||||
|
||||
create or replace trigger p_resource_trig
|
||||
before insert on prefix_resource
|
||||
referencing new as new_row
|
||||
for each row
|
||||
begin
|
||||
select p_resource_seq.nextval into :new_row.id from dual;
|
||||
end;
|
||||
.
|
||||
/
|
||||
|
||||
comment on table prefix_resource is 'table of resources';
|
||||
|
||||
insert into prefix_resource(course,name,type,reference,summary,alltext,timemodified) values(1,'1',1,1,'1','1',1);
|
||||
insert into prefix_resource(course,name,type,reference,summary,alltext,timemodified) values(2,'2',2,2,'2','2',2);
|
||||
insert into prefix_resource(course,name,type,reference,summary,alltext,timemodified) values(3,'3',3,3,'3','3',3);
|
||||
insert into prefix_resource(course,name,type,reference,summary,alltext,timemodified) values(4,'4',4,4,'4','4',4);
|
||||
|
||||
select * from prefix_resource order by 1,2;
|
||||
|
||||
rem
|
||||
rem Dumping data for table log_display
|
||||
rem
|
||||
|
||||
delete from prefix_log_display where module = 'resource';
|
||||
INSERT INTO prefix_log_display (module, action, mtable, field) VALUES ('resource', 'view', 'resource', 'name');
|
||||
select * from prefix_log_display where module = 'resource';
|
||||
rem
|
||||
rem Table structure for table resource
|
||||
rem
|
||||
|
||||
drop TABLE prefix_resource;
|
||||
CREATE TABLE prefix_resource (
|
||||
id number(10) primary key,
|
||||
course number(10) default '0' not null,
|
||||
name varchar2(255) default '' not null,
|
||||
type number(4) default '0' not null,
|
||||
reference varchar2(255) default NULL,
|
||||
summary varchar2(1024) NOT NULL,
|
||||
alltext varchar2(1024) NOT NULL,
|
||||
timemodified number(10) default '0' not null
|
||||
);
|
||||
|
||||
drop sequence p_resource_seq;
|
||||
create sequence p_resource_seq;
|
||||
|
||||
create or replace trigger p_resource_trig
|
||||
before insert on prefix_resource
|
||||
referencing new as new_row
|
||||
for each row
|
||||
begin
|
||||
select p_resource_seq.nextval into :new_row.id from dual;
|
||||
end;
|
||||
.
|
||||
/
|
||||
|
||||
comment on table prefix_resource is 'table of resources';
|
||||
|
||||
insert into prefix_resource(course,name,type,reference,summary,alltext,timemodified) values(1,'1',1,1,'1','1',1);
|
||||
insert into prefix_resource(course,name,type,reference,summary,alltext,timemodified) values(2,'2',2,2,'2','2',2);
|
||||
insert into prefix_resource(course,name,type,reference,summary,alltext,timemodified) values(3,'3',3,3,'3','3',3);
|
||||
insert into prefix_resource(course,name,type,reference,summary,alltext,timemodified) values(4,'4',4,4,'4','4',4);
|
||||
|
||||
select * from prefix_resource order by 1,2;
|
||||
|
||||
rem
|
||||
rem Dumping data for table log_display
|
||||
rem
|
||||
|
||||
delete from prefix_log_display where module = 'resource';
|
||||
INSERT INTO prefix_log_display (module, action, mtable, field) VALUES ('resource', 'view', 'resource', 'name');
|
||||
select * from prefix_log_display where module = 'resource';
|
||||
|
||||
+353
-353
@@ -1,353 +1,353 @@
|
||||
<php
|
||||
require_once('../../config.php');
|
||||
require_once('locallib.php');
|
||||
|
||||
$command = required_param('command', PARAM_ALPHA);
|
||||
$sessionid = required_param('session_id', PARAM_ALPHANUM);
|
||||
$aiccdata = optional_param('aicc_data', '', PARAM_RAW);
|
||||
|
||||
require_login();
|
||||
|
||||
if (!empty($command) && confirm_sesskey($sessionid)) {
|
||||
$command = strtolower($command);
|
||||
|
||||
if (isset($SESSION->scorm_scoid)) {
|
||||
$scoid = $SESSION->scorm_scoid;
|
||||
} else {
|
||||
error('Invalid script call');
|
||||
}
|
||||
$mode = 'normal';
|
||||
if (isset($SESSION->scorm_mode)) {
|
||||
$mode = $SESSION->scorm_mode;
|
||||
}
|
||||
$status = 'Not Initialized';
|
||||
if (isset($SESSION->scorm_status)) {
|
||||
$status = $SESSION->scorm_status;
|
||||
}
|
||||
if (isset($SESSION->attempt)) {
|
||||
$attempt = $SESSION->attempt;
|
||||
} else {
|
||||
$attempt = 1;
|
||||
}
|
||||
|
||||
if ($sco = get_record('scorm_scoes','id',$scoid)) {
|
||||
if (!$scorm = get_record('scorm','id',$sco->scorm)) {
|
||||
error('Invalid script call');
|
||||
}
|
||||
} else {
|
||||
error('Invalid script call');
|
||||
}
|
||||
|
||||
if ($scorm = get_record('scorm','id',$sco->scorm)) {
|
||||
switch ($command) {
|
||||
case 'getparam':
|
||||
if ($status == 'Not Initialized') {
|
||||
$SESSION->scorm_status = 'Running';
|
||||
$status = 'Running';
|
||||
}
|
||||
if ($status != 'Running') {
|
||||
echo "error = 101\nerror_text = Terminated\n";
|
||||
} else {
|
||||
if ($usertrack=scorm_get_tracks($scoid,$USER->id,$attempt)) {
|
||||
$userdata = $usertrack;
|
||||
} else {
|
||||
$userdata->status = '';
|
||||
$userdata->score_raw = '';
|
||||
}
|
||||
$userdata->student_id = $USER->username;
|
||||
$userdata->student_name = $USER->lastname .', '. $USER->firstname;
|
||||
$userdata->mode = $mode;
|
||||
if ($userdata->mode == 'normal') {
|
||||
$userdata->credit = 'credit';
|
||||
} else {
|
||||
$userdata->credit = 'no-credit';
|
||||
}
|
||||
|
||||
if ($sco = get_record('scorm_scoes','id',$scoid)) {
|
||||
$userdata->course_id = $sco->identifier;
|
||||
$userdata->datafromlms = $sco->datafromlms;
|
||||
$userdata->masteryscore = $sco->masteryscore;
|
||||
$userdata->maxtimeallowed = $sco->maxtimeallowed;
|
||||
$userdata->timelimitaction = $sco->timelimitaction;
|
||||
|
||||
echo "error = 0\nerror_text = Successful\naicc_data=\n";
|
||||
echo "[Core]\n";
|
||||
echo 'Student_ID = '.$userdata->student_id."\n";
|
||||
echo 'Student_Name = '.$userdata->student_name."\n";
|
||||
if (isset($userdata->{'cmi.core.lesson_location'})) {
|
||||
echo 'Lesson_Location = '.$userdata->{'cmi.core.lesson_location'}."\n";
|
||||
} else {
|
||||
echo 'Lesson_Location = '."\n";
|
||||
}
|
||||
echo 'Credit = '.$userdata->credit."\n";
|
||||
if (isset($userdata->status)) {
|
||||
if ($userdata->status == '') {
|
||||
$userdata->entry = ', ab-initio';
|
||||
} else {
|
||||
if (isset($userdata->{'cmi.core.exit'}) && ($userdata->{'cmi.core.exit'} == 'suspend')) {
|
||||
$userdata->entry = ', resume';
|
||||
} else {
|
||||
$userdata->entry = '';
|
||||
}
|
||||
}
|
||||
}
|
||||
if (isset($userdata->{'cmi.core.lesson_status'})) {
|
||||
echo 'Lesson_Status = '.$userdata->{'cmi.core.lesson_status'}.$userdata->entry."\n";
|
||||
$SESSION->scorm_lessonstatus = $userdata->{'cmi.core.lesson_status'};
|
||||
} else {
|
||||
echo 'Lesson_Status = not attempted'.$userdata->entry."\n";
|
||||
$SESSION->scorm_lessonstatus = 'not attempted';
|
||||
}
|
||||
if (isset($userdata->{'cmi.core.score.raw'})) {
|
||||
$max = '';
|
||||
$min = '';
|
||||
if (isset($userdata->{'cmi.core.score.max'}) && !empty($userdata->{'cmi.core.score.max'})) {
|
||||
$max = ', '.$userdata->{'cmi.core.score.max'};
|
||||
if (isset($userdata->{'cmi.core.score.min'}) && !empty($userdata->{'cmi.core.score.min'})) {
|
||||
$min = ', '.$userdata->{'cmi.core.score.min'};
|
||||
}
|
||||
}
|
||||
echo 'Score = '.$userdata->{'cmi.core.score.raw'}.$max.$min."\n";
|
||||
} else {
|
||||
echo 'Score = '."\n";
|
||||
}
|
||||
if (isset($userdata->{'cmi.core.total_time'})) {
|
||||
echo 'Time = '.$userdata->{'cmi.core.total_time'}."\n";
|
||||
} else {
|
||||
echo 'Time = '.'00:00:00'."\n";
|
||||
}
|
||||
echo 'Lesson_Mode = '.$userdata->mode."\n";
|
||||
if (isset($userdata->{'cmi.suspend_data'})) {
|
||||
echo "[Core_Lesson]\n".$userdata->{'cmi.suspend_data'}."\n";
|
||||
} else {
|
||||
echo "[Core_Lesson]\n"."\n";
|
||||
}
|
||||
echo "[Core_Vendor]\n".$userdata->datafromlms."\n";
|
||||
echo "[Evaluation]\nCourse_ID = {".$userdata->course_id."}\n";
|
||||
echo "[Student_Data]\n";
|
||||
echo 'Mastery_Score = '.$userdata->masteryscore."\n";
|
||||
echo 'Max_Time_Allowed = '.$userdata->maxtimeallowed."\n";
|
||||
echo 'Time_Limit_Action = '.$userdata->timelimitaction."\n";
|
||||
} else {
|
||||
error('Sco not found');
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 'putparam':
|
||||
if ($status == 'Running') {
|
||||
if (! $cm = get_coursemodule_from_instance("scorm", $scorm->id, $scorm->course)) {
|
||||
echo "error = 1\nerror_text = Unknown\n"; // No one must see this error message if not hacked
|
||||
}
|
||||
if (!empty($aiccdata) && has_capability('mod/scorm:savetrack', get_context_instance(CONTEXT_MODULE, $cm->id))) {
|
||||
$initlessonstatus = 'not attempted';
|
||||
$lessonstatus = 'not attempted';
|
||||
if (isset($SESSION->scorm_lessonstatus)) {
|
||||
$initlessonstatus = $SESSION->scorm_lessonstatus;
|
||||
}
|
||||
$score = '';
|
||||
$datamodel['lesson_location'] = 'cmi.core.lesson_location';
|
||||
$datamodel['lesson_status'] = 'cmi.core.lesson_status';
|
||||
$datamodel['score'] = 'cmi.core.score.raw';
|
||||
$datamodel['time'] = 'cmi.core.session_time';
|
||||
$datamodel['[core_lesson]'] = 'cmi.suspend_data';
|
||||
$datamodel['[comments]'] = 'cmi.comments';
|
||||
$datarows = explode("\n",$aiccdata);
|
||||
reset($datarows);
|
||||
while ((list(,$datarow) = each($datarows)) !== false) {
|
||||
if (($equal = strpos($datarow, '=')) !== false) {
|
||||
$element = strtolower(trim(substr($datarow,0,$equal)));
|
||||
$value = trim(substr($datarow,$equal+1));
|
||||
if (isset($datamodel[$element])) {
|
||||
$element = $datamodel[$element];
|
||||
switch ($element) {
|
||||
case 'cmi.core.lesson_location':
|
||||
$id = scorm_insert_track($USER->id, $scorm->id, $sco->id, $attempt, $element, $value);
|
||||
break;
|
||||
case 'cmi.core.lesson_status':
|
||||
$statuses = array(
|
||||
'passed' => 'passed',
|
||||
'completed' => 'completed',
|
||||
'failed' => 'failed',
|
||||
'incomplete' => 'incomplete',
|
||||
'browsed' => 'browsed',
|
||||
'not attempted' => 'not attempted',
|
||||
'p' => 'passed',
|
||||
'c' => 'completed',
|
||||
'f' => 'failed',
|
||||
'i' => 'incomplete',
|
||||
'b' => 'browsed',
|
||||
'n' => 'not attempted'
|
||||
);
|
||||
$exites = array(
|
||||
'logout' => 'logout',
|
||||
'time-out' => 'time-out',
|
||||
'suspend' => 'suspend',
|
||||
'l' => 'logout',
|
||||
't' => 'time-out',
|
||||
's' => 'suspend',
|
||||
);
|
||||
$values = explode(',',$value);
|
||||
$value = '';
|
||||
if (count($values) > 1) {
|
||||
$value = trim(strtolower($values[1]));
|
||||
if (isset($exites[$value])) {
|
||||
$value = $exites[$value];
|
||||
}
|
||||
}
|
||||
if (empty($value) || isset($exites[$value])) {
|
||||
$subelement = 'cmi.core.exit';
|
||||
$id = scorm_insert_track($USER->id, $scorm->id, $sco->id, $attempt, $subelement, $value);
|
||||
}
|
||||
$value = trim(strtolower($values[0]));
|
||||
if (isset($statuses[$value]) && ($mode == 'normal')) {
|
||||
$value = $statuses[$value];
|
||||
$id = scorm_insert_track($USER->id, $scorm->id, $sco->id, $attempt, $element, $value);
|
||||
}
|
||||
$lessonstatus = $value;
|
||||
break;
|
||||
case 'cmi.core.score.raw':
|
||||
$values = explode(',',$value);
|
||||
if ((count($values) > 1) && ($values[1] >= $values[0]) && is_numeric($values[1])) {
|
||||
$subelement = 'cmi.core.score.max';
|
||||
$value = trim($values[1]);
|
||||
$id = scorm_insert_track($USER->id, $scorm->id, $sco->id, $attempt, $subelement, $value);
|
||||
if ((count($values) == 3) && ($values[2] <= $values[0]) && is_numeric($values[2])) {
|
||||
$subelement = 'cmi.core.score.min';
|
||||
$value = trim($values[2]);
|
||||
$id = scorm_insert_track($USER->id, $scorm->id, $sco->id, $attempt, $subelement, $value);
|
||||
}
|
||||
}
|
||||
|
||||
$value = '';
|
||||
if (is_numeric($values[0])) {
|
||||
$value = trim($values[0]);
|
||||
$id = scorm_insert_track($USER->id, $scorm->id, $sco->id, $attempt, $element, $value);
|
||||
}
|
||||
$score = $value;
|
||||
break;
|
||||
case 'cmi.core.session_time':
|
||||
$SESSION->scorm_session_time = $value;
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (isset($datamodel[strtolower(trim($datarow))])) {
|
||||
$element = $datamodel[strtolower(trim($datarow))];
|
||||
$value = '';
|
||||
while ((($datarow = current($datarows)) !== false) && (substr($datarow,0,1) != '[')) {
|
||||
$value .= $datarow;
|
||||
next($datarows);
|
||||
}
|
||||
$id = scorm_insert_track($USER->id, $scorm->id, $sco->id, $attempt, $element, $value);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (($mode == 'browse') && ($initlessonstatus == 'not attempted')){
|
||||
$lessonstatus = 'browsed';
|
||||
$id = scorm_insert_track($USER->id, $scorm->id, $sco->id, $attempt, 'cmi.core.lesson_status', 'browsed');
|
||||
}
|
||||
if ($mode == 'normal') {
|
||||
if ($lessonstatus == 'completed') {
|
||||
if (!empty($sco->masteryscore) && !empty($score) && ($score >= $sco->masteryscore)) {
|
||||
$lessonstatus = 'passed';
|
||||
} else {
|
||||
$lessonstatus = 'failed';
|
||||
}
|
||||
$id = scorm_insert_track($USER->id, $scorm->id, $sco->id, $attempt, 'cmi.core.lesson_status', $lessonstatus);
|
||||
}
|
||||
}
|
||||
}
|
||||
echo "error = 0\nerror_text = Successful\n";
|
||||
} else if ($status == 'Terminated') {
|
||||
echo "error = 1\nerror_text = Terminated\n";
|
||||
} else {
|
||||
echo "error = 1\nerror_text = Not Initialized\n";
|
||||
}
|
||||
break;
|
||||
case 'putcomments':
|
||||
if ($status == 'Running') {
|
||||
echo "error = 0\nerror_text = Successful\n";
|
||||
} else if ($status == 'Terminated') {
|
||||
echo "error = 1\nerror_text = Terminated\n";
|
||||
} else {
|
||||
echo "error = 1\nerror_text = Not Initialized\n";
|
||||
}
|
||||
break;
|
||||
case 'putinteractions':
|
||||
if ($status == 'Running') {
|
||||
echo "error = 0\nerror_text = Successful\n";
|
||||
} else if ($status == 'Terminated') {
|
||||
echo "error = 1\nerror_text = Terminated\n";
|
||||
} else {
|
||||
echo "error = 1\nerror_text = Not Initialized\n";
|
||||
}
|
||||
break;
|
||||
case 'putobjectives':
|
||||
if ($status == 'Running') {
|
||||
echo "error = 0\nerror_text = Successful\n";
|
||||
} else if ($status == 'Terminated') {
|
||||
echo "error = 1\nerror_text = Terminated\n";
|
||||
} else {
|
||||
echo "error = 1\nerror_text = Not Initialized\n";
|
||||
}
|
||||
break;
|
||||
case 'putpath':
|
||||
if ($status == 'Running') {
|
||||
echo "error = 0\nerror_text = Successful\n";
|
||||
} else if ($status == 'Terminated') {
|
||||
echo "error = 1\nerror_text = Terminated\n";
|
||||
} else {
|
||||
echo "error = 1\nerror_text = Not Initialized\n";
|
||||
}
|
||||
break;
|
||||
case 'putperformance':
|
||||
if ($status == 'Running') {
|
||||
echo "error = 0\nerror_text = Successful\n";
|
||||
} else if ($status == 'Terminated') {
|
||||
echo "error = 1\nerror_text = Terminated\n";
|
||||
} else {
|
||||
echo "error = 1\nerror_text = Not Initialized\n";
|
||||
}
|
||||
break;
|
||||
case 'exitau':
|
||||
if ($status == 'Running') {
|
||||
if (isset($SESSION->scorm_session_time) && ($SESSION->scorm_session_time != '')) {
|
||||
if ($track = get_record_select('scorm_scoes_track',"userid='$USER->id' AND scormid='$scorm->id' AND scoid='$sco->id' AND element='cmi.core.total_time'")) {
|
||||
// Add session_time to total_time
|
||||
$value = scorm_add_time($track->value, $SESSION->scorm_session_time);
|
||||
$track->value = $value;
|
||||
$track->timemodified = time();
|
||||
$id = update_record('scorm_scoes_track',$track);
|
||||
} else {
|
||||
$track->userid = $USER->id;
|
||||
$track->scormid = $scorm->id;
|
||||
$track->scoid = $sco->id;
|
||||
$track->element = 'cmi.core.total_time';
|
||||
$track->value = $SESSION->scorm_session_time;
|
||||
$track->timemodified = time();
|
||||
$id = insert_record('scorm_scoes_track',$track);
|
||||
}
|
||||
}
|
||||
|
||||
$SESSION->scorm_status = 'Terminated';
|
||||
$SESSION->scorm_session_time = '';
|
||||
echo "error = 0\nerror_text = Successful\n";
|
||||
} else if ($status == 'Terminated') {
|
||||
echo "error = 1\nerror_text = Terminated\n";
|
||||
} else {
|
||||
echo "error = 1\nerror_text = Not Initialized\n";
|
||||
}
|
||||
break;
|
||||
default:
|
||||
echo "error = 1\nerror_text = Invalid Command\n";
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (empty($command)) {
|
||||
echo "error = 1\nerror_text = Invalid Command\n";
|
||||
} else {
|
||||
echo "error = 3\nerror_text = Invalid Session ID\n";
|
||||
}
|
||||
}
|
||||
?>
|
||||
<php
|
||||
require_once('../../config.php');
|
||||
require_once('locallib.php');
|
||||
|
||||
$command = required_param('command', PARAM_ALPHA);
|
||||
$sessionid = required_param('session_id', PARAM_ALPHANUM);
|
||||
$aiccdata = optional_param('aicc_data', '', PARAM_RAW);
|
||||
|
||||
require_login();
|
||||
|
||||
if (!empty($command) && confirm_sesskey($sessionid)) {
|
||||
$command = strtolower($command);
|
||||
|
||||
if (isset($SESSION->scorm_scoid)) {
|
||||
$scoid = $SESSION->scorm_scoid;
|
||||
} else {
|
||||
error('Invalid script call');
|
||||
}
|
||||
$mode = 'normal';
|
||||
if (isset($SESSION->scorm_mode)) {
|
||||
$mode = $SESSION->scorm_mode;
|
||||
}
|
||||
$status = 'Not Initialized';
|
||||
if (isset($SESSION->scorm_status)) {
|
||||
$status = $SESSION->scorm_status;
|
||||
}
|
||||
if (isset($SESSION->attempt)) {
|
||||
$attempt = $SESSION->attempt;
|
||||
} else {
|
||||
$attempt = 1;
|
||||
}
|
||||
|
||||
if ($sco = get_record('scorm_scoes','id',$scoid)) {
|
||||
if (!$scorm = get_record('scorm','id',$sco->scorm)) {
|
||||
error('Invalid script call');
|
||||
}
|
||||
} else {
|
||||
error('Invalid script call');
|
||||
}
|
||||
|
||||
if ($scorm = get_record('scorm','id',$sco->scorm)) {
|
||||
switch ($command) {
|
||||
case 'getparam':
|
||||
if ($status == 'Not Initialized') {
|
||||
$SESSION->scorm_status = 'Running';
|
||||
$status = 'Running';
|
||||
}
|
||||
if ($status != 'Running') {
|
||||
echo "error = 101\nerror_text = Terminated\n";
|
||||
} else {
|
||||
if ($usertrack=scorm_get_tracks($scoid,$USER->id,$attempt)) {
|
||||
$userdata = $usertrack;
|
||||
} else {
|
||||
$userdata->status = '';
|
||||
$userdata->score_raw = '';
|
||||
}
|
||||
$userdata->student_id = $USER->username;
|
||||
$userdata->student_name = $USER->lastname .', '. $USER->firstname;
|
||||
$userdata->mode = $mode;
|
||||
if ($userdata->mode == 'normal') {
|
||||
$userdata->credit = 'credit';
|
||||
} else {
|
||||
$userdata->credit = 'no-credit';
|
||||
}
|
||||
|
||||
if ($sco = get_record('scorm_scoes','id',$scoid)) {
|
||||
$userdata->course_id = $sco->identifier;
|
||||
$userdata->datafromlms = $sco->datafromlms;
|
||||
$userdata->masteryscore = $sco->masteryscore;
|
||||
$userdata->maxtimeallowed = $sco->maxtimeallowed;
|
||||
$userdata->timelimitaction = $sco->timelimitaction;
|
||||
|
||||
echo "error = 0\nerror_text = Successful\naicc_data=\n";
|
||||
echo "[Core]\n";
|
||||
echo 'Student_ID = '.$userdata->student_id."\n";
|
||||
echo 'Student_Name = '.$userdata->student_name."\n";
|
||||
if (isset($userdata->{'cmi.core.lesson_location'})) {
|
||||
echo 'Lesson_Location = '.$userdata->{'cmi.core.lesson_location'}."\n";
|
||||
} else {
|
||||
echo 'Lesson_Location = '."\n";
|
||||
}
|
||||
echo 'Credit = '.$userdata->credit."\n";
|
||||
if (isset($userdata->status)) {
|
||||
if ($userdata->status == '') {
|
||||
$userdata->entry = ', ab-initio';
|
||||
} else {
|
||||
if (isset($userdata->{'cmi.core.exit'}) && ($userdata->{'cmi.core.exit'} == 'suspend')) {
|
||||
$userdata->entry = ', resume';
|
||||
} else {
|
||||
$userdata->entry = '';
|
||||
}
|
||||
}
|
||||
}
|
||||
if (isset($userdata->{'cmi.core.lesson_status'})) {
|
||||
echo 'Lesson_Status = '.$userdata->{'cmi.core.lesson_status'}.$userdata->entry."\n";
|
||||
$SESSION->scorm_lessonstatus = $userdata->{'cmi.core.lesson_status'};
|
||||
} else {
|
||||
echo 'Lesson_Status = not attempted'.$userdata->entry."\n";
|
||||
$SESSION->scorm_lessonstatus = 'not attempted';
|
||||
}
|
||||
if (isset($userdata->{'cmi.core.score.raw'})) {
|
||||
$max = '';
|
||||
$min = '';
|
||||
if (isset($userdata->{'cmi.core.score.max'}) && !empty($userdata->{'cmi.core.score.max'})) {
|
||||
$max = ', '.$userdata->{'cmi.core.score.max'};
|
||||
if (isset($userdata->{'cmi.core.score.min'}) && !empty($userdata->{'cmi.core.score.min'})) {
|
||||
$min = ', '.$userdata->{'cmi.core.score.min'};
|
||||
}
|
||||
}
|
||||
echo 'Score = '.$userdata->{'cmi.core.score.raw'}.$max.$min."\n";
|
||||
} else {
|
||||
echo 'Score = '."\n";
|
||||
}
|
||||
if (isset($userdata->{'cmi.core.total_time'})) {
|
||||
echo 'Time = '.$userdata->{'cmi.core.total_time'}."\n";
|
||||
} else {
|
||||
echo 'Time = '.'00:00:00'."\n";
|
||||
}
|
||||
echo 'Lesson_Mode = '.$userdata->mode."\n";
|
||||
if (isset($userdata->{'cmi.suspend_data'})) {
|
||||
echo "[Core_Lesson]\n".$userdata->{'cmi.suspend_data'}."\n";
|
||||
} else {
|
||||
echo "[Core_Lesson]\n"."\n";
|
||||
}
|
||||
echo "[Core_Vendor]\n".$userdata->datafromlms."\n";
|
||||
echo "[Evaluation]\nCourse_ID = {".$userdata->course_id."}\n";
|
||||
echo "[Student_Data]\n";
|
||||
echo 'Mastery_Score = '.$userdata->masteryscore."\n";
|
||||
echo 'Max_Time_Allowed = '.$userdata->maxtimeallowed."\n";
|
||||
echo 'Time_Limit_Action = '.$userdata->timelimitaction."\n";
|
||||
} else {
|
||||
error('Sco not found');
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 'putparam':
|
||||
if ($status == 'Running') {
|
||||
if (! $cm = get_coursemodule_from_instance("scorm", $scorm->id, $scorm->course)) {
|
||||
echo "error = 1\nerror_text = Unknown\n"; // No one must see this error message if not hacked
|
||||
}
|
||||
if (!empty($aiccdata) && has_capability('mod/scorm:savetrack', get_context_instance(CONTEXT_MODULE, $cm->id))) {
|
||||
$initlessonstatus = 'not attempted';
|
||||
$lessonstatus = 'not attempted';
|
||||
if (isset($SESSION->scorm_lessonstatus)) {
|
||||
$initlessonstatus = $SESSION->scorm_lessonstatus;
|
||||
}
|
||||
$score = '';
|
||||
$datamodel['lesson_location'] = 'cmi.core.lesson_location';
|
||||
$datamodel['lesson_status'] = 'cmi.core.lesson_status';
|
||||
$datamodel['score'] = 'cmi.core.score.raw';
|
||||
$datamodel['time'] = 'cmi.core.session_time';
|
||||
$datamodel['[core_lesson]'] = 'cmi.suspend_data';
|
||||
$datamodel['[comments]'] = 'cmi.comments';
|
||||
$datarows = explode("\n",$aiccdata);
|
||||
reset($datarows);
|
||||
while ((list(,$datarow) = each($datarows)) !== false) {
|
||||
if (($equal = strpos($datarow, '=')) !== false) {
|
||||
$element = strtolower(trim(substr($datarow,0,$equal)));
|
||||
$value = trim(substr($datarow,$equal+1));
|
||||
if (isset($datamodel[$element])) {
|
||||
$element = $datamodel[$element];
|
||||
switch ($element) {
|
||||
case 'cmi.core.lesson_location':
|
||||
$id = scorm_insert_track($USER->id, $scorm->id, $sco->id, $attempt, $element, $value);
|
||||
break;
|
||||
case 'cmi.core.lesson_status':
|
||||
$statuses = array(
|
||||
'passed' => 'passed',
|
||||
'completed' => 'completed',
|
||||
'failed' => 'failed',
|
||||
'incomplete' => 'incomplete',
|
||||
'browsed' => 'browsed',
|
||||
'not attempted' => 'not attempted',
|
||||
'p' => 'passed',
|
||||
'c' => 'completed',
|
||||
'f' => 'failed',
|
||||
'i' => 'incomplete',
|
||||
'b' => 'browsed',
|
||||
'n' => 'not attempted'
|
||||
);
|
||||
$exites = array(
|
||||
'logout' => 'logout',
|
||||
'time-out' => 'time-out',
|
||||
'suspend' => 'suspend',
|
||||
'l' => 'logout',
|
||||
't' => 'time-out',
|
||||
's' => 'suspend',
|
||||
);
|
||||
$values = explode(',',$value);
|
||||
$value = '';
|
||||
if (count($values) > 1) {
|
||||
$value = trim(strtolower($values[1]));
|
||||
if (isset($exites[$value])) {
|
||||
$value = $exites[$value];
|
||||
}
|
||||
}
|
||||
if (empty($value) || isset($exites[$value])) {
|
||||
$subelement = 'cmi.core.exit';
|
||||
$id = scorm_insert_track($USER->id, $scorm->id, $sco->id, $attempt, $subelement, $value);
|
||||
}
|
||||
$value = trim(strtolower($values[0]));
|
||||
if (isset($statuses[$value]) && ($mode == 'normal')) {
|
||||
$value = $statuses[$value];
|
||||
$id = scorm_insert_track($USER->id, $scorm->id, $sco->id, $attempt, $element, $value);
|
||||
}
|
||||
$lessonstatus = $value;
|
||||
break;
|
||||
case 'cmi.core.score.raw':
|
||||
$values = explode(',',$value);
|
||||
if ((count($values) > 1) && ($values[1] >= $values[0]) && is_numeric($values[1])) {
|
||||
$subelement = 'cmi.core.score.max';
|
||||
$value = trim($values[1]);
|
||||
$id = scorm_insert_track($USER->id, $scorm->id, $sco->id, $attempt, $subelement, $value);
|
||||
if ((count($values) == 3) && ($values[2] <= $values[0]) && is_numeric($values[2])) {
|
||||
$subelement = 'cmi.core.score.min';
|
||||
$value = trim($values[2]);
|
||||
$id = scorm_insert_track($USER->id, $scorm->id, $sco->id, $attempt, $subelement, $value);
|
||||
}
|
||||
}
|
||||
|
||||
$value = '';
|
||||
if (is_numeric($values[0])) {
|
||||
$value = trim($values[0]);
|
||||
$id = scorm_insert_track($USER->id, $scorm->id, $sco->id, $attempt, $element, $value);
|
||||
}
|
||||
$score = $value;
|
||||
break;
|
||||
case 'cmi.core.session_time':
|
||||
$SESSION->scorm_session_time = $value;
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (isset($datamodel[strtolower(trim($datarow))])) {
|
||||
$element = $datamodel[strtolower(trim($datarow))];
|
||||
$value = '';
|
||||
while ((($datarow = current($datarows)) !== false) && (substr($datarow,0,1) != '[')) {
|
||||
$value .= $datarow;
|
||||
next($datarows);
|
||||
}
|
||||
$id = scorm_insert_track($USER->id, $scorm->id, $sco->id, $attempt, $element, $value);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (($mode == 'browse') && ($initlessonstatus == 'not attempted')){
|
||||
$lessonstatus = 'browsed';
|
||||
$id = scorm_insert_track($USER->id, $scorm->id, $sco->id, $attempt, 'cmi.core.lesson_status', 'browsed');
|
||||
}
|
||||
if ($mode == 'normal') {
|
||||
if ($lessonstatus == 'completed') {
|
||||
if (!empty($sco->masteryscore) && !empty($score) && ($score >= $sco->masteryscore)) {
|
||||
$lessonstatus = 'passed';
|
||||
} else {
|
||||
$lessonstatus = 'failed';
|
||||
}
|
||||
$id = scorm_insert_track($USER->id, $scorm->id, $sco->id, $attempt, 'cmi.core.lesson_status', $lessonstatus);
|
||||
}
|
||||
}
|
||||
}
|
||||
echo "error = 0\nerror_text = Successful\n";
|
||||
} else if ($status == 'Terminated') {
|
||||
echo "error = 1\nerror_text = Terminated\n";
|
||||
} else {
|
||||
echo "error = 1\nerror_text = Not Initialized\n";
|
||||
}
|
||||
break;
|
||||
case 'putcomments':
|
||||
if ($status == 'Running') {
|
||||
echo "error = 0\nerror_text = Successful\n";
|
||||
} else if ($status == 'Terminated') {
|
||||
echo "error = 1\nerror_text = Terminated\n";
|
||||
} else {
|
||||
echo "error = 1\nerror_text = Not Initialized\n";
|
||||
}
|
||||
break;
|
||||
case 'putinteractions':
|
||||
if ($status == 'Running') {
|
||||
echo "error = 0\nerror_text = Successful\n";
|
||||
} else if ($status == 'Terminated') {
|
||||
echo "error = 1\nerror_text = Terminated\n";
|
||||
} else {
|
||||
echo "error = 1\nerror_text = Not Initialized\n";
|
||||
}
|
||||
break;
|
||||
case 'putobjectives':
|
||||
if ($status == 'Running') {
|
||||
echo "error = 0\nerror_text = Successful\n";
|
||||
} else if ($status == 'Terminated') {
|
||||
echo "error = 1\nerror_text = Terminated\n";
|
||||
} else {
|
||||
echo "error = 1\nerror_text = Not Initialized\n";
|
||||
}
|
||||
break;
|
||||
case 'putpath':
|
||||
if ($status == 'Running') {
|
||||
echo "error = 0\nerror_text = Successful\n";
|
||||
} else if ($status == 'Terminated') {
|
||||
echo "error = 1\nerror_text = Terminated\n";
|
||||
} else {
|
||||
echo "error = 1\nerror_text = Not Initialized\n";
|
||||
}
|
||||
break;
|
||||
case 'putperformance':
|
||||
if ($status == 'Running') {
|
||||
echo "error = 0\nerror_text = Successful\n";
|
||||
} else if ($status == 'Terminated') {
|
||||
echo "error = 1\nerror_text = Terminated\n";
|
||||
} else {
|
||||
echo "error = 1\nerror_text = Not Initialized\n";
|
||||
}
|
||||
break;
|
||||
case 'exitau':
|
||||
if ($status == 'Running') {
|
||||
if (isset($SESSION->scorm_session_time) && ($SESSION->scorm_session_time != '')) {
|
||||
if ($track = get_record_select('scorm_scoes_track',"userid='$USER->id' AND scormid='$scorm->id' AND scoid='$sco->id' AND element='cmi.core.total_time'")) {
|
||||
// Add session_time to total_time
|
||||
$value = scorm_add_time($track->value, $SESSION->scorm_session_time);
|
||||
$track->value = $value;
|
||||
$track->timemodified = time();
|
||||
$id = update_record('scorm_scoes_track',$track);
|
||||
} else {
|
||||
$track->userid = $USER->id;
|
||||
$track->scormid = $scorm->id;
|
||||
$track->scoid = $sco->id;
|
||||
$track->element = 'cmi.core.total_time';
|
||||
$track->value = $SESSION->scorm_session_time;
|
||||
$track->timemodified = time();
|
||||
$id = insert_record('scorm_scoes_track',$track);
|
||||
}
|
||||
}
|
||||
|
||||
$SESSION->scorm_status = 'Terminated';
|
||||
$SESSION->scorm_session_time = '';
|
||||
echo "error = 0\nerror_text = Successful\n";
|
||||
} else if ($status == 'Terminated') {
|
||||
echo "error = 1\nerror_text = Terminated\n";
|
||||
} else {
|
||||
echo "error = 1\nerror_text = Not Initialized\n";
|
||||
}
|
||||
break;
|
||||
default:
|
||||
echo "error = 1\nerror_text = Invalid Command\n";
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (empty($command)) {
|
||||
echo "error = 1\nerror_text = Invalid Command\n";
|
||||
} else {
|
||||
echo "error = 3\nerror_text = Invalid Session ID\n";
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
+74
-74
@@ -1,74 +1,74 @@
|
||||
<?php
|
||||
|
||||
require_once("../../config.php");
|
||||
require_once('locallib.php');
|
||||
|
||||
$id = optional_param('id', '', PARAM_INT); // Course Module ID, or
|
||||
$a = optional_param('a', '', PARAM_INT); // scorm ID
|
||||
$scoid = required_param('scoid', PARAM_INT); // sco ID
|
||||
$mode = optional_param('mode', '', PARAM_ALPHA); // navigation mode
|
||||
$attempt = required_param('attempt', PARAM_INT); // new attempt
|
||||
|
||||
if (!empty($id)) {
|
||||
if (! $cm = get_coursemodule_from_id('scorm', $id)) {
|
||||
error("Course Module ID was incorrect");
|
||||
}
|
||||
if (! $course = get_record("course", "id", $cm->course)) {
|
||||
error("Course is misconfigured");
|
||||
}
|
||||
if (! $scorm = get_record("scorm", "id", $cm->instance)) {
|
||||
error("Course module is incorrect");
|
||||
}
|
||||
} else if (!empty($a)) {
|
||||
if (! $scorm = get_record("scorm", "id", $a)) {
|
||||
error("Course module is incorrect");
|
||||
}
|
||||
if (! $course = get_record("course", "id", $scorm->course)) {
|
||||
error("Course is misconfigured");
|
||||
}
|
||||
if (! $cm = get_coursemodule_from_instance("scorm", $scorm->id, $course->id)) {
|
||||
error("Course Module ID was incorrect");
|
||||
}
|
||||
} else {
|
||||
error('A required parameter is missing');
|
||||
}
|
||||
|
||||
require_login($course->id, false, $cm);
|
||||
|
||||
if ($usertrack=scorm_get_tracks($scoid,$USER->id,$attempt)) {
|
||||
$userdata = $usertrack;
|
||||
} else {
|
||||
$userdata->status = '';
|
||||
$userdata->score_raw = '';
|
||||
}
|
||||
$userdata->student_id = addslashes($USER->username);
|
||||
$userdata->student_name = addslashes($USER->lastname .', '. $USER->firstname);
|
||||
$userdata->mode = 'normal';
|
||||
if (isset($mode)) {
|
||||
$userdata->mode = $mode;
|
||||
}
|
||||
if ($userdata->mode == 'normal') {
|
||||
$userdata->credit = 'credit';
|
||||
} else {
|
||||
$userdata->credit = 'no-credit';
|
||||
}
|
||||
if ($sco = get_record('scorm_scoes','id',$scoid)) {
|
||||
$userdata->datafromlms = $sco->datafromlms;
|
||||
$userdata->masteryscore = $sco->masteryscore;
|
||||
$userdata->maxtimeallowed = $sco->maxtimeallowed;
|
||||
$userdata->timelimitaction = $sco->timelimitaction;
|
||||
} else {
|
||||
error('Sco not found');
|
||||
}
|
||||
$scorm->version = strtolower(clean_param($scorm->version, PARAM_SAFEDIR)); // Just to be safe
|
||||
if (file_exists($CFG->dirroot.'/mod/scorm/datamodels/'.$scorm->version.'.js.php')) {
|
||||
include_once($CFG->dirroot.'/mod/scorm/datamodels/'.$scorm->version.'.js.php');
|
||||
} else {
|
||||
include_once($CFG->dirroot.'/mod/scorm/datamodels/scorm_12.js.php');
|
||||
}
|
||||
?>
|
||||
|
||||
var errorCode = "0";
|
||||
function underscore(str) {
|
||||
return str.replace(/\./g,"__");
|
||||
}
|
||||
<?php
|
||||
|
||||
require_once("../../config.php");
|
||||
require_once('locallib.php');
|
||||
|
||||
$id = optional_param('id', '', PARAM_INT); // Course Module ID, or
|
||||
$a = optional_param('a', '', PARAM_INT); // scorm ID
|
||||
$scoid = required_param('scoid', PARAM_INT); // sco ID
|
||||
$mode = optional_param('mode', '', PARAM_ALPHA); // navigation mode
|
||||
$attempt = required_param('attempt', PARAM_INT); // new attempt
|
||||
|
||||
if (!empty($id)) {
|
||||
if (! $cm = get_coursemodule_from_id('scorm', $id)) {
|
||||
error("Course Module ID was incorrect");
|
||||
}
|
||||
if (! $course = get_record("course", "id", $cm->course)) {
|
||||
error("Course is misconfigured");
|
||||
}
|
||||
if (! $scorm = get_record("scorm", "id", $cm->instance)) {
|
||||
error("Course module is incorrect");
|
||||
}
|
||||
} else if (!empty($a)) {
|
||||
if (! $scorm = get_record("scorm", "id", $a)) {
|
||||
error("Course module is incorrect");
|
||||
}
|
||||
if (! $course = get_record("course", "id", $scorm->course)) {
|
||||
error("Course is misconfigured");
|
||||
}
|
||||
if (! $cm = get_coursemodule_from_instance("scorm", $scorm->id, $course->id)) {
|
||||
error("Course Module ID was incorrect");
|
||||
}
|
||||
} else {
|
||||
error('A required parameter is missing');
|
||||
}
|
||||
|
||||
require_login($course->id, false, $cm);
|
||||
|
||||
if ($usertrack=scorm_get_tracks($scoid,$USER->id,$attempt)) {
|
||||
$userdata = $usertrack;
|
||||
} else {
|
||||
$userdata->status = '';
|
||||
$userdata->score_raw = '';
|
||||
}
|
||||
$userdata->student_id = addslashes($USER->username);
|
||||
$userdata->student_name = addslashes($USER->lastname .', '. $USER->firstname);
|
||||
$userdata->mode = 'normal';
|
||||
if (isset($mode)) {
|
||||
$userdata->mode = $mode;
|
||||
}
|
||||
if ($userdata->mode == 'normal') {
|
||||
$userdata->credit = 'credit';
|
||||
} else {
|
||||
$userdata->credit = 'no-credit';
|
||||
}
|
||||
if ($sco = get_record('scorm_scoes','id',$scoid)) {
|
||||
$userdata->datafromlms = $sco->datafromlms;
|
||||
$userdata->masteryscore = $sco->masteryscore;
|
||||
$userdata->maxtimeallowed = $sco->maxtimeallowed;
|
||||
$userdata->timelimitaction = $sco->timelimitaction;
|
||||
} else {
|
||||
error('Sco not found');
|
||||
}
|
||||
$scorm->version = strtolower(clean_param($scorm->version, PARAM_SAFEDIR)); // Just to be safe
|
||||
if (file_exists($CFG->dirroot.'/mod/scorm/datamodels/'.$scorm->version.'.js.php')) {
|
||||
include_once($CFG->dirroot.'/mod/scorm/datamodels/'.$scorm->version.'.js.php');
|
||||
} else {
|
||||
include_once($CFG->dirroot.'/mod/scorm/datamodels/scorm_12.js.php');
|
||||
}
|
||||
?>
|
||||
|
||||
var errorCode = "0";
|
||||
function underscore(str) {
|
||||
return str.replace(/\./g,"__");
|
||||
}
|
||||
|
||||
+107
-107
@@ -1,107 +1,107 @@
|
||||
<?php // $Id$
|
||||
|
||||
require_once("../../config.php");
|
||||
require_once('locallib.php');
|
||||
|
||||
$id = optional_param('id', '', PARAM_INT); // Course Module ID, or
|
||||
$a = optional_param('a', '', PARAM_INT); // SCORM ID
|
||||
$b = optional_param('b', '', PARAM_INT); // SCO ID
|
||||
$user = optional_param('user', '', PARAM_INT); // User ID
|
||||
|
||||
if (!empty($id)) {
|
||||
if (! $cm = get_record("course_modules", "id", $id)) {
|
||||
error("Course Module ID was incorrect");
|
||||
}
|
||||
if (! $course = get_record("course", "id", $cm->course)) {
|
||||
error("Course is misconfigured");
|
||||
}
|
||||
if (! $scorm = get_record("scorm", "id", $cm->instance)) {
|
||||
error("Course module is incorrect");
|
||||
}
|
||||
} else {
|
||||
if (!empty($b)) {
|
||||
if (! $sco = get_record("scorm_scoes", "id", $b)) {
|
||||
error("Scorm activity is incorrect");
|
||||
}
|
||||
$a = $sco->scorm;
|
||||
}
|
||||
if (!empty($a)) {
|
||||
if (! $scorm = get_record("scorm", "id", $a)) {
|
||||
error("Course module is incorrect");
|
||||
}
|
||||
if (! $course = get_record("course", "id", $scorm->course)) {
|
||||
error("Course is misconfigured");
|
||||
}
|
||||
if (! $cm = get_coursemodule_from_instance("scorm", $scorm->id, $course->id)) {
|
||||
error("Course Module ID was incorrect");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
require_login($course->id, false, $cm);
|
||||
require_capability('mod/scorm:viewgrades', get_context_instance(COTNEXT_MODULE, $cm->id));
|
||||
|
||||
add_to_log($course->id, "scorm", "report", "cofficientsetting.php?id=$cm->id", "$scorm->id");
|
||||
|
||||
/// Print the page header
|
||||
if (empty($noheader)) {
|
||||
if ($course->category) {
|
||||
$navigation = "<a href=\"../../course/view.php?id=$course->id\">$course->shortname</a> ->";
|
||||
} else {
|
||||
$navigation = '';
|
||||
}
|
||||
|
||||
$strscorms = get_string("modulenameplural", "scorm");
|
||||
$strscorm = get_string("modulename", "scorm");
|
||||
$strreport = get_string("report", "scorm");
|
||||
$strname = get_string('name');
|
||||
$strcoefficient = get_string('coefficient',"scorm");
|
||||
$strcoefficient = "Thiet lap he so";
|
||||
if (empty($b)) {
|
||||
print_header("$course->shortname: ".format_string($scorm->name), "$course->fullname",
|
||||
"$navigation <a href=\"index.php?id=$course->id\">$strscorms</a>
|
||||
-> <a href=\"view.php?id=$cm->id\">".format_string($scorm->name,true)."</a> -> $strcoefficient",
|
||||
"", "", true);
|
||||
} else {
|
||||
print_header("$course->shortname: ".format_string($scorm->name), "$course->fullname",
|
||||
"$navigation <a href=\"index.php?id=$course->id\">$strscorms</a>
|
||||
-> <a href=\"view.php?id=$cm->id\">".format_string($scorm->name,true)."</a>
|
||||
-> <a href=\"report.php?id=$cm->id\">$strreport</a> -> $sco->title",
|
||||
"", "", true);
|
||||
}
|
||||
print_heading(format_string($scorm->name));
|
||||
}
|
||||
|
||||
$scormpixdir = $CFG->modpixpath.'/scorm/pix';
|
||||
|
||||
//Phan trinh bay chinh
|
||||
?>
|
||||
|
||||
<?php
|
||||
$examScoes = get_records_select('scorm_scoes', 'scorm ='.($scorm->id).' and minnormalizedmeasure > -1');
|
||||
foreach ($examScoes as $examSco){
|
||||
$newcoefficient = optional_param($examSco->id,'',PARAM_INT);
|
||||
$sco = get_record('scorm_scoes','scorm',$scorm->id,'id',$examSco->id,'','');
|
||||
$sco->score_coefficient = $newcoefficient;
|
||||
$ketqua = update_record('scorm_scoes',$sco);
|
||||
//echo "Cap nhat $examSco->id voi he so diem ".$newcoefficient."<br>";
|
||||
}
|
||||
|
||||
if ($ketqua)
|
||||
{
|
||||
echo "".get_string('updatesuccess','scorm');
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "".get_string('updatefail','scorm');
|
||||
}
|
||||
|
||||
echo "<br><br><a href=coefficientsetting.php?id=$id>".get_string('back','scorm')."</a>"
|
||||
?>
|
||||
<?php
|
||||
//ket thuc phan trinh bay chinh
|
||||
|
||||
if (empty($noheader)) {
|
||||
print_footer($course);
|
||||
}
|
||||
?>
|
||||
<?php // $Id$
|
||||
|
||||
require_once("../../config.php");
|
||||
require_once('locallib.php');
|
||||
|
||||
$id = optional_param('id', '', PARAM_INT); // Course Module ID, or
|
||||
$a = optional_param('a', '', PARAM_INT); // SCORM ID
|
||||
$b = optional_param('b', '', PARAM_INT); // SCO ID
|
||||
$user = optional_param('user', '', PARAM_INT); // User ID
|
||||
|
||||
if (!empty($id)) {
|
||||
if (! $cm = get_record("course_modules", "id", $id)) {
|
||||
error("Course Module ID was incorrect");
|
||||
}
|
||||
if (! $course = get_record("course", "id", $cm->course)) {
|
||||
error("Course is misconfigured");
|
||||
}
|
||||
if (! $scorm = get_record("scorm", "id", $cm->instance)) {
|
||||
error("Course module is incorrect");
|
||||
}
|
||||
} else {
|
||||
if (!empty($b)) {
|
||||
if (! $sco = get_record("scorm_scoes", "id", $b)) {
|
||||
error("Scorm activity is incorrect");
|
||||
}
|
||||
$a = $sco->scorm;
|
||||
}
|
||||
if (!empty($a)) {
|
||||
if (! $scorm = get_record("scorm", "id", $a)) {
|
||||
error("Course module is incorrect");
|
||||
}
|
||||
if (! $course = get_record("course", "id", $scorm->course)) {
|
||||
error("Course is misconfigured");
|
||||
}
|
||||
if (! $cm = get_coursemodule_from_instance("scorm", $scorm->id, $course->id)) {
|
||||
error("Course Module ID was incorrect");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
require_login($course->id, false, $cm);
|
||||
require_capability('mod/scorm:viewgrades', get_context_instance(COTNEXT_MODULE, $cm->id));
|
||||
|
||||
add_to_log($course->id, "scorm", "report", "cofficientsetting.php?id=$cm->id", "$scorm->id");
|
||||
|
||||
/// Print the page header
|
||||
if (empty($noheader)) {
|
||||
if ($course->category) {
|
||||
$navigation = "<a href=\"../../course/view.php?id=$course->id\">$course->shortname</a> ->";
|
||||
} else {
|
||||
$navigation = '';
|
||||
}
|
||||
|
||||
$strscorms = get_string("modulenameplural", "scorm");
|
||||
$strscorm = get_string("modulename", "scorm");
|
||||
$strreport = get_string("report", "scorm");
|
||||
$strname = get_string('name');
|
||||
$strcoefficient = get_string('coefficient',"scorm");
|
||||
$strcoefficient = "Thiet lap he so";
|
||||
if (empty($b)) {
|
||||
print_header("$course->shortname: ".format_string($scorm->name), "$course->fullname",
|
||||
"$navigation <a href=\"index.php?id=$course->id\">$strscorms</a>
|
||||
-> <a href=\"view.php?id=$cm->id\">".format_string($scorm->name,true)."</a> -> $strcoefficient",
|
||||
"", "", true);
|
||||
} else {
|
||||
print_header("$course->shortname: ".format_string($scorm->name), "$course->fullname",
|
||||
"$navigation <a href=\"index.php?id=$course->id\">$strscorms</a>
|
||||
-> <a href=\"view.php?id=$cm->id\">".format_string($scorm->name,true)."</a>
|
||||
-> <a href=\"report.php?id=$cm->id\">$strreport</a> -> $sco->title",
|
||||
"", "", true);
|
||||
}
|
||||
print_heading(format_string($scorm->name));
|
||||
}
|
||||
|
||||
$scormpixdir = $CFG->modpixpath.'/scorm/pix';
|
||||
|
||||
//Phan trinh bay chinh
|
||||
?>
|
||||
|
||||
<?php
|
||||
$examScoes = get_records_select('scorm_scoes', 'scorm ='.($scorm->id).' and minnormalizedmeasure > -1');
|
||||
foreach ($examScoes as $examSco){
|
||||
$newcoefficient = optional_param($examSco->id,'',PARAM_INT);
|
||||
$sco = get_record('scorm_scoes','scorm',$scorm->id,'id',$examSco->id,'','');
|
||||
$sco->score_coefficient = $newcoefficient;
|
||||
$ketqua = update_record('scorm_scoes',$sco);
|
||||
//echo "Cap nhat $examSco->id voi he so diem ".$newcoefficient."<br>";
|
||||
}
|
||||
|
||||
if ($ketqua)
|
||||
{
|
||||
echo "".get_string('updatesuccess','scorm');
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "".get_string('updatefail','scorm');
|
||||
}
|
||||
|
||||
echo "<br><br><a href=coefficientsetting.php?id=$id>".get_string('back','scorm')."</a>"
|
||||
?>
|
||||
<?php
|
||||
//ket thuc phan trinh bay chinh
|
||||
|
||||
if (empty($noheader)) {
|
||||
print_footer($course);
|
||||
}
|
||||
?>
|
||||
|
||||
+114
-114
@@ -1,114 +1,114 @@
|
||||
<?php // $Id$
|
||||
|
||||
require_once("../../config.php");
|
||||
require_once('locallib.php');
|
||||
|
||||
$id = optional_param('id', '', PARAM_INT); // Course Module ID, or
|
||||
$a = optional_param('a', '', PARAM_INT); // SCORM ID
|
||||
$b = optional_param('b', '', PARAM_INT); // SCO ID
|
||||
$user = optional_param('user', '', PARAM_INT); // User ID
|
||||
|
||||
if (!empty($id)) {
|
||||
if (! $cm = get_record("course_modules", "id", $id)) {
|
||||
error("Course Module ID was incorrect");
|
||||
}
|
||||
if (! $course = get_record("course", "id", $cm->course)) {
|
||||
error("Course is misconfigured");
|
||||
}
|
||||
if (! $scorm = get_record("scorm", "id", $cm->instance)) {
|
||||
error("Course module is incorrect");
|
||||
}
|
||||
} else {
|
||||
if (!empty($b)) {
|
||||
if (! $sco = get_record("scorm_scoes", "id", $b)) {
|
||||
error("Scorm activity is incorrect");
|
||||
}
|
||||
$a = $sco->scorm;
|
||||
}
|
||||
if (!empty($a)) {
|
||||
if (! $scorm = get_record("scorm", "id", $a)) {
|
||||
error("Course module is incorrect");
|
||||
}
|
||||
if (! $course = get_record("course", "id", $scorm->course)) {
|
||||
error("Course is misconfigured");
|
||||
}
|
||||
if (! $cm = get_coursemodule_from_instance("scorm", $scorm->id, $course->id)) {
|
||||
error("Course Module ID was incorrect");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
require_login($course->id, false, $cm);
|
||||
require_capability('mod/scorm:viewgrades', get_context_instance(COTNEXT_MODULE, $cm->id));
|
||||
|
||||
add_to_log($course->id, "scorm", "report", "cofficientsetting.php?id=$cm->id", "$scorm->id");
|
||||
|
||||
/// Print the page header
|
||||
if (empty($noheader)) {
|
||||
if ($course->category) {
|
||||
$navigation = "<a href=\"../../course/view.php?id=$course->id\">$course->shortname</a> ->";
|
||||
} else {
|
||||
$navigation = '';
|
||||
}
|
||||
|
||||
$strscorms = get_string("modulenameplural", "scorm");
|
||||
$strscorm = get_string("modulename", "scorm");
|
||||
$strreport = get_string("report", "scorm");
|
||||
$strname = get_string('name');
|
||||
$strcoefficient = get_string('coefficient','scorm');
|
||||
if (empty($b)) {
|
||||
print_header("$course->shortname: ".format_string($scorm->name), "$course->fullname",
|
||||
"$navigation <a href=\"index.php?id=$course->id\">$strscorms</a>
|
||||
-> <a href=\"view.php?id=$cm->id\">".format_string($scorm->name,true)."</a> -> $strcoefficient",
|
||||
"", "", true);
|
||||
} else {
|
||||
print_header("$course->shortname: ".format_string($scorm->name), "$course->fullname",
|
||||
"$navigation <a href=\"index.php?id=$course->id\">$strscorms</a>
|
||||
-> <a href=\"view.php?id=$cm->id\">".format_string($scorm->name,true)."</a>
|
||||
-> <a href=\"report.php?id=$cm->id\">$strreport</a> -> $sco->title",
|
||||
"", "", true);
|
||||
}
|
||||
print_heading(format_string($scorm->name));
|
||||
}
|
||||
|
||||
$scormpixdir = $CFG->modpixpath.'/scorm/pix';
|
||||
|
||||
//Phan trinh bay chinh
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
function validate_form()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
</script>
|
||||
<form name="form" method="post" action="coefficientconfirm.php" onsubmit="return validate_form();" >
|
||||
<table width="50%" border="0">
|
||||
<tr>
|
||||
<td class="scormtableheader"><?php echo(get_string('title','scorm')); ?></td>
|
||||
<td class="scormtableheader"><?php echo(get_string('coefficient','scorm')); ?></td>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
$examScoes = get_records_select('scorm_scoes', 'scorm ='.($scorm->id).' and minnormalizedmeasure > -1');
|
||||
if(!empty($examScoes))
|
||||
{
|
||||
|
||||
foreach ($examScoes as $examSco){
|
||||
echo "<tr><td>";
|
||||
echo "$examSco->identifier.</td><td><input type='text' name='$examSco->id' class='scormtextbox' value=$examSco->score_coefficient /></td></tr><br>";
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
</table>
|
||||
<br>
|
||||
<input type="hidden" name="id" value="<?php p($id) ?>" />
|
||||
<input type="submit" value="<?php print_string('savechanges') ?>" />
|
||||
</form>
|
||||
<?php
|
||||
//ket thuc phan trinh bay chinh
|
||||
|
||||
if (empty($noheader)) {
|
||||
print_footer($course);
|
||||
}
|
||||
?>
|
||||
<?php // $Id$
|
||||
|
||||
require_once("../../config.php");
|
||||
require_once('locallib.php');
|
||||
|
||||
$id = optional_param('id', '', PARAM_INT); // Course Module ID, or
|
||||
$a = optional_param('a', '', PARAM_INT); // SCORM ID
|
||||
$b = optional_param('b', '', PARAM_INT); // SCO ID
|
||||
$user = optional_param('user', '', PARAM_INT); // User ID
|
||||
|
||||
if (!empty($id)) {
|
||||
if (! $cm = get_record("course_modules", "id", $id)) {
|
||||
error("Course Module ID was incorrect");
|
||||
}
|
||||
if (! $course = get_record("course", "id", $cm->course)) {
|
||||
error("Course is misconfigured");
|
||||
}
|
||||
if (! $scorm = get_record("scorm", "id", $cm->instance)) {
|
||||
error("Course module is incorrect");
|
||||
}
|
||||
} else {
|
||||
if (!empty($b)) {
|
||||
if (! $sco = get_record("scorm_scoes", "id", $b)) {
|
||||
error("Scorm activity is incorrect");
|
||||
}
|
||||
$a = $sco->scorm;
|
||||
}
|
||||
if (!empty($a)) {
|
||||
if (! $scorm = get_record("scorm", "id", $a)) {
|
||||
error("Course module is incorrect");
|
||||
}
|
||||
if (! $course = get_record("course", "id", $scorm->course)) {
|
||||
error("Course is misconfigured");
|
||||
}
|
||||
if (! $cm = get_coursemodule_from_instance("scorm", $scorm->id, $course->id)) {
|
||||
error("Course Module ID was incorrect");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
require_login($course->id, false, $cm);
|
||||
require_capability('mod/scorm:viewgrades', get_context_instance(COTNEXT_MODULE, $cm->id));
|
||||
|
||||
add_to_log($course->id, "scorm", "report", "cofficientsetting.php?id=$cm->id", "$scorm->id");
|
||||
|
||||
/// Print the page header
|
||||
if (empty($noheader)) {
|
||||
if ($course->category) {
|
||||
$navigation = "<a href=\"../../course/view.php?id=$course->id\">$course->shortname</a> ->";
|
||||
} else {
|
||||
$navigation = '';
|
||||
}
|
||||
|
||||
$strscorms = get_string("modulenameplural", "scorm");
|
||||
$strscorm = get_string("modulename", "scorm");
|
||||
$strreport = get_string("report", "scorm");
|
||||
$strname = get_string('name');
|
||||
$strcoefficient = get_string('coefficient','scorm');
|
||||
if (empty($b)) {
|
||||
print_header("$course->shortname: ".format_string($scorm->name), "$course->fullname",
|
||||
"$navigation <a href=\"index.php?id=$course->id\">$strscorms</a>
|
||||
-> <a href=\"view.php?id=$cm->id\">".format_string($scorm->name,true)."</a> -> $strcoefficient",
|
||||
"", "", true);
|
||||
} else {
|
||||
print_header("$course->shortname: ".format_string($scorm->name), "$course->fullname",
|
||||
"$navigation <a href=\"index.php?id=$course->id\">$strscorms</a>
|
||||
-> <a href=\"view.php?id=$cm->id\">".format_string($scorm->name,true)."</a>
|
||||
-> <a href=\"report.php?id=$cm->id\">$strreport</a> -> $sco->title",
|
||||
"", "", true);
|
||||
}
|
||||
print_heading(format_string($scorm->name));
|
||||
}
|
||||
|
||||
$scormpixdir = $CFG->modpixpath.'/scorm/pix';
|
||||
|
||||
//Phan trinh bay chinh
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
function validate_form()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
</script>
|
||||
<form name="form" method="post" action="coefficientconfirm.php" onsubmit="return validate_form();" >
|
||||
<table width="50%" border="0">
|
||||
<tr>
|
||||
<td class="scormtableheader"><?php echo(get_string('title','scorm')); ?></td>
|
||||
<td class="scormtableheader"><?php echo(get_string('coefficient','scorm')); ?></td>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
$examScoes = get_records_select('scorm_scoes', 'scorm ='.($scorm->id).' and minnormalizedmeasure > -1');
|
||||
if(!empty($examScoes))
|
||||
{
|
||||
|
||||
foreach ($examScoes as $examSco){
|
||||
echo "<tr><td>";
|
||||
echo "$examSco->identifier.</td><td><input type='text' name='$examSco->id' class='scormtextbox' value=$examSco->score_coefficient /></td></tr><br>";
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
</table>
|
||||
<br>
|
||||
<input type="hidden" name="id" value="<?php p($id) ?>" />
|
||||
<input type="submit" value="<?php print_string('savechanges') ?>" />
|
||||
</form>
|
||||
<?php
|
||||
//ket thuc phan trinh bay chinh
|
||||
|
||||
if (empty($noheader)) {
|
||||
print_footer($course);
|
||||
}
|
||||
?>
|
||||
|
||||
+56
-56
@@ -1,56 +1,56 @@
|
||||
<?php
|
||||
require_once('../../config.php');
|
||||
require_once('locallib.php');
|
||||
|
||||
$id = optional_param('id', '', PARAM_INT); // Course Module ID, or
|
||||
$a = optional_param('a', '', PARAM_INT); // scorm ID
|
||||
$scoid = required_param('scoid', PARAM_INT); // sco ID
|
||||
// $attempt = required_param('attempt', PARAM_INT); // attempt number
|
||||
$attempt = $SESSION->scorm_attempt;
|
||||
|
||||
|
||||
if (!empty($id)) {
|
||||
if (! $cm = get_record("course_modules", "id", $id)) {
|
||||
error("Course Module ID was incorrect");
|
||||
}
|
||||
if (! $course = get_record("course", "id", $cm->course)) {
|
||||
error("Course is misconfigured");
|
||||
}
|
||||
if (! $scorm = get_record("scorm", "id", $cm->instance)) {
|
||||
error("Course module is incorrect");
|
||||
}
|
||||
} else if (!empty($a)) {
|
||||
if (! $scorm = get_record("scorm", "id", $a)) {
|
||||
error("Course module is incorrect");
|
||||
}
|
||||
if (! $course = get_record("course", "id", $scorm->course)) {
|
||||
error("Course is misconfigured");
|
||||
}
|
||||
if (! $cm = get_coursemodule_from_instance("scorm", $scorm->id, $course->id)) {
|
||||
error("Course Module ID was incorrect");
|
||||
}
|
||||
} else {
|
||||
error('A required parameter is missing');
|
||||
}
|
||||
|
||||
require_login($course->id, false, $cm);
|
||||
|
||||
if (confirm_sesskey() && (!empty($scoid))) {
|
||||
$result = true;
|
||||
if (has_capability('mod/scorm:savetrack', get_context_instance(CONTEXT_MODULE,$cm->id))) {
|
||||
foreach ($_POST as $element => $value) {
|
||||
if (substr($element,0,3) == 'cmi') {
|
||||
$element = str_replace('__','.',$element);
|
||||
$element = preg_replace('/_(\d+)/',".\$1",$element);
|
||||
$result = scorm_insert_track($USER->id, $scorm->id, $scoid, $attempt, $element, $value) && $result;
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($result) {
|
||||
echo "true\n0";
|
||||
} else {
|
||||
echo "false\n101";
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<?php
|
||||
require_once('../../config.php');
|
||||
require_once('locallib.php');
|
||||
|
||||
$id = optional_param('id', '', PARAM_INT); // Course Module ID, or
|
||||
$a = optional_param('a', '', PARAM_INT); // scorm ID
|
||||
$scoid = required_param('scoid', PARAM_INT); // sco ID
|
||||
// $attempt = required_param('attempt', PARAM_INT); // attempt number
|
||||
$attempt = $SESSION->scorm_attempt;
|
||||
|
||||
|
||||
if (!empty($id)) {
|
||||
if (! $cm = get_record("course_modules", "id", $id)) {
|
||||
error("Course Module ID was incorrect");
|
||||
}
|
||||
if (! $course = get_record("course", "id", $cm->course)) {
|
||||
error("Course is misconfigured");
|
||||
}
|
||||
if (! $scorm = get_record("scorm", "id", $cm->instance)) {
|
||||
error("Course module is incorrect");
|
||||
}
|
||||
} else if (!empty($a)) {
|
||||
if (! $scorm = get_record("scorm", "id", $a)) {
|
||||
error("Course module is incorrect");
|
||||
}
|
||||
if (! $course = get_record("course", "id", $scorm->course)) {
|
||||
error("Course is misconfigured");
|
||||
}
|
||||
if (! $cm = get_coursemodule_from_instance("scorm", $scorm->id, $course->id)) {
|
||||
error("Course Module ID was incorrect");
|
||||
}
|
||||
} else {
|
||||
error('A required parameter is missing');
|
||||
}
|
||||
|
||||
require_login($course->id, false, $cm);
|
||||
|
||||
if (confirm_sesskey() && (!empty($scoid))) {
|
||||
$result = true;
|
||||
if (has_capability('mod/scorm:savetrack', get_context_instance(CONTEXT_MODULE,$cm->id))) {
|
||||
foreach ($_POST as $element => $value) {
|
||||
if (substr($element,0,3) == 'cmi') {
|
||||
$element = str_replace('__','.',$element);
|
||||
$element = preg_replace('/_(\d+)/',".\$1",$element);
|
||||
$result = scorm_insert_track($USER->id, $scorm->id, $scoid, $attempt, $element, $value) && $result;
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($result) {
|
||||
echo "true\n0";
|
||||
} else {
|
||||
echo "false\n101";
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
+95
-95
@@ -1,95 +1,95 @@
|
||||
<?php // $Id$
|
||||
|
||||
require_once("../../config.php");
|
||||
|
||||
$id = required_param('id', PARAM_INT); // course id
|
||||
|
||||
if (!empty($id)) {
|
||||
if (! $course = get_record("course", "id", $id)) {
|
||||
error("Course ID is incorrect");
|
||||
}
|
||||
} else {
|
||||
error('A required parameter is missing');
|
||||
}
|
||||
|
||||
require_course_login($course);
|
||||
|
||||
add_to_log($course->id, "scorm", "view all", "index.php?id=$course->id", "");
|
||||
|
||||
$strscorm = get_string("modulename", "scorm");
|
||||
$strscorms = get_string("modulenameplural", "scorm");
|
||||
$strweek = get_string("week");
|
||||
$strtopic = get_string("topic");
|
||||
$strname = get_string("name");
|
||||
$strsummary = get_string("summary");
|
||||
$strreport = get_string("report",'scorm');
|
||||
$strlastmodified = get_string("lastmodified");
|
||||
|
||||
print_header_simple("$strscorms", "", "$strscorms",
|
||||
"", "", true, "", navmenu($course));
|
||||
|
||||
if ($course->format == "weeks" or $course->format == "topics") {
|
||||
$sortorder = "cw.section ASC";
|
||||
} else {
|
||||
$sortorder = "m.timemodified DESC";
|
||||
}
|
||||
|
||||
if (! $scorms = get_all_instances_in_course("scorm", $course)) {
|
||||
notice("There are no scorms", "../../course/view.php?id=$course->id");
|
||||
exit;
|
||||
}
|
||||
|
||||
if ($course->format == "weeks") {
|
||||
$table->head = array ($strweek, $strname, $strsummary, $strreport);
|
||||
$table->align = array ("center", "left", "left", "left");
|
||||
} else if ($course->format == "topics") {
|
||||
$table->head = array ($strtopic, $strname, $strsummary, $strreport);
|
||||
$table->align = array ("center", "left", "left", "left");
|
||||
} else {
|
||||
$table->head = array ($strlastmodified, $strname, $strsummary, $strreport);
|
||||
$table->align = array ("left", "left", "left", "left");
|
||||
}
|
||||
|
||||
foreach ($scorms as $scorm) {
|
||||
|
||||
$context = get_context_instance(CONTEXT_MODULE,$scorm->coursemodule);
|
||||
$tt = "";
|
||||
if ($course->format == "weeks" or $course->format == "topics") {
|
||||
if ($scorm->section) {
|
||||
$tt = "$scorm->section";
|
||||
}
|
||||
} else {
|
||||
$tt = userdate($scorm->timemodified);
|
||||
}
|
||||
$report = ' ';
|
||||
if (has_capability('mod/scorm:viewreport', $context)) {
|
||||
$trackedusers = get_record('scorm_scoes_track', 'scormid', $scorm->id, '', '', '', '', 'count(distinct(userid)) as c');
|
||||
if ($trackedusers->c > 0) {
|
||||
$reportshow = '<a href="report.php?a='.$scorm->id.'">'.get_string('viewallreports','scorm',$trackedusers->c).'</a></div>';
|
||||
} else {
|
||||
$reportshow = get_string('noreports','scorm');
|
||||
}
|
||||
} else if (has_capability('mod/scorm:viewscores', $context)) {
|
||||
require_once('locallib.php');
|
||||
$report = scorm_grade_user(get_records('scorm_scoes','scorm',$scorm->id), $USER->id, $scorm->grademethod);
|
||||
$reportshow = get_string('score','scorm').": ".$report;
|
||||
}
|
||||
if (!$scorm->visible) {
|
||||
//Show dimmed if the mod is hidden
|
||||
$table->data[] = array ($tt, "<a class=\"dimmed\" href=\"view.php?id=$scorm->coursemodule\">".format_string($scorm->name,true)."</a>",
|
||||
format_text($scorm->summary),$reportshow);
|
||||
} else {
|
||||
//Show normal if the mod is visible
|
||||
$table->data[] = array ($tt, "<a href=\"view.php?id=$scorm->coursemodule\">".format_string($scorm->name,true)."</a>",
|
||||
format_text($scorm->summary), $reportshow);
|
||||
}
|
||||
}
|
||||
|
||||
echo "<br />";
|
||||
|
||||
print_table($table);
|
||||
|
||||
print_footer($course);
|
||||
|
||||
?>
|
||||
|
||||
<?php // $Id$
|
||||
|
||||
require_once("../../config.php");
|
||||
|
||||
$id = required_param('id', PARAM_INT); // course id
|
||||
|
||||
if (!empty($id)) {
|
||||
if (! $course = get_record("course", "id", $id)) {
|
||||
error("Course ID is incorrect");
|
||||
}
|
||||
} else {
|
||||
error('A required parameter is missing');
|
||||
}
|
||||
|
||||
require_course_login($course);
|
||||
|
||||
add_to_log($course->id, "scorm", "view all", "index.php?id=$course->id", "");
|
||||
|
||||
$strscorm = get_string("modulename", "scorm");
|
||||
$strscorms = get_string("modulenameplural", "scorm");
|
||||
$strweek = get_string("week");
|
||||
$strtopic = get_string("topic");
|
||||
$strname = get_string("name");
|
||||
$strsummary = get_string("summary");
|
||||
$strreport = get_string("report",'scorm');
|
||||
$strlastmodified = get_string("lastmodified");
|
||||
|
||||
print_header_simple("$strscorms", "", "$strscorms",
|
||||
"", "", true, "", navmenu($course));
|
||||
|
||||
if ($course->format == "weeks" or $course->format == "topics") {
|
||||
$sortorder = "cw.section ASC";
|
||||
} else {
|
||||
$sortorder = "m.timemodified DESC";
|
||||
}
|
||||
|
||||
if (! $scorms = get_all_instances_in_course("scorm", $course)) {
|
||||
notice("There are no scorms", "../../course/view.php?id=$course->id");
|
||||
exit;
|
||||
}
|
||||
|
||||
if ($course->format == "weeks") {
|
||||
$table->head = array ($strweek, $strname, $strsummary, $strreport);
|
||||
$table->align = array ("center", "left", "left", "left");
|
||||
} else if ($course->format == "topics") {
|
||||
$table->head = array ($strtopic, $strname, $strsummary, $strreport);
|
||||
$table->align = array ("center", "left", "left", "left");
|
||||
} else {
|
||||
$table->head = array ($strlastmodified, $strname, $strsummary, $strreport);
|
||||
$table->align = array ("left", "left", "left", "left");
|
||||
}
|
||||
|
||||
foreach ($scorms as $scorm) {
|
||||
|
||||
$context = get_context_instance(CONTEXT_MODULE,$scorm->coursemodule);
|
||||
$tt = "";
|
||||
if ($course->format == "weeks" or $course->format == "topics") {
|
||||
if ($scorm->section) {
|
||||
$tt = "$scorm->section";
|
||||
}
|
||||
} else {
|
||||
$tt = userdate($scorm->timemodified);
|
||||
}
|
||||
$report = ' ';
|
||||
if (has_capability('mod/scorm:viewreport', $context)) {
|
||||
$trackedusers = get_record('scorm_scoes_track', 'scormid', $scorm->id, '', '', '', '', 'count(distinct(userid)) as c');
|
||||
if ($trackedusers->c > 0) {
|
||||
$reportshow = '<a href="report.php?a='.$scorm->id.'">'.get_string('viewallreports','scorm',$trackedusers->c).'</a></div>';
|
||||
} else {
|
||||
$reportshow = get_string('noreports','scorm');
|
||||
}
|
||||
} else if (has_capability('mod/scorm:viewscores', $context)) {
|
||||
require_once('locallib.php');
|
||||
$report = scorm_grade_user(get_records('scorm_scoes','scorm',$scorm->id), $USER->id, $scorm->grademethod);
|
||||
$reportshow = get_string('score','scorm').": ".$report;
|
||||
}
|
||||
if (!$scorm->visible) {
|
||||
//Show dimmed if the mod is hidden
|
||||
$table->data[] = array ($tt, "<a class=\"dimmed\" href=\"view.php?id=$scorm->coursemodule\">".format_string($scorm->name,true)."</a>",
|
||||
format_text($scorm->summary),$reportshow);
|
||||
} else {
|
||||
//Show normal if the mod is visible
|
||||
$table->data[] = array ($tt, "<a href=\"view.php?id=$scorm->coursemodule\">".format_string($scorm->name,true)."</a>",
|
||||
format_text($scorm->summary), $reportshow);
|
||||
}
|
||||
}
|
||||
|
||||
echo "<br />";
|
||||
|
||||
print_table($table);
|
||||
|
||||
print_footer($course);
|
||||
|
||||
?>
|
||||
|
||||
|
||||
+113
-113
@@ -1,113 +1,113 @@
|
||||
<?php
|
||||
require_once("../../config.php");
|
||||
require_once('locallib.php');
|
||||
|
||||
$id = optional_param('id', '', PARAM_INT); // Course Module ID, or
|
||||
$a = optional_param('a', '', PARAM_INT); // scorm ID
|
||||
$scoid = required_param('scoid', PARAM_INT); // sco ID
|
||||
|
||||
if (!empty($id)) {
|
||||
if (! $cm = get_coursemodule_from_id('scorm', $id)) {
|
||||
error("Course Module ID was incorrect");
|
||||
}
|
||||
if (! $course = get_record("course", "id", $cm->course)) {
|
||||
error("Course is misconfigured");
|
||||
}
|
||||
if (! $scorm = get_record("scorm", "id", $cm->instance)) {
|
||||
error("Course module is incorrect");
|
||||
}
|
||||
} else if (!empty($a)) {
|
||||
if (! $scorm = get_record("scorm", "id", $a)) {
|
||||
error("Course module is incorrect");
|
||||
}
|
||||
if (! $course = get_record("course", "id", $scorm->course)) {
|
||||
error("Course is misconfigured");
|
||||
}
|
||||
if (! $cm = get_coursemodule_from_instance("scorm", $scorm->id, $course->id)) {
|
||||
error("Course Module ID was incorrect");
|
||||
}
|
||||
} else {
|
||||
error('A required parameter is missing');
|
||||
}
|
||||
|
||||
require_login($course->id, false, $cm);
|
||||
if (!empty($scoid)) {
|
||||
//
|
||||
// Direct SCO request
|
||||
//
|
||||
if ($sco = get_record("scorm_scoes","id",$scoid)) {
|
||||
if ($sco->launch == '') {
|
||||
// Search for the next launchable sco
|
||||
if ($scoes = get_records_select("scorm_scoes","scorm=".$scorm->id." AND launch<>'' AND id>".$sco->id,"id ASC")) {
|
||||
$sco = current($scoes);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//
|
||||
// If no sco was found get the first of SCORM package
|
||||
//
|
||||
if (!isset($sco)) {
|
||||
$scoes = get_records_select("scorm_scoes","scorm=".$scorm->id." AND launch<>''","id ASC");
|
||||
$sco = current($scoes);
|
||||
}
|
||||
|
||||
//
|
||||
// Forge SCO URL
|
||||
//
|
||||
$connector = '';
|
||||
$version = substr($scorm->version,0,4);
|
||||
if (!empty($sco->parameters) || ($version == 'AICC')) {
|
||||
if (stripos($sco->launch,'?') !== false) {
|
||||
$connector = '&';
|
||||
} else {
|
||||
$connector = '?';
|
||||
}
|
||||
if (!empty($sco->parameters) && ($sco->parameters[0] == '?')) {
|
||||
$sco->parameters = substr($sco->parameters,1);
|
||||
}
|
||||
}
|
||||
|
||||
if ($version == 'AICC') {
|
||||
if (!empty($sco->parameters)) {
|
||||
$sco->parameters = '&'. $sco->parameters;
|
||||
}
|
||||
$launcher = $sco->launch.$connector.'aicc_sid='.sesskey().'&aicc_url='.$CFG->wwwroot.'/mod/scorm/type/aicc/aicc.php'.$sco->parameters;
|
||||
} else {
|
||||
$launcher = $sco->launch.$connector.$sco->parameters;
|
||||
}
|
||||
|
||||
if (scorm_external_link($sco->launch)) {
|
||||
$result = $launcher;
|
||||
} else if ($scorm->reference[0] == '#') {
|
||||
require_once($repositoryconfigfile);
|
||||
$result = $CFG->repositorywebroot.substr($scorm->reference,1).'/'.$sco->launch;
|
||||
} else {
|
||||
if (basename($scorm->reference) == 'imsmanifest.xml') {
|
||||
$basedir = dirname($scorm->reference);
|
||||
} else {
|
||||
$basedir = 'moddata/scorm/'.$scorm->id;
|
||||
}
|
||||
if ($CFG->slasharguments) {
|
||||
$result = $CFG->wwwroot.'/file.php/'.$scorm->course.'/'.$basedir.'/'.$launcher;
|
||||
} else {
|
||||
$result = $CFG->wwwroot.'/file.php?file=/'.$scorm->course.'/'.$basedir.'/'.$launcher;
|
||||
}
|
||||
}
|
||||
?>
|
||||
<html>
|
||||
<head>
|
||||
<title>LoadSCO</title>
|
||||
<script language="javascript" type="text/javascript">
|
||||
<!--
|
||||
setTimeout('document.location = "<?php echo $result ?>";',2000);
|
||||
-->
|
||||
</script>
|
||||
<noscript>
|
||||
<meta http-equiv="refresh" content="2;url=<?php echo $result ?>" />
|
||||
</noscript>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
<?php
|
||||
require_once("../../config.php");
|
||||
require_once('locallib.php');
|
||||
|
||||
$id = optional_param('id', '', PARAM_INT); // Course Module ID, or
|
||||
$a = optional_param('a', '', PARAM_INT); // scorm ID
|
||||
$scoid = required_param('scoid', PARAM_INT); // sco ID
|
||||
|
||||
if (!empty($id)) {
|
||||
if (! $cm = get_coursemodule_from_id('scorm', $id)) {
|
||||
error("Course Module ID was incorrect");
|
||||
}
|
||||
if (! $course = get_record("course", "id", $cm->course)) {
|
||||
error("Course is misconfigured");
|
||||
}
|
||||
if (! $scorm = get_record("scorm", "id", $cm->instance)) {
|
||||
error("Course module is incorrect");
|
||||
}
|
||||
} else if (!empty($a)) {
|
||||
if (! $scorm = get_record("scorm", "id", $a)) {
|
||||
error("Course module is incorrect");
|
||||
}
|
||||
if (! $course = get_record("course", "id", $scorm->course)) {
|
||||
error("Course is misconfigured");
|
||||
}
|
||||
if (! $cm = get_coursemodule_from_instance("scorm", $scorm->id, $course->id)) {
|
||||
error("Course Module ID was incorrect");
|
||||
}
|
||||
} else {
|
||||
error('A required parameter is missing');
|
||||
}
|
||||
|
||||
require_login($course->id, false, $cm);
|
||||
if (!empty($scoid)) {
|
||||
//
|
||||
// Direct SCO request
|
||||
//
|
||||
if ($sco = get_record("scorm_scoes","id",$scoid)) {
|
||||
if ($sco->launch == '') {
|
||||
// Search for the next launchable sco
|
||||
if ($scoes = get_records_select("scorm_scoes","scorm=".$scorm->id." AND launch<>'' AND id>".$sco->id,"id ASC")) {
|
||||
$sco = current($scoes);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//
|
||||
// If no sco was found get the first of SCORM package
|
||||
//
|
||||
if (!isset($sco)) {
|
||||
$scoes = get_records_select("scorm_scoes","scorm=".$scorm->id." AND launch<>''","id ASC");
|
||||
$sco = current($scoes);
|
||||
}
|
||||
|
||||
//
|
||||
// Forge SCO URL
|
||||
//
|
||||
$connector = '';
|
||||
$version = substr($scorm->version,0,4);
|
||||
if (!empty($sco->parameters) || ($version == 'AICC')) {
|
||||
if (stripos($sco->launch,'?') !== false) {
|
||||
$connector = '&';
|
||||
} else {
|
||||
$connector = '?';
|
||||
}
|
||||
if (!empty($sco->parameters) && ($sco->parameters[0] == '?')) {
|
||||
$sco->parameters = substr($sco->parameters,1);
|
||||
}
|
||||
}
|
||||
|
||||
if ($version == 'AICC') {
|
||||
if (!empty($sco->parameters)) {
|
||||
$sco->parameters = '&'. $sco->parameters;
|
||||
}
|
||||
$launcher = $sco->launch.$connector.'aicc_sid='.sesskey().'&aicc_url='.$CFG->wwwroot.'/mod/scorm/type/aicc/aicc.php'.$sco->parameters;
|
||||
} else {
|
||||
$launcher = $sco->launch.$connector.$sco->parameters;
|
||||
}
|
||||
|
||||
if (scorm_external_link($sco->launch)) {
|
||||
$result = $launcher;
|
||||
} else if ($scorm->reference[0] == '#') {
|
||||
require_once($repositoryconfigfile);
|
||||
$result = $CFG->repositorywebroot.substr($scorm->reference,1).'/'.$sco->launch;
|
||||
} else {
|
||||
if (basename($scorm->reference) == 'imsmanifest.xml') {
|
||||
$basedir = dirname($scorm->reference);
|
||||
} else {
|
||||
$basedir = 'moddata/scorm/'.$scorm->id;
|
||||
}
|
||||
if ($CFG->slasharguments) {
|
||||
$result = $CFG->wwwroot.'/file.php/'.$scorm->course.'/'.$basedir.'/'.$launcher;
|
||||
} else {
|
||||
$result = $CFG->wwwroot.'/file.php?file=/'.$scorm->course.'/'.$basedir.'/'.$launcher;
|
||||
}
|
||||
}
|
||||
?>
|
||||
<html>
|
||||
<head>
|
||||
<title>LoadSCO</title>
|
||||
<script language="javascript" type="text/javascript">
|
||||
<!--
|
||||
setTimeout('document.location = "<?php echo $result ?>";',2000);
|
||||
-->
|
||||
</script>
|
||||
<noscript>
|
||||
<meta http-equiv="refresh" content="2;url=<?php echo $result ?>" />
|
||||
</noscript>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
+450
-450
@@ -1,450 +1,450 @@
|
||||
<?php
|
||||
require_once($CFG->dirroot.'/mod/scorm/configurations.php');
|
||||
if (!isset($form->name)) {
|
||||
$form->name = '';
|
||||
}
|
||||
if (!isset($form->reference)) {
|
||||
$form->reference = '';
|
||||
}
|
||||
if (!isset($form->summary)) {
|
||||
$form->summary = '';
|
||||
}
|
||||
if (!isset($form->launch)) {
|
||||
$form->launch = '';
|
||||
}
|
||||
if (!isset($form->auto)) {
|
||||
$form->auto = '';
|
||||
}
|
||||
if (!isset($form->popup)) {
|
||||
$form->popup = 0;
|
||||
}
|
||||
if (!isset($form->datadir)) {
|
||||
$form->datadir = '';
|
||||
}
|
||||
if (!isset($form->maxgrade)) {
|
||||
$form->maxgrade = '';
|
||||
}
|
||||
if (!isset($form->grademethod)) {
|
||||
$form->grademethod = 0;
|
||||
}
|
||||
if (!isset($form->maxattempt)) {
|
||||
$form->maxattempt = 1;
|
||||
}
|
||||
if (!isset($form->whatgrade)) {
|
||||
$form->whatgrade = 0;
|
||||
}
|
||||
if (!isset($form->hidebrowse)) {
|
||||
$form->hidebrowse = 0;
|
||||
}
|
||||
if (!isset($form->hidetoc)) {
|
||||
$form->hidetoc = 0;
|
||||
}
|
||||
if (!isset($form->hidenav)) {
|
||||
$form->hidenav = 0;
|
||||
}
|
||||
if (!isset($form->width)) {
|
||||
$form->width = $CFG->scorm_framewidth;
|
||||
}
|
||||
if ((strpos($form->width,'%') === false) && ($form->width <= 100)) {
|
||||
$form->width .= '%';
|
||||
}
|
||||
if (!isset($form->height)) {
|
||||
$form->height = $CFG->scorm_frameheight;
|
||||
}
|
||||
if ((strpos($form->height,'%') === false) && ($form->height <= 100)) {
|
||||
$form->height .= '%';
|
||||
}
|
||||
if (!isset($form->options) || empty($form->options)) {
|
||||
$form->options = $stdoptions;
|
||||
}
|
||||
$options = explode(',',$form->options);
|
||||
$window = new stdClass();
|
||||
foreach ($options as $option) {
|
||||
list($element,$value) = explode('=',$option);
|
||||
$element = trim($element);
|
||||
$window->$element = trim($value)==1?'checked':'';
|
||||
}
|
||||
if (!isset($form->pkgtype)) {
|
||||
$form->pkgtype = '';
|
||||
}
|
||||
$scormid = '';
|
||||
if (!empty($form->instance)) {
|
||||
$scormid = '&instance='.$form->instance;
|
||||
}
|
||||
$datadir = '';
|
||||
if (!empty($form->datadir)) {
|
||||
$datadir = '&datadir='.$form->datadir;
|
||||
}
|
||||
$sessionkey = '';
|
||||
if (!empty($form->sesskey)) {
|
||||
$sessionkey = '&sesskey='.$form->sesskey;
|
||||
}
|
||||
|
||||
$strfilename = get_string('coursepacket', 'scorm');
|
||||
$strchooseafile = get_string('chooseapacket', 'scorm');
|
||||
$strbrowserepository = get_string('browserepository', 'scorm');
|
||||
$striframe = get_string('iframe', 'scorm');
|
||||
$striframedisplay = get_string('iframedisplay', 'scorm');
|
||||
$strnewwindow = get_string('popup', 'scorm');
|
||||
$strnewwindowopen = get_string('popupopen', 'scorm');
|
||||
$strheight = get_string('height', 'scorm');
|
||||
$strwidth = get_string('width', 'scorm');
|
||||
$strresizable = get_string('resizable', 'scorm');
|
||||
$strscrollbars = get_string('scrollbars', 'scorm');
|
||||
$strdirectories = get_string('directories', 'scorm');
|
||||
$strlocation = get_string('location', 'scorm');
|
||||
$strmenubar = get_string('menubar', 'scorm');
|
||||
$strtoolbar = get_string('toolbar', 'scorm');
|
||||
$strstatus = get_string('statusbar', 'scorm');
|
||||
?>
|
||||
|
||||
<script type="text/javascript" src="<?php p($CFG->wwwroot) ?>/mod/scorm/request.js" ></script>
|
||||
<script type="text/javascript">
|
||||
function validate_scorm(theform,filename,confirmed) {
|
||||
var confirmedstr = '';
|
||||
if (confirmed == true) {
|
||||
confirmedstr = '&confirmed=true';
|
||||
}
|
||||
|
||||
var myRequest = NewHttpReq();
|
||||
result = DoRequest(myRequest,"<?php p($CFG->wwwroot) ?>/mod/scorm/validate.php","id=<?php p($form->course) ?>&reference="+filename+"<?php echo $sessionkey.$scormid.$datadir ?>");
|
||||
//alert(result);
|
||||
results = result.split('\n');
|
||||
result = '';
|
||||
errorlogs = '';
|
||||
datadir = '';
|
||||
for (i=0;i<results.length;i++) {
|
||||
element = results[i].split('=');
|
||||
switch(element[0]) {
|
||||
case 'result':
|
||||
result = element[1];
|
||||
break;
|
||||
case 'launch':
|
||||
launch = element[1];
|
||||
break;
|
||||
case 'datadir':
|
||||
datadir = element[1];
|
||||
break;
|
||||
case 'pkgtype':
|
||||
pkgtype = element[1];
|
||||
break;
|
||||
case 'errorlogs':
|
||||
i++;
|
||||
do {
|
||||
errorlogs.concat(results[i]+'\n');
|
||||
i++;
|
||||
} while (i<results.lenght());
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
if ((result == "found") || (result == "regular")) {
|
||||
theform.datadir.value = datadir;
|
||||
theform.pkgtype.value = pkgtype;
|
||||
theform.launch.value = launch;
|
||||
if (theform.mode.value == 'add') {
|
||||
theform.parse.value = 1;
|
||||
} else if (launch == 0) {
|
||||
theform.parse.value = 1;
|
||||
}
|
||||
return true;
|
||||
} else {
|
||||
if (result == "confirm") {
|
||||
response = confirm("<?php print_string('confirmloosetracks','scorm') ?>");
|
||||
if (response == true) {
|
||||
return validate_scorm(theform,filename,true);
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
result = '<?php print_string('validation','scorm') ?>: '+ result + '\n';
|
||||
if (errorlogs != '') {
|
||||
result.concat('<?php print_string('errorlogs','scorm') ?>:\n'+errorlogs);
|
||||
}
|
||||
alert(result);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function checkscormform (whatcheck,checkvalue,whatset) {
|
||||
if (whatcheck.options[whatcheck.selectedIndex].value == checkvalue) {
|
||||
whatset.disabled = true;
|
||||
} else {
|
||||
whatset.disabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
function showhide (id, set) {
|
||||
divobj = document.getElementById(id);
|
||||
butobj = document.getElementById(id+'button');
|
||||
prefobj = document.getElementById(id+'pref');
|
||||
if (set == true) {
|
||||
if (prefobj.value == '1') {
|
||||
divobj.style.display = 'block';
|
||||
butobj.value = '<?php print_string('hidesettings') ?>';
|
||||
} else {
|
||||
divobj.style.display = 'none';
|
||||
butobj.value = '<?php print_string('showsettings') ?>...';
|
||||
}
|
||||
} else {
|
||||
if (prefobj.value == '1') {
|
||||
divobj.style.display = 'none';
|
||||
butobj.value = '<?php print_string('showsettings') ?>...';
|
||||
prefobj.value = '0';
|
||||
} else {
|
||||
divobj.style.display = 'block';
|
||||
butobj.value = '<?php print_string('hidesettings') ?>';
|
||||
prefobj.value = '1';
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<form name="form" method="post" action="mod.php?goto=" onsubmit="return validate_scorm(document.form,document.form.reference.value,false,false);">
|
||||
<table cellpadding="5">
|
||||
<tr valign="top">
|
||||
<td align="right"><b><?php print_string('name') ?>:</b></td>
|
||||
<td>
|
||||
<input type="text" name="name" size="50" value="<?php p($form->name) ?>" alt="<?php print_string('name') ?>" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr valign="top">
|
||||
<td align="right"><b><?php print_string('summary') ?>:</b><br />
|
||||
<?php helpbutton('summary', get_string('summary'), 'scorm', true, true) ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php print_textarea($usehtmleditor, 10, 50, 680, 400, 'summary', $form->summary); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr valign="top">
|
||||
<td align="right" nowrap="nowrap">
|
||||
<b><?php echo $strfilename?>:</b>
|
||||
</td>
|
||||
<td>
|
||||
<input name="reference" size="50" value="<?php echo $form->reference ?>" alt="<?php echo $strfilename ?>" />
|
||||
<?php
|
||||
button_to_popup_window ('/files/index.php?id='.$course->id.'&choose=form.reference',
|
||||
'coursefiles', $strchooseafile, 500, 750, $strchooseafile);
|
||||
require_once($repositoryconfigfile);
|
||||
if ($CFG->repositoryactivate) {
|
||||
button_to_popup_window ($repositorybrowser.'?choose=form.reference',
|
||||
'browserepository', $strbrowserepository, 500, 750, $strbrowserepository);
|
||||
}
|
||||
helpbutton('package', get_string('coursepacket', 'scorm'), 'scorm', true);
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr valign="top">
|
||||
<td align="right"><b><?php print_string('grademethod', 'scorm') ?>:</b></td>
|
||||
<td>
|
||||
<?php
|
||||
choose_from_menu($SCORM_GRADE_METHOD, 'grademethod', (int) $form->grademethod, '','checkscormform(this,0,document.form.maxgrade);');
|
||||
helpbutton('grademethod', get_string('grademethod','scorm'), 'scorm');
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr valign="top">
|
||||
<td align="right"><b><?php print_string('maximumgrade') ?>:</b></td>
|
||||
<td>
|
||||
<?php
|
||||
for ($i=100; $i>=1; $i--) {
|
||||
$grades[$i] = $i;
|
||||
}
|
||||
$disabled = $form->grademethod=='0';
|
||||
choose_from_menu($grades, 'maxgrade', (int) $form->maxgrade, '','','0',false,$disabled);
|
||||
helpbutton('maxgrade', get_string('maximumgrade'), 'scorm');
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr valign="top">
|
||||
<td align="right"><b><?php print_string('maximumattempts','scorm') ?>:</b></td>
|
||||
<td>
|
||||
<?php
|
||||
for ($i=1; $i<=$CFG->scorm_maxattempts; $i++) {
|
||||
if ($i == 1) {
|
||||
$attempts[$i] = $i . ' ' . get_string('attempt','scorm');
|
||||
} else {
|
||||
$attempts[$i] = $i . ' ' . get_string('attempts','scorm');
|
||||
}
|
||||
}
|
||||
choose_from_menu($attempts, 'maxattempt', (int) $form->maxattempt, get_string('nolimit','scorm'),'checkscormform(this,1,document.form.whatgrade);');
|
||||
helpbutton('maxattempt', get_string('maximumattempts','scorm'), 'scorm');
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr valign="top">
|
||||
<td align="right"><b><?php print_string('whatgrade','scorm') ?>:</b></td>
|
||||
<td>
|
||||
<?php
|
||||
$disabled = (int) $form->maxattempt === 1;
|
||||
choose_from_menu($SCORM_WHAT_GRADE, 'whatgrade', (int) $form->whatgrade, '','','0',false,$disabled);
|
||||
helpbutton('whatgrade', get_string('whatgrade','scorm'), 'scorm');
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td colspan="2"><hr /></td></tr>
|
||||
|
||||
<tr>
|
||||
<td align="right"><b><?php print_string('advanced', 'scorm') ?>:</b></td>
|
||||
<td>
|
||||
<input type="button" value="<?php print_string('hidesettings') ?>" id="advancedsettingsbutton" onclick="javascript: return showhide('advancedsettings');" />
|
||||
<input type="hidden" name="advancedsettingspref" id="advancedsettingspref"
|
||||
value="<?php echo get_user_preferences('scorm_advancedsettingspref', $CFG->scorm_advancedsettings); ?>" />
|
||||
<?php helpbutton('advanced', get_string('advanced', 'scorm'), 'scorm', true) ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<div id="advancedsettings">
|
||||
<table align="center">
|
||||
<tr>
|
||||
<td align="right"><b><?php print_string('autocontinue','scorm') ?>:</b></td>
|
||||
<td>
|
||||
<?php
|
||||
$options = array();
|
||||
$options[0]=get_string('no');
|
||||
$options[1]=get_string('yes');
|
||||
choose_from_menu ($options, 'auto', (int) $form->auto,'');
|
||||
helpbutton('autocontinue', get_string('autocontinue','scorm'), 'scorm', true);
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right"><b><?php print_string('hidebrowse','scorm') ?>:</b></td>
|
||||
<td>
|
||||
<?php
|
||||
$options = array();
|
||||
$options[0]=get_string('no');
|
||||
$options[1]=get_string('yes');
|
||||
choose_from_menu ($options, 'hidebrowse', (int) $form->hidebrowse, '');
|
||||
helpbutton('browsemode', get_string('hidebrowse','scorm'), 'scorm', true);
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right"><b><?php print_string('hidetoc','scorm') ?>:</b></td>
|
||||
<td>
|
||||
<?php
|
||||
$options = array();
|
||||
$options[1]=get_string('hidden','scorm');
|
||||
$options[0]=get_string('sided','scorm');
|
||||
$options[2]=get_string('popupmenu','scorm');
|
||||
choose_from_menu ($options, 'hidetoc', (int) $form->hidetoc, '');
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right"><b><?php print_string('hidenav','scorm') ?>:</b></td>
|
||||
<td>
|
||||
<?php
|
||||
$options = array();
|
||||
$options[0]=get_string('no');
|
||||
$options[1]=get_string('yes');
|
||||
choose_from_menu ($options, 'hidenav', (int) $form->hidenav, '');
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right"><b><?php print_string('window', 'scorm') ?>:</b></td>
|
||||
<td>
|
||||
<input type="button" value="<?php print_string('hidesettings') ?>" id="windowsettingsbutton" onclick="javascript: return showhide('windowsettings');" />
|
||||
<input type="hidden" name="windowsettingspref" id="windowsettingspref"
|
||||
value="<?php echo get_user_preferences('scorm_windowsettingspref', $CFG->scorm_windowsettings); ?>" />
|
||||
<?php helpbutton('window', get_string('window', 'scorm'), 'scorm', true) ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<div id="windowsettings">
|
||||
<table align="center">
|
||||
<tr valign="top">
|
||||
<td>
|
||||
<b><?php print_string('stagesize','scorm'); ?></b>
|
||||
<?php helpbutton('size', get_string('stagesize', 'scorm'), 'scorm', true) ?><br />
|
||||
<input name="width" type="text" size="4" value="<?php p($form->width) ?>" alt="<?php p($strwidth) ?>" />
|
||||
<label for="width"><?php p($strwidth) ?></label><br />
|
||||
<input name="height" type="text" size="4" value="<?php p($form->height) ?>" alt="<?php p($strheight) ?>" />
|
||||
<label for="height"><?php p($strheight) ?></label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr valign="top">
|
||||
<td>
|
||||
<script type="text/javascript">
|
||||
var popupitems = ["<?php echo implode('","',array_keys($SCORM_POPUP_OPTIONS)); ?>"];
|
||||
</script>
|
||||
<br /><b><?php print_string('display','scorm'); ?>:</b><br />
|
||||
<input type="radio"
|
||||
name="popup"
|
||||
value="0" alt="<?php p($striframe) ?>"
|
||||
<?php echo ($form->popup == 0) ? "checked=\"checked\"" : "" ?>
|
||||
onclick="return lockoptions('form', 'popup[1]', popupitems);"
|
||||
/>
|
||||
<b title="<?php p($striframedisplay) ?>"><?php p($striframe) ?></b>
|
||||
</td>
|
||||
</tr>
|
||||
<tr valign="top">
|
||||
<td>
|
||||
<input name="popup"
|
||||
type="radio"
|
||||
value="1"
|
||||
alt="<?php p($strnewwindow)?>"
|
||||
<?php echo ($form->popup == 1) ? 'checked="checked"' : '' ?>
|
||||
onclick="return lockoptions('form', 'popup[1]', popupitems);"
|
||||
/>
|
||||
<b title="<?php p($strnewwindowopen) ?>"><?php p($strnewwindow) ?></b>
|
||||
<blockquote>
|
||||
<?php
|
||||
foreach ($window as $name => $value) {
|
||||
echo "<input name=\"h$name\" type=\"hidden\" value=\"0\"/>\n";
|
||||
echo "<input name=\"$name\" type=\"checkbox\" value=\"1\" ".$window->$name." alt=\"$name\" />\n";
|
||||
$stringname = "str$name";
|
||||
echo $$stringname."<br />\n";
|
||||
}
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
lockoptions('form','popup[1]', popupitems);
|
||||
</script>
|
||||
</blockquote>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<script language="javascript" type="text/javascript">
|
||||
showhide('advancedsettings', true);
|
||||
showhide('windowsettings', true);
|
||||
</script>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<input type="hidden" name="datadir" value="<?php p($form->datadir) ?>" />
|
||||
<input type="hidden" name="pkgtype" value="<?php p($form->pkgtype) ?>" />
|
||||
<input type="hidden" name="launch" value="<?php p($form->launch) ?>" />
|
||||
<input type="hidden" name="parse" value="0" />
|
||||
<?php
|
||||
$scorms = get_all_instances_in_course('scorm', $course);
|
||||
$coursescorm = current($scorms);
|
||||
if (($course->format == 'scorm') && ((count($scorms) == 0) || ($form->instance == $coursescorm->id))) {
|
||||
?>
|
||||
<input type="hidden" name="redirect" value="yes" />
|
||||
<input type="hidden" name="redirecturl" value="../course/view.php?id=<?php p($form->course) ?>" />
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<input type="hidden" name="course" value="<?php p($form->course) ?>" />
|
||||
<input type="hidden" name="sesskey" value="<?php p($form->sesskey) ?>" />
|
||||
<input type="hidden" name="section" value="<?php p($form->section) ?>" />
|
||||
<input type="hidden" name="module" value="<?php p($form->module) ?>" />
|
||||
<input type="hidden" name="mode" value="<?php p($form->mode) ?>" />
|
||||
<input type="hidden" name="coursemodule" value="<?php p($form->coursemodule) ?>" />
|
||||
<input type="hidden" name="modulename" value="<?php p($form->modulename) ?>" />
|
||||
<input type="hidden" name="instance" value="<?php p($form->instance) ?>" />
|
||||
<center>
|
||||
<input type="submit" value="<?php print_string('savechanges') ?>"/>
|
||||
<input type="button" name="cancel" value="<?php print_string('cancel') ?>" onclick="document.location='view.php?id=<?php echo $form->course ?>'" />
|
||||
</center>
|
||||
</form>
|
||||
<?php
|
||||
require_once($CFG->dirroot.'/mod/scorm/configurations.php');
|
||||
if (!isset($form->name)) {
|
||||
$form->name = '';
|
||||
}
|
||||
if (!isset($form->reference)) {
|
||||
$form->reference = '';
|
||||
}
|
||||
if (!isset($form->summary)) {
|
||||
$form->summary = '';
|
||||
}
|
||||
if (!isset($form->launch)) {
|
||||
$form->launch = '';
|
||||
}
|
||||
if (!isset($form->auto)) {
|
||||
$form->auto = '';
|
||||
}
|
||||
if (!isset($form->popup)) {
|
||||
$form->popup = 0;
|
||||
}
|
||||
if (!isset($form->datadir)) {
|
||||
$form->datadir = '';
|
||||
}
|
||||
if (!isset($form->maxgrade)) {
|
||||
$form->maxgrade = '';
|
||||
}
|
||||
if (!isset($form->grademethod)) {
|
||||
$form->grademethod = 0;
|
||||
}
|
||||
if (!isset($form->maxattempt)) {
|
||||
$form->maxattempt = 1;
|
||||
}
|
||||
if (!isset($form->whatgrade)) {
|
||||
$form->whatgrade = 0;
|
||||
}
|
||||
if (!isset($form->hidebrowse)) {
|
||||
$form->hidebrowse = 0;
|
||||
}
|
||||
if (!isset($form->hidetoc)) {
|
||||
$form->hidetoc = 0;
|
||||
}
|
||||
if (!isset($form->hidenav)) {
|
||||
$form->hidenav = 0;
|
||||
}
|
||||
if (!isset($form->width)) {
|
||||
$form->width = $CFG->scorm_framewidth;
|
||||
}
|
||||
if ((strpos($form->width,'%') === false) && ($form->width <= 100)) {
|
||||
$form->width .= '%';
|
||||
}
|
||||
if (!isset($form->height)) {
|
||||
$form->height = $CFG->scorm_frameheight;
|
||||
}
|
||||
if ((strpos($form->height,'%') === false) && ($form->height <= 100)) {
|
||||
$form->height .= '%';
|
||||
}
|
||||
if (!isset($form->options) || empty($form->options)) {
|
||||
$form->options = $stdoptions;
|
||||
}
|
||||
$options = explode(',',$form->options);
|
||||
$window = new stdClass();
|
||||
foreach ($options as $option) {
|
||||
list($element,$value) = explode('=',$option);
|
||||
$element = trim($element);
|
||||
$window->$element = trim($value)==1?'checked':'';
|
||||
}
|
||||
if (!isset($form->pkgtype)) {
|
||||
$form->pkgtype = '';
|
||||
}
|
||||
$scormid = '';
|
||||
if (!empty($form->instance)) {
|
||||
$scormid = '&instance='.$form->instance;
|
||||
}
|
||||
$datadir = '';
|
||||
if (!empty($form->datadir)) {
|
||||
$datadir = '&datadir='.$form->datadir;
|
||||
}
|
||||
$sessionkey = '';
|
||||
if (!empty($form->sesskey)) {
|
||||
$sessionkey = '&sesskey='.$form->sesskey;
|
||||
}
|
||||
|
||||
$strfilename = get_string('coursepacket', 'scorm');
|
||||
$strchooseafile = get_string('chooseapacket', 'scorm');
|
||||
$strbrowserepository = get_string('browserepository', 'scorm');
|
||||
$striframe = get_string('iframe', 'scorm');
|
||||
$striframedisplay = get_string('iframedisplay', 'scorm');
|
||||
$strnewwindow = get_string('popup', 'scorm');
|
||||
$strnewwindowopen = get_string('popupopen', 'scorm');
|
||||
$strheight = get_string('height', 'scorm');
|
||||
$strwidth = get_string('width', 'scorm');
|
||||
$strresizable = get_string('resizable', 'scorm');
|
||||
$strscrollbars = get_string('scrollbars', 'scorm');
|
||||
$strdirectories = get_string('directories', 'scorm');
|
||||
$strlocation = get_string('location', 'scorm');
|
||||
$strmenubar = get_string('menubar', 'scorm');
|
||||
$strtoolbar = get_string('toolbar', 'scorm');
|
||||
$strstatus = get_string('statusbar', 'scorm');
|
||||
?>
|
||||
|
||||
<script type="text/javascript" src="<?php p($CFG->wwwroot) ?>/mod/scorm/request.js" ></script>
|
||||
<script type="text/javascript">
|
||||
function validate_scorm(theform,filename,confirmed) {
|
||||
var confirmedstr = '';
|
||||
if (confirmed == true) {
|
||||
confirmedstr = '&confirmed=true';
|
||||
}
|
||||
|
||||
var myRequest = NewHttpReq();
|
||||
result = DoRequest(myRequest,"<?php p($CFG->wwwroot) ?>/mod/scorm/validate.php","id=<?php p($form->course) ?>&reference="+filename+"<?php echo $sessionkey.$scormid.$datadir ?>");
|
||||
//alert(result);
|
||||
results = result.split('\n');
|
||||
result = '';
|
||||
errorlogs = '';
|
||||
datadir = '';
|
||||
for (i=0;i<results.length;i++) {
|
||||
element = results[i].split('=');
|
||||
switch(element[0]) {
|
||||
case 'result':
|
||||
result = element[1];
|
||||
break;
|
||||
case 'launch':
|
||||
launch = element[1];
|
||||
break;
|
||||
case 'datadir':
|
||||
datadir = element[1];
|
||||
break;
|
||||
case 'pkgtype':
|
||||
pkgtype = element[1];
|
||||
break;
|
||||
case 'errorlogs':
|
||||
i++;
|
||||
do {
|
||||
errorlogs.concat(results[i]+'\n');
|
||||
i++;
|
||||
} while (i<results.lenght());
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
if ((result == "found") || (result == "regular")) {
|
||||
theform.datadir.value = datadir;
|
||||
theform.pkgtype.value = pkgtype;
|
||||
theform.launch.value = launch;
|
||||
if (theform.mode.value == 'add') {
|
||||
theform.parse.value = 1;
|
||||
} else if (launch == 0) {
|
||||
theform.parse.value = 1;
|
||||
}
|
||||
return true;
|
||||
} else {
|
||||
if (result == "confirm") {
|
||||
response = confirm("<?php print_string('confirmloosetracks','scorm') ?>");
|
||||
if (response == true) {
|
||||
return validate_scorm(theform,filename,true);
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
result = '<?php print_string('validation','scorm') ?>: '+ result + '\n';
|
||||
if (errorlogs != '') {
|
||||
result.concat('<?php print_string('errorlogs','scorm') ?>:\n'+errorlogs);
|
||||
}
|
||||
alert(result);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function checkscormform (whatcheck,checkvalue,whatset) {
|
||||
if (whatcheck.options[whatcheck.selectedIndex].value == checkvalue) {
|
||||
whatset.disabled = true;
|
||||
} else {
|
||||
whatset.disabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
function showhide (id, set) {
|
||||
divobj = document.getElementById(id);
|
||||
butobj = document.getElementById(id+'button');
|
||||
prefobj = document.getElementById(id+'pref');
|
||||
if (set == true) {
|
||||
if (prefobj.value == '1') {
|
||||
divobj.style.display = 'block';
|
||||
butobj.value = '<?php print_string('hidesettings') ?>';
|
||||
} else {
|
||||
divobj.style.display = 'none';
|
||||
butobj.value = '<?php print_string('showsettings') ?>...';
|
||||
}
|
||||
} else {
|
||||
if (prefobj.value == '1') {
|
||||
divobj.style.display = 'none';
|
||||
butobj.value = '<?php print_string('showsettings') ?>...';
|
||||
prefobj.value = '0';
|
||||
} else {
|
||||
divobj.style.display = 'block';
|
||||
butobj.value = '<?php print_string('hidesettings') ?>';
|
||||
prefobj.value = '1';
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<form name="form" method="post" action="mod.php?goto=" onsubmit="return validate_scorm(document.form,document.form.reference.value,false,false);">
|
||||
<table cellpadding="5">
|
||||
<tr valign="top">
|
||||
<td align="right"><b><?php print_string('name') ?>:</b></td>
|
||||
<td>
|
||||
<input type="text" name="name" size="50" value="<?php p($form->name) ?>" alt="<?php print_string('name') ?>" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr valign="top">
|
||||
<td align="right"><b><?php print_string('summary') ?>:</b><br />
|
||||
<?php helpbutton('summary', get_string('summary'), 'scorm', true, true) ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php print_textarea($usehtmleditor, 10, 50, 680, 400, 'summary', $form->summary); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr valign="top">
|
||||
<td align="right" nowrap="nowrap">
|
||||
<b><?php echo $strfilename?>:</b>
|
||||
</td>
|
||||
<td>
|
||||
<input name="reference" size="50" value="<?php echo $form->reference ?>" alt="<?php echo $strfilename ?>" />
|
||||
<?php
|
||||
button_to_popup_window ('/files/index.php?id='.$course->id.'&choose=form.reference',
|
||||
'coursefiles', $strchooseafile, 500, 750, $strchooseafile);
|
||||
require_once($repositoryconfigfile);
|
||||
if ($CFG->repositoryactivate) {
|
||||
button_to_popup_window ($repositorybrowser.'?choose=form.reference',
|
||||
'browserepository', $strbrowserepository, 500, 750, $strbrowserepository);
|
||||
}
|
||||
helpbutton('package', get_string('coursepacket', 'scorm'), 'scorm', true);
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr valign="top">
|
||||
<td align="right"><b><?php print_string('grademethod', 'scorm') ?>:</b></td>
|
||||
<td>
|
||||
<?php
|
||||
choose_from_menu($SCORM_GRADE_METHOD, 'grademethod', (int) $form->grademethod, '','checkscormform(this,0,document.form.maxgrade);');
|
||||
helpbutton('grademethod', get_string('grademethod','scorm'), 'scorm');
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr valign="top">
|
||||
<td align="right"><b><?php print_string('maximumgrade') ?>:</b></td>
|
||||
<td>
|
||||
<?php
|
||||
for ($i=100; $i>=1; $i--) {
|
||||
$grades[$i] = $i;
|
||||
}
|
||||
$disabled = $form->grademethod=='0';
|
||||
choose_from_menu($grades, 'maxgrade', (int) $form->maxgrade, '','','0',false,$disabled);
|
||||
helpbutton('maxgrade', get_string('maximumgrade'), 'scorm');
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr valign="top">
|
||||
<td align="right"><b><?php print_string('maximumattempts','scorm') ?>:</b></td>
|
||||
<td>
|
||||
<?php
|
||||
for ($i=1; $i<=$CFG->scorm_maxattempts; $i++) {
|
||||
if ($i == 1) {
|
||||
$attempts[$i] = $i . ' ' . get_string('attempt','scorm');
|
||||
} else {
|
||||
$attempts[$i] = $i . ' ' . get_string('attempts','scorm');
|
||||
}
|
||||
}
|
||||
choose_from_menu($attempts, 'maxattempt', (int) $form->maxattempt, get_string('nolimit','scorm'),'checkscormform(this,1,document.form.whatgrade);');
|
||||
helpbutton('maxattempt', get_string('maximumattempts','scorm'), 'scorm');
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr valign="top">
|
||||
<td align="right"><b><?php print_string('whatgrade','scorm') ?>:</b></td>
|
||||
<td>
|
||||
<?php
|
||||
$disabled = (int) $form->maxattempt === 1;
|
||||
choose_from_menu($SCORM_WHAT_GRADE, 'whatgrade', (int) $form->whatgrade, '','','0',false,$disabled);
|
||||
helpbutton('whatgrade', get_string('whatgrade','scorm'), 'scorm');
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td colspan="2"><hr /></td></tr>
|
||||
|
||||
<tr>
|
||||
<td align="right"><b><?php print_string('advanced', 'scorm') ?>:</b></td>
|
||||
<td>
|
||||
<input type="button" value="<?php print_string('hidesettings') ?>" id="advancedsettingsbutton" onclick="javascript: return showhide('advancedsettings');" />
|
||||
<input type="hidden" name="advancedsettingspref" id="advancedsettingspref"
|
||||
value="<?php echo get_user_preferences('scorm_advancedsettingspref', $CFG->scorm_advancedsettings); ?>" />
|
||||
<?php helpbutton('advanced', get_string('advanced', 'scorm'), 'scorm', true) ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<div id="advancedsettings">
|
||||
<table align="center">
|
||||
<tr>
|
||||
<td align="right"><b><?php print_string('autocontinue','scorm') ?>:</b></td>
|
||||
<td>
|
||||
<?php
|
||||
$options = array();
|
||||
$options[0]=get_string('no');
|
||||
$options[1]=get_string('yes');
|
||||
choose_from_menu ($options, 'auto', (int) $form->auto,'');
|
||||
helpbutton('autocontinue', get_string('autocontinue','scorm'), 'scorm', true);
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right"><b><?php print_string('hidebrowse','scorm') ?>:</b></td>
|
||||
<td>
|
||||
<?php
|
||||
$options = array();
|
||||
$options[0]=get_string('no');
|
||||
$options[1]=get_string('yes');
|
||||
choose_from_menu ($options, 'hidebrowse', (int) $form->hidebrowse, '');
|
||||
helpbutton('browsemode', get_string('hidebrowse','scorm'), 'scorm', true);
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right"><b><?php print_string('hidetoc','scorm') ?>:</b></td>
|
||||
<td>
|
||||
<?php
|
||||
$options = array();
|
||||
$options[1]=get_string('hidden','scorm');
|
||||
$options[0]=get_string('sided','scorm');
|
||||
$options[2]=get_string('popupmenu','scorm');
|
||||
choose_from_menu ($options, 'hidetoc', (int) $form->hidetoc, '');
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right"><b><?php print_string('hidenav','scorm') ?>:</b></td>
|
||||
<td>
|
||||
<?php
|
||||
$options = array();
|
||||
$options[0]=get_string('no');
|
||||
$options[1]=get_string('yes');
|
||||
choose_from_menu ($options, 'hidenav', (int) $form->hidenav, '');
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right"><b><?php print_string('window', 'scorm') ?>:</b></td>
|
||||
<td>
|
||||
<input type="button" value="<?php print_string('hidesettings') ?>" id="windowsettingsbutton" onclick="javascript: return showhide('windowsettings');" />
|
||||
<input type="hidden" name="windowsettingspref" id="windowsettingspref"
|
||||
value="<?php echo get_user_preferences('scorm_windowsettingspref', $CFG->scorm_windowsettings); ?>" />
|
||||
<?php helpbutton('window', get_string('window', 'scorm'), 'scorm', true) ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<div id="windowsettings">
|
||||
<table align="center">
|
||||
<tr valign="top">
|
||||
<td>
|
||||
<b><?php print_string('stagesize','scorm'); ?></b>
|
||||
<?php helpbutton('size', get_string('stagesize', 'scorm'), 'scorm', true) ?><br />
|
||||
<input name="width" type="text" size="4" value="<?php p($form->width) ?>" alt="<?php p($strwidth) ?>" />
|
||||
<label for="width"><?php p($strwidth) ?></label><br />
|
||||
<input name="height" type="text" size="4" value="<?php p($form->height) ?>" alt="<?php p($strheight) ?>" />
|
||||
<label for="height"><?php p($strheight) ?></label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr valign="top">
|
||||
<td>
|
||||
<script type="text/javascript">
|
||||
var popupitems = ["<?php echo implode('","',array_keys($SCORM_POPUP_OPTIONS)); ?>"];
|
||||
</script>
|
||||
<br /><b><?php print_string('display','scorm'); ?>:</b><br />
|
||||
<input type="radio"
|
||||
name="popup"
|
||||
value="0" alt="<?php p($striframe) ?>"
|
||||
<?php echo ($form->popup == 0) ? "checked=\"checked\"" : "" ?>
|
||||
onclick="return lockoptions('form', 'popup[1]', popupitems);"
|
||||
/>
|
||||
<b title="<?php p($striframedisplay) ?>"><?php p($striframe) ?></b>
|
||||
</td>
|
||||
</tr>
|
||||
<tr valign="top">
|
||||
<td>
|
||||
<input name="popup"
|
||||
type="radio"
|
||||
value="1"
|
||||
alt="<?php p($strnewwindow)?>"
|
||||
<?php echo ($form->popup == 1) ? 'checked="checked"' : '' ?>
|
||||
onclick="return lockoptions('form', 'popup[1]', popupitems);"
|
||||
/>
|
||||
<b title="<?php p($strnewwindowopen) ?>"><?php p($strnewwindow) ?></b>
|
||||
<blockquote>
|
||||
<?php
|
||||
foreach ($window as $name => $value) {
|
||||
echo "<input name=\"h$name\" type=\"hidden\" value=\"0\"/>\n";
|
||||
echo "<input name=\"$name\" type=\"checkbox\" value=\"1\" ".$window->$name." alt=\"$name\" />\n";
|
||||
$stringname = "str$name";
|
||||
echo $$stringname."<br />\n";
|
||||
}
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
lockoptions('form','popup[1]', popupitems);
|
||||
</script>
|
||||
</blockquote>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<script language="javascript" type="text/javascript">
|
||||
showhide('advancedsettings', true);
|
||||
showhide('windowsettings', true);
|
||||
</script>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<input type="hidden" name="datadir" value="<?php p($form->datadir) ?>" />
|
||||
<input type="hidden" name="pkgtype" value="<?php p($form->pkgtype) ?>" />
|
||||
<input type="hidden" name="launch" value="<?php p($form->launch) ?>" />
|
||||
<input type="hidden" name="parse" value="0" />
|
||||
<?php
|
||||
$scorms = get_all_instances_in_course('scorm', $course);
|
||||
$coursescorm = current($scorms);
|
||||
if (($course->format == 'scorm') && ((count($scorms) == 0) || ($form->instance == $coursescorm->id))) {
|
||||
?>
|
||||
<input type="hidden" name="redirect" value="yes" />
|
||||
<input type="hidden" name="redirecturl" value="../course/view.php?id=<?php p($form->course) ?>" />
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<input type="hidden" name="course" value="<?php p($form->course) ?>" />
|
||||
<input type="hidden" name="sesskey" value="<?php p($form->sesskey) ?>" />
|
||||
<input type="hidden" name="section" value="<?php p($form->section) ?>" />
|
||||
<input type="hidden" name="module" value="<?php p($form->module) ?>" />
|
||||
<input type="hidden" name="mode" value="<?php p($form->mode) ?>" />
|
||||
<input type="hidden" name="coursemodule" value="<?php p($form->coursemodule) ?>" />
|
||||
<input type="hidden" name="modulename" value="<?php p($form->modulename) ?>" />
|
||||
<input type="hidden" name="instance" value="<?php p($form->instance) ?>" />
|
||||
<center>
|
||||
<input type="submit" value="<?php print_string('savechanges') ?>"/>
|
||||
<input type="button" name="cancel" value="<?php print_string('cancel') ?>" onclick="document.location='view.php?id=<?php echo $form->course ?>'" />
|
||||
</center>
|
||||
</form>
|
||||
|
||||
+514
-514
File diff suppressed because it is too large
Load Diff
+83
-83
@@ -1,83 +1,83 @@
|
||||
.structlist {
|
||||
list-style-type: none;
|
||||
white-space: nowrap;
|
||||
font-size: small;
|
||||
}
|
||||
.orgtitle {
|
||||
font-weight: bold;
|
||||
font-size: small;
|
||||
}
|
||||
.mod-scorm .top {
|
||||
vertical-align: top;
|
||||
}
|
||||
.mod-scorm .left {
|
||||
text-align: left;
|
||||
}
|
||||
.mod-scorm .center {
|
||||
text-align: center;
|
||||
}
|
||||
.mod-scorm .right {
|
||||
text-align: right;
|
||||
}
|
||||
.mod-scorm .scoframe {
|
||||
|
||||
}
|
||||
|
||||
#mod-scorm-player #scormpage {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
}
|
||||
#mod-scorm-player #tocbox {
|
||||
position: absolute;
|
||||
left: 0px;
|
||||
top: 0px;
|
||||
width: 19%;
|
||||
}
|
||||
#mod-scorm-player #tochead {
|
||||
text-align: center;
|
||||
font-weight: bold;
|
||||
}
|
||||
#mod-scorm-player #scormbox {
|
||||
position: absolute;
|
||||
right: 0px;
|
||||
top: 0px;
|
||||
}
|
||||
#mod-scorm-player .toc {
|
||||
width: 80%;
|
||||
margin-left: 20%;
|
||||
}
|
||||
#mod-scorm-player .no-toc {
|
||||
width: 100%;
|
||||
}
|
||||
#mod-scorm-player #scormobject {
|
||||
/* border: 1px solid black; */
|
||||
}
|
||||
#mod-scorm-player #scormtop {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
height: 30px;
|
||||
}
|
||||
#mod-scorm-player #scormbrowse {
|
||||
position: absolute;
|
||||
left: 5px;
|
||||
top: 0px;
|
||||
}
|
||||
#mod-scorm-player #scormnav {
|
||||
position: absolute;
|
||||
right: 5px;
|
||||
top: 0px;
|
||||
}
|
||||
#mod-scorm-player .structurelist {
|
||||
list-style-type: none;
|
||||
text-indent:-4ex;
|
||||
font-size: small;
|
||||
}
|
||||
|
||||
#mod-scorm-view .structurehead {
|
||||
font-weight: bold;
|
||||
text-align: center;
|
||||
}
|
||||
#mod-scorm-view .structurelist {
|
||||
list-style-type: none;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.structlist {
|
||||
list-style-type: none;
|
||||
white-space: nowrap;
|
||||
font-size: small;
|
||||
}
|
||||
.orgtitle {
|
||||
font-weight: bold;
|
||||
font-size: small;
|
||||
}
|
||||
.mod-scorm .top {
|
||||
vertical-align: top;
|
||||
}
|
||||
.mod-scorm .left {
|
||||
text-align: left;
|
||||
}
|
||||
.mod-scorm .center {
|
||||
text-align: center;
|
||||
}
|
||||
.mod-scorm .right {
|
||||
text-align: right;
|
||||
}
|
||||
.mod-scorm .scoframe {
|
||||
|
||||
}
|
||||
|
||||
#mod-scorm-player #scormpage {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
}
|
||||
#mod-scorm-player #tocbox {
|
||||
position: absolute;
|
||||
left: 0px;
|
||||
top: 0px;
|
||||
width: 19%;
|
||||
}
|
||||
#mod-scorm-player #tochead {
|
||||
text-align: center;
|
||||
font-weight: bold;
|
||||
}
|
||||
#mod-scorm-player #scormbox {
|
||||
position: absolute;
|
||||
right: 0px;
|
||||
top: 0px;
|
||||
}
|
||||
#mod-scorm-player .toc {
|
||||
width: 80%;
|
||||
margin-left: 20%;
|
||||
}
|
||||
#mod-scorm-player .no-toc {
|
||||
width: 100%;
|
||||
}
|
||||
#mod-scorm-player #scormobject {
|
||||
/* border: 1px solid black; */
|
||||
}
|
||||
#mod-scorm-player #scormtop {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
height: 30px;
|
||||
}
|
||||
#mod-scorm-player #scormbrowse {
|
||||
position: absolute;
|
||||
left: 5px;
|
||||
top: 0px;
|
||||
}
|
||||
#mod-scorm-player #scormnav {
|
||||
position: absolute;
|
||||
right: 5px;
|
||||
top: 0px;
|
||||
}
|
||||
#mod-scorm-player .structurelist {
|
||||
list-style-type: none;
|
||||
text-indent:-4ex;
|
||||
font-size: small;
|
||||
}
|
||||
|
||||
#mod-scorm-view .structurehead {
|
||||
font-weight: bold;
|
||||
text-align: center;
|
||||
}
|
||||
#mod-scorm-view .structurelist {
|
||||
list-style-type: none;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
+29
-29
@@ -1,29 +1,29 @@
|
||||
<?php
|
||||
require_once('../../config.php');
|
||||
require_once('locallib.php');
|
||||
|
||||
$id = required_param('id', PARAM_INT); // course ID
|
||||
$scormid = required_param('scorm', PARAM_INT); // scorm ID
|
||||
$scoid = required_param('sco', PARAM_INT); // suspend sco ID
|
||||
$userid = required_param('userid', PARAM_INT); // user ID
|
||||
|
||||
$attempt = scorm_get_last_attempt($scormid,$userid);
|
||||
$statistic = get_record('scorm_statistic',"scormid",$scormid,"userid",$userid);
|
||||
$statisticInput->accesstime = $statistic->accesstime;
|
||||
$statisticInput->durationtime = $statistic->durationtime + time()- $statistic->accesstime;
|
||||
$statisticInput->status = 'suspend';
|
||||
$statisticInput->attemptnumber = $attempt;
|
||||
$statisticInput->scormid = $statistic->scormid;
|
||||
$statisticInput->userid = $statistic->userid;
|
||||
$statisticid = scorm_insert_statistic($statisticInput);
|
||||
|
||||
$result = scorm_insert_trackmodel($userid, $scormid, $scoid,$attempt);
|
||||
if ($result) {
|
||||
echo "<script language='Javascript' type='text/javascript'>";
|
||||
echo "location.href='".$CFG->wwwroot." /course/view.php?id=".$id."';";
|
||||
echo "</script>";
|
||||
} else {
|
||||
echo "Suspend failed";
|
||||
}
|
||||
?>
|
||||
|
||||
<?php
|
||||
require_once('../../config.php');
|
||||
require_once('locallib.php');
|
||||
|
||||
$id = required_param('id', PARAM_INT); // course ID
|
||||
$scormid = required_param('scorm', PARAM_INT); // scorm ID
|
||||
$scoid = required_param('sco', PARAM_INT); // suspend sco ID
|
||||
$userid = required_param('userid', PARAM_INT); // user ID
|
||||
|
||||
$attempt = scorm_get_last_attempt($scormid,$userid);
|
||||
$statistic = get_record('scorm_statistic',"scormid",$scormid,"userid",$userid);
|
||||
$statisticInput->accesstime = $statistic->accesstime;
|
||||
$statisticInput->durationtime = $statistic->durationtime + time()- $statistic->accesstime;
|
||||
$statisticInput->status = 'suspend';
|
||||
$statisticInput->attemptnumber = $attempt;
|
||||
$statisticInput->scormid = $statistic->scormid;
|
||||
$statisticInput->userid = $statistic->userid;
|
||||
$statisticid = scorm_insert_statistic($statisticInput);
|
||||
|
||||
$result = scorm_insert_trackmodel($userid, $scormid, $scoid,$attempt);
|
||||
if ($result) {
|
||||
echo "<script language='Javascript' type='text/javascript'>";
|
||||
echo "location.href='".$CFG->wwwroot." /course/view.php?id=".$id."';";
|
||||
echo "</script>";
|
||||
} else {
|
||||
echo "Suspend failed";
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
+193
-193
@@ -1,193 +1,193 @@
|
||||
# phpMyAdmin MySQL-Dump
|
||||
# version 2.2.1
|
||||
# http://phpwizard.net/phpMyAdmin/
|
||||
# http://phpmyadmin.sourceforge.net/ (download page)
|
||||
#
|
||||
# Host: localhost
|
||||
# Generation Time: Nov 14, 2001 at 04:39 PM
|
||||
# Server version: 3.23.36
|
||||
# PHP Version: 4.0.6
|
||||
# Database : `moodle`
|
||||
# --------------------------------------------------------
|
||||
|
||||
#
|
||||
# Table structure for table `survey`
|
||||
#
|
||||
|
||||
CREATE TABLE prefix_survey (
|
||||
id int(10) unsigned NOT NULL auto_increment,
|
||||
course int(10) unsigned NOT NULL default '0',
|
||||
template int(10) unsigned NOT NULL default '0',
|
||||
days smallint(6) NOT NULL default '0',
|
||||
timecreated int(10) unsigned NOT NULL default '0',
|
||||
timemodified int(10) unsigned NOT NULL default '0',
|
||||
name varchar(255) NOT NULL default '',
|
||||
intro text NOT NULL default '',
|
||||
questions varchar(255) NOT NULL default '',
|
||||
PRIMARY KEY (id),
|
||||
KEY `course` (`course`)
|
||||
) TYPE=MyISAM COMMENT='all surveys';
|
||||
|
||||
#
|
||||
# Dumping data for table `survey`
|
||||
#
|
||||
|
||||
INSERT INTO `prefix_survey` (`id`, `course`, `template`, `days`, `timecreated`, `timemodified`, `name`, `intro`, `questions`) VALUES (1, 0, 0, 0, 985017600, 985017600, 'collesaname', 'collesaintro', '25,26,27,28,29,30,43,44');
|
||||
INSERT INTO `prefix_survey` (`id`, `course`, `template`, `days`, `timecreated`, `timemodified`, `name`, `intro`, `questions`) VALUES (2, 0, 0, 0, 985017600, 985017600, 'collespname', 'collespintro', '31,32,33,34,35,36,43,44');
|
||||
INSERT INTO `prefix_survey` (`id`, `course`, `template`, `days`, `timecreated`, `timemodified`, `name`, `intro`, `questions`) VALUES (3, 0, 0, 0, 985017600, 985017600, 'collesapname', 'collesapintro', '37,38,39,40,41,42,43,44');
|
||||
INSERT INTO `prefix_survey` (`id`, `course`, `template`, `days`, `timecreated`, `timemodified`, `name`, `intro`, `questions`) VALUES (4, 0, 0, 0, 985017600, 985017600, 'attlsname', 'attlsintro', '65,67,68');
|
||||
INSERT INTO `prefix_survey` (`id`, `course`, `template`, `days`, `timecreated`, `timemodified`, `name`, `intro`, `questions`) VALUES (5, 0, 0, 0, 985017600, 985017600, 'ciqname', 'ciqintro', '69,70,71,72,73');
|
||||
|
||||
|
||||
|
||||
#
|
||||
# Table structure for table `survey_analysis`
|
||||
#
|
||||
|
||||
CREATE TABLE prefix_survey_analysis (
|
||||
id int(10) unsigned NOT NULL auto_increment,
|
||||
survey int(10) unsigned NOT NULL default '0',
|
||||
userid int(10) unsigned NOT NULL default '0',
|
||||
notes text NOT NULL default '',
|
||||
PRIMARY KEY (id),
|
||||
UNIQUE KEY id (id),
|
||||
KEY survey (survey),
|
||||
KEY userid (userid)
|
||||
) TYPE=MyISAM;
|
||||
|
||||
#
|
||||
# Dumping data for table `survey_analysis`
|
||||
#
|
||||
|
||||
# --------------------------------------------------------
|
||||
|
||||
#
|
||||
# Table structure for table `survey_answers`
|
||||
#
|
||||
|
||||
CREATE TABLE prefix_survey_answers (
|
||||
id int(10) unsigned NOT NULL auto_increment,
|
||||
userid int(10) unsigned NOT NULL default '0',
|
||||
survey int(10) unsigned NOT NULL default '0',
|
||||
question int(10) unsigned NOT NULL default '0',
|
||||
time int(10) unsigned NOT NULL default '0',
|
||||
answer1 text NOT NULL default '',
|
||||
answer2 text NOT NULL default '',
|
||||
PRIMARY KEY (id),
|
||||
UNIQUE KEY id (id),
|
||||
KEY userid (userid),
|
||||
KEY survey (survey),
|
||||
KEY question (question)
|
||||
) TYPE=MyISAM;
|
||||
|
||||
#
|
||||
# Dumping data for table `survey_answers`
|
||||
#
|
||||
|
||||
# --------------------------------------------------------
|
||||
|
||||
#
|
||||
# Table structure for table `survey_questions`
|
||||
#
|
||||
|
||||
CREATE TABLE `prefix_survey_questions` (
|
||||
`id` int(10) unsigned NOT NULL auto_increment,
|
||||
`text` varchar(255) NOT NULL default '',
|
||||
`shorttext` varchar(30) NOT NULL default '',
|
||||
`multi` varchar(100) NOT NULL default '',
|
||||
`intro` varchar(50) NOT NULL default '',
|
||||
`type` tinyint(3) NOT NULL default '0',
|
||||
`options` text,
|
||||
PRIMARY KEY (`id`)
|
||||
) TYPE=MyISAM;
|
||||
|
||||
#
|
||||
# Dumping data for table `survey_questions`
|
||||
#
|
||||
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (1, 'colles1', 'colles1short', '', '', 1, 'scaletimes5');
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (2, 'colles2', 'colles2short', '', '', 1, 'scaletimes5');
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (3, 'colles3', 'colles3short', '', '', 1, 'scaletimes5');
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (4, 'colles4', 'colles4short', '', '', 1, 'scaletimes5');
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (5, 'colles5', 'colles5short', '', '', 1, 'scaletimes5');
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (6, 'colles6', 'colles6short', '', '', 1, 'scaletimes5');
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (7, 'colles7', 'colles7short', '', '', 1, 'scaletimes5');
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (8, 'colles8', 'colles8short', '', '', 1, 'scaletimes5');
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (9, 'colles9', 'colles9short', '', '', 1, 'scaletimes5');
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (10, 'colles10', 'colles10short', '', '', 1, 'scaletimes5');
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (11, 'colles11', 'colles11short', '', '', 1, 'scaletimes5');
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (12, 'colles12', 'colles12short', '', '', 1, 'scaletimes5');
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (13, 'colles13', 'colles13short', '', '', 1, 'scaletimes5');
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (14, 'colles14', 'colles14short', '', '', 1, 'scaletimes5');
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (15, 'colles15', 'colles15short', '', '', 1, 'scaletimes5');
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (16, 'colles16', 'colles16short', '', '', 1, 'scaletimes5');
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (17, 'colles17', 'colles17short', '', '', 1, 'scaletimes5');
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (18, 'colles18', 'colles18short', '', '', 1, 'scaletimes5');
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (19, 'colles19', 'colles19short', '', '', 1, 'scaletimes5');
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (20, 'colles20', 'colles20short', '', '', 1, 'scaletimes5');
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (21, 'colles21', 'colles21short', '', '', 1, 'scaletimes5');
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (22, 'colles22', 'colles22short', '', '', 1, 'scaletimes5');
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (23, 'colles23', 'colles23short', '', '', 1, 'scaletimes5');
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (24, 'colles24', 'colles24short', '', '', 1, 'scaletimes5');
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (25, 'collesm1', 'collesm1short', '1,2,3,4', 'collesmintro', 1, 'scaletimes5');
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (26, 'collesm2', 'collesm2short', '5,6,7,8', 'collesmintro', 1, 'scaletimes5');
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (27, 'collesm3', 'collesm3short', '9,10,11,12', 'collesmintro', 1, 'scaletimes5');
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (28, 'collesm4', 'collesm4short', '13,14,15,16', 'collesmintro', 1, 'scaletimes5');
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (29, 'collesm5', 'collesm5short', '17,18,19,20', 'collesmintro', 1, 'scaletimes5');
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (30, 'collesm6', 'collesm6short', '21,22,23,24', 'collesmintro', 1, 'scaletimes5');
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (31, 'collesm1', 'collesm1short', '1,2,3,4', 'collesmintro', 2, 'scaletimes5');
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (32, 'collesm2', 'collesm2short', '5,6,7,8', 'collesmintro', 2, 'scaletimes5');
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (33, 'collesm3', 'collesm3short', '9,10,11,12', 'collesmintro', 2, 'scaletimes5');
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (34, 'collesm4', 'collesm4short', '13,14,15,16', 'collesmintro', 2, 'scaletimes5');
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (35, 'collesm5', 'collesm5short', '17,18,19,20', 'collesmintro', 2, 'scaletimes5');
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (36, 'collesm6', 'collesm6short', '21,22,23,24', 'collesmintro', 2, 'scaletimes5');
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (37, 'collesm1', 'collesm1short', '1,2,3,4', 'collesmintro', 3, 'scaletimes5');
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (38, 'collesm2', 'collesm2short', '5,6,7,8', 'collesmintro', 3, 'scaletimes5');
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (39, 'collesm3', 'collesm3short', '9,10,11,12', 'collesmintro', 3, 'scaletimes5');
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (40, 'collesm4', 'collesm4short', '13,14,15,16', 'collesmintro', 3, 'scaletimes5');
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (41, 'collesm5', 'collesm5short', '17,18,19,20', 'collesmintro', 3, 'scaletimes5');
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (42, 'collesm6', 'collesm6short', '21,22,23,24', 'collesmintro', 3, 'scaletimes5');
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (43, 'howlong', '', '', '', 1, 'howlongoptions');
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (44, 'othercomments', '', '', '', 0, '');
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (64, 'attls20', 'attls20short', '', '', 1, 'scaleagree5');
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (58, 'attls14', 'attls14short', '', '', 1, 'scaleagree5');
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (59, 'attls15', 'attls15short', '', '', 1, 'scaleagree5');
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (60, 'attls16', 'attls16short', '', '', 1, 'scaleagree5');
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (61, 'attls17', 'attls17short', '', '', 1, 'scaleagree5');
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (62, 'attls18', 'attls18short', '', '', 1, 'scaleagree5');
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (63, 'attls19', 'attls19short', '', '', 1, 'scaleagree5');
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (56, 'attls12', 'attls12short', '', '', 1, 'scaleagree5');
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (57, 'attls13', 'attls13short', '', '', 1, 'scaleagree5');
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (55, 'attls11', 'attls11short', '', '', 1, 'scaleagree5');
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (54, 'attls10', 'attls10short', '', '', 1, 'scaleagree5');
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (53, 'attls9', 'attls9short', '', '', 1, 'scaleagree5');
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (52, 'attls8', 'attls8short', '', '', 1, 'scaleagree5');
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (51, 'attls7', 'attls7short', '', '', 1, 'scaleagree5');
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (50, 'attls6', 'attls6short', '', '', 1, 'scaleagree5');
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (49, 'attls5', 'attls5short', '', '', 1, 'scaleagree5');
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (48, 'attls4', 'attls4short', '', '', 1, 'scaleagree5');
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (47, 'attls3', 'attls3short', '', '', 1, 'scaleagree5');
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (45, 'attls1', 'attls1short', '', '', 1, 'scaleagree5');
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (46, 'attls2', 'attls2short', '', '', 1, 'scaleagree5');
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (65, 'attlsm1', 'attlsm1', '45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64', 'attlsmintro', 1, 'scaleagree5');
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (67, 'attlsm2', 'attlsm2', '63,62,59,57,55,49,52,50,48,47', 'attlsmintro', -1, 'scaleagree5');
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (68, 'attlsm3', 'attlsm3', '46,54,45,51,60,53,56,58,61,64', 'attlsmintro', -1, 'scaleagree5');
|
||||
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (69, 'ciq1', 'ciq1short', '', '', 0, '');
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (70, 'ciq2', 'ciq2short', '', '', 0, '');
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (71, 'ciq3', 'ciq3short', '', '', 0, '');
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (72, 'ciq4', 'ciq4short', '', '', 0, '');
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (73, 'ciq5', 'ciq5short', '', '', 0, '');
|
||||
|
||||
|
||||
#
|
||||
# Dumping data for table `log_display`
|
||||
#
|
||||
|
||||
INSERT INTO prefix_log_display (module, action, mtable, field) VALUES ('survey', 'add', 'survey', 'name');
|
||||
INSERT INTO prefix_log_display (module, action, mtable, field) VALUES ('survey', 'update', 'survey', 'name');
|
||||
INSERT INTO prefix_log_display (module, action, mtable, field) VALUES ('survey', 'download', 'survey', 'name');
|
||||
INSERT INTO prefix_log_display (module, action, mtable, field) VALUES ('survey', 'view form', 'survey', 'name');
|
||||
INSERT INTO prefix_log_display (module, action, mtable, field) VALUES ('survey', 'view graph', 'survey', 'name');
|
||||
INSERT INTO prefix_log_display (module, action, mtable, field) VALUES ('survey', 'view report', 'survey', 'name');
|
||||
INSERT INTO prefix_log_display (module, action, mtable, field) VALUES ('survey', 'submit', 'survey', 'name');
|
||||
# phpMyAdmin MySQL-Dump
|
||||
# version 2.2.1
|
||||
# http://phpwizard.net/phpMyAdmin/
|
||||
# http://phpmyadmin.sourceforge.net/ (download page)
|
||||
#
|
||||
# Host: localhost
|
||||
# Generation Time: Nov 14, 2001 at 04:39 PM
|
||||
# Server version: 3.23.36
|
||||
# PHP Version: 4.0.6
|
||||
# Database : `moodle`
|
||||
# --------------------------------------------------------
|
||||
|
||||
#
|
||||
# Table structure for table `survey`
|
||||
#
|
||||
|
||||
CREATE TABLE prefix_survey (
|
||||
id int(10) unsigned NOT NULL auto_increment,
|
||||
course int(10) unsigned NOT NULL default '0',
|
||||
template int(10) unsigned NOT NULL default '0',
|
||||
days smallint(6) NOT NULL default '0',
|
||||
timecreated int(10) unsigned NOT NULL default '0',
|
||||
timemodified int(10) unsigned NOT NULL default '0',
|
||||
name varchar(255) NOT NULL default '',
|
||||
intro text NOT NULL default '',
|
||||
questions varchar(255) NOT NULL default '',
|
||||
PRIMARY KEY (id),
|
||||
KEY `course` (`course`)
|
||||
) TYPE=MyISAM COMMENT='all surveys';
|
||||
|
||||
#
|
||||
# Dumping data for table `survey`
|
||||
#
|
||||
|
||||
INSERT INTO `prefix_survey` (`id`, `course`, `template`, `days`, `timecreated`, `timemodified`, `name`, `intro`, `questions`) VALUES (1, 0, 0, 0, 985017600, 985017600, 'collesaname', 'collesaintro', '25,26,27,28,29,30,43,44');
|
||||
INSERT INTO `prefix_survey` (`id`, `course`, `template`, `days`, `timecreated`, `timemodified`, `name`, `intro`, `questions`) VALUES (2, 0, 0, 0, 985017600, 985017600, 'collespname', 'collespintro', '31,32,33,34,35,36,43,44');
|
||||
INSERT INTO `prefix_survey` (`id`, `course`, `template`, `days`, `timecreated`, `timemodified`, `name`, `intro`, `questions`) VALUES (3, 0, 0, 0, 985017600, 985017600, 'collesapname', 'collesapintro', '37,38,39,40,41,42,43,44');
|
||||
INSERT INTO `prefix_survey` (`id`, `course`, `template`, `days`, `timecreated`, `timemodified`, `name`, `intro`, `questions`) VALUES (4, 0, 0, 0, 985017600, 985017600, 'attlsname', 'attlsintro', '65,67,68');
|
||||
INSERT INTO `prefix_survey` (`id`, `course`, `template`, `days`, `timecreated`, `timemodified`, `name`, `intro`, `questions`) VALUES (5, 0, 0, 0, 985017600, 985017600, 'ciqname', 'ciqintro', '69,70,71,72,73');
|
||||
|
||||
|
||||
|
||||
#
|
||||
# Table structure for table `survey_analysis`
|
||||
#
|
||||
|
||||
CREATE TABLE prefix_survey_analysis (
|
||||
id int(10) unsigned NOT NULL auto_increment,
|
||||
survey int(10) unsigned NOT NULL default '0',
|
||||
userid int(10) unsigned NOT NULL default '0',
|
||||
notes text NOT NULL default '',
|
||||
PRIMARY KEY (id),
|
||||
UNIQUE KEY id (id),
|
||||
KEY survey (survey),
|
||||
KEY userid (userid)
|
||||
) TYPE=MyISAM;
|
||||
|
||||
#
|
||||
# Dumping data for table `survey_analysis`
|
||||
#
|
||||
|
||||
# --------------------------------------------------------
|
||||
|
||||
#
|
||||
# Table structure for table `survey_answers`
|
||||
#
|
||||
|
||||
CREATE TABLE prefix_survey_answers (
|
||||
id int(10) unsigned NOT NULL auto_increment,
|
||||
userid int(10) unsigned NOT NULL default '0',
|
||||
survey int(10) unsigned NOT NULL default '0',
|
||||
question int(10) unsigned NOT NULL default '0',
|
||||
time int(10) unsigned NOT NULL default '0',
|
||||
answer1 text NOT NULL default '',
|
||||
answer2 text NOT NULL default '',
|
||||
PRIMARY KEY (id),
|
||||
UNIQUE KEY id (id),
|
||||
KEY userid (userid),
|
||||
KEY survey (survey),
|
||||
KEY question (question)
|
||||
) TYPE=MyISAM;
|
||||
|
||||
#
|
||||
# Dumping data for table `survey_answers`
|
||||
#
|
||||
|
||||
# --------------------------------------------------------
|
||||
|
||||
#
|
||||
# Table structure for table `survey_questions`
|
||||
#
|
||||
|
||||
CREATE TABLE `prefix_survey_questions` (
|
||||
`id` int(10) unsigned NOT NULL auto_increment,
|
||||
`text` varchar(255) NOT NULL default '',
|
||||
`shorttext` varchar(30) NOT NULL default '',
|
||||
`multi` varchar(100) NOT NULL default '',
|
||||
`intro` varchar(50) NOT NULL default '',
|
||||
`type` tinyint(3) NOT NULL default '0',
|
||||
`options` text,
|
||||
PRIMARY KEY (`id`)
|
||||
) TYPE=MyISAM;
|
||||
|
||||
#
|
||||
# Dumping data for table `survey_questions`
|
||||
#
|
||||
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (1, 'colles1', 'colles1short', '', '', 1, 'scaletimes5');
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (2, 'colles2', 'colles2short', '', '', 1, 'scaletimes5');
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (3, 'colles3', 'colles3short', '', '', 1, 'scaletimes5');
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (4, 'colles4', 'colles4short', '', '', 1, 'scaletimes5');
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (5, 'colles5', 'colles5short', '', '', 1, 'scaletimes5');
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (6, 'colles6', 'colles6short', '', '', 1, 'scaletimes5');
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (7, 'colles7', 'colles7short', '', '', 1, 'scaletimes5');
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (8, 'colles8', 'colles8short', '', '', 1, 'scaletimes5');
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (9, 'colles9', 'colles9short', '', '', 1, 'scaletimes5');
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (10, 'colles10', 'colles10short', '', '', 1, 'scaletimes5');
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (11, 'colles11', 'colles11short', '', '', 1, 'scaletimes5');
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (12, 'colles12', 'colles12short', '', '', 1, 'scaletimes5');
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (13, 'colles13', 'colles13short', '', '', 1, 'scaletimes5');
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (14, 'colles14', 'colles14short', '', '', 1, 'scaletimes5');
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (15, 'colles15', 'colles15short', '', '', 1, 'scaletimes5');
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (16, 'colles16', 'colles16short', '', '', 1, 'scaletimes5');
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (17, 'colles17', 'colles17short', '', '', 1, 'scaletimes5');
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (18, 'colles18', 'colles18short', '', '', 1, 'scaletimes5');
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (19, 'colles19', 'colles19short', '', '', 1, 'scaletimes5');
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (20, 'colles20', 'colles20short', '', '', 1, 'scaletimes5');
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (21, 'colles21', 'colles21short', '', '', 1, 'scaletimes5');
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (22, 'colles22', 'colles22short', '', '', 1, 'scaletimes5');
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (23, 'colles23', 'colles23short', '', '', 1, 'scaletimes5');
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (24, 'colles24', 'colles24short', '', '', 1, 'scaletimes5');
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (25, 'collesm1', 'collesm1short', '1,2,3,4', 'collesmintro', 1, 'scaletimes5');
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (26, 'collesm2', 'collesm2short', '5,6,7,8', 'collesmintro', 1, 'scaletimes5');
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (27, 'collesm3', 'collesm3short', '9,10,11,12', 'collesmintro', 1, 'scaletimes5');
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (28, 'collesm4', 'collesm4short', '13,14,15,16', 'collesmintro', 1, 'scaletimes5');
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (29, 'collesm5', 'collesm5short', '17,18,19,20', 'collesmintro', 1, 'scaletimes5');
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (30, 'collesm6', 'collesm6short', '21,22,23,24', 'collesmintro', 1, 'scaletimes5');
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (31, 'collesm1', 'collesm1short', '1,2,3,4', 'collesmintro', 2, 'scaletimes5');
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (32, 'collesm2', 'collesm2short', '5,6,7,8', 'collesmintro', 2, 'scaletimes5');
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (33, 'collesm3', 'collesm3short', '9,10,11,12', 'collesmintro', 2, 'scaletimes5');
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (34, 'collesm4', 'collesm4short', '13,14,15,16', 'collesmintro', 2, 'scaletimes5');
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (35, 'collesm5', 'collesm5short', '17,18,19,20', 'collesmintro', 2, 'scaletimes5');
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (36, 'collesm6', 'collesm6short', '21,22,23,24', 'collesmintro', 2, 'scaletimes5');
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (37, 'collesm1', 'collesm1short', '1,2,3,4', 'collesmintro', 3, 'scaletimes5');
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (38, 'collesm2', 'collesm2short', '5,6,7,8', 'collesmintro', 3, 'scaletimes5');
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (39, 'collesm3', 'collesm3short', '9,10,11,12', 'collesmintro', 3, 'scaletimes5');
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (40, 'collesm4', 'collesm4short', '13,14,15,16', 'collesmintro', 3, 'scaletimes5');
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (41, 'collesm5', 'collesm5short', '17,18,19,20', 'collesmintro', 3, 'scaletimes5');
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (42, 'collesm6', 'collesm6short', '21,22,23,24', 'collesmintro', 3, 'scaletimes5');
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (43, 'howlong', '', '', '', 1, 'howlongoptions');
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (44, 'othercomments', '', '', '', 0, '');
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (64, 'attls20', 'attls20short', '', '', 1, 'scaleagree5');
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (58, 'attls14', 'attls14short', '', '', 1, 'scaleagree5');
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (59, 'attls15', 'attls15short', '', '', 1, 'scaleagree5');
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (60, 'attls16', 'attls16short', '', '', 1, 'scaleagree5');
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (61, 'attls17', 'attls17short', '', '', 1, 'scaleagree5');
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (62, 'attls18', 'attls18short', '', '', 1, 'scaleagree5');
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (63, 'attls19', 'attls19short', '', '', 1, 'scaleagree5');
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (56, 'attls12', 'attls12short', '', '', 1, 'scaleagree5');
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (57, 'attls13', 'attls13short', '', '', 1, 'scaleagree5');
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (55, 'attls11', 'attls11short', '', '', 1, 'scaleagree5');
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (54, 'attls10', 'attls10short', '', '', 1, 'scaleagree5');
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (53, 'attls9', 'attls9short', '', '', 1, 'scaleagree5');
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (52, 'attls8', 'attls8short', '', '', 1, 'scaleagree5');
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (51, 'attls7', 'attls7short', '', '', 1, 'scaleagree5');
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (50, 'attls6', 'attls6short', '', '', 1, 'scaleagree5');
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (49, 'attls5', 'attls5short', '', '', 1, 'scaleagree5');
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (48, 'attls4', 'attls4short', '', '', 1, 'scaleagree5');
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (47, 'attls3', 'attls3short', '', '', 1, 'scaleagree5');
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (45, 'attls1', 'attls1short', '', '', 1, 'scaleagree5');
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (46, 'attls2', 'attls2short', '', '', 1, 'scaleagree5');
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (65, 'attlsm1', 'attlsm1', '45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64', 'attlsmintro', 1, 'scaleagree5');
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (67, 'attlsm2', 'attlsm2', '63,62,59,57,55,49,52,50,48,47', 'attlsmintro', -1, 'scaleagree5');
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (68, 'attlsm3', 'attlsm3', '46,54,45,51,60,53,56,58,61,64', 'attlsmintro', -1, 'scaleagree5');
|
||||
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (69, 'ciq1', 'ciq1short', '', '', 0, '');
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (70, 'ciq2', 'ciq2short', '', '', 0, '');
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (71, 'ciq3', 'ciq3short', '', '', 0, '');
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (72, 'ciq4', 'ciq4short', '', '', 0, '');
|
||||
INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (73, 'ciq5', 'ciq5short', '', '', 0, '');
|
||||
|
||||
|
||||
#
|
||||
# Dumping data for table `log_display`
|
||||
#
|
||||
|
||||
INSERT INTO prefix_log_display (module, action, mtable, field) VALUES ('survey', 'add', 'survey', 'name');
|
||||
INSERT INTO prefix_log_display (module, action, mtable, field) VALUES ('survey', 'update', 'survey', 'name');
|
||||
INSERT INTO prefix_log_display (module, action, mtable, field) VALUES ('survey', 'download', 'survey', 'name');
|
||||
INSERT INTO prefix_log_display (module, action, mtable, field) VALUES ('survey', 'view form', 'survey', 'name');
|
||||
INSERT INTO prefix_log_display (module, action, mtable, field) VALUES ('survey', 'view graph', 'survey', 'name');
|
||||
INSERT INTO prefix_log_display (module, action, mtable, field) VALUES ('survey', 'view report', 'survey', 'name');
|
||||
INSERT INTO prefix_log_display (module, action, mtable, field) VALUES ('survey', 'submit', 'survey', 'name');
|
||||
|
||||
+227
-227
@@ -1,227 +1,227 @@
|
||||
rem
|
||||
rem Table structure for table survey
|
||||
rem
|
||||
|
||||
drop TABLE prefix_survey;
|
||||
CREATE TABLE prefix_survey (
|
||||
id number(10) primary key,
|
||||
course number(10) default '0' not null,
|
||||
template number(10) default '0' not null,
|
||||
days number(6) default '0' not null,
|
||||
timecreated number(10) default '0' not null,
|
||||
timemodified number(10) default '0' not null,
|
||||
name varchar2(255) default '' not null,
|
||||
intro varchar2(1024),
|
||||
questions varchar2(255) default NULL
|
||||
);
|
||||
|
||||
drop sequence p_survey_seq;
|
||||
create sequence p_survey_seq;
|
||||
|
||||
create or replace trigger p_survey_trig
|
||||
before insert on prefix_survey
|
||||
referencing new as new_row
|
||||
for each row
|
||||
begin
|
||||
select p_survey_seq.nextval into :new_row.id from dual;
|
||||
end;
|
||||
.
|
||||
/
|
||||
|
||||
COMMENT on table prefix_survey is 'all surveys';
|
||||
|
||||
INSERT INTO prefix_survey (course, template, days, timecreated, timemodified, name, intro, questions) VALUES (0, 0, 0, 985017600, 985017600, 'collesaname', 'collesaintro', '25,26,27,28,29,30,43,44');
|
||||
INSERT INTO prefix_survey (course, template, days, timecreated, timemodified, name, intro, questions) VALUES (0, 0, 0, 985017600, 985017600, 'collespname', 'collespintro', '31,32,33,34,35,36,43,44');
|
||||
INSERT INTO prefix_survey (course, template, days, timecreated, timemodified, name, intro, questions) VALUES (0, 0, 0, 985017600, 985017600, 'collesapname', 'collesapintro', '37,38,39,40,41,42,43,44');
|
||||
INSERT INTO prefix_survey (course, template, days, timecreated, timemodified, name, intro, questions) VALUES (0, 0, 0, 985017600, 985017600, 'attlsname', 'attlsintro', '65,67,68');
|
||||
|
||||
select * from prefix_survey order by 1,2;
|
||||
|
||||
rem
|
||||
rem Table structure for table survey_analysis
|
||||
rem
|
||||
|
||||
drop TABLE prefix_survey_analysis;
|
||||
CREATE TABLE prefix_survey_analysis (
|
||||
id number(10) primary key,
|
||||
survey number(10) default '0' not null,
|
||||
userid number(10) default '0' not null,
|
||||
notes varchar2(1024) NOT NULL
|
||||
|
||||
drop sequence p_survey_analysis_seq;
|
||||
create sequence p_survey_analysis_seq;
|
||||
|
||||
create or replace trigger p_survey_analysis_trig
|
||||
before insert on prefix_survey_analysis
|
||||
referencing new as new_row
|
||||
for each row
|
||||
begin
|
||||
select p_survey_analysis_seq.nextval into :new_row.id from dual;
|
||||
end;
|
||||
.
|
||||
/
|
||||
|
||||
);
|
||||
|
||||
comment on table prefix_survey_analysis is 'Survey analysis';
|
||||
|
||||
rem
|
||||
rem Dumping data for table survey_analysis
|
||||
rem
|
||||
|
||||
rem --------------------------------------------------------
|
||||
|
||||
rem
|
||||
rem Table structure for table survey_answers
|
||||
rem
|
||||
|
||||
drop TABLE prefix_survey_answers;
|
||||
CREATE TABLE prefix_survey_answers (
|
||||
id number(10) primary key,
|
||||
userid number(10) default '0' not null,
|
||||
survey number(10) default '0' not null,
|
||||
question number(10) default '0' not null,
|
||||
time number(10) default NULL,
|
||||
answer1 varchar2(255) default NULL,
|
||||
answer2 varchar2(255) default NULL
|
||||
);
|
||||
|
||||
drop sequence p_survey_answers_seq;
|
||||
create sequence p_survey_answers_seq;
|
||||
|
||||
create or replace trigger p_survey_answers_trig
|
||||
before insert on prefix_survey_answers
|
||||
referencing new as new_row
|
||||
for each row
|
||||
begin
|
||||
select p_survey_answers_seq.nextval into :new_row.id from dual;
|
||||
end;
|
||||
.
|
||||
/
|
||||
|
||||
|
||||
rem
|
||||
rem Dumping data for table survey_answers
|
||||
rem
|
||||
|
||||
rem --------------------------------------------------------
|
||||
|
||||
rem
|
||||
rem Table structure for table survey_questions
|
||||
rem
|
||||
|
||||
drop TABLE prefix_survey_questions;
|
||||
CREATE TABLE prefix_survey_questions (
|
||||
id number(10) primary key,
|
||||
text varchar2(255) default '' not null,
|
||||
shorttext varchar2(30) default '' not null,
|
||||
multi varchar2(100) default '' not null,
|
||||
intro varchar2(50) default NULL,
|
||||
type number(3) default '0' not null,
|
||||
options varchar2(1024)
|
||||
);
|
||||
|
||||
comment on table prefix_survey_questions is 'structure for survey_questions';
|
||||
|
||||
drop sequence p_survey_questions_seq;
|
||||
create sequence p_survey_questions_seq;
|
||||
|
||||
create or replace trigger p_survey_questions_trig
|
||||
before insert on prefix_survey_questions
|
||||
referencing new as new_row
|
||||
for each row
|
||||
begin
|
||||
select p_survey_questions_seq.nextval into :new_row.id from dual;
|
||||
end;
|
||||
.
|
||||
/
|
||||
|
||||
rem
|
||||
rem Dumping data for table survey_questions
|
||||
rem
|
||||
|
||||
INSERT INTO prefix_survey_questions ( text, shorttext, multi, intro, type, options) VALUES ('colles1', 'colles1short', '1', '1', 1, 'scaletimes5');
|
||||
INSERT INTO prefix_survey_questions (text, shorttext, multi, intro, type, options) VALUES ('colles2', 'colles2short', '1', '1', 1, 'scaletimes5');
|
||||
INSERT INTO prefix_survey_questions (text, shorttext, multi, intro, type, options) VALUES ('colles3', 'colles3short', '1', '1', 1, 'scaletimes5');
|
||||
INSERT INTO prefix_survey_questions (text, shorttext, multi, intro, type, options) VALUES ('colles4', 'colles4short', '1', '1', 1, 'scaletimes5');
|
||||
INSERT INTO prefix_survey_questions (text, shorttext, multi, intro, type, options) VALUES ('colles5', 'colles5short', '1', '1', 1, 'scaletimes5');
|
||||
INSERT INTO prefix_survey_questions (text, shorttext, multi, intro, type, options) VALUES ('colles6', 'colles6short', '1', '1', 1, 'scaletimes5');
|
||||
INSERT INTO prefix_survey_questions (text, shorttext, multi, intro, type, options) VALUES ('colles7', 'colles7short', '1', '1', 1, 'scaletimes5');
|
||||
INSERT INTO prefix_survey_questions (text, shorttext, multi, intro, type, options) VALUES ('colles8', 'colles8short', '1', '1', 1, 'scaletimes5');
|
||||
INSERT INTO prefix_survey_questions (text, shorttext, multi, intro, type, options) VALUES ('colles9', 'colles9short', '1', '1', 1, 'scaletimes5');
|
||||
INSERT INTO prefix_survey_questions (text, shorttext, multi, intro, type, options) VALUES ( 'colles10', 'colles10short', '1', '1', 1, 'scaletimes5');
|
||||
INSERT INTO prefix_survey_questions (text, shorttext, multi, intro, type, options) VALUES ( 'colles11', 'colles11short', '1', '1', 1, 'scaletimes5');
|
||||
INSERT INTO prefix_survey_questions (text, shorttext, multi, intro, type, options) VALUES ( 'colles12', 'colles12short', '1', '1', 1, 'scaletimes5');
|
||||
INSERT INTO prefix_survey_questions (text, shorttext, multi, intro, type, options) VALUES ( 'colles13', 'colles13short', '1', '1', 1, 'scaletimes5');
|
||||
INSERT INTO prefix_survey_questions (text, shorttext, multi, intro, type, options) VALUES ('colles14', 'colles14short', '1', '1', 1, 'scaletimes5');
|
||||
INSERT INTO prefix_survey_questions (text, shorttext, multi, intro, type, options) VALUES ('colles15', 'colles15short', '1', '1', 1, 'scaletimes5');
|
||||
INSERT INTO prefix_survey_questions (text, shorttext, multi, intro, type, options) VALUES ('colles16', 'colles16short', '1', '1', 1, 'scaletimes5');
|
||||
INSERT INTO prefix_survey_questions (text, shorttext, multi, intro, type, options) VALUES ('colles17', 'colles17short', '1', '1', 1, 'scaletimes5');
|
||||
INSERT INTO prefix_survey_questions (text, shorttext, multi, intro, type, options) VALUES ('colles18', 'colles18short', '1', '1', 1, 'scaletimes5');
|
||||
INSERT INTO prefix_survey_questions (text, shorttext, multi, intro, type, options) VALUES ('colles19', 'colles19short', '1', '1', 1, 'scaletimes5');
|
||||
INSERT INTO prefix_survey_questions (text, shorttext, multi, intro, type, options) VALUES ('colles20', 'colles20short', '1', '1', 1, 'scaletimes5');
|
||||
INSERT INTO prefix_survey_questions (text, shorttext, multi, intro, type, options) VALUES ('colles21', 'colles21short', '1', '1', 1, 'scaletimes5');
|
||||
INSERT INTO prefix_survey_questions (text, shorttext, multi, intro, type, options) VALUES ('colles22', 'colles22short', '1', '1', 1, 'scaletimes5');
|
||||
INSERT INTO prefix_survey_questions (text, shorttext, multi, intro, type, options) VALUES ('colles23', 'colles23short', '1', '1', 1, 'scaletimes5');
|
||||
INSERT INTO prefix_survey_questions (text, shorttext, multi, intro, type, options) VALUES ('colles24', 'colles24short', '1', '1', 1, 'scaletimes5');
|
||||
INSERT INTO prefix_survey_questions (text, shorttext, multi, intro, type, options) VALUES ('collesm1', 'collesm1short', '1,2,3,4', 'collesmintro', 1, 'scaletimes5');
|
||||
INSERT INTO prefix_survey_questions (text, shorttext, multi, intro, type, options) VALUES ('collesm2', 'collesm2short', '5,6,7,8', 'collesmintro', 1, 'scaletimes5');
|
||||
INSERT INTO prefix_survey_questions (text, shorttext, multi, intro, type, options) VALUES ('collesm3', 'collesm3short', '9,10,11,12', 'collesmintro', 1, 'scaletimes5');
|
||||
INSERT INTO prefix_survey_questions (text, shorttext, multi, intro, type, options) VALUES ('collesm4', 'collesm4short', '13,14,15,16', 'collesmintro', 1, 'scaletimes5');
|
||||
INSERT INTO prefix_survey_questions (text, shorttext, multi, intro, type, options) VALUES ('collesm5', 'collesm5short', '17,18,19,20', 'collesmintro', 1, 'scaletimes5');
|
||||
INSERT INTO prefix_survey_questions (text, shorttext, multi, intro, type, options) VALUES ('collesm6', 'collesm6short', '21,22,23,24', 'collesmintro', 1, 'scaletimes5');
|
||||
INSERT INTO prefix_survey_questions (text, shorttext, multi, intro, type, options) VALUES ('collesm1', 'collesm1short', '1,2,3,4', 'collesmintro', 2, 'scaletimes5');
|
||||
INSERT INTO prefix_survey_questions (text, shorttext, multi, intro, type, options) VALUES ('collesm2', 'collesm2short', '5,6,7,8', 'collesmintro', 2, 'scaletimes5');
|
||||
INSERT INTO prefix_survey_questions (text, shorttext, multi, intro, type, options) VALUES ('collesm3', 'collesm3short', '9,10,11,12', 'collesmintro', 2, 'scaletimes5');
|
||||
INSERT INTO prefix_survey_questions (text, shorttext, multi, intro, type, options) VALUES ('collesm4', 'collesm4short', '13,14,15,16', 'collesmintro', 2, 'scaletimes5');
|
||||
INSERT INTO prefix_survey_questions (text, shorttext, multi, intro, type, options) VALUES ('collesm5', 'collesm5short', '17,18,19,20', 'collesmintro', 2, 'scaletimes5');
|
||||
INSERT INTO prefix_survey_questions (text, shorttext, multi, intro, type, options) VALUES ('collesm6', 'collesm6short', '21,22,23,24', 'collesmintro', 2, 'scaletimes5');
|
||||
INSERT INTO prefix_survey_questions (text, shorttext, multi, intro, type, options) VALUES ('collesm1', 'collesm1short', '1,2,3,4', 'collesmintro', 3, 'scaletimes5');
|
||||
INSERT INTO prefix_survey_questions (text, shorttext, multi, intro, type, options) VALUES ('collesm2', 'collesm2short', '5,6,7,8', 'collesmintro', 3, 'scaletimes5');
|
||||
INSERT INTO prefix_survey_questions (text, shorttext, multi, intro, type, options) VALUES ('collesm3', 'collesm3short', '9,10,11,12', 'collesmintro', 3, 'scaletimes5');
|
||||
INSERT INTO prefix_survey_questions (text, shorttext, multi, intro, type, options) VALUES ('collesm4', 'collesm4short', '13,14,15,16', 'collesmintro', 3, 'scaletimes5');
|
||||
INSERT INTO prefix_survey_questions (text, shorttext, multi, intro, type, options) VALUES ('collesm5', 'collesm5short', '17,18,19,20', 'collesmintro', 3, 'scaletimes5');
|
||||
INSERT INTO prefix_survey_questions (text, shorttext, multi, intro, type, options) VALUES ('collesm6', 'collesm6short', '21,22,23,24', 'collesmintro', 3, 'scaletimes5');
|
||||
INSERT INTO prefix_survey_questions (text, shorttext, multi, intro, type, options) VALUES ('howlong', '1', '1', '1', 1, 'howlongoptions');
|
||||
INSERT INTO prefix_survey_questions (text, shorttext, multi, intro, type, options) VALUES ('othercomments', '1', '1', '1', 0, '');
|
||||
INSERT INTO prefix_survey_questions (text, shorttext, multi, intro, type, options) VALUES ('attls20', 'attls20short', '1', '1', 1, 'scaleagree5');
|
||||
INSERT INTO prefix_survey_questions (text, shorttext, multi, intro, type, options) VALUES ('attls14', 'attls14short', '1', '1', 1, 'scaleagree5');
|
||||
INSERT INTO prefix_survey_questions (text, shorttext, multi, intro, type, options) VALUES ('attls15', 'attls15short', '1', '1', 1, 'scaleagree5');
|
||||
INSERT INTO prefix_survey_questions (text, shorttext, multi, intro, type, options) VALUES ('attls16', 'attls16short', '1', '1', 1, 'scaleagree5');
|
||||
INSERT INTO prefix_survey_questions (text, shorttext, multi, intro, type, options) VALUES ('attls17', 'attls17short', '1', '1', 1, 'scaleagree5');
|
||||
INSERT INTO prefix_survey_questions (text, shorttext, multi, intro, type, options) VALUES ('attls18', 'attls18short', '1', '1', 1, 'scaleagree5');
|
||||
INSERT INTO prefix_survey_questions (text, shorttext, multi, intro, type, options) VALUES ('attls19', 'attls19short', '1', '1', 1, 'scaleagree5');
|
||||
INSERT INTO prefix_survey_questions (text, shorttext, multi, intro, type, options) VALUES ('attls12', 'attls12short', '1', '1', 1, 'scaleagree5');
|
||||
INSERT INTO prefix_survey_questions (text, shorttext, multi, intro, type, options) VALUES ('attls13', 'attls13short', '1', '1', 1, 'scaleagree5');
|
||||
INSERT INTO prefix_survey_questions (text, shorttext, multi, intro, type, options) VALUES ('attls11', 'attls11short', '1', '1', 1, 'scaleagree5');
|
||||
INSERT INTO prefix_survey_questions (text, shorttext, multi, intro, type, options) VALUES ('attls10', 'attls10short', '1', '1', 1, 'scaleagree5');
|
||||
INSERT INTO prefix_survey_questions (text, shorttext, multi, intro, type, options) VALUES ('attls9', 'attls9short', '1', '1', 1, 'scaleagree5');
|
||||
INSERT INTO prefix_survey_questions (text, shorttext, multi, intro, type, options) VALUES ('attls8', 'attls8short', '1', '1', 1, 'scaleagree5');
|
||||
INSERT INTO prefix_survey_questions (text, shorttext, multi, intro, type, options) VALUES ('attls7', 'attls7short', '1', '1', 1, 'scaleagree5');
|
||||
INSERT INTO prefix_survey_questions (text, shorttext, multi, intro, type, options) VALUES ('attls6', 'attls6short', '1', '1', 1, 'scaleagree5');
|
||||
INSERT INTO prefix_survey_questions (text, shorttext, multi, intro, type, options) VALUES ('attls5', 'attls5short', '1', '1', 1, 'scaleagree5');
|
||||
INSERT INTO prefix_survey_questions (text, shorttext, multi, intro, type, options) VALUES ('attls4', 'attls4short', '1', '1', 1, 'scaleagree5');
|
||||
INSERT INTO prefix_survey_questions (text, shorttext, multi, intro, type, options) VALUES ('attls3', 'attls3short', '1', '1', 1, 'scaleagree5');
|
||||
INSERT INTO prefix_survey_questions (text, shorttext, multi, intro, type, options) VALUES ('attls1', 'attls1short', '1', '1', 1, 'scaleagree5');
|
||||
INSERT INTO prefix_survey_questions (text, shorttext, multi, intro, type, options) VALUES ('attls2', 'attls2short', '1', '1', 1, 'scaleagree5');
|
||||
INSERT INTO prefix_survey_questions (text, shorttext, multi, intro, type, options) VALUES ('attlsm1', 'attlsm1', '45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64', 'attlsmintro', 1, 'scaleagree5');
|
||||
INSERT INTO prefix_survey_questions (text, shorttext, multi, intro, type, options) VALUES ('attlsm2', 'attlsm2', '63,62,59,57,55,49,52,50,48,47', 'attlsmintro', -1, 'scaleagree5');
|
||||
INSERT INTO prefix_survey_questions (text, shorttext, multi, intro, type, options) VALUES ('attlsm3', 'attlsm3', '46,54,45,51,60,53,56,58,61,64', 'attlsmintro', -1, 'scaleagree5');
|
||||
|
||||
rem select * from prefix_survey_questions where text like 'colles%' or text like 'attlsm%'
|
||||
|
||||
col id format 99
|
||||
select * from prefix_survey_questions;
|
||||
|
||||
|
||||
rem
|
||||
rem Dumping data for table log_display
|
||||
rem
|
||||
|
||||
delete from prefix_log_display where module = 'survey';
|
||||
INSERT INTO prefix_log_display (module, action, mtable, field) VALUES ('survey', 'download', 'survey', 'name');
|
||||
INSERT INTO prefix_log_display (module, action, mtable, field) VALUES ('survey', 'view form', 'survey', 'name');
|
||||
INSERT INTO prefix_log_display (module, action, mtable, field) VALUES ('survey', 'view graph', 'survey', 'name');
|
||||
INSERT INTO prefix_log_display (module, action, mtable, field) VALUES ('survey', 'view report', 'survey', 'name');
|
||||
INSERT INTO prefix_log_display (module, action, mtable, field) VALUES ('survey', 'submit', 'survey', 'name');
|
||||
select * from prefix_log_display where module = 'survey';
|
||||
rem
|
||||
rem Table structure for table survey
|
||||
rem
|
||||
|
||||
drop TABLE prefix_survey;
|
||||
CREATE TABLE prefix_survey (
|
||||
id number(10) primary key,
|
||||
course number(10) default '0' not null,
|
||||
template number(10) default '0' not null,
|
||||
days number(6) default '0' not null,
|
||||
timecreated number(10) default '0' not null,
|
||||
timemodified number(10) default '0' not null,
|
||||
name varchar2(255) default '' not null,
|
||||
intro varchar2(1024),
|
||||
questions varchar2(255) default NULL
|
||||
);
|
||||
|
||||
drop sequence p_survey_seq;
|
||||
create sequence p_survey_seq;
|
||||
|
||||
create or replace trigger p_survey_trig
|
||||
before insert on prefix_survey
|
||||
referencing new as new_row
|
||||
for each row
|
||||
begin
|
||||
select p_survey_seq.nextval into :new_row.id from dual;
|
||||
end;
|
||||
.
|
||||
/
|
||||
|
||||
COMMENT on table prefix_survey is 'all surveys';
|
||||
|
||||
INSERT INTO prefix_survey (course, template, days, timecreated, timemodified, name, intro, questions) VALUES (0, 0, 0, 985017600, 985017600, 'collesaname', 'collesaintro', '25,26,27,28,29,30,43,44');
|
||||
INSERT INTO prefix_survey (course, template, days, timecreated, timemodified, name, intro, questions) VALUES (0, 0, 0, 985017600, 985017600, 'collespname', 'collespintro', '31,32,33,34,35,36,43,44');
|
||||
INSERT INTO prefix_survey (course, template, days, timecreated, timemodified, name, intro, questions) VALUES (0, 0, 0, 985017600, 985017600, 'collesapname', 'collesapintro', '37,38,39,40,41,42,43,44');
|
||||
INSERT INTO prefix_survey (course, template, days, timecreated, timemodified, name, intro, questions) VALUES (0, 0, 0, 985017600, 985017600, 'attlsname', 'attlsintro', '65,67,68');
|
||||
|
||||
select * from prefix_survey order by 1,2;
|
||||
|
||||
rem
|
||||
rem Table structure for table survey_analysis
|
||||
rem
|
||||
|
||||
drop TABLE prefix_survey_analysis;
|
||||
CREATE TABLE prefix_survey_analysis (
|
||||
id number(10) primary key,
|
||||
survey number(10) default '0' not null,
|
||||
userid number(10) default '0' not null,
|
||||
notes varchar2(1024) NOT NULL
|
||||
|
||||
drop sequence p_survey_analysis_seq;
|
||||
create sequence p_survey_analysis_seq;
|
||||
|
||||
create or replace trigger p_survey_analysis_trig
|
||||
before insert on prefix_survey_analysis
|
||||
referencing new as new_row
|
||||
for each row
|
||||
begin
|
||||
select p_survey_analysis_seq.nextval into :new_row.id from dual;
|
||||
end;
|
||||
.
|
||||
/
|
||||
|
||||
);
|
||||
|
||||
comment on table prefix_survey_analysis is 'Survey analysis';
|
||||
|
||||
rem
|
||||
rem Dumping data for table survey_analysis
|
||||
rem
|
||||
|
||||
rem --------------------------------------------------------
|
||||
|
||||
rem
|
||||
rem Table structure for table survey_answers
|
||||
rem
|
||||
|
||||
drop TABLE prefix_survey_answers;
|
||||
CREATE TABLE prefix_survey_answers (
|
||||
id number(10) primary key,
|
||||
userid number(10) default '0' not null,
|
||||
survey number(10) default '0' not null,
|
||||
question number(10) default '0' not null,
|
||||
time number(10) default NULL,
|
||||
answer1 varchar2(255) default NULL,
|
||||
answer2 varchar2(255) default NULL
|
||||
);
|
||||
|
||||
drop sequence p_survey_answers_seq;
|
||||
create sequence p_survey_answers_seq;
|
||||
|
||||
create or replace trigger p_survey_answers_trig
|
||||
before insert on prefix_survey_answers
|
||||
referencing new as new_row
|
||||
for each row
|
||||
begin
|
||||
select p_survey_answers_seq.nextval into :new_row.id from dual;
|
||||
end;
|
||||
.
|
||||
/
|
||||
|
||||
|
||||
rem
|
||||
rem Dumping data for table survey_answers
|
||||
rem
|
||||
|
||||
rem --------------------------------------------------------
|
||||
|
||||
rem
|
||||
rem Table structure for table survey_questions
|
||||
rem
|
||||
|
||||
drop TABLE prefix_survey_questions;
|
||||
CREATE TABLE prefix_survey_questions (
|
||||
id number(10) primary key,
|
||||
text varchar2(255) default '' not null,
|
||||
shorttext varchar2(30) default '' not null,
|
||||
multi varchar2(100) default '' not null,
|
||||
intro varchar2(50) default NULL,
|
||||
type number(3) default '0' not null,
|
||||
options varchar2(1024)
|
||||
);
|
||||
|
||||
comment on table prefix_survey_questions is 'structure for survey_questions';
|
||||
|
||||
drop sequence p_survey_questions_seq;
|
||||
create sequence p_survey_questions_seq;
|
||||
|
||||
create or replace trigger p_survey_questions_trig
|
||||
before insert on prefix_survey_questions
|
||||
referencing new as new_row
|
||||
for each row
|
||||
begin
|
||||
select p_survey_questions_seq.nextval into :new_row.id from dual;
|
||||
end;
|
||||
.
|
||||
/
|
||||
|
||||
rem
|
||||
rem Dumping data for table survey_questions
|
||||
rem
|
||||
|
||||
INSERT INTO prefix_survey_questions ( text, shorttext, multi, intro, type, options) VALUES ('colles1', 'colles1short', '1', '1', 1, 'scaletimes5');
|
||||
INSERT INTO prefix_survey_questions (text, shorttext, multi, intro, type, options) VALUES ('colles2', 'colles2short', '1', '1', 1, 'scaletimes5');
|
||||
INSERT INTO prefix_survey_questions (text, shorttext, multi, intro, type, options) VALUES ('colles3', 'colles3short', '1', '1', 1, 'scaletimes5');
|
||||
INSERT INTO prefix_survey_questions (text, shorttext, multi, intro, type, options) VALUES ('colles4', 'colles4short', '1', '1', 1, 'scaletimes5');
|
||||
INSERT INTO prefix_survey_questions (text, shorttext, multi, intro, type, options) VALUES ('colles5', 'colles5short', '1', '1', 1, 'scaletimes5');
|
||||
INSERT INTO prefix_survey_questions (text, shorttext, multi, intro, type, options) VALUES ('colles6', 'colles6short', '1', '1', 1, 'scaletimes5');
|
||||
INSERT INTO prefix_survey_questions (text, shorttext, multi, intro, type, options) VALUES ('colles7', 'colles7short', '1', '1', 1, 'scaletimes5');
|
||||
INSERT INTO prefix_survey_questions (text, shorttext, multi, intro, type, options) VALUES ('colles8', 'colles8short', '1', '1', 1, 'scaletimes5');
|
||||
INSERT INTO prefix_survey_questions (text, shorttext, multi, intro, type, options) VALUES ('colles9', 'colles9short', '1', '1', 1, 'scaletimes5');
|
||||
INSERT INTO prefix_survey_questions (text, shorttext, multi, intro, type, options) VALUES ( 'colles10', 'colles10short', '1', '1', 1, 'scaletimes5');
|
||||
INSERT INTO prefix_survey_questions (text, shorttext, multi, intro, type, options) VALUES ( 'colles11', 'colles11short', '1', '1', 1, 'scaletimes5');
|
||||
INSERT INTO prefix_survey_questions (text, shorttext, multi, intro, type, options) VALUES ( 'colles12', 'colles12short', '1', '1', 1, 'scaletimes5');
|
||||
INSERT INTO prefix_survey_questions (text, shorttext, multi, intro, type, options) VALUES ( 'colles13', 'colles13short', '1', '1', 1, 'scaletimes5');
|
||||
INSERT INTO prefix_survey_questions (text, shorttext, multi, intro, type, options) VALUES ('colles14', 'colles14short', '1', '1', 1, 'scaletimes5');
|
||||
INSERT INTO prefix_survey_questions (text, shorttext, multi, intro, type, options) VALUES ('colles15', 'colles15short', '1', '1', 1, 'scaletimes5');
|
||||
INSERT INTO prefix_survey_questions (text, shorttext, multi, intro, type, options) VALUES ('colles16', 'colles16short', '1', '1', 1, 'scaletimes5');
|
||||
INSERT INTO prefix_survey_questions (text, shorttext, multi, intro, type, options) VALUES ('colles17', 'colles17short', '1', '1', 1, 'scaletimes5');
|
||||
INSERT INTO prefix_survey_questions (text, shorttext, multi, intro, type, options) VALUES ('colles18', 'colles18short', '1', '1', 1, 'scaletimes5');
|
||||
INSERT INTO prefix_survey_questions (text, shorttext, multi, intro, type, options) VALUES ('colles19', 'colles19short', '1', '1', 1, 'scaletimes5');
|
||||
INSERT INTO prefix_survey_questions (text, shorttext, multi, intro, type, options) VALUES ('colles20', 'colles20short', '1', '1', 1, 'scaletimes5');
|
||||
INSERT INTO prefix_survey_questions (text, shorttext, multi, intro, type, options) VALUES ('colles21', 'colles21short', '1', '1', 1, 'scaletimes5');
|
||||
INSERT INTO prefix_survey_questions (text, shorttext, multi, intro, type, options) VALUES ('colles22', 'colles22short', '1', '1', 1, 'scaletimes5');
|
||||
INSERT INTO prefix_survey_questions (text, shorttext, multi, intro, type, options) VALUES ('colles23', 'colles23short', '1', '1', 1, 'scaletimes5');
|
||||
INSERT INTO prefix_survey_questions (text, shorttext, multi, intro, type, options) VALUES ('colles24', 'colles24short', '1', '1', 1, 'scaletimes5');
|
||||
INSERT INTO prefix_survey_questions (text, shorttext, multi, intro, type, options) VALUES ('collesm1', 'collesm1short', '1,2,3,4', 'collesmintro', 1, 'scaletimes5');
|
||||
INSERT INTO prefix_survey_questions (text, shorttext, multi, intro, type, options) VALUES ('collesm2', 'collesm2short', '5,6,7,8', 'collesmintro', 1, 'scaletimes5');
|
||||
INSERT INTO prefix_survey_questions (text, shorttext, multi, intro, type, options) VALUES ('collesm3', 'collesm3short', '9,10,11,12', 'collesmintro', 1, 'scaletimes5');
|
||||
INSERT INTO prefix_survey_questions (text, shorttext, multi, intro, type, options) VALUES ('collesm4', 'collesm4short', '13,14,15,16', 'collesmintro', 1, 'scaletimes5');
|
||||
INSERT INTO prefix_survey_questions (text, shorttext, multi, intro, type, options) VALUES ('collesm5', 'collesm5short', '17,18,19,20', 'collesmintro', 1, 'scaletimes5');
|
||||
INSERT INTO prefix_survey_questions (text, shorttext, multi, intro, type, options) VALUES ('collesm6', 'collesm6short', '21,22,23,24', 'collesmintro', 1, 'scaletimes5');
|
||||
INSERT INTO prefix_survey_questions (text, shorttext, multi, intro, type, options) VALUES ('collesm1', 'collesm1short', '1,2,3,4', 'collesmintro', 2, 'scaletimes5');
|
||||
INSERT INTO prefix_survey_questions (text, shorttext, multi, intro, type, options) VALUES ('collesm2', 'collesm2short', '5,6,7,8', 'collesmintro', 2, 'scaletimes5');
|
||||
INSERT INTO prefix_survey_questions (text, shorttext, multi, intro, type, options) VALUES ('collesm3', 'collesm3short', '9,10,11,12', 'collesmintro', 2, 'scaletimes5');
|
||||
INSERT INTO prefix_survey_questions (text, shorttext, multi, intro, type, options) VALUES ('collesm4', 'collesm4short', '13,14,15,16', 'collesmintro', 2, 'scaletimes5');
|
||||
INSERT INTO prefix_survey_questions (text, shorttext, multi, intro, type, options) VALUES ('collesm5', 'collesm5short', '17,18,19,20', 'collesmintro', 2, 'scaletimes5');
|
||||
INSERT INTO prefix_survey_questions (text, shorttext, multi, intro, type, options) VALUES ('collesm6', 'collesm6short', '21,22,23,24', 'collesmintro', 2, 'scaletimes5');
|
||||
INSERT INTO prefix_survey_questions (text, shorttext, multi, intro, type, options) VALUES ('collesm1', 'collesm1short', '1,2,3,4', 'collesmintro', 3, 'scaletimes5');
|
||||
INSERT INTO prefix_survey_questions (text, shorttext, multi, intro, type, options) VALUES ('collesm2', 'collesm2short', '5,6,7,8', 'collesmintro', 3, 'scaletimes5');
|
||||
INSERT INTO prefix_survey_questions (text, shorttext, multi, intro, type, options) VALUES ('collesm3', 'collesm3short', '9,10,11,12', 'collesmintro', 3, 'scaletimes5');
|
||||
INSERT INTO prefix_survey_questions (text, shorttext, multi, intro, type, options) VALUES ('collesm4', 'collesm4short', '13,14,15,16', 'collesmintro', 3, 'scaletimes5');
|
||||
INSERT INTO prefix_survey_questions (text, shorttext, multi, intro, type, options) VALUES ('collesm5', 'collesm5short', '17,18,19,20', 'collesmintro', 3, 'scaletimes5');
|
||||
INSERT INTO prefix_survey_questions (text, shorttext, multi, intro, type, options) VALUES ('collesm6', 'collesm6short', '21,22,23,24', 'collesmintro', 3, 'scaletimes5');
|
||||
INSERT INTO prefix_survey_questions (text, shorttext, multi, intro, type, options) VALUES ('howlong', '1', '1', '1', 1, 'howlongoptions');
|
||||
INSERT INTO prefix_survey_questions (text, shorttext, multi, intro, type, options) VALUES ('othercomments', '1', '1', '1', 0, '');
|
||||
INSERT INTO prefix_survey_questions (text, shorttext, multi, intro, type, options) VALUES ('attls20', 'attls20short', '1', '1', 1, 'scaleagree5');
|
||||
INSERT INTO prefix_survey_questions (text, shorttext, multi, intro, type, options) VALUES ('attls14', 'attls14short', '1', '1', 1, 'scaleagree5');
|
||||
INSERT INTO prefix_survey_questions (text, shorttext, multi, intro, type, options) VALUES ('attls15', 'attls15short', '1', '1', 1, 'scaleagree5');
|
||||
INSERT INTO prefix_survey_questions (text, shorttext, multi, intro, type, options) VALUES ('attls16', 'attls16short', '1', '1', 1, 'scaleagree5');
|
||||
INSERT INTO prefix_survey_questions (text, shorttext, multi, intro, type, options) VALUES ('attls17', 'attls17short', '1', '1', 1, 'scaleagree5');
|
||||
INSERT INTO prefix_survey_questions (text, shorttext, multi, intro, type, options) VALUES ('attls18', 'attls18short', '1', '1', 1, 'scaleagree5');
|
||||
INSERT INTO prefix_survey_questions (text, shorttext, multi, intro, type, options) VALUES ('attls19', 'attls19short', '1', '1', 1, 'scaleagree5');
|
||||
INSERT INTO prefix_survey_questions (text, shorttext, multi, intro, type, options) VALUES ('attls12', 'attls12short', '1', '1', 1, 'scaleagree5');
|
||||
INSERT INTO prefix_survey_questions (text, shorttext, multi, intro, type, options) VALUES ('attls13', 'attls13short', '1', '1', 1, 'scaleagree5');
|
||||
INSERT INTO prefix_survey_questions (text, shorttext, multi, intro, type, options) VALUES ('attls11', 'attls11short', '1', '1', 1, 'scaleagree5');
|
||||
INSERT INTO prefix_survey_questions (text, shorttext, multi, intro, type, options) VALUES ('attls10', 'attls10short', '1', '1', 1, 'scaleagree5');
|
||||
INSERT INTO prefix_survey_questions (text, shorttext, multi, intro, type, options) VALUES ('attls9', 'attls9short', '1', '1', 1, 'scaleagree5');
|
||||
INSERT INTO prefix_survey_questions (text, shorttext, multi, intro, type, options) VALUES ('attls8', 'attls8short', '1', '1', 1, 'scaleagree5');
|
||||
INSERT INTO prefix_survey_questions (text, shorttext, multi, intro, type, options) VALUES ('attls7', 'attls7short', '1', '1', 1, 'scaleagree5');
|
||||
INSERT INTO prefix_survey_questions (text, shorttext, multi, intro, type, options) VALUES ('attls6', 'attls6short', '1', '1', 1, 'scaleagree5');
|
||||
INSERT INTO prefix_survey_questions (text, shorttext, multi, intro, type, options) VALUES ('attls5', 'attls5short', '1', '1', 1, 'scaleagree5');
|
||||
INSERT INTO prefix_survey_questions (text, shorttext, multi, intro, type, options) VALUES ('attls4', 'attls4short', '1', '1', 1, 'scaleagree5');
|
||||
INSERT INTO prefix_survey_questions (text, shorttext, multi, intro, type, options) VALUES ('attls3', 'attls3short', '1', '1', 1, 'scaleagree5');
|
||||
INSERT INTO prefix_survey_questions (text, shorttext, multi, intro, type, options) VALUES ('attls1', 'attls1short', '1', '1', 1, 'scaleagree5');
|
||||
INSERT INTO prefix_survey_questions (text, shorttext, multi, intro, type, options) VALUES ('attls2', 'attls2short', '1', '1', 1, 'scaleagree5');
|
||||
INSERT INTO prefix_survey_questions (text, shorttext, multi, intro, type, options) VALUES ('attlsm1', 'attlsm1', '45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64', 'attlsmintro', 1, 'scaleagree5');
|
||||
INSERT INTO prefix_survey_questions (text, shorttext, multi, intro, type, options) VALUES ('attlsm2', 'attlsm2', '63,62,59,57,55,49,52,50,48,47', 'attlsmintro', -1, 'scaleagree5');
|
||||
INSERT INTO prefix_survey_questions (text, shorttext, multi, intro, type, options) VALUES ('attlsm3', 'attlsm3', '46,54,45,51,60,53,56,58,61,64', 'attlsmintro', -1, 'scaleagree5');
|
||||
|
||||
rem select * from prefix_survey_questions where text like 'colles%' or text like 'attlsm%'
|
||||
|
||||
col id format 99
|
||||
select * from prefix_survey_questions;
|
||||
|
||||
|
||||
rem
|
||||
rem Dumping data for table log_display
|
||||
rem
|
||||
|
||||
delete from prefix_log_display where module = 'survey';
|
||||
INSERT INTO prefix_log_display (module, action, mtable, field) VALUES ('survey', 'download', 'survey', 'name');
|
||||
INSERT INTO prefix_log_display (module, action, mtable, field) VALUES ('survey', 'view form', 'survey', 'name');
|
||||
INSERT INTO prefix_log_display (module, action, mtable, field) VALUES ('survey', 'view graph', 'survey', 'name');
|
||||
INSERT INTO prefix_log_display (module, action, mtable, field) VALUES ('survey', 'view report', 'survey', 'name');
|
||||
INSERT INTO prefix_log_display (module, action, mtable, field) VALUES ('survey', 'submit', 'survey', 'name');
|
||||
select * from prefix_log_display where module = 'survey';
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,145 +1,145 @@
|
||||
<?xml version="1.0" ?>
|
||||
<activityset setno="2">
|
||||
<title>Maths</title>
|
||||
<questions>
|
||||
<question type="multiChoice">
|
||||
<text>The ages, in years, of 10 horses in a field were 3, 3, 4, 5, 7, 7, 7, 8, 8, 8,<p>
|
||||
Which one of the following is true?</text>
|
||||
<award>1</award>
|
||||
<hint>mean = (3+3+4+5+7+7+7+8+8+8)/10 = 6<p>
|
||||
median = 7 i.e the middle number<p>
|
||||
range = 8-3 = 5</hint>
|
||||
<answer>
|
||||
<option correct="yes">median > mean > range</option>
|
||||
<option correct="no">mean = median</option>
|
||||
<option correct="no">mean > median > range</option>
|
||||
<option correct="no">median > range > mean</option>
|
||||
</answer>
|
||||
</question>
|
||||
<question type="multiChoice">
|
||||
<text>At a college, students are given a points score calculated from their GCSE grades.<p>
|
||||
Someone with 4 A grades and 4 B grades gains a score of 36 points.<br>Someone with 2 A grades and 4 B grades gains a score of 26 points.<br>Someone with 3 A grades and 3 B grades would have a score of</text>
|
||||
<award>1</award>
|
||||
<hint>4A + 4B = 36 and 2A + 4B = 26<p>solving simultaneously gives A = 5 and B = 4</hint>
|
||||
<answer>
|
||||
<option correct="yes">27 points</option>
|
||||
<option correct="no">21 points</option>
|
||||
<option correct="no">30 points</option>
|
||||
<option correct="no">31 points</option>
|
||||
</answer>
|
||||
</question>
|
||||
<question type="multiChoice">
|
||||
<text>A sequence consists of adding the previous three terms together to form the next term. The first three terms of the sequence are 1, 2, 3.<p>
|
||||
What is the sixth term in the sequence?</text>
|
||||
<award>1</award>
|
||||
<hint>1, 2, 3, 6, 11, ...</hint>
|
||||
<answer>
|
||||
<option correct="yes">20</option>
|
||||
<option correct="no">6</option>
|
||||
<option correct="no">11</option>
|
||||
<option correct="no">13</option>
|
||||
</answer>
|
||||
</question>
|
||||
<question type="multiChoice">
|
||||
<text>The value of an item is described as decreasing exponentially. Which description below best matches this statement?</text>
|
||||
<award>1</award>
|
||||
<hint>No hint - you either know this or you don't!</hint>
|
||||
<answer>
|
||||
<option correct="yes">The value falls by a smaller amount each year.</option>
|
||||
<option correct="no">The value falls by the same amount each year.</option>
|
||||
<option correct="no">The value falls by the same amount each year for a while, and then remains constant.</option>
|
||||
<option correct="no">The value falls by a larger amount each year.</option>
|
||||
</answer>
|
||||
</question>
|
||||
<question type="multiChoice">
|
||||
<text>Consider the statement<p>
|
||||
"Schools with high numbers of pupils on free school meals do not do well in league tables."<p>
|
||||
Which of the following statements follows logically from the one above?</text>
|
||||
<award>1</award>
|
||||
<hint>Factors other than the number of pupils on free school meals affect how well a school does in league tables.</hint>
|
||||
<answer>
|
||||
<option correct="yes">Schools which do well in league tables do not have high numbers of pupils on free school meals.</option>
|
||||
<option correct="no">Schools with low numbers of pupils on free school meals do well in league tables.</option>
|
||||
<option correct="no">Making all pupils pay for school meals will improve league table results.</option>
|
||||
<option correct="no">Schools which do not do well in league tables have high numbers of pupils on free school meals.</option>
|
||||
</answer>
|
||||
</question>
|
||||
<question type="multiChoice">
|
||||
<text>The force between two point electric charges is inversely proportional to the square of their distance apart. What effect does doubling this distance have on the force?</text>
|
||||
<award>1</award>
|
||||
<hint>Inversely proportional means that increasing the distance decreases the force.<br>2 squared gives 4.</hint>
|
||||
<answer>
|
||||
<option correct="yes">The force decreases by a factor of four.</option>
|
||||
<option correct="no">The force is halved.</option>
|
||||
<option correct="no">The force is doubled.</option>
|
||||
<option correct="no">The force increases by a factor of four.</option>
|
||||
</answer>
|
||||
</question>
|
||||
<question type="multiChoice">
|
||||
<text>Two of the five playing cards that Colin has are aces. He shuffles the five cards, then puts them face down on the table. Madge takes a card and then another. The probability that she now has <b>both</b> of the aces is</text>
|
||||
<award>1</award>
|
||||
<hint>2/5 x 1/4</hint>
|
||||
<answer>
|
||||
<option correct="yes">1/10</option>
|
||||
<option correct="no">4/25</option>
|
||||
<option correct="no">1/5</option>
|
||||
<option correct="no">2/5</option>
|
||||
</answer>
|
||||
</question>
|
||||
<question type="multiChoice">
|
||||
<text>A college's guidelines say that classes must have a minimum of 12 students and a maximum of 20 students. For what numbers of students studying a particular subject is it impossible to run classes without breaking the guidelines?</text>
|
||||
<award>1</award>
|
||||
<hint>between 12 and 20 students - one class<br>
|
||||
between 24 and 36 students - two classes<br>
|
||||
between 36 and 40 students - two classes</hint>
|
||||
<answer>
|
||||
<option correct="yes">between 20 and 24 students</option>
|
||||
<option correct="no">between 12 and 20 students</option>
|
||||
<option correct="no">between 24 and 36 students</option>
|
||||
<option correct="no">between 36 and 40 students</option>
|
||||
</answer>
|
||||
</question>
|
||||
<question type="multiChoice">
|
||||
<text>The ages of two friends are in the ratio 3:4. In 8 years time their ages will be in the ratio 5:6. How old are they now?</text>
|
||||
<award>1</award>
|
||||
<hint>(12+8):(16+8) = 20:24 = 5:6</hint>
|
||||
<answer>
|
||||
<option correct="yes">12, 16</option>
|
||||
<option correct="no">3, 4</option>
|
||||
<option correct="no">6, 8</option>
|
||||
<option correct="no">9, 12</option>
|
||||
</answer>
|
||||
</question>
|
||||
<question type="multiChoice">
|
||||
<text>A heavy construction vehicle travels for 40 minutes between sites, at an average speed of 16 km per second. The distance between sites is</text>
|
||||
<award>1</award>
|
||||
<hint>16/60 x 40</hint>
|
||||
<answer>
|
||||
<option correct="yes">10.7 km</option>
|
||||
<option correct="no">2.5 km</option>
|
||||
<option correct="no">6.4 km</option>
|
||||
<option correct="no">38.4 km</option>
|
||||
</answer>
|
||||
</question>
|
||||
<question type="multianswerchoice">
|
||||
<text>Which of the following are features of a Virtual Learning Environment? (Select all that apply)</text>
|
||||
<hint />
|
||||
<answer>
|
||||
<option correct="yes" award="1" deduct="0">course resources are available from home and from college</option>
|
||||
<option correct="yes" award="1" deduct="0">forums enable collaborative work</option>
|
||||
<option correct="yes" award="1" deduct="0">assessments can give instant feedback</option>
|
||||
<option correct="yes" award="1" deduct="0">course progress is recorded</option>
|
||||
<option correct="no" award="1" deduct="0">kettle is put on automatically for tea/coffee</option>
|
||||
</answer>
|
||||
</question>
|
||||
<question type="multianswerchoice">
|
||||
<text>Which of the following may a Virtual Learning Environment be used for? (Select all that apply)</text>
|
||||
<hint />
|
||||
<answer>
|
||||
<option correct="yes" award="1" deduct="1">delivering a course online</option>
|
||||
<option correct="yes" award="1" deduct="1">supporting face-to-face teaching</option>
|
||||
<option correct="no" award="1" deduct="0">as a complete replacement for teachers</option>
|
||||
</answer>
|
||||
</question>
|
||||
</questions>
|
||||
</activityset>
|
||||
<?xml version="1.0" ?>
|
||||
<activityset setno="2">
|
||||
<title>Maths</title>
|
||||
<questions>
|
||||
<question type="multiChoice">
|
||||
<text>The ages, in years, of 10 horses in a field were 3, 3, 4, 5, 7, 7, 7, 8, 8, 8,<p>
|
||||
Which one of the following is true?</text>
|
||||
<award>1</award>
|
||||
<hint>mean = (3+3+4+5+7+7+7+8+8+8)/10 = 6<p>
|
||||
median = 7 i.e the middle number<p>
|
||||
range = 8-3 = 5</hint>
|
||||
<answer>
|
||||
<option correct="yes">median > mean > range</option>
|
||||
<option correct="no">mean = median</option>
|
||||
<option correct="no">mean > median > range</option>
|
||||
<option correct="no">median > range > mean</option>
|
||||
</answer>
|
||||
</question>
|
||||
<question type="multiChoice">
|
||||
<text>At a college, students are given a points score calculated from their GCSE grades.<p>
|
||||
Someone with 4 A grades and 4 B grades gains a score of 36 points.<br>Someone with 2 A grades and 4 B grades gains a score of 26 points.<br>Someone with 3 A grades and 3 B grades would have a score of</text>
|
||||
<award>1</award>
|
||||
<hint>4A + 4B = 36 and 2A + 4B = 26<p>solving simultaneously gives A = 5 and B = 4</hint>
|
||||
<answer>
|
||||
<option correct="yes">27 points</option>
|
||||
<option correct="no">21 points</option>
|
||||
<option correct="no">30 points</option>
|
||||
<option correct="no">31 points</option>
|
||||
</answer>
|
||||
</question>
|
||||
<question type="multiChoice">
|
||||
<text>A sequence consists of adding the previous three terms together to form the next term. The first three terms of the sequence are 1, 2, 3.<p>
|
||||
What is the sixth term in the sequence?</text>
|
||||
<award>1</award>
|
||||
<hint>1, 2, 3, 6, 11, ...</hint>
|
||||
<answer>
|
||||
<option correct="yes">20</option>
|
||||
<option correct="no">6</option>
|
||||
<option correct="no">11</option>
|
||||
<option correct="no">13</option>
|
||||
</answer>
|
||||
</question>
|
||||
<question type="multiChoice">
|
||||
<text>The value of an item is described as decreasing exponentially. Which description below best matches this statement?</text>
|
||||
<award>1</award>
|
||||
<hint>No hint - you either know this or you don't!</hint>
|
||||
<answer>
|
||||
<option correct="yes">The value falls by a smaller amount each year.</option>
|
||||
<option correct="no">The value falls by the same amount each year.</option>
|
||||
<option correct="no">The value falls by the same amount each year for a while, and then remains constant.</option>
|
||||
<option correct="no">The value falls by a larger amount each year.</option>
|
||||
</answer>
|
||||
</question>
|
||||
<question type="multiChoice">
|
||||
<text>Consider the statement<p>
|
||||
"Schools with high numbers of pupils on free school meals do not do well in league tables."<p>
|
||||
Which of the following statements follows logically from the one above?</text>
|
||||
<award>1</award>
|
||||
<hint>Factors other than the number of pupils on free school meals affect how well a school does in league tables.</hint>
|
||||
<answer>
|
||||
<option correct="yes">Schools which do well in league tables do not have high numbers of pupils on free school meals.</option>
|
||||
<option correct="no">Schools with low numbers of pupils on free school meals do well in league tables.</option>
|
||||
<option correct="no">Making all pupils pay for school meals will improve league table results.</option>
|
||||
<option correct="no">Schools which do not do well in league tables have high numbers of pupils on free school meals.</option>
|
||||
</answer>
|
||||
</question>
|
||||
<question type="multiChoice">
|
||||
<text>The force between two point electric charges is inversely proportional to the square of their distance apart. What effect does doubling this distance have on the force?</text>
|
||||
<award>1</award>
|
||||
<hint>Inversely proportional means that increasing the distance decreases the force.<br>2 squared gives 4.</hint>
|
||||
<answer>
|
||||
<option correct="yes">The force decreases by a factor of four.</option>
|
||||
<option correct="no">The force is halved.</option>
|
||||
<option correct="no">The force is doubled.</option>
|
||||
<option correct="no">The force increases by a factor of four.</option>
|
||||
</answer>
|
||||
</question>
|
||||
<question type="multiChoice">
|
||||
<text>Two of the five playing cards that Colin has are aces. He shuffles the five cards, then puts them face down on the table. Madge takes a card and then another. The probability that she now has <b>both</b> of the aces is</text>
|
||||
<award>1</award>
|
||||
<hint>2/5 x 1/4</hint>
|
||||
<answer>
|
||||
<option correct="yes">1/10</option>
|
||||
<option correct="no">4/25</option>
|
||||
<option correct="no">1/5</option>
|
||||
<option correct="no">2/5</option>
|
||||
</answer>
|
||||
</question>
|
||||
<question type="multiChoice">
|
||||
<text>A college's guidelines say that classes must have a minimum of 12 students and a maximum of 20 students. For what numbers of students studying a particular subject is it impossible to run classes without breaking the guidelines?</text>
|
||||
<award>1</award>
|
||||
<hint>between 12 and 20 students - one class<br>
|
||||
between 24 and 36 students - two classes<br>
|
||||
between 36 and 40 students - two classes</hint>
|
||||
<answer>
|
||||
<option correct="yes">between 20 and 24 students</option>
|
||||
<option correct="no">between 12 and 20 students</option>
|
||||
<option correct="no">between 24 and 36 students</option>
|
||||
<option correct="no">between 36 and 40 students</option>
|
||||
</answer>
|
||||
</question>
|
||||
<question type="multiChoice">
|
||||
<text>The ages of two friends are in the ratio 3:4. In 8 years time their ages will be in the ratio 5:6. How old are they now?</text>
|
||||
<award>1</award>
|
||||
<hint>(12+8):(16+8) = 20:24 = 5:6</hint>
|
||||
<answer>
|
||||
<option correct="yes">12, 16</option>
|
||||
<option correct="no">3, 4</option>
|
||||
<option correct="no">6, 8</option>
|
||||
<option correct="no">9, 12</option>
|
||||
</answer>
|
||||
</question>
|
||||
<question type="multiChoice">
|
||||
<text>A heavy construction vehicle travels for 40 minutes between sites, at an average speed of 16 km per second. The distance between sites is</text>
|
||||
<award>1</award>
|
||||
<hint>16/60 x 40</hint>
|
||||
<answer>
|
||||
<option correct="yes">10.7 km</option>
|
||||
<option correct="no">2.5 km</option>
|
||||
<option correct="no">6.4 km</option>
|
||||
<option correct="no">38.4 km</option>
|
||||
</answer>
|
||||
</question>
|
||||
<question type="multianswerchoice">
|
||||
<text>Which of the following are features of a Virtual Learning Environment? (Select all that apply)</text>
|
||||
<hint />
|
||||
<answer>
|
||||
<option correct="yes" award="1" deduct="0">course resources are available from home and from college</option>
|
||||
<option correct="yes" award="1" deduct="0">forums enable collaborative work</option>
|
||||
<option correct="yes" award="1" deduct="0">assessments can give instant feedback</option>
|
||||
<option correct="yes" award="1" deduct="0">course progress is recorded</option>
|
||||
<option correct="no" award="1" deduct="0">kettle is put on automatically for tea/coffee</option>
|
||||
</answer>
|
||||
</question>
|
||||
<question type="multianswerchoice">
|
||||
<text>Which of the following may a Virtual Learning Environment be used for? (Select all that apply)</text>
|
||||
<hint />
|
||||
<answer>
|
||||
<option correct="yes" award="1" deduct="1">delivering a course online</option>
|
||||
<option correct="yes" award="1" deduct="1">supporting face-to-face teaching</option>
|
||||
<option correct="no" award="1" deduct="0">as a complete replacement for teachers</option>
|
||||
</answer>
|
||||
</question>
|
||||
</questions>
|
||||
</activityset>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
- Ajouter un espace après un symbole <= s'il préfixe une parenthèse ouvrante.
|
||||
- Gérer 'and', 'or', ... comme &&, ||
|
||||
- Ne pas mettre de '$' sur les @param si aucun nom de variable n'esp spécifié.
|
||||
- Ajouter OneTrueBrace pour les if, while, for, else ... (Gustavo Carreno <[email protected]>, Richard Bateman <[email protected]>, Yaroslav Shvetsov <[email protected]>, Chris Small <[email protected]>)
|
||||
- Remove blank lines (Sergio Marchesini <[email protected]>)
|
||||
- Forcer une ligne vide après une déclaration de fonction (Richard Bateman <[email protected]>)
|
||||
|
||||
- Ajouter un espace apr�s un symbole <= s'il pr�fixe une parenth�se ouvrante.
|
||||
- G�rer 'and', 'or', ... comme &&, ||
|
||||
- Ne pas mettre de '$' sur les @param si aucun nom de variable n'esp sp�cifi�.
|
||||
- Ajouter OneTrueBrace pour les if, while, for, else ... (Gustavo Carreno <[email protected]>, Richard Bateman <[email protected]>, Yaroslav Shvetsov <[email protected]>, Chris Small <[email protected]>)
|
||||
- Remove blank lines (Sergio Marchesini <[email protected]>)
|
||||
- Forcer une ligne vide apr�s une d�claration de fonction (Richard Bateman <[email protected]>)
|
||||
|
||||
|
||||
+47
-47
@@ -1,47 +1,47 @@
|
||||
<?php // $Id$
|
||||
// expired.php - called by hive when the session has expired.
|
||||
|
||||
require('../../config.php');
|
||||
|
||||
require('lib.php');
|
||||
|
||||
require_login();
|
||||
|
||||
//MW theres no easy way to log in seamlessly. We need the users unhashed password.
|
||||
// It's a security risk to carry that in $SESSION so we put up login form.
|
||||
print_header();
|
||||
notify('Your session has expired. Please log in again.');
|
||||
?>
|
||||
<form action="login.php" method="post" name="login" id="login">
|
||||
<table border="0" align="center">
|
||||
<tr>
|
||||
<td width="80%">
|
||||
<table align="center" class="loginform">
|
||||
<tr class="username">
|
||||
<td align="right" class="c0">
|
||||
<?php print_string("username") ?>:
|
||||
</td>
|
||||
<td class="c1">
|
||||
<input type="text" name="username" size="15" value="<?php p($frm->username) ?>" alt="<?php print_string("username") ?>" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="password">
|
||||
<td align="right" class="c0">
|
||||
<?php print_string("password") ?>:
|
||||
</td>
|
||||
<td class="c1">
|
||||
<input type="password" name="password" size="15" value="" alt="<?php print_string("password") ?>" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<td width="20%">
|
||||
<input type="submit" value="<?php print_string("login") ?>" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
<br />
|
||||
<?php
|
||||
close_window_button();
|
||||
?>
|
||||
<?php // $Id$
|
||||
// expired.php - called by hive when the session has expired.
|
||||
|
||||
require('../../config.php');
|
||||
|
||||
require('lib.php');
|
||||
|
||||
require_login();
|
||||
|
||||
//MW theres no easy way to log in seamlessly. We need the users unhashed password.
|
||||
// It's a security risk to carry that in $SESSION so we put up login form.
|
||||
print_header();
|
||||
notify('Your session has expired. Please log in again.');
|
||||
?>
|
||||
<form action="login.php" method="post" name="login" id="login">
|
||||
<table border="0" align="center">
|
||||
<tr>
|
||||
<td width="80%">
|
||||
<table align="center" class="loginform">
|
||||
<tr class="username">
|
||||
<td align="right" class="c0">
|
||||
<?php print_string("username") ?>:
|
||||
</td>
|
||||
<td class="c1">
|
||||
<input type="text" name="username" size="15" value="<?php p($frm->username) ?>" alt="<?php print_string("username") ?>" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="password">
|
||||
<td align="right" class="c0">
|
||||
<?php print_string("password") ?>:
|
||||
</td>
|
||||
<td class="c1">
|
||||
<input type="password" name="password" size="15" value="" alt="<?php print_string("password") ?>" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<td width="20%">
|
||||
<input type="submit" value="<?php print_string("login") ?>" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
<br />
|
||||
<?php
|
||||
close_window_button();
|
||||
?>
|
||||
|
||||
+79
-79
@@ -1,79 +1,79 @@
|
||||
<?php // $Id$
|
||||
// Logs into Hive from HarvestRoad and stores session ID in Moodle session
|
||||
// Martin Dougiamas, Moodle
|
||||
//
|
||||
// Example CFG variables to make this work:
|
||||
|
||||
// $CFG->sso = 'hive';
|
||||
// $CFG->hiveprotocol = 'http';
|
||||
// $CFG->hiveport = '80';
|
||||
// $CFG->hivehost = 'turkey.harvestroad.com.au';
|
||||
// $CFG->hivepath = '/cgi-bin/hive/hive.cgi';
|
||||
// $CFG->hivecbid = '28';
|
||||
|
||||
function sso_user_login($username, $password) {
|
||||
|
||||
global $CFG, $SESSION;
|
||||
|
||||
include($CFG->libdir.'/snoopy/Snoopy.class.inc');
|
||||
|
||||
if (empty($CFG->hivehost)) {
|
||||
return false; // Hive config variables not configured yet
|
||||
}
|
||||
|
||||
/// Set up Snoopy
|
||||
|
||||
$snoopy = new Snoopy;
|
||||
|
||||
$submit_url = $CFG->hiveprotocol .'://'. $CFG->hivehost .':'. $CFG->hiveport .''. $CFG->hivepath ;
|
||||
|
||||
$submit_vars['HIVE_UNAME'] = $username;
|
||||
$submit_vars['HIVE_UPASS'] = $password;
|
||||
$submit_vars['HIVE_ENDUSER']= $username;
|
||||
$submit_vars['HIVE_REQ'] = '2112';
|
||||
$submit_vars['HIVE_REF'] = 'hin:hive@API Login 3';
|
||||
$submit_vars['HIVE_RET'] = 'ORG';
|
||||
$submit_vars['HIVE_REM'] = '';
|
||||
$submit_vars['HIVE_PROD'] = '0';
|
||||
$submit_vars['HIVE_USERIP'] = getremoteaddr();
|
||||
|
||||
|
||||
/// We use POST to call Hive with a bit more security
|
||||
$snoopy->submit($submit_url,$submit_vars);
|
||||
|
||||
/// Extract HIVE_SESSION from headers
|
||||
|
||||
foreach ($snoopy->headers as $header) {
|
||||
if (strpos($header, 'HIVE_SESSION=') !== false) {
|
||||
$header = explode('HIVE_SESSION=', $header);
|
||||
if (count($header) > 1) {
|
||||
$cookie = explode(';', $header[1]);
|
||||
$cookie = $cookie[0];
|
||||
$SESSION->HIVE_SESSION = $cookie;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Try again with the guest username and password
|
||||
|
||||
$submit_vars['HIVE_UNAME'] = $CFG->hiveusername;
|
||||
$submit_vars['HIVE_UPASS'] = $CFG->hivepassword;
|
||||
$submit_vars['HIVE_ENDUSER']= $CFG->hiveusername;
|
||||
$snoopy->submit($submit_url,$submit_vars);
|
||||
foreach ($snoopy->headers as $header) {
|
||||
if (strpos($header, 'HIVE_SESSION=') !== false) {
|
||||
$header = explode('HIVE_SESSION=', $header);
|
||||
if (count($header) > 1) {
|
||||
$cookie = explode(';', $header[1]);
|
||||
$cookie = $cookie[0];
|
||||
$SESSION->HIVE_SESSION = $cookie;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false; // No cookie found
|
||||
}
|
||||
|
||||
?>
|
||||
<?php // $Id$
|
||||
// Logs into Hive from HarvestRoad and stores session ID in Moodle session
|
||||
// Martin Dougiamas, Moodle
|
||||
//
|
||||
// Example CFG variables to make this work:
|
||||
|
||||
// $CFG->sso = 'hive';
|
||||
// $CFG->hiveprotocol = 'http';
|
||||
// $CFG->hiveport = '80';
|
||||
// $CFG->hivehost = 'turkey.harvestroad.com.au';
|
||||
// $CFG->hivepath = '/cgi-bin/hive/hive.cgi';
|
||||
// $CFG->hivecbid = '28';
|
||||
|
||||
function sso_user_login($username, $password) {
|
||||
|
||||
global $CFG, $SESSION;
|
||||
|
||||
include($CFG->libdir.'/snoopy/Snoopy.class.inc');
|
||||
|
||||
if (empty($CFG->hivehost)) {
|
||||
return false; // Hive config variables not configured yet
|
||||
}
|
||||
|
||||
/// Set up Snoopy
|
||||
|
||||
$snoopy = new Snoopy;
|
||||
|
||||
$submit_url = $CFG->hiveprotocol .'://'. $CFG->hivehost .':'. $CFG->hiveport .''. $CFG->hivepath ;
|
||||
|
||||
$submit_vars['HIVE_UNAME'] = $username;
|
||||
$submit_vars['HIVE_UPASS'] = $password;
|
||||
$submit_vars['HIVE_ENDUSER']= $username;
|
||||
$submit_vars['HIVE_REQ'] = '2112';
|
||||
$submit_vars['HIVE_REF'] = 'hin:hive@API Login 3';
|
||||
$submit_vars['HIVE_RET'] = 'ORG';
|
||||
$submit_vars['HIVE_REM'] = '';
|
||||
$submit_vars['HIVE_PROD'] = '0';
|
||||
$submit_vars['HIVE_USERIP'] = getremoteaddr();
|
||||
|
||||
|
||||
/// We use POST to call Hive with a bit more security
|
||||
$snoopy->submit($submit_url,$submit_vars);
|
||||
|
||||
/// Extract HIVE_SESSION from headers
|
||||
|
||||
foreach ($snoopy->headers as $header) {
|
||||
if (strpos($header, 'HIVE_SESSION=') !== false) {
|
||||
$header = explode('HIVE_SESSION=', $header);
|
||||
if (count($header) > 1) {
|
||||
$cookie = explode(';', $header[1]);
|
||||
$cookie = $cookie[0];
|
||||
$SESSION->HIVE_SESSION = $cookie;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Try again with the guest username and password
|
||||
|
||||
$submit_vars['HIVE_UNAME'] = $CFG->hiveusername;
|
||||
$submit_vars['HIVE_UPASS'] = $CFG->hivepassword;
|
||||
$submit_vars['HIVE_ENDUSER']= $CFG->hiveusername;
|
||||
$snoopy->submit($submit_url,$submit_vars);
|
||||
foreach ($snoopy->headers as $header) {
|
||||
if (strpos($header, 'HIVE_SESSION=') !== false) {
|
||||
$header = explode('HIVE_SESSION=', $header);
|
||||
if (count($header) > 1) {
|
||||
$cookie = explode(';', $header[1]);
|
||||
$cookie = $cookie[0];
|
||||
$SESSION->HIVE_SESSION = $cookie;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false; // No cookie found
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
+23
-23
@@ -1,23 +1,23 @@
|
||||
<?php // $Id$
|
||||
// login.php - action of the login form put up by expired.php.
|
||||
|
||||
require('../../config.php');
|
||||
|
||||
require('lib.php');
|
||||
|
||||
require_login();
|
||||
|
||||
// get the login data
|
||||
$frm = data_submitted('');
|
||||
|
||||
// log back into Hive
|
||||
if (sso_user_login($frm->username, $frm->password)) {
|
||||
|
||||
/// reopen Hive
|
||||
redirect($CFG->wwwroot.'/mod/resource/type/repository/hive/openlitebrowse.php');
|
||||
} else {
|
||||
redirect($CFG->wwwroot.'/sso/hive/expired.php');
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<?php // $Id$
|
||||
// login.php - action of the login form put up by expired.php.
|
||||
|
||||
require('../../config.php');
|
||||
|
||||
require('lib.php');
|
||||
|
||||
require_login();
|
||||
|
||||
// get the login data
|
||||
$frm = data_submitted('');
|
||||
|
||||
// log back into Hive
|
||||
if (sso_user_login($frm->username, $frm->password)) {
|
||||
|
||||
/// reopen Hive
|
||||
redirect($CFG->wwwroot.'/mod/resource/type/repository/hive/openlitebrowse.php');
|
||||
} else {
|
||||
redirect($CFG->wwwroot.'/sso/hive/expired.php');
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
|
||||
@@ -1,42 +1,42 @@
|
||||
ACTIVITY MODULES
|
||||
----------------
|
||||
|
||||
These are main modules in Moodle, allowing various activities.
|
||||
|
||||
|
||||
Each of these modules contains a number of expected components:
|
||||
|
||||
mod.html: a form to setup/update a module instance
|
||||
|
||||
version.php: defines some meta-info and provides upgrading code
|
||||
|
||||
icon.gif: a 16x16 icon for the module
|
||||
|
||||
db/mysql.sql: an SQL dump of all the required db tables and data
|
||||
|
||||
index.php: a page to list all instances in a course
|
||||
|
||||
view.php: a page to view a particular instance
|
||||
|
||||
lib.php: any/all functions defined by the module should be in here.
|
||||
constants should be defined using MODULENAME_xxxxxx
|
||||
functions should be defined using modulename_xxxxxx
|
||||
|
||||
There are a number of standard functions:
|
||||
|
||||
modulename_add_instance()
|
||||
modulename_update_instance()
|
||||
modulename_delete_instance()
|
||||
|
||||
modulename_user_complete()
|
||||
modulename_user_outline()
|
||||
|
||||
modulename_cron()
|
||||
|
||||
modulename_print_recent_activity()
|
||||
|
||||
|
||||
If you are a developer and interested in developing new Modules see:
|
||||
|
||||
Moodle Documentation: http://moodle.org/doc
|
||||
Moodle Community: http://moodle.org/community
|
||||
ACTIVITY MODULES
|
||||
----------------
|
||||
|
||||
These are main modules in Moodle, allowing various activities.
|
||||
|
||||
|
||||
Each of these modules contains a number of expected components:
|
||||
|
||||
mod.html: a form to setup/update a module instance
|
||||
|
||||
version.php: defines some meta-info and provides upgrading code
|
||||
|
||||
icon.gif: a 16x16 icon for the module
|
||||
|
||||
db/mysql.sql: an SQL dump of all the required db tables and data
|
||||
|
||||
index.php: a page to list all instances in a course
|
||||
|
||||
view.php: a page to view a particular instance
|
||||
|
||||
lib.php: any/all functions defined by the module should be in here.
|
||||
constants should be defined using MODULENAME_xxxxxx
|
||||
functions should be defined using modulename_xxxxxx
|
||||
|
||||
There are a number of standard functions:
|
||||
|
||||
modulename_add_instance()
|
||||
modulename_update_instance()
|
||||
modulename_delete_instance()
|
||||
|
||||
modulename_user_complete()
|
||||
modulename_user_outline()
|
||||
|
||||
modulename_cron()
|
||||
|
||||
modulename_print_recent_activity()
|
||||
|
||||
|
||||
If you are a developer and interested in developing new Modules see:
|
||||
|
||||
Moodle Documentation: http://moodle.org/doc
|
||||
Moodle Community: http://moodle.org/community
|
||||
|
||||
+356
-356
@@ -1,356 +1,356 @@
|
||||
/*
|
||||
cssQuery, version 2.0.2 (2005-08-19)
|
||||
Copyright: 2004-2005, Dean Edwards (http://dean.edwards.name/)
|
||||
License: http://creativecommons.org/licenses/LGPL/2.1/
|
||||
*/
|
||||
|
||||
// the following functions allow querying of the DOM using CSS selectors
|
||||
var cssQuery = function() {
|
||||
var version = "2.0.2";
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// main query function
|
||||
// -----------------------------------------------------------------------
|
||||
|
||||
var $COMMA = /\s*,\s*/;
|
||||
var cssQuery = function($selector, $$from) {
|
||||
try {
|
||||
var $match = [];
|
||||
var $useCache = arguments.callee.caching && !$$from;
|
||||
var $base = ($$from) ? ($$from.constructor == Array) ? $$from : [$$from] : [document];
|
||||
// process comma separated selectors
|
||||
var $$selectors = parseSelector($selector).split($COMMA), i;
|
||||
for (i = 0; i < $$selectors.length; i++) {
|
||||
// convert the selector to a stream
|
||||
$selector = _toStream($$selectors[i]);
|
||||
// faster chop if it starts with id (MSIE only)
|
||||
if (isMSIE && $selector.slice(0, 3).join("") == " *#") {
|
||||
$selector = $selector.slice(2);
|
||||
$$from = _msie_selectById([], $base, $selector[1]);
|
||||
} else $$from = $base;
|
||||
// process the stream
|
||||
var j = 0, $token, $filter, $arguments, $cacheSelector = "";
|
||||
while (j < $selector.length) {
|
||||
$token = $selector[j++];
|
||||
$filter = $selector[j++];
|
||||
$cacheSelector += $token + $filter;
|
||||
// some pseudo-classes allow arguments to be passed
|
||||
// e.g. nth-child(even)
|
||||
$arguments = "";
|
||||
if ($selector[j] == "(") {
|
||||
while ($selector[j++] != ")" && j < $selector.length) {
|
||||
$arguments += $selector[j];
|
||||
}
|
||||
$arguments = $arguments.slice(0, -1);
|
||||
$cacheSelector += "(" + $arguments + ")";
|
||||
}
|
||||
// process a token/filter pair use cached results if possible
|
||||
$$from = ($useCache && cache[$cacheSelector]) ?
|
||||
cache[$cacheSelector] : select($$from, $token, $filter, $arguments);
|
||||
if ($useCache) cache[$cacheSelector] = $$from;
|
||||
}
|
||||
$match = $match.concat($$from);
|
||||
}
|
||||
delete cssQuery.error;
|
||||
return $match;
|
||||
} catch ($error) {
|
||||
cssQuery.error = $error;
|
||||
return [];
|
||||
}};
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// public interface
|
||||
// -----------------------------------------------------------------------
|
||||
|
||||
cssQuery.toString = function() {
|
||||
return "function cssQuery() {\n [version " + version + "]\n}";
|
||||
};
|
||||
|
||||
// caching
|
||||
var cache = {};
|
||||
cssQuery.caching = false;
|
||||
cssQuery.clearCache = function($selector) {
|
||||
if ($selector) {
|
||||
$selector = _toStream($selector).join("");
|
||||
delete cache[$selector];
|
||||
} else cache = {};
|
||||
};
|
||||
|
||||
// allow extensions
|
||||
var modules = {};
|
||||
var loaded = false;
|
||||
cssQuery.addModule = function($name, $script) {
|
||||
if (loaded) eval("$script=" + String($script));
|
||||
modules[$name] = new $script();;
|
||||
};
|
||||
|
||||
// hackery
|
||||
cssQuery.valueOf = function($code) {
|
||||
return $code ? eval($code) : this;
|
||||
};
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// declarations
|
||||
// -----------------------------------------------------------------------
|
||||
|
||||
var selectors = {};
|
||||
var pseudoClasses = {};
|
||||
// a safari bug means that these have to be declared here
|
||||
var AttributeSelector = {match: /\[([\w-]+(\|[\w-]+)?)\s*(\W?=)?\s*([^\]]*)\]/};
|
||||
var attributeSelectors = [];
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// selectors
|
||||
// -----------------------------------------------------------------------
|
||||
|
||||
// descendant selector
|
||||
selectors[" "] = function($results, $from, $tagName, $namespace) {
|
||||
// loop through current selection
|
||||
var $element, i, j;
|
||||
for (i = 0; i < $from.length; i++) {
|
||||
// get descendants
|
||||
var $subset = getElementsByTagName($from[i], $tagName, $namespace);
|
||||
// loop through descendants and add to results selection
|
||||
for (j = 0; ($element = $subset[j]); j++) {
|
||||
if (thisElement($element) && compareNamespace($element, $namespace))
|
||||
$results.push($element);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// ID selector
|
||||
selectors["#"] = function($results, $from, $id) {
|
||||
// loop through current selection and check ID
|
||||
var $element, j;
|
||||
for (j = 0; ($element = $from[j]); j++) if ($element.id == $id) $results.push($element);
|
||||
};
|
||||
|
||||
// class selector
|
||||
selectors["."] = function($results, $from, $className) {
|
||||
// create a RegExp version of the class
|
||||
$className = new RegExp("(^|\\s)" + $className + "(\\s|$)");
|
||||
// loop through current selection and check class
|
||||
var $element, i;
|
||||
for (i = 0; ($element = $from[i]); i++)
|
||||
if ($className.test($element.className)) $results.push($element);
|
||||
};
|
||||
|
||||
// pseudo-class selector
|
||||
selectors[":"] = function($results, $from, $pseudoClass, $arguments) {
|
||||
// retrieve the cssQuery pseudo-class function
|
||||
var $test = pseudoClasses[$pseudoClass], $element, i;
|
||||
// loop through current selection and apply pseudo-class filter
|
||||
if ($test) for (i = 0; ($element = $from[i]); i++)
|
||||
// if the cssQuery pseudo-class function returns "true" add the element
|
||||
if ($test($element, $arguments)) $results.push($element);
|
||||
};
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// pseudo-classes
|
||||
// -----------------------------------------------------------------------
|
||||
|
||||
pseudoClasses["link"] = function($element) {
|
||||
var $document = getDocument($element);
|
||||
if ($document.links) for (var i = 0; i < $document.links.length; i++) {
|
||||
if ($document.links[i] == $element) return true;
|
||||
}
|
||||
};
|
||||
|
||||
pseudoClasses["visited"] = function($element) {
|
||||
// can't do this without jiggery-pokery
|
||||
};
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// DOM traversal
|
||||
// -----------------------------------------------------------------------
|
||||
|
||||
// IE5/6 includes comments (LOL) in it's elements collections.
|
||||
// so we have to check for this. the test is tagName != "!". LOL (again).
|
||||
var thisElement = function($element) {
|
||||
return ($element && $element.nodeType == 1 && $element.tagName != "!") ? $element : null;
|
||||
};
|
||||
|
||||
// return the previous element to the supplied element
|
||||
// previousSibling is not good enough as it might return a text or comment node
|
||||
var previousElementSibling = function($element) {
|
||||
while ($element && ($element = $element.previousSibling) && !thisElement($element)) continue;
|
||||
return $element;
|
||||
};
|
||||
|
||||
// return the next element to the supplied element
|
||||
var nextElementSibling = function($element) {
|
||||
while ($element && ($element = $element.nextSibling) && !thisElement($element)) continue;
|
||||
return $element;
|
||||
};
|
||||
|
||||
// return the first child ELEMENT of an element
|
||||
// NOT the first child node (though they may be the same thing)
|
||||
var firstElementChild = function($element) {
|
||||
return thisElement($element.firstChild) || nextElementSibling($element.firstChild);
|
||||
};
|
||||
|
||||
var lastElementChild = function($element) {
|
||||
return thisElement($element.lastChild) || previousElementSibling($element.lastChild);
|
||||
};
|
||||
|
||||
// return child elements of an element (not child nodes)
|
||||
var childElements = function($element) {
|
||||
var $childElements = [];
|
||||
$element = firstElementChild($element);
|
||||
while ($element) {
|
||||
$childElements.push($element);
|
||||
$element = nextElementSibling($element);
|
||||
}
|
||||
return $childElements;
|
||||
};
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// browser compatibility
|
||||
// -----------------------------------------------------------------------
|
||||
|
||||
// all of the functions in this section can be overwritten. the default
|
||||
// configuration is for IE. The functions below reflect this. standard
|
||||
// methods are included in a separate module. It would probably be better
|
||||
// the other way round of course but this makes it easier to keep IE7 trim.
|
||||
|
||||
var isMSIE = true;
|
||||
|
||||
var isXML = function($element) {
|
||||
var $document = getDocument($element);
|
||||
return (typeof $document.mimeType == "unknown") ?
|
||||
/\.xml$/i.test($document.URL) :
|
||||
Boolean($document.mimeType == "XML Document");
|
||||
};
|
||||
|
||||
// return the element's containing document
|
||||
var getDocument = function($element) {
|
||||
return $element.ownerDocument || $element.document;
|
||||
};
|
||||
|
||||
var getElementsByTagName = function($element, $tagName) {
|
||||
return ($tagName == "*" && $element.all) ? $element.all : $element.getElementsByTagName($tagName);
|
||||
};
|
||||
|
||||
var compareTagName = function($element, $tagName, $namespace) {
|
||||
if ($tagName == "*") return thisElement($element);
|
||||
if (!compareNamespace($element, $namespace)) return false;
|
||||
if (!isXML($element)) $tagName = $tagName.toUpperCase();
|
||||
return $element.tagName == $tagName;
|
||||
};
|
||||
|
||||
var compareNamespace = function($element, $namespace) {
|
||||
return !$namespace || ($namespace == "*") || ($element.scopeName == $namespace);
|
||||
};
|
||||
|
||||
var getTextContent = function($element) {
|
||||
return $element.innerText;
|
||||
};
|
||||
|
||||
function _msie_selectById($results, $from, id) {
|
||||
var $match, i, j;
|
||||
for (i = 0; i < $from.length; i++) {
|
||||
if ($match = $from[i].all.item(id)) {
|
||||
if ($match.id == id) $results.push($match);
|
||||
else if ($match.length != null) {
|
||||
for (j = 0; j < $match.length; j++) {
|
||||
if ($match[j].id == id) $results.push($match[j]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return $results;
|
||||
};
|
||||
|
||||
// for IE5.0
|
||||
if (![].push) Array.prototype.push = function() {
|
||||
for (var i = 0; i < arguments.length; i++) {
|
||||
this[this.length] = arguments[i];
|
||||
}
|
||||
return this.length;
|
||||
};
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// query support
|
||||
// -----------------------------------------------------------------------
|
||||
|
||||
// select a set of matching elements.
|
||||
// "from" is an array of elements.
|
||||
// "token" is a character representing the type of filter
|
||||
// e.g. ">" means child selector
|
||||
// "filter" represents the tag name, id or class name that is being selected
|
||||
// the function returns an array of matching elements
|
||||
var $NAMESPACE = /\|/;
|
||||
function select($$from, $token, $filter, $arguments) {
|
||||
if ($NAMESPACE.test($filter)) {
|
||||
$filter = $filter.split($NAMESPACE);
|
||||
$arguments = $filter[0];
|
||||
$filter = $filter[1];
|
||||
}
|
||||
var $results = [];
|
||||
if (selectors[$token]) {
|
||||
selectors[$token]($results, $$from, $filter, $arguments);
|
||||
}
|
||||
return $results;
|
||||
};
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// parsing
|
||||
// -----------------------------------------------------------------------
|
||||
|
||||
// convert css selectors to a stream of tokens and filters
|
||||
// it's not a real stream. it's just an array of strings.
|
||||
var $STANDARD_SELECT = /^[^\s>+~]/;
|
||||
var $$STREAM = /[\s#.:>+~()@]|[^\s#.:>+~()@]+/g;
|
||||
function _toStream($selector) {
|
||||
if ($STANDARD_SELECT.test($selector)) $selector = " " + $selector;
|
||||
return $selector.match($$STREAM) || [];
|
||||
};
|
||||
|
||||
var $WHITESPACE = /\s*([\s>+~(),]|^|$)\s*/g;
|
||||
var $IMPLIED_ALL = /([\s>+~,]|[^(]\+|^)([#.:@])/g;
|
||||
var parseSelector = function($selector) {
|
||||
return $selector
|
||||
// trim whitespace
|
||||
.replace($WHITESPACE, "$1")
|
||||
// e.g. ".class1" --> "*.class1"
|
||||
.replace($IMPLIED_ALL, "$1*$2");
|
||||
};
|
||||
|
||||
var Quote = {
|
||||
toString: function() {return "'"},
|
||||
match: /^('[^']*')|("[^"]*")$/,
|
||||
test: function($string) {
|
||||
return this.match.test($string);
|
||||
},
|
||||
add: function($string) {
|
||||
return this.test($string) ? $string : this + $string + this;
|
||||
},
|
||||
remove: function($string) {
|
||||
return this.test($string) ? $string.slice(1, -1) : $string;
|
||||
}
|
||||
};
|
||||
|
||||
var getText = function($text) {
|
||||
return Quote.remove($text);
|
||||
};
|
||||
|
||||
var $ESCAPE = /([\/()[\]?{}|*+-])/g;
|
||||
function regEscape($string) {
|
||||
return $string.replace($ESCAPE, "\\$1");
|
||||
};
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// modules
|
||||
// -----------------------------------------------------------------------
|
||||
|
||||
// -------- >> insert modules here for packaging << -------- \\
|
||||
|
||||
loaded = true;
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// return the query function
|
||||
// -----------------------------------------------------------------------
|
||||
|
||||
return cssQuery;
|
||||
|
||||
}(); // cssQuery
|
||||
/*
|
||||
cssQuery, version 2.0.2 (2005-08-19)
|
||||
Copyright: 2004-2005, Dean Edwards (http://dean.edwards.name/)
|
||||
License: http://creativecommons.org/licenses/LGPL/2.1/
|
||||
*/
|
||||
|
||||
// the following functions allow querying of the DOM using CSS selectors
|
||||
var cssQuery = function() {
|
||||
var version = "2.0.2";
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// main query function
|
||||
// -----------------------------------------------------------------------
|
||||
|
||||
var $COMMA = /\s*,\s*/;
|
||||
var cssQuery = function($selector, $$from) {
|
||||
try {
|
||||
var $match = [];
|
||||
var $useCache = arguments.callee.caching && !$$from;
|
||||
var $base = ($$from) ? ($$from.constructor == Array) ? $$from : [$$from] : [document];
|
||||
// process comma separated selectors
|
||||
var $$selectors = parseSelector($selector).split($COMMA), i;
|
||||
for (i = 0; i < $$selectors.length; i++) {
|
||||
// convert the selector to a stream
|
||||
$selector = _toStream($$selectors[i]);
|
||||
// faster chop if it starts with id (MSIE only)
|
||||
if (isMSIE && $selector.slice(0, 3).join("") == " *#") {
|
||||
$selector = $selector.slice(2);
|
||||
$$from = _msie_selectById([], $base, $selector[1]);
|
||||
} else $$from = $base;
|
||||
// process the stream
|
||||
var j = 0, $token, $filter, $arguments, $cacheSelector = "";
|
||||
while (j < $selector.length) {
|
||||
$token = $selector[j++];
|
||||
$filter = $selector[j++];
|
||||
$cacheSelector += $token + $filter;
|
||||
// some pseudo-classes allow arguments to be passed
|
||||
// e.g. nth-child(even)
|
||||
$arguments = "";
|
||||
if ($selector[j] == "(") {
|
||||
while ($selector[j++] != ")" && j < $selector.length) {
|
||||
$arguments += $selector[j];
|
||||
}
|
||||
$arguments = $arguments.slice(0, -1);
|
||||
$cacheSelector += "(" + $arguments + ")";
|
||||
}
|
||||
// process a token/filter pair use cached results if possible
|
||||
$$from = ($useCache && cache[$cacheSelector]) ?
|
||||
cache[$cacheSelector] : select($$from, $token, $filter, $arguments);
|
||||
if ($useCache) cache[$cacheSelector] = $$from;
|
||||
}
|
||||
$match = $match.concat($$from);
|
||||
}
|
||||
delete cssQuery.error;
|
||||
return $match;
|
||||
} catch ($error) {
|
||||
cssQuery.error = $error;
|
||||
return [];
|
||||
}};
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// public interface
|
||||
// -----------------------------------------------------------------------
|
||||
|
||||
cssQuery.toString = function() {
|
||||
return "function cssQuery() {\n [version " + version + "]\n}";
|
||||
};
|
||||
|
||||
// caching
|
||||
var cache = {};
|
||||
cssQuery.caching = false;
|
||||
cssQuery.clearCache = function($selector) {
|
||||
if ($selector) {
|
||||
$selector = _toStream($selector).join("");
|
||||
delete cache[$selector];
|
||||
} else cache = {};
|
||||
};
|
||||
|
||||
// allow extensions
|
||||
var modules = {};
|
||||
var loaded = false;
|
||||
cssQuery.addModule = function($name, $script) {
|
||||
if (loaded) eval("$script=" + String($script));
|
||||
modules[$name] = new $script();;
|
||||
};
|
||||
|
||||
// hackery
|
||||
cssQuery.valueOf = function($code) {
|
||||
return $code ? eval($code) : this;
|
||||
};
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// declarations
|
||||
// -----------------------------------------------------------------------
|
||||
|
||||
var selectors = {};
|
||||
var pseudoClasses = {};
|
||||
// a safari bug means that these have to be declared here
|
||||
var AttributeSelector = {match: /\[([\w-]+(\|[\w-]+)?)\s*(\W?=)?\s*([^\]]*)\]/};
|
||||
var attributeSelectors = [];
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// selectors
|
||||
// -----------------------------------------------------------------------
|
||||
|
||||
// descendant selector
|
||||
selectors[" "] = function($results, $from, $tagName, $namespace) {
|
||||
// loop through current selection
|
||||
var $element, i, j;
|
||||
for (i = 0; i < $from.length; i++) {
|
||||
// get descendants
|
||||
var $subset = getElementsByTagName($from[i], $tagName, $namespace);
|
||||
// loop through descendants and add to results selection
|
||||
for (j = 0; ($element = $subset[j]); j++) {
|
||||
if (thisElement($element) && compareNamespace($element, $namespace))
|
||||
$results.push($element);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// ID selector
|
||||
selectors["#"] = function($results, $from, $id) {
|
||||
// loop through current selection and check ID
|
||||
var $element, j;
|
||||
for (j = 0; ($element = $from[j]); j++) if ($element.id == $id) $results.push($element);
|
||||
};
|
||||
|
||||
// class selector
|
||||
selectors["."] = function($results, $from, $className) {
|
||||
// create a RegExp version of the class
|
||||
$className = new RegExp("(^|\\s)" + $className + "(\\s|$)");
|
||||
// loop through current selection and check class
|
||||
var $element, i;
|
||||
for (i = 0; ($element = $from[i]); i++)
|
||||
if ($className.test($element.className)) $results.push($element);
|
||||
};
|
||||
|
||||
// pseudo-class selector
|
||||
selectors[":"] = function($results, $from, $pseudoClass, $arguments) {
|
||||
// retrieve the cssQuery pseudo-class function
|
||||
var $test = pseudoClasses[$pseudoClass], $element, i;
|
||||
// loop through current selection and apply pseudo-class filter
|
||||
if ($test) for (i = 0; ($element = $from[i]); i++)
|
||||
// if the cssQuery pseudo-class function returns "true" add the element
|
||||
if ($test($element, $arguments)) $results.push($element);
|
||||
};
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// pseudo-classes
|
||||
// -----------------------------------------------------------------------
|
||||
|
||||
pseudoClasses["link"] = function($element) {
|
||||
var $document = getDocument($element);
|
||||
if ($document.links) for (var i = 0; i < $document.links.length; i++) {
|
||||
if ($document.links[i] == $element) return true;
|
||||
}
|
||||
};
|
||||
|
||||
pseudoClasses["visited"] = function($element) {
|
||||
// can't do this without jiggery-pokery
|
||||
};
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// DOM traversal
|
||||
// -----------------------------------------------------------------------
|
||||
|
||||
// IE5/6 includes comments (LOL) in it's elements collections.
|
||||
// so we have to check for this. the test is tagName != "!". LOL (again).
|
||||
var thisElement = function($element) {
|
||||
return ($element && $element.nodeType == 1 && $element.tagName != "!") ? $element : null;
|
||||
};
|
||||
|
||||
// return the previous element to the supplied element
|
||||
// previousSibling is not good enough as it might return a text or comment node
|
||||
var previousElementSibling = function($element) {
|
||||
while ($element && ($element = $element.previousSibling) && !thisElement($element)) continue;
|
||||
return $element;
|
||||
};
|
||||
|
||||
// return the next element to the supplied element
|
||||
var nextElementSibling = function($element) {
|
||||
while ($element && ($element = $element.nextSibling) && !thisElement($element)) continue;
|
||||
return $element;
|
||||
};
|
||||
|
||||
// return the first child ELEMENT of an element
|
||||
// NOT the first child node (though they may be the same thing)
|
||||
var firstElementChild = function($element) {
|
||||
return thisElement($element.firstChild) || nextElementSibling($element.firstChild);
|
||||
};
|
||||
|
||||
var lastElementChild = function($element) {
|
||||
return thisElement($element.lastChild) || previousElementSibling($element.lastChild);
|
||||
};
|
||||
|
||||
// return child elements of an element (not child nodes)
|
||||
var childElements = function($element) {
|
||||
var $childElements = [];
|
||||
$element = firstElementChild($element);
|
||||
while ($element) {
|
||||
$childElements.push($element);
|
||||
$element = nextElementSibling($element);
|
||||
}
|
||||
return $childElements;
|
||||
};
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// browser compatibility
|
||||
// -----------------------------------------------------------------------
|
||||
|
||||
// all of the functions in this section can be overwritten. the default
|
||||
// configuration is for IE. The functions below reflect this. standard
|
||||
// methods are included in a separate module. It would probably be better
|
||||
// the other way round of course but this makes it easier to keep IE7 trim.
|
||||
|
||||
var isMSIE = true;
|
||||
|
||||
var isXML = function($element) {
|
||||
var $document = getDocument($element);
|
||||
return (typeof $document.mimeType == "unknown") ?
|
||||
/\.xml$/i.test($document.URL) :
|
||||
Boolean($document.mimeType == "XML Document");
|
||||
};
|
||||
|
||||
// return the element's containing document
|
||||
var getDocument = function($element) {
|
||||
return $element.ownerDocument || $element.document;
|
||||
};
|
||||
|
||||
var getElementsByTagName = function($element, $tagName) {
|
||||
return ($tagName == "*" && $element.all) ? $element.all : $element.getElementsByTagName($tagName);
|
||||
};
|
||||
|
||||
var compareTagName = function($element, $tagName, $namespace) {
|
||||
if ($tagName == "*") return thisElement($element);
|
||||
if (!compareNamespace($element, $namespace)) return false;
|
||||
if (!isXML($element)) $tagName = $tagName.toUpperCase();
|
||||
return $element.tagName == $tagName;
|
||||
};
|
||||
|
||||
var compareNamespace = function($element, $namespace) {
|
||||
return !$namespace || ($namespace == "*") || ($element.scopeName == $namespace);
|
||||
};
|
||||
|
||||
var getTextContent = function($element) {
|
||||
return $element.innerText;
|
||||
};
|
||||
|
||||
function _msie_selectById($results, $from, id) {
|
||||
var $match, i, j;
|
||||
for (i = 0; i < $from.length; i++) {
|
||||
if ($match = $from[i].all.item(id)) {
|
||||
if ($match.id == id) $results.push($match);
|
||||
else if ($match.length != null) {
|
||||
for (j = 0; j < $match.length; j++) {
|
||||
if ($match[j].id == id) $results.push($match[j]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return $results;
|
||||
};
|
||||
|
||||
// for IE5.0
|
||||
if (![].push) Array.prototype.push = function() {
|
||||
for (var i = 0; i < arguments.length; i++) {
|
||||
this[this.length] = arguments[i];
|
||||
}
|
||||
return this.length;
|
||||
};
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// query support
|
||||
// -----------------------------------------------------------------------
|
||||
|
||||
// select a set of matching elements.
|
||||
// "from" is an array of elements.
|
||||
// "token" is a character representing the type of filter
|
||||
// e.g. ">" means child selector
|
||||
// "filter" represents the tag name, id or class name that is being selected
|
||||
// the function returns an array of matching elements
|
||||
var $NAMESPACE = /\|/;
|
||||
function select($$from, $token, $filter, $arguments) {
|
||||
if ($NAMESPACE.test($filter)) {
|
||||
$filter = $filter.split($NAMESPACE);
|
||||
$arguments = $filter[0];
|
||||
$filter = $filter[1];
|
||||
}
|
||||
var $results = [];
|
||||
if (selectors[$token]) {
|
||||
selectors[$token]($results, $$from, $filter, $arguments);
|
||||
}
|
||||
return $results;
|
||||
};
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// parsing
|
||||
// -----------------------------------------------------------------------
|
||||
|
||||
// convert css selectors to a stream of tokens and filters
|
||||
// it's not a real stream. it's just an array of strings.
|
||||
var $STANDARD_SELECT = /^[^\s>+~]/;
|
||||
var $$STREAM = /[\s#.:>+~()@]|[^\s#.:>+~()@]+/g;
|
||||
function _toStream($selector) {
|
||||
if ($STANDARD_SELECT.test($selector)) $selector = " " + $selector;
|
||||
return $selector.match($$STREAM) || [];
|
||||
};
|
||||
|
||||
var $WHITESPACE = /\s*([\s>+~(),]|^|$)\s*/g;
|
||||
var $IMPLIED_ALL = /([\s>+~,]|[^(]\+|^)([#.:@])/g;
|
||||
var parseSelector = function($selector) {
|
||||
return $selector
|
||||
// trim whitespace
|
||||
.replace($WHITESPACE, "$1")
|
||||
// e.g. ".class1" --> "*.class1"
|
||||
.replace($IMPLIED_ALL, "$1*$2");
|
||||
};
|
||||
|
||||
var Quote = {
|
||||
toString: function() {return "'"},
|
||||
match: /^('[^']*')|("[^"]*")$/,
|
||||
test: function($string) {
|
||||
return this.match.test($string);
|
||||
},
|
||||
add: function($string) {
|
||||
return this.test($string) ? $string : this + $string + this;
|
||||
},
|
||||
remove: function($string) {
|
||||
return this.test($string) ? $string.slice(1, -1) : $string;
|
||||
}
|
||||
};
|
||||
|
||||
var getText = function($text) {
|
||||
return Quote.remove($text);
|
||||
};
|
||||
|
||||
var $ESCAPE = /([\/()[\]?{}|*+-])/g;
|
||||
function regEscape($string) {
|
||||
return $string.replace($ESCAPE, "\\$1");
|
||||
};
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// modules
|
||||
// -----------------------------------------------------------------------
|
||||
|
||||
// -------- >> insert modules here for packaging << -------- \\
|
||||
|
||||
loaded = true;
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// return the query function
|
||||
// -----------------------------------------------------------------------
|
||||
|
||||
return cssQuery;
|
||||
|
||||
}(); // cssQuery
|
||||
|
||||
+647
-647
File diff suppressed because it is too large
Load Diff
@@ -1,4 +1,4 @@
|
||||
/* make some small fonts a little bigger */
|
||||
.logininfo, .helplink, .minicalendar *, .link, .footer {
|
||||
font-size: 9pt !important;
|
||||
}
|
||||
/* make some small fonts a little bigger */
|
||||
.logininfo, .helplink, .minicalendar *, .link, .footer {
|
||||
font-size: 9pt !important;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user