Compare commits
36 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 572729aaa5 | |||
| bfae08a46d | |||
| 3d1141b0ee | |||
| 0e2be52d69 | |||
| 237f06b3d0 | |||
| 4493e62d1d | |||
| cb8004dabd | |||
| a292ea9761 | |||
| 1033e1e2f2 | |||
| b52204405e | |||
| 342d7cf4bf | |||
| 72225da176 | |||
| 9b4660e0ba | |||
| 6ab3a85252 | |||
| 1c2857e2e4 | |||
| 224a8644b0 | |||
| 41246701c2 | |||
| 15d529c1c3 | |||
| 905ff1fc36 | |||
| af72d273df | |||
| 8907e85ab5 | |||
| 9016f02312 | |||
| 2b190b1359 | |||
| 007182c2ae | |||
| aeabf66c16 | |||
| 7e2eb109ee | |||
| ef2a66a993 | |||
| 6b1280f163 | |||
| 3286ed2048 | |||
| f19f76ae9a | |||
| e1d726afcf | |||
| ad69341954 | |||
| ef69fa6e29 | |||
| c56ff4a8f7 | |||
| bb2714e517 | |||
| 36c45da5ce |
@@ -315,6 +315,7 @@ class enrolment_plugin_mnet {
|
||||
$userrecord->firstname = addslashes($user['firstname']);
|
||||
$userrecord->lastname = addslashes($user['lastname']);
|
||||
$userrecord->mnethostid = $MNET_REMOTE_CLIENT->id;
|
||||
$userrecord->confirmed = 1;
|
||||
|
||||
if ($userrecord->id = insert_record('user', $userrecord)) {
|
||||
$userrecord = get_record('user','id', $userrecord->id);
|
||||
|
||||
@@ -115,7 +115,7 @@ class edit_outcome_form extends moodleform {
|
||||
if (empty($courseid)) {
|
||||
$mform->hardFreeze('standard');
|
||||
|
||||
} else if (empty($outcome->courseid) and !has_capability('moodle/grade:manage', get_context_instance(CONTEXT_SYSTEM))) {
|
||||
} else if (!has_capability('moodle/grade:manage', get_context_instance(CONTEXT_SYSTEM))) {
|
||||
$mform->hardFreeze('standard');
|
||||
|
||||
} else if ($coursecount and empty($outcome->courseid)) {
|
||||
|
||||
@@ -482,6 +482,17 @@ function environment_check_php_extensions($version) {
|
||||
$result->setErrorCode(NO_PHP_EXTENSIONS_SECTION_FOUND);
|
||||
return array($result);
|
||||
}
|
||||
|
||||
/// Hack alert: inject extra mysqli dependency, mysql PHP extension is not supported in Moodle 2.x, warn only ppl using MySQL.
|
||||
global $CFG;
|
||||
set_dbfamily();
|
||||
if ($CFG->dbfamily === 'mysql') {
|
||||
$mver = normalize_version($version);
|
||||
if (version_compare($mver, '2.0', 'ge')) {
|
||||
$data['#']['PHP_EXTENSIONS']['0']['#']['PHP_EXTENSION'][] = array('#' => '', '@' => array('name' => 'mysqli', 'level' => 'required'));
|
||||
}
|
||||
}
|
||||
|
||||
/// Iterate over extensions checking them and creating the needed environment_results
|
||||
foreach($data['#']['PHP_EXTENSIONS']['0']['#']['PHP_EXTENSION'] as $extension) {
|
||||
$result = new environment_results('php_extension');
|
||||
|
||||
+44
-13
@@ -6381,9 +6381,14 @@ function check_php_version($version='4.1.0') {
|
||||
|
||||
|
||||
case 'Firefox': /// Mozilla Firefox browsers
|
||||
|
||||
if (preg_match("/Firefox\/([0-9\.]+)/i", $agent, $match)) {
|
||||
if (version_compare($match[1], $version) >= 0) {
|
||||
if (strpos($agent, 'Iceweasel') === false and strpos($agent, 'Firefox') === false) {
|
||||
return false;
|
||||
}
|
||||
if (empty($version)) {
|
||||
return true; // no version specified
|
||||
}
|
||||
if (preg_match("/(Iceweasel|Firefox)\/([0-9\.]+)/i", $agent, $match)) {
|
||||
if (version_compare($match[2], $version) >= 0) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -6391,19 +6396,45 @@ function check_php_version($version='4.1.0') {
|
||||
|
||||
|
||||
case 'Gecko': /// Gecko based browsers
|
||||
|
||||
if (substr_count($agent, 'Camino')) {
|
||||
// MacOS X Camino support
|
||||
$version = 20041110;
|
||||
// Do not look for dates any more, we expect real Firefox version here.
|
||||
if (empty($version)) {
|
||||
$version = 1;
|
||||
} else if ($version > 20000000) {
|
||||
// This is just a guess, it is not supposed to be 100% accurate!
|
||||
if (preg_match('/^201/', $version)) {
|
||||
$version = 3.6;
|
||||
} else if (preg_match('/^200[7-9]/', $version)) {
|
||||
$version = 3;
|
||||
} else if (preg_match('/^2006/', $version)) {
|
||||
$version = 2;
|
||||
} else {
|
||||
$version = 1.5;
|
||||
}
|
||||
}
|
||||
|
||||
// the proper string - Gecko/CCYYMMDD Vendor/Version
|
||||
// Faster version and work-a-round No IDN problem.
|
||||
if (preg_match("/Gecko\/([0-9]+)/i", $agent, $match)) {
|
||||
if ($match[1] > $version) {
|
||||
return true;
|
||||
if (preg_match("/(Iceweasel|Firefox)\/([0-9\.]+)/i", $agent, $match)) {
|
||||
// Use real Firefox version if specified in user agent string.
|
||||
if (version_compare($match[2], $version) >= 0) {
|
||||
return true;
|
||||
}
|
||||
} else if (preg_match("/Gecko\/([0-9\.]+)/i", $agent, $match)) {
|
||||
// Gecko might contain date or Firefox revision, let's just guess the Firefox version from the date.
|
||||
$browserver = $match[1];
|
||||
if ($browserver > 20000000) {
|
||||
// This is just a guess, it is not supposed to be 100% accurate!
|
||||
if (preg_match('/^201/', $browserver)) {
|
||||
$browserver = 3.6;
|
||||
} else if (preg_match('/^200[7-9]/', $browserver)) {
|
||||
$browserver = 3;
|
||||
} else if (preg_match('/^2006/', $version)) {
|
||||
$browserver = 2;
|
||||
} else {
|
||||
$browserver = 1.5;
|
||||
}
|
||||
}
|
||||
if (version_compare($browserver, $version) >= 0) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -2152,5 +2152,171 @@ function data_get_extra_capabilities() {
|
||||
return array('moodle/site:accessallgroups', 'moodle/site:viewfullnames');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all of the record ids from a database activity.
|
||||
*
|
||||
* @param int $dataid The dataid of the database module.
|
||||
* @return array $idarray An array of record ids
|
||||
*/
|
||||
function data_get_all_recordids($dataid, $selectdata = '') {
|
||||
global $CFG;
|
||||
|
||||
$initsql = "SELECT r.id
|
||||
FROM {$CFG->prefix}data_records r
|
||||
WHERE r.dataid = {$dataid}";
|
||||
if ($selectdata != '') {
|
||||
$initsql .= $selectdata;
|
||||
}
|
||||
$initsql .= ' GROUP BY r.id';
|
||||
$initrecord = get_recordset_sql($initsql);
|
||||
$idarray = array();
|
||||
foreach ($initrecord as $data) {
|
||||
$idarray[] = $data['id'];
|
||||
}
|
||||
$initrecord->close();
|
||||
return $idarray;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the ids of all the records that match that advanced search criteria.
|
||||
* This goes and loops through each criterion one at a time until it either
|
||||
* runs out of records or returns a subset of records.
|
||||
*
|
||||
* @param array $recordids An array of record ids.
|
||||
* @param array $searcharray Contains information for the advanced search criteria
|
||||
* @param int $dataid The data id of the database.
|
||||
* @return array $recordids An array of record ids.
|
||||
*/
|
||||
function data_get_advance_search_ids($recordids, $searcharray, $dataid) {
|
||||
$searchcriteria = array_keys($searcharray);
|
||||
// Loop through and reduce the IDs one search criteria at a time.
|
||||
foreach ($searchcriteria as $key) {
|
||||
$recordids = data_get_recordids($key, $searcharray, $dataid, $recordids);
|
||||
// If we don't have anymore IDs then stop.
|
||||
if (!$recordids) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
return $recordids;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the record IDs given the search criteria
|
||||
*
|
||||
* @param string $alias Record alias.
|
||||
* @param array $searcharray Criteria for the search.
|
||||
* @param int $dataid Data ID for the database
|
||||
* @param array $recordids An array of record IDs.
|
||||
* @return array $nestarray An arry of record IDs
|
||||
*/
|
||||
function data_get_recordids($alias, $searcharray, $dataid, $recordids) {
|
||||
global $CFG;
|
||||
|
||||
$nestsearch = $searcharray[$alias];
|
||||
// searching for content outside of mdl_data_content
|
||||
if ($alias < 0) {
|
||||
$alias = '';
|
||||
}
|
||||
$recordidsstring = implode(',', $recordids);
|
||||
$nestselect = "SELECT c$alias.recordid
|
||||
FROM {$CFG->prefix}data_content c$alias,
|
||||
{$CFG->prefix}data_fields f,
|
||||
{$CFG->prefix}data_records r,
|
||||
{$CFG->prefix}user u ";
|
||||
$nestwhere = "WHERE u.id = r.userid
|
||||
AND f.id = c$alias.fieldid
|
||||
AND r.id = c$alias.recordid
|
||||
AND r.dataid = $dataid
|
||||
AND c$alias.recordid IN ($recordidsstring)
|
||||
AND ";
|
||||
|
||||
$params['dataid'] = $dataid;
|
||||
if (!empty($nestsearch->sql)) {
|
||||
$nestsql = $nestselect . $nestwhere . $nestsearch->sql;
|
||||
} else {
|
||||
$sql = $nestsearch->field . ' ' . sql_ilike() . " '%$nestsearch->data%'";
|
||||
$nestsql = $nestselect . $nestwhere . $sql . ' GROUP BY c' . $alias . '.recordid';
|
||||
}
|
||||
$nestrecords = get_recordset_sql($nestsql);
|
||||
$nestarray = array();
|
||||
foreach ($nestrecords as $data) {
|
||||
$nestarray[] = $data['recordid'];
|
||||
}
|
||||
// Close the record set and free up resources.
|
||||
$nestrecords->close();
|
||||
return $nestarray;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an array with an sql string for advanced searches and the parameters that go with them.
|
||||
*
|
||||
* @param int $sort DATA_*
|
||||
* @param stdClass $data Data module object
|
||||
* @param array $recordids An array of record IDs.
|
||||
* @param string $selectdata Information for the select part of the sql statement.
|
||||
* @param string $sortorder Additional sort parameters
|
||||
* @return string An sql string.
|
||||
*/
|
||||
function data_get_advanced_search_sql($sort, $data, $recordids, $selectdata, $sortorder) {
|
||||
global $CFG;
|
||||
// Sorting by time created.
|
||||
if ($sort == 0) {
|
||||
$nestselectsql = "SELECT r.id, r.approved, r.timecreated, r.timemodified, r.userid, u.firstname, u.lastname
|
||||
FROM {$CFG->prefix}data_content c,
|
||||
{$CFG->prefix}data_records r,
|
||||
{$CFG->prefix}user u ";
|
||||
$groupsql = ' GROUP BY r.id, r.approved, r.timecreated, r.timemodified, r.userid, u.firstname, u.lastname ';
|
||||
} else {
|
||||
// Sorting through 'Other' criteria
|
||||
if ($sort <= 0) {
|
||||
switch ($sort) {
|
||||
case DATA_LASTNAME:
|
||||
$sortcontentfull = "u.lastname";
|
||||
break;
|
||||
case DATA_FIRSTNAME:
|
||||
$sortcontentfull = "u.firstname";
|
||||
break;
|
||||
case DATA_APPROVED:
|
||||
$sortcontentfull = "r.approved";
|
||||
break;
|
||||
case DATA_TIMEMODIFIED:
|
||||
$sortcontentfull = "r.timemodified";
|
||||
break;
|
||||
case DATA_TIMEADDED:
|
||||
default:
|
||||
$sortcontentfull = "r.timecreated";
|
||||
}
|
||||
} else {
|
||||
// Sorting with user entered data fields.
|
||||
$sortfield = data_get_field_from_id($sort, $data);
|
||||
$sortcontent = sql_compare_text('c.' . $sortfield->get_sort_field());
|
||||
$sortcontentfull = $sortfield->get_sort_sql($sortcontent);
|
||||
}
|
||||
|
||||
$nestselectsql = "SELECT r.id, r.approved, r.timecreated, r.timemodified, r.userid, u.firstname, u.lastname, $sortcontentfull
|
||||
AS sortorder
|
||||
FROM {$CFG->prefix}data_content c,
|
||||
{$CFG->prefix}data_records r,
|
||||
{$CFG->prefix}user u ";
|
||||
$groupsql = ' GROUP BY r.id, r.approved, r.timecreated, r.timemodified, r.userid, u.firstname, u.lastname, ' .$sortcontentfull;
|
||||
}
|
||||
$nestfromsql = 'WHERE c.recordid = r.id
|
||||
AND r.dataid = ' . $data->id . '
|
||||
AND r.userid = u.id';
|
||||
|
||||
// Find the field we are sorting on
|
||||
if ($sort > 0 or data_get_field_from_id($sort, $data)) {
|
||||
$nestfromsql .= " AND c.fieldid = $sort";
|
||||
}
|
||||
// If there are no record IDs then return an sql statment that will return no rows.
|
||||
if (count($recordids) != 0) {
|
||||
$recordidsstring = implode(',', $recordids);
|
||||
$insql = " IN ($recordidsstring) ";
|
||||
} else {
|
||||
$insql = " = -1";
|
||||
}
|
||||
$nestfromsql .= ' AND c.recordid ' . $insql . $selectdata . $groupsql;
|
||||
$nestfromsql = "$nestfromsql $selectdata";
|
||||
return "$nestselectsql $nestfromsql $sortorder";
|
||||
}
|
||||
?>
|
||||
|
||||
+28
-9
@@ -300,6 +300,14 @@
|
||||
groups_print_activity_menu($cm, $returnurl);
|
||||
$currentgroup = groups_get_activity_group($cm);
|
||||
$groupmode = groups_get_activity_groupmode($cm);
|
||||
// If a student is not part of a group and seperate groups is enabled, we don't
|
||||
// want them seeing all records.
|
||||
if ($currentgroup == 0 && $groupmode == 1 && !has_capability('mod/data:manageentries', $context)) {
|
||||
$canviewallrecords = false;
|
||||
} else {
|
||||
$canviewallrecords = true;
|
||||
}
|
||||
|
||||
|
||||
// deletect entries not approved yet and show hint instead of not found error
|
||||
if ($record and $data->approval and !$record->approved and $record->userid != $USER->id and !has_capability('mod/data:manageentries', $context)) {
|
||||
@@ -439,7 +447,13 @@
|
||||
if ($currentgroup) {
|
||||
$groupselect = " AND (r.groupid = '$currentgroup' OR r.groupid = 0)";
|
||||
} else {
|
||||
$groupselect = ' ';
|
||||
if ($canviewallrecords) {
|
||||
$groupselect = ' ';
|
||||
} else {
|
||||
// If separate groups are enabled and the user isn't in a group or
|
||||
// a teacher, manager, admin etc, then just show them entries for 'All participants'.
|
||||
$groupselect = " AND r.groupid = 0";
|
||||
}
|
||||
}
|
||||
|
||||
$ilike = sql_ilike(); //Be case-insensitive
|
||||
@@ -507,7 +521,7 @@
|
||||
$sortcontent = sql_compare_text('c.' . $sortfield->get_sort_field());
|
||||
$sortcontentfull = $sortfield->get_sort_sql($sortcontent);
|
||||
|
||||
$what = ' DISTINCT r.id, r.approved, r.timecreated, r.timemodified, r.userid, u.firstname, u.lastname, '.$sortcontentfull.' AS _order ';
|
||||
$what = ' DISTINCT r.id, r.approved, r.timecreated, r.timemodified, r.userid, u.firstname, u.lastname, '.$sortcontentfull.' AS sortorder ';
|
||||
$count = ' COUNT(DISTINCT c.recordid) ';
|
||||
$tables = $CFG->prefix.'data_content c,'.$CFG->prefix.'data_records r,'.$CFG->prefix.'data_content cs, '.$CFG->prefix.'user u ';
|
||||
$where = 'WHERE c.recordid = r.id
|
||||
@@ -515,7 +529,7 @@
|
||||
AND r.dataid = '.$data->id.'
|
||||
AND r.userid = u.id
|
||||
AND cs.recordid = r.id ';
|
||||
$sortorder = ' ORDER BY _order '.$order.' , r.id ASC ';
|
||||
$sortorder = ' ORDER BY sortorder '.$order.' , r.id ASC ';
|
||||
$searchselect = '';
|
||||
|
||||
// If requiredentries is not reached, only show current user's entries
|
||||
@@ -543,13 +557,21 @@
|
||||
/// To actually fetch the records
|
||||
|
||||
$fromsql = "FROM $tables $advtables $where $advwhere $groupselect $approveselect $searchselect $advsearchselect";
|
||||
$sqlselect = "SELECT $what $fromsql $sortorder";
|
||||
$sqlcount = "SELECT $count $fromsql"; // Total number of records when searching
|
||||
$sqlmax = "SELECT $count FROM $tables $where $groupselect $approveselect"; // number of all recoirds user may see
|
||||
|
||||
/// Work out the paging numbers and counts
|
||||
$selectdata = $groupselect . $approveselect;
|
||||
$recordids = data_get_all_recordids($data->id, $selectdata);
|
||||
|
||||
$newrecordids = data_get_advance_search_ids($recordids, $search_array, $data->id);
|
||||
$totalcount = count($newrecordids);
|
||||
|
||||
if (!empty($advanced)) {
|
||||
$sqlselect = data_get_advanced_search_sql($sort, $data, $newrecordids, $selectdata, $sortorder);
|
||||
} else {
|
||||
$sqlselect = "SELECT $what $fromsql $sortorder";
|
||||
}
|
||||
|
||||
$totalcount = count_records_sql($sqlcount);
|
||||
if (empty($searchselect) && empty($advsearchselect)) {
|
||||
$maxcount = $totalcount;
|
||||
} else {
|
||||
@@ -559,14 +581,11 @@
|
||||
if ($record) { // We need to just show one, so where is it in context?
|
||||
$nowperpage = 1;
|
||||
$mode = 'single';
|
||||
|
||||
$page = 0;
|
||||
// TODO: Improve this because we are executing $sqlselect twice (here and some lines below)!
|
||||
if ($allrecordids = get_fieldset_sql($sqlselect)) {
|
||||
$page = (int)array_search($record->id, $allrecordids);
|
||||
unset($allrecordids);
|
||||
}
|
||||
|
||||
} else if ($mode == 'single') { // We rely on ambient $page settings
|
||||
$nowperpage = 1;
|
||||
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
<h1>Add quiz chain</h1>
|
||||
|
||||
<div class="indent">
|
||||
<p>
|
||||
<b>No</b><br />
|
||||
Only one quiz will be added to the course
|
||||
</p>
|
||||
<p>
|
||||
<b>Yes</b><br />
|
||||
If the "File name" is a file, it is treated as the start of a chain
|
||||
of Hot Potatoes quizzes and all quizzes in the chain will be added to the course
|
||||
with identical settings.<br />
|
||||
<br />
|
||||
If the "File name" is a folder, all Hot Potatoes quizzes in the folder
|
||||
will be added to the course as a chain of quizzes with identical settings.
|
||||
</p>
|
||||
</div>
|
||||
@@ -0,0 +1,8 @@
|
||||
<h1>Item Response Analysis</h1>
|
||||
<p>This table lists the responses to each question and the frequency of each response.</p>
|
||||
<ul>
|
||||
<li>The frequencies of <b>correct answers</b> are shown in <font color="red"><b>red text</b></font>.</li>
|
||||
<li>The frequencies of <b>wrong answers</b> are shown in <font color="blue"><b>blue text</b></font>.</li>
|
||||
<li>The frequencies of <b>ignored answers</b> are shown in <font color="brown"><b>brown text</b></font>.</li>
|
||||
<li>The frequencies of <b>numeric data</b> are shown in <font color="green"><b>green text</b></font>.</li>
|
||||
</ul>
|
||||
@@ -0,0 +1,19 @@
|
||||
<h1>Enable click reporting</h1>
|
||||
|
||||
<div class="indent">
|
||||
<p>
|
||||
<b>Yes</b><br />
|
||||
A separate record is stored in the database each time a
|
||||
"hint", "clue" or "check"
|
||||
button is clicked. This allows the teacher to see a very
|
||||
detailed report showing the state of the quiz at each click.
|
||||
However, it may also mean that the size of the database grows
|
||||
very quickly, because several "click" records may
|
||||
be stored for each attempt at a quiz.
|
||||
</p>
|
||||
<p>
|
||||
<b>No</b><br />
|
||||
Only one record per attempt at a quiz is stored in the Moodle database.
|
||||
</p>
|
||||
</div>
|
||||
<p>By the default this option is disabled.</p>
|
||||
@@ -0,0 +1,74 @@
|
||||
<h1>Click Trail</h1>
|
||||
<p>
|
||||
This table shows details of every click by every student
|
||||
during completed attempts at a particular Hot Potatoes quiz.
|
||||
</p>
|
||||
<p>
|
||||
Please note that this report is very wide and can be very
|
||||
long, so it is intended to be downloaded and viewed using
|
||||
a spreadsheet program, such as Microsoft Excel.
|
||||
</p>
|
||||
<p>
|
||||
Each row in the table contains the following information:
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<b>Which click?</b><br />
|
||||
The following details identify to which click in which attempt
|
||||
by which student at which quiz in which section of which course
|
||||
this row refers:
|
||||
</p>
|
||||
<ul>
|
||||
<li>Course name, Section number, Exercise number, Exercise name, Exercise type, Number of questions</li>
|
||||
<li>Student's full name, Login date, Login time, Logoff time</li>
|
||||
<li>Attempt number, Attempt start time, Attempt finish time</li>
|
||||
<li>Click number, Click time, Click type</li>
|
||||
</ul>
|
||||
|
||||
<p>
|
||||
<b>Which questions were affected?</b><br />
|
||||
The following details are shown of which questions,
|
||||
if any, were affected by the current click:
|
||||
</p>
|
||||
<ul>
|
||||
<li>questions which were checked, or given a hint or clue on the current click</li>
|
||||
<li>the status of each question after the current click
|
||||
<ul>
|
||||
<li><b>0</b> means "correct"</li>
|
||||
<li><b>X</b> means "wrong"</li>
|
||||
<li><b>-</b> means "not attempted"</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>new answers which were received on the current click (answers that did not change are not shown)</li>
|
||||
<li>questions for which new answers were received on the current click</li>
|
||||
<li>questions for which new answers were received, or for which a hint or clue was given, on the current click</li>
|
||||
</ul>
|
||||
|
||||
<p>
|
||||
<b>How many questions were affected?</b><br />
|
||||
The following details are shown of the total number
|
||||
of questions, if any, affected by the current click
|
||||
and the total number of questions affected so far
|
||||
in the quiz:
|
||||
</p>
|
||||
<ul>
|
||||
<li>the number of questions attempted</li>
|
||||
<li>the number of questions not attempted</li>
|
||||
<li>the number of questions whose status is "right"</li>
|
||||
<li>the number of questions whose status is "wrong"</li>
|
||||
<li>the number of questions for which hints have been given</li>
|
||||
<li>the number of questions for which clues have been given</li>
|
||||
<li>the number of questions for which new answers have been received</li>
|
||||
<li>the number of questions for which new answers have been received, or for which a hint or clue has been given</li>
|
||||
</ul>
|
||||
|
||||
<p>
|
||||
<b>Scores</b><br />
|
||||
The following details are shown about scores for this click
|
||||
and for the quiz so far:
|
||||
</p>
|
||||
<ul>
|
||||
<li>the raw score</li>
|
||||
<li>the maximum score</li>
|
||||
<li>the score as a percentage</li>
|
||||
</ul>
|
||||
@@ -0,0 +1,17 @@
|
||||
<h1>Force Moodle to use Moodle-compatible media players</h1>
|
||||
|
||||
<div class="indent">
|
||||
<p>
|
||||
<b>No</b><br />
|
||||
Moodle will not change the settings of any media players in the quiz
|
||||
</p>
|
||||
<p>
|
||||
<b>Yes</b><br />
|
||||
Moodle will force the quiz to use Moodle-compatible media players to play files like:
|
||||
<ul><li>avi</li><li>mpeg</li><li>mpg</li><li>mp3</li><li>mov</li><li>wmv</li></ul>
|
||||
</p>
|
||||
</div>
|
||||
<p>
|
||||
More information:
|
||||
<a href="help.php?module=hotpot&file=mediaplayers.html">Relative URLs, media players and Hot Potatoes</a>
|
||||
</p>
|
||||
@@ -0,0 +1,16 @@
|
||||
<h2>Hot Potatoes</h2>
|
||||
<ul>
|
||||
<li><a href="help.php?module=hotpot&file=addquizchain.html">Add quiz chain</a></li>
|
||||
<li><a href="help.php?module=hotpot&file=analysistable.html">Analysis table</a></li>
|
||||
<li><a href="help.php?module=hotpot&file=clickreporting.html">Click trail report</a></li>
|
||||
<li><a href="help.php?module=hotpot&file=forceplugins.html">Force media plugins</a></li>
|
||||
<li><a href="help.php?module=hotpot&file=mediaplayers.html">Media players, relative URLs and Hot Potatoes</a></li>
|
||||
<li><a href="help.php?module=hotpot&file=navigation.html">Navigation</a></li>
|
||||
<li><a href="help.php?module=hotpot&file=outputformat.html">Output format</a></li>
|
||||
<li><a href="help.php?module=hotpot&file=reportcontent.html">Report content</a></li>
|
||||
<li><a href="help.php?module=hotpot&file=reportformat.html">Report format</a></li>
|
||||
<li><a href="help.php?module=hotpot&file=responsestable.html">Responses table</a></li>
|
||||
<li><a href="help.php?module=hotpot&file=shownextquiz.html">Show next quiz</a></li>
|
||||
<li><a href="help.php?module=hotpot&file=studentfeedback.html">Student feedback</a></li>
|
||||
<li><a href="help.php?module=hotpot&file=updatequizchain.html">Update quiz chain</a></li>
|
||||
</ul>
|
||||
@@ -0,0 +1,28 @@
|
||||
<h1>Relative URLs, media players and Hot Potatoes</h1>
|
||||
|
||||
<h2>Definitions</h2>
|
||||
|
||||
<div class="indent">
|
||||
<p><i>URL</i><br />
|
||||
the address of an internet resource, such as a webpage, image or sound file.
|
||||
</p>
|
||||
<p>
|
||||
<i>absolute URL</i><br />
|
||||
a URL that begins with "http://" is called an absolute URL.
|
||||
Wherever it is used, it always refers to the same target resource.
|
||||
</p>
|
||||
<p>
|
||||
<i>relative URL</i><br />
|
||||
a URL that does not begin with "http://" is called a relative URL.
|
||||
It can be combined with the absolute URL of a "base" page, to get
|
||||
the absolute URL of the target resource.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<h2>Relative URLs in Hot Potatoes quizzes</h2>
|
||||
<p>Relative URLs are a convenient way to specify images, sounds and videos in a Hot Potatoes quiz, because they allow the quiz to be viewed and tested on a local PC, before being uploaded to a Moodle site. When the quiz is uploaded to the Moodle site, the multimedia files must also be uploaded, so that they are available when the quiz is administered via Moodle.</p>
|
||||
<p>For security reasons, Moodle does not allow direct access to course files. All requests for files in a given course go through a guardian script which verfies that the person requesting the file is enrolled in the course. However, this mechanism can break relative links used in the quiz, because the normal rules for deriving an absolute URL from a relative URL do not work.</p>
|
||||
<p>The solution is simple enough: <font color="red"><b>all relative URLs must be converted to absolute URLs </b></font> by the time the quiz reaches the browser. In the case of Hot Potatoes quizzes, the URLs will be converted by Moodle, so content creators do not have to bother with this tedious and error-prone task. </p>
|
||||
|
||||
<h2>Media players in Hot Potatoes quizzes </h2>
|
||||
<p>Some media players will not accept the media file if it comes via the script which guards the course files. In this situation, it is necessary to replace the media player with one that is known to be compatible with Moodle. You can do this yourself by modifying the reference to the media player in the quiz, or you can force Moodle to do it by setting the "Force media plugins" option on the quiz's settings page to "Yes".</p>
|
||||
@@ -0,0 +1,8 @@
|
||||
<p><img src="<?php echo $CFG->wwwroot?>/mod/hotpot/icon.gif" alt="" /> <b>Hot Potatoes</b></p>
|
||||
<div class="indent">
|
||||
This module, the "HotPot" module, allows teachers to administer
|
||||
<a href="http://web.uvic.ca/hrd/halfbaked/" target="_blank">Hot Potatoes</a> quizzes via Moodle.
|
||||
The quizzes are created on the teacher's computer and then uploaded to the Moodle course.<br />
|
||||
After students have attempted the quizzes, a number of reports are available which show how
|
||||
individual questions were answered and some statistical trends in the scores.
|
||||
</div>
|
||||
@@ -0,0 +1,40 @@
|
||||
<h1>Navigation</h1>
|
||||
<p>
|
||||
You can specify different navigation aids for a Hot Potatoes Quiz.
|
||||
</p>
|
||||
<div class="indent">
|
||||
<p>
|
||||
<b>Moodle navigation bar</b><br />
|
||||
The standard Moodle navigation bar will be displayed in the same
|
||||
window as the quiz at the top of the page.
|
||||
</p>
|
||||
<p>
|
||||
<b>Moodle navigation frame</b><br />
|
||||
The standard Moodle navigation bar will be displayed in a separate
|
||||
frame at the top of the quiz.
|
||||
</p>
|
||||
<p>
|
||||
<b>Embedded IFRAME</b><br />
|
||||
The standard Moodle navigation bar will be displayed in the same
|
||||
window as the quiz and the quiz will be embedded in an IFRAME.
|
||||
</p>
|
||||
<p>
|
||||
<b>Hot Potatoes quiz buttons </b><br />
|
||||
The quiz will be displayed with the navigation buttons, if any,
|
||||
defined in the quiz.
|
||||
</p>
|
||||
<p>
|
||||
<b>A single "Give Up" button</b><br />
|
||||
The quiz will be displayed with a single "Give Up" button
|
||||
at the top of the page.
|
||||
</p>
|
||||
<p>
|
||||
<b>None</b><br />
|
||||
The quiz will be displayed with no navigation aids. i.e. neither
|
||||
a Moodle navigation bar nor any Hot Potatoes navigation buttons.
|
||||
When all questions on the current quiz have been answered correctly,
|
||||
Moodle will either return to the course page or display the next quiz,
|
||||
depending on the setting of the "Show next quiz?" field
|
||||
for the current quiz.
|
||||
</p>
|
||||
</div>
|
||||
@@ -0,0 +1,39 @@
|
||||
<h1>Output Format</h1>
|
||||
<p>
|
||||
You can specify different formats to display the quiz
|
||||
</p>
|
||||
<div class="indent">
|
||||
<p>
|
||||
<b>best</b><br />
|
||||
The quiz will be displayed in the best format for the browser.
|
||||
</p>
|
||||
<p>
|
||||
<b>v6+</b><br />
|
||||
The quiz will be displayed in a drag and drop format for v6+ browsers
|
||||
</p>
|
||||
<p>
|
||||
<b>v6</b><br />
|
||||
The quiz will be displayed in format for v6 browsers
|
||||
</p>
|
||||
<p>
|
||||
<b>v5</b><br />
|
||||
The quiz will be displayed in a format for v5 browsers
|
||||
</p>
|
||||
<p>
|
||||
<b>v4</b><br />
|
||||
The quiz will be displayed in a format for v4 browsers
|
||||
</p>
|
||||
<p>
|
||||
<b>v3</b><br />
|
||||
The quiz will be displayed in a format for v3 browsers
|
||||
</p>
|
||||
<p>
|
||||
<b>Flash</b><br />
|
||||
The quiz will be displayed in using Flash
|
||||
</p>
|
||||
<p>
|
||||
<b>mobile</b><br />
|
||||
The quiz will be displayed in a format suitable for viewing on
|
||||
small mobile devices such as cell phones
|
||||
</p>
|
||||
</div>
|
||||
@@ -0,0 +1,13 @@
|
||||
<h1>Remove grade item</h1>
|
||||
|
||||
<div class="indent">
|
||||
<p>
|
||||
<b>No</b><br />
|
||||
The grade item for this activity in the Moodle gradebook will not be removed
|
||||
</p>
|
||||
<p>
|
||||
<b>Yes</b><br />
|
||||
If the maximum grade for this Hot Potatoes quiz is set to zero,
|
||||
then the grade item for this activity will be removed from the Moodle gradebook
|
||||
</p>
|
||||
</div>
|
||||
@@ -0,0 +1,109 @@
|
||||
<h1>Report Content</h1>
|
||||
<p>You can specify different content for the Hot Potatoes reports.</p>
|
||||
|
||||
<h2>Selecting the type of report</h2>
|
||||
<div class="indent">
|
||||
<p>
|
||||
<b>Overview</b><br />
|
||||
This report is a list of all attempts at this quiz.
|
||||
|
||||
It shows the picture and name of each user, along with their
|
||||
grade for the quiz and the score, time and duration of each attempt.
|
||||
|
||||
Attempts may be selected and then deleted if required.
|
||||
</p>
|
||||
<p>
|
||||
<b>Simple statistics</b><br />
|
||||
This report is a list of all attempts at this quiz,
|
||||
except "in progress" attempts.
|
||||
|
||||
It shows the picture and name of each user, along with their
|
||||
grade for the quiz, and the score of each question in each attempt.
|
||||
|
||||
It also gives the average scores of the individual
|
||||
questions and the quiz as a whole.
|
||||
</p>
|
||||
<p>
|
||||
<b>Detailed statistics</b><br />
|
||||
This report shows full details of all attempts at this quiz,
|
||||
except "in progress" attempts.
|
||||
|
||||
The report contains the following tables:
|
||||
</p>
|
||||
<ul>
|
||||
<li>the <a href="help.php?module=hotpot&file=responsestable.html">responses table</a>,
|
||||
which shows how each user responded to each question in each of their attempts at the quiz.</li>
|
||||
|
||||
<li>the <a href="help.php?module=hotpot&file=analysistable.html">item analysis table</a>,
|
||||
which lists the responses to each question and the frequency of each response.</li>
|
||||
</ul>
|
||||
<p>
|
||||
<b>Click trail report</b><br />
|
||||
This report shows details of every click by every student in all attempts at this quiz,
|
||||
except "in progress" attempts.
|
||||
|
||||
The report can be very large and is intended to be downloaded and viewed in a spreadsheet
|
||||
program, such as Microsoft Excel.
|
||||
|
||||
Details of the columns in this report are available in the
|
||||
<a href="help.php?module=hotpot&file=clickreporttable.html">click trail table</a>
|
||||
help file.
|
||||
</p>
|
||||
<p>
|
||||
The click trail report is only available if
|
||||
<a href="help.php?module=hotpot&file=clickreporting.html">click reporting</a>
|
||||
has been enabled for this HotPot activity.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<h2>Selecting users</h2>
|
||||
<div class="indent">
|
||||
<p>
|
||||
<b>All users</b><br />
|
||||
The report will show responses by all users who have attempted this quiz.
|
||||
This includes users who are not currently enrolled on the course,
|
||||
the "guest" user, course creators and Moodle administrators.
|
||||
</p>
|
||||
<p>
|
||||
<b>All participants</b><br />
|
||||
The report will show responses by all students and teachers who are currently
|
||||
enrolled on this course, as well as responses by the "guest" user,
|
||||
course creators and Moodle administrators.
|
||||
</p>
|
||||
<p>
|
||||
<b>Group: group name</b><br />
|
||||
The report will show responses by all students in the group selected.
|
||||
The group options will not appear on the drop-down menu if there are
|
||||
no groups defined for this course.
|
||||
</p>
|
||||
<p>
|
||||
<b>Enrolled students</b><br />
|
||||
The report will show responses by students currently enrolled in this course.
|
||||
Teacher's responses will not be included in the report.
|
||||
</p>
|
||||
<p>
|
||||
<b>Single student</b><br />
|
||||
The report will show responses by a single student selected from a drop-down list
|
||||
of students' names.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<h2>Selecting grades</h2>
|
||||
<div class="indent">
|
||||
<p>
|
||||
<b>All attempts</b><br />
|
||||
The report will include the responses from all the attempts by each user.
|
||||
</p>
|
||||
<p>
|
||||
<b>Best attempt</b><br />
|
||||
The report will only include the responses from the highest scoring attempt by each user.
|
||||
</p>
|
||||
<p>
|
||||
<b>First attempt</b><br />
|
||||
The report will only include the responses from the first attempt by each user.
|
||||
</p>
|
||||
<p>
|
||||
<b>Last attempt</b><br />
|
||||
The report will only include the responses from the most recent attempt by each user.
|
||||
</p>
|
||||
</div>
|
||||
@@ -0,0 +1,60 @@
|
||||
<h1>Report Format</h1>
|
||||
<p>
|
||||
You can specify different output formats for the Hot Potatoes reports.
|
||||
</p>
|
||||
|
||||
<h2>Report Format</h2>
|
||||
<div class="indent">
|
||||
<p>
|
||||
<b>HTML</b><br />
|
||||
the report will be generated in HTML format suitable for displaying in a web browser
|
||||
</p>
|
||||
<p>
|
||||
<b>Excel</b><br />
|
||||
the report will be generated as an ".xls" file which can be opened by
|
||||
a spreadsheet program, such as Microsoft Excel
|
||||
</p>
|
||||
<p>
|
||||
<b>Text</b><br />
|
||||
the report will be generated a text file which can be opened by a text editor
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<h2>Encoding</h2>
|
||||
<div class="indent">
|
||||
<p>
|
||||
A list of encodings may be offered which allows you to force the report values
|
||||
into a specific encoding if your spreadsheet program requires it.
|
||||
|
||||
For example, Microsoft Excel requires the "SJIS" encoding for Japanese.
|
||||
|
||||
The list of possible encodings can be adjusted by the site administrator on the
|
||||
"Settings" page for the HotPot module
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<h2>Wrap data</h2>
|
||||
<div class="indent">
|
||||
<p>
|
||||
<b>Yes</b><br />
|
||||
long data values will be wrapped to fit into table cells.
|
||||
This may make some rows very tall
|
||||
</p>
|
||||
<p>
|
||||
<b>No</b><br />
|
||||
data values will not be wrapped
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<h2>Show legend</h2>
|
||||
<div class="indent">
|
||||
<p>
|
||||
<b>Yes</b><br />
|
||||
in the main report, questions and answers will be represented by letters.
|
||||
A legend will be generated which shows which letters represent which questions or answers
|
||||
</p>
|
||||
<p>
|
||||
<b>No</b><br />
|
||||
questions and answers will appear in full in the report and no legend will be generated
|
||||
</p>
|
||||
</div>
|
||||
@@ -0,0 +1,22 @@
|
||||
<h1>Individual Responses</h1>
|
||||
<p>
|
||||
This table shows how each user responded to each
|
||||
question in each of their attempts at the quiz.
|
||||
</p>
|
||||
<p>
|
||||
The responses are color-coded as follows:
|
||||
</p>
|
||||
<ul>
|
||||
<li><font color="red"><b>Correct answers</b></font></li>
|
||||
<li><font color="brown"><b>Ignored answers</b></font> (if any)</li>
|
||||
<li><font color="blue"><b>Wrong answers</b></font> (if any)</li>
|
||||
<li><font color="green"><b>score% (hints,clues,checks)</b></font>
|
||||
<ul>
|
||||
<li><b>score</b> is the percentage score for this question</li>
|
||||
<li><b>hints</b> is the number hints requested</li>
|
||||
<li><b>clues</b> indicates whether the clue was shown (=1) or not (=0)</li>
|
||||
<li><b>checks</b> is the number checks performed on this question.
|
||||
A value of "-1" means that the student clicked the "Show answer" button</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -0,0 +1,17 @@
|
||||
<h1>Show next quiz</h1>
|
||||
|
||||
<div class="indent">
|
||||
<p>
|
||||
<b>No</b><br />
|
||||
When the Hot Potatoes quiz is finished, Moodle will
|
||||
record the results and return to the main page for the
|
||||
current course
|
||||
</p>
|
||||
<p>
|
||||
<b>Yes</b><br />
|
||||
When the Hot Potatoes quiz is finished, Moodle will
|
||||
record the results and then display the next Hot Potatoes
|
||||
quiz in the current section. If there is no such quiz,
|
||||
Moodle will return to the main page for the current course
|
||||
</p>
|
||||
</div>
|
||||
@@ -0,0 +1,38 @@
|
||||
<h1>Student feedback</h1>
|
||||
<p>
|
||||
If this option is enabled, a link to a popup feedback window will be displayed
|
||||
whenever the student clicks on the "Check" button. The feedback window
|
||||
allows students to send feedback to the teacher regarding the quiz.
|
||||
<p>
|
||||
</p>
|
||||
This option can have the following settings:
|
||||
</p>
|
||||
<div class="indent">
|
||||
<p>
|
||||
<b>None</b><br />
|
||||
no feedback window will be displayed
|
||||
</p>
|
||||
<p>
|
||||
<b>Web page</b><br />
|
||||
a web page will be displayed in the feedback window.
|
||||
You will need to enter the URL of the web page, for example:
|
||||
<tt>http://myserver.com/feedbackform.html</tt>
|
||||
</p>
|
||||
<p>
|
||||
<b>Feedback form</b><br />
|
||||
a form suitable for sending to a standard form-to-email script,
|
||||
such as formmail.pl, will be displayed in the feedback window.
|
||||
You should also enter the URL of the form script, for example:
|
||||
<tt>http://myserver.com/cgi-bin/formmail.pl</tt>
|
||||
</p>
|
||||
<p>
|
||||
<b>Moodle forum</b><br />
|
||||
the forum index for this Moodle course will be displayed
|
||||
</p>
|
||||
<p>
|
||||
<b>Moodle messaging</b><br />
|
||||
the Moodle instant messaging window will be displayed.
|
||||
If the course has several teachers, the student will be
|
||||
prompted to select a teacher before the messaging page appears.
|
||||
</p>
|
||||
</div>
|
||||
@@ -0,0 +1,13 @@
|
||||
<h1>Update next quiz</h1>
|
||||
|
||||
<div class="indent">
|
||||
<p>
|
||||
<b>No</b><br />
|
||||
Only the current quiz will be updated
|
||||
</p>
|
||||
<p>
|
||||
<b>Yes</b><br />
|
||||
If this quiz is part of a chain of Hot Potatoes quizzes, then all quizzes
|
||||
in the chain will be assigned identical settings to the current quiz.
|
||||
</p>
|
||||
</div>
|
||||
@@ -0,0 +1,160 @@
|
||||
<?PHP // $Id$
|
||||
// hotpot.php - created with Moodle 1.7 beta + (2006101003)
|
||||
|
||||
|
||||
$string['abandoned'] = 'Abandoned';
|
||||
$string['addquizchain'] = 'Add quiz chain';
|
||||
$string['allusers'] = 'All users';
|
||||
$string['alwaysopen'] = 'Always open';
|
||||
$string['attemptsall'] = 'All attempts';
|
||||
$string['attemptsbest'] = 'Best attempt';
|
||||
$string['attemptsfirst'] = 'First attempt';
|
||||
$string['attemptslast'] = 'Last attempt';
|
||||
$string['average'] = 'Average';
|
||||
$string['checks'] = 'Checks';
|
||||
$string['clickreporting'] = 'Enable click reporting';
|
||||
$string['clues'] = 'Clues';
|
||||
$string['completed'] = 'Completed';
|
||||
$string['configexcelencodings'] = 'A list of encodings, separated by commas, that can be used to force report values into a specific encoding for spreadsheet programs. For example, Microsoft Excel requires the "SJIS" encoding for Japanese';
|
||||
$string['configshowtimes'] = 'Should the time taken to process records be displayed in listings and reports? This is only really necessary if you are trying to find out why your server is running slowly.';
|
||||
$string['copiedtoclipboard'] = 'The contents of this page have been copied to the clipboard';
|
||||
$string['copytoclipboard'] = 'Copy to Clipboard';
|
||||
$string['correct'] = 'Correct';
|
||||
$string['deleteabandoned'] = 'Delete abandoned';
|
||||
$string['deleteabandonedcheck'] = 'Do you really want to delete all $a abandoned attempts?';
|
||||
$string['deleteallattempts'] = 'Delete all attempts';
|
||||
$string['displaycoursenext'] = 'Display Course page next';
|
||||
$string['displayhotpotnext'] = 'Display Hot Potatoes quiz next';
|
||||
$string['displayindexnext'] = 'Display HotPot index next';
|
||||
$string['enterafilename'] = 'Please enter a file name';
|
||||
$string['error_couldnotopenfolder'] = 'Could not access the folder "$a"';
|
||||
$string['error_couldnotopensourcefile'] = 'Could not open the source file \"$a\"';
|
||||
$string['error_couldnotopentemplate'] = 'Could not open template for "$a" format';
|
||||
$string['error_invalidquiztype'] = 'Quiz type is missing or invalid';
|
||||
$string['error_nocourseorfilename'] = 'Could not create XML tree: missing course or file name';
|
||||
$string['error_nofeedbackurlformmail'] = 'Please enter a URL for the form processing script';
|
||||
$string['error_nofeedbackurlwebpage'] = 'Please enter a URL for the webpage';
|
||||
$string['error_nofilename'] = 'Please enter a file name';
|
||||
$string['error_noquizzesfound'] = 'No Hot Potatoes quizzes found';
|
||||
$string['error_notfileorfolder'] = '"$a" is not file or folder';
|
||||
$string['excelencodings'] = 'Excel encodings';
|
||||
$string['feedbackformmail'] = 'Feedback form';
|
||||
$string['feedbackmoodleforum'] = 'Moodle forum';
|
||||
$string['feedbackmoodlemessaging'] = 'Moodle messaging';
|
||||
$string['feedbacknone'] = 'None';
|
||||
$string['feedbackwebpage'] = 'Web page';
|
||||
$string['filetype'] = 'File type';
|
||||
$string['forceplugins'] = 'Force media plugins';
|
||||
$string['giveup'] = 'Give Up';
|
||||
$string['hints'] = 'Hints';
|
||||
$string['hotpot:attempt'] = 'Attempt a quiz';
|
||||
$string['hotpot:deleteattempt'] = 'Delete quiz attempts';
|
||||
$string['hotpot:grade'] = 'Modify grades';
|
||||
$string['hotpot:view'] = 'Use quiz';
|
||||
$string['hotpot:viewreport'] = 'View reports';
|
||||
$string['hotpotcloses'] = 'Hot Potatoes quiz closes';
|
||||
$string['hotpotopens'] = 'Hot Potatoes quiz opens';
|
||||
$string['ignored'] = 'Ignored';
|
||||
$string['inprogress'] = 'In progress';
|
||||
$string['location'] = 'File location';
|
||||
$string['modulename'] = 'Hot Potatoes Quiz';
|
||||
$string['modulenameplural'] = 'Hot Potatoes Quizzes';
|
||||
$string['navigation'] = 'Navigation';
|
||||
$string['navigation_bar'] = 'Moodle navigation bar';
|
||||
$string['navigation_buttons'] = 'Hot Potatoes quiz buttons';
|
||||
$string['navigation_frame'] = 'Moodle navigation frame';
|
||||
$string['navigation_give_up'] = 'A single "Give Up" button';
|
||||
$string['navigation_iframe'] = 'Embedded IFRAME';
|
||||
$string['navigation_none'] = 'None';
|
||||
$string['neverclosed'] = 'Never closed';
|
||||
$string['noactivity'] = 'No activity';
|
||||
$string['noresponses'] = 'No information about individual questions and responses was found.';
|
||||
$string['outputformat'] = 'Output format';
|
||||
$string['outputformat_best'] = 'best';
|
||||
$string['outputformat_flash'] = 'Flash';
|
||||
$string['outputformat_mobile'] = 'mobile';
|
||||
$string['outputformat_v3'] = 'v3';
|
||||
$string['outputformat_v4'] = 'v4';
|
||||
$string['outputformat_v5'] = 'v5';
|
||||
$string['outputformat_v5_plus'] = 'v5+';
|
||||
$string['outputformat_v6'] = 'v6';
|
||||
$string['outputformat_v6_plus'] = 'v6+';
|
||||
$string['penalties'] = 'Penalties';
|
||||
$string['questionshort'] = 'Q-$a';
|
||||
$string['quiztype'] = 'Quiz type';
|
||||
$string['rawdetails'] = 'Raw attempt details';
|
||||
$string['regrade'] = 'Regrade';
|
||||
$string['regradecheck'] = 'Do you really want to regrade "$a"?';
|
||||
$string['regraderequired'] = 'Regrade required';
|
||||
$string['removegradeitem'] = 'Remove grade item';
|
||||
$string['reportanswers'] = 'Answers';
|
||||
$string['reportattemptfinish'] = 'Att. finish';
|
||||
$string['reportattemptnumber'] = 'Attempt';
|
||||
$string['reportattemptstart'] = 'Att. start';
|
||||
$string['reportbutton'] = 'Generate report';
|
||||
$string['reportchanges'] = 'Changes';
|
||||
$string['reportchecks'] = 'Checks';
|
||||
$string['reportclick'] = 'Click trail report';
|
||||
$string['reportclicknumber'] = 'Click';
|
||||
$string['reportclicktime'] = 'Click time';
|
||||
$string['reportclicktype'] = 'Click type';
|
||||
$string['reportclues'] = 'Clues';
|
||||
$string['reportcontent'] = 'Content';
|
||||
$string['reportcorrectsymbol'] = 'O';
|
||||
$string['reportcoursename'] = 'Course name';
|
||||
$string['reportencoding'] = 'Encoding';
|
||||
$string['reportevents'] = 'Events';
|
||||
$string['reportexercisename'] = 'Ex. name';
|
||||
$string['reportexercisenumber'] = 'Exercise';
|
||||
$string['reportexercisetype'] = 'Ex. type';
|
||||
$string['reportformat'] = 'Format';
|
||||
$string['allmycourses'] = 'All my courses'; //necessary for 1.6 and older
|
||||
$string['allusers'] = 'All users';
|
||||
$string['reportformatexcel'] = 'Excel';
|
||||
$string['reportformathtml'] = 'HTML';
|
||||
$string['reportformattext'] = 'Text';
|
||||
$string['reporthints'] = 'Hints';
|
||||
$string['reporthotpotscore'] = 'Hotpot score';
|
||||
$string['reportlegend'] = 'Legend';
|
||||
$string['reportlogindate'] = 'Login date';
|
||||
$string['reportlogintime'] = 'Login time';
|
||||
$string['reportlogofftime'] = 'Logoff time';
|
||||
$string['reportmaxscore'] = 'Max score';
|
||||
$string['reportnottried'] = 'Not tried';
|
||||
$string['reportnottriedsymbol'] = '-';
|
||||
$string['reportnumberofquestions'] = 'No. of q\'s';
|
||||
$string['reportpercentscore'] = '%% Score';
|
||||
$string['reportquestionstried'] = 'Q\'s tried';
|
||||
$string['reportrawscore'] = 'Raw score';
|
||||
$string['reportright'] = 'Right';
|
||||
$string['reportsectionnumber'] = 'Section';
|
||||
$string['reportshowanswer'] = 'Show answers';
|
||||
$string['reportshowlegend'] = 'Show legend';
|
||||
$string['reportsofar'] = '$a so far';
|
||||
$string['reportstatus'] = 'Status';
|
||||
$string['reportstudentid'] = 'Student id';
|
||||
$string['reportthisclick'] = '$a this click';
|
||||
$string['reporttimerecorded'] = 'Responses recorded';
|
||||
$string['reportwrapdata'] = 'Wrap data';
|
||||
$string['reportwrong'] = 'Wrong';
|
||||
$string['reportwrongsymbol'] = 'X';
|
||||
$string['resultssaved'] = 'Quiz results were saved';
|
||||
$string['score'] = 'Score';
|
||||
$string['showhtmlsource'] = 'Show HTML source';
|
||||
$string['shownextquiz'] = 'Show next quiz';
|
||||
$string['showtimes'] = 'Show processing times';
|
||||
$string['showxmlsource'] = 'Show XML source';
|
||||
$string['showxmltree'] = 'Show XML tree';
|
||||
$string['specifictime'] = 'Specific time';
|
||||
$string['studentfeedback'] = 'Student feedback';
|
||||
$string['textsourcefilename'] = 'Use file name';
|
||||
$string['textsourcefilepath'] = 'Use file path';
|
||||
$string['textsourcequiz'] = 'Get from quiz';
|
||||
$string['textsourcespecific'] = 'Specific text';
|
||||
$string['thiscourse'] = 'This course'; //necessary for 1.6 and older
|
||||
$string['timedout'] = 'Timed out';
|
||||
$string['updatequizchain'] = 'Update quiz chain';
|
||||
$string['weighting'] = 'Weighting';
|
||||
$string['wrong'] = 'Wrong';
|
||||
|
||||
?>
|
||||
+9
-5
@@ -1097,7 +1097,7 @@ function hotpot_get_recent_mod_activity(&$activities, &$index, $sincetime, $cour
|
||||
}
|
||||
}
|
||||
|
||||
function hotpot_print_recent_mod_activity($activity, $course, $detail=false) {
|
||||
function hotpot_print_recent_mod_activity($activity, $courseid, $detail=false) {
|
||||
/// Basically, this function prints the results of "hotpot_get_recent_activity"
|
||||
|
||||
global $CFG, $THEME, $USER;
|
||||
@@ -1108,10 +1108,14 @@ function hotpot_print_recent_mod_activity($activity, $course, $detail=false) {
|
||||
$bgcolor = '';
|
||||
}
|
||||
|
||||
if (is_object($courseid) && isset($courseid->id)) {
|
||||
$courseid = $courseid->id; // shouldn't happen !!
|
||||
}
|
||||
|
||||
print '<table border="0" cellpadding="3" cellspacing="0">';
|
||||
|
||||
print '<tr><td'.$bgcolor.' class="forumpostpicture" width="35" valign="top">';
|
||||
print_user_picture($activity->user->userid, $course, $activity->user->picture);
|
||||
print_user_picture($activity->user->userid, $courseid, $activity->user->picture);
|
||||
print '</td><td width="100%"><font size="2">';
|
||||
|
||||
if ($detail) {
|
||||
@@ -1123,7 +1127,7 @@ function hotpot_print_recent_mod_activity($activity, $course, $detail=false) {
|
||||
$href = "$CFG->wwwroot/mod/hotpot/view.php?hp=$activity->instance";
|
||||
print '<a href="'.$href.'">'.$activity->name.'</a> - ';
|
||||
}
|
||||
if (has_capability('mod/hotpot:viewreport',get_context_instance(CONTEXT_COURSE, $course))) {
|
||||
if (has_capability('mod/hotpot:viewreport',get_context_instance(CONTEXT_COURSE, $courseid))) {
|
||||
// score (with link to attempt details)
|
||||
$href = "$CFG->wwwroot/mod/hotpot/review.php?hp=$activity->instance&attempt=".$activity->content->attemptid;
|
||||
print '<a href="'.$href.'">('.hotpot_format_score($activity->content).')</a> ';
|
||||
@@ -1133,7 +1137,7 @@ function hotpot_print_recent_mod_activity($activity, $course, $detail=false) {
|
||||
}
|
||||
|
||||
// link to user
|
||||
$href = "$CFG->wwwroot/user/view.php?id=$activity->user->userid&course=$course";
|
||||
$href = "$CFG->wwwroot/user/view.php?id=$activity->user->userid&course=$courseid";
|
||||
print '<a href="'.$href.'">'.$activity->user->fullname.'</a> ';
|
||||
|
||||
// time and date
|
||||
@@ -1805,7 +1809,7 @@ class hotpot_xml_quiz extends hotpot_xml_tree {
|
||||
$quoteopen = '("|"|&quot;)'; // open quote
|
||||
$quoteclose = '\\5'; // close quote (to match open quote)
|
||||
|
||||
$tags = array('script'=>'src', 'link'=>'href', 'a'=>'href','img'=>'src','param'=>'value', 'object'=>'data', 'embed'=>'src');
|
||||
$tags = array('script'=>'src', 'link'=>'href', 'a'=>'href','img'=>'src','param'=>'value', 'object'=>'data', 'embed'=>'src', '(?:table|th|td)' =>'background');
|
||||
foreach ($tags as $tag=>$attribute) {
|
||||
if ($tag=='param') {
|
||||
$url = '\S+?\.\S+?'; // must include a filename and have no spaces
|
||||
|
||||
+55
-53
@@ -1,39 +1,39 @@
|
||||
<?PHP //$Id$
|
||||
<?php
|
||||
//This php script contains all the stuff to restore hotpot mods
|
||||
//-----------------------------------------------------------
|
||||
// This is the "graphical" structure of the hotpot mod:
|
||||
//-----------------------------------------------------------
|
||||
//
|
||||
// hotpot
|
||||
// (CL, pk->id,
|
||||
// fk->course, files)
|
||||
// |
|
||||
// +--------------+---------------+
|
||||
// | |
|
||||
// hotpot_attempts hotpot_questions
|
||||
// (UL, pk->id, (UL, pk->id,
|
||||
// fk->hotpot) fk->hotpot, text)
|
||||
// | | |
|
||||
// +-------------------+----------+ |
|
||||
// | | |
|
||||
// hotpot_details hotpot_responses |
|
||||
// (UL, pk->id, (UL, pk->id, |
|
||||
// fk->attempt) fk->attempt, question, |
|
||||
// correct, wrong, ignored) |
|
||||
// | |
|
||||
// +-------+-------+
|
||||
// |
|
||||
// hotpot_strings
|
||||
// (UL, pk->id)
|
||||
//
|
||||
// Meaning: pk->primary key field of the table
|
||||
// fk->foreign key to link with parent
|
||||
// nt->nested field (recursive data)
|
||||
// CL->course level info
|
||||
// UL->user level info
|
||||
// files->table may have files
|
||||
//
|
||||
//-----------------------------------------------------------
|
||||
//-----------------------------------------------------------
|
||||
// This is the "graphical" structure of the hotpot mod:
|
||||
//-----------------------------------------------------------
|
||||
//
|
||||
// hotpot
|
||||
// (CL, pk->id,
|
||||
// fk->course, files)
|
||||
// |
|
||||
// +--------------+---------------+
|
||||
// | |
|
||||
// hotpot_attempts hotpot_questions
|
||||
// (UL, pk->id, (UL, pk->id,
|
||||
// fk->hotpot) fk->hotpot, text)
|
||||
// | | |
|
||||
// +-------------------+----------+ |
|
||||
// | | |
|
||||
// hotpot_details hotpot_responses |
|
||||
// (UL, pk->id, (UL, pk->id, |
|
||||
// fk->attempt) fk->attempt, question, |
|
||||
// correct, wrong, ignored) |git
|
||||
// | |
|
||||
// +-------+-------+
|
||||
// |
|
||||
// hotpot_strings
|
||||
// (UL, pk->id)
|
||||
//
|
||||
// Meaning: pk->primary key field of the table
|
||||
// fk->foreign key to link with parent
|
||||
// nt->nested field (recursive data)
|
||||
// CL->course level info
|
||||
// UL->user level info
|
||||
// files->table may have files
|
||||
//
|
||||
//-----------------------------------------------------------
|
||||
|
||||
require_once ("$CFG->dirroot/mod/hotpot/lib.php");
|
||||
|
||||
@@ -359,17 +359,19 @@ function hotpot_restore_record(&$restore, $status, &$xml, $table, $foreign_keys,
|
||||
}
|
||||
|
||||
// check all "not null" fields have been set
|
||||
foreach ($table_columns[$table] as $column) {
|
||||
if ($column->not_null) {
|
||||
$name = $column->name;
|
||||
if ($name=='id' || (isset($record->$name) && ! is_null($record->$name))) {
|
||||
// do nothing
|
||||
} else if (isset($column->default_value)) {
|
||||
$record->$name = $column->default_value;
|
||||
} else if (preg_match('/int|decimal|double|float|time|year/i', $column->type)) {
|
||||
$record->$name = 0;
|
||||
} else {
|
||||
$record->$name = '';
|
||||
if (isset($table_columns[$table]) && is_array($table_columns[$table])) {
|
||||
foreach ($table_columns[$table] as $column) {
|
||||
if ($column->not_null) {
|
||||
$name = $column->name;
|
||||
if ($name=='id' || (isset($record->$name) && ! is_null($record->$name))) {
|
||||
// do nothing
|
||||
} else if (isset($column->default_value)) {
|
||||
$record->$name = $column->default_value;
|
||||
} else if (preg_match('/int|decimal|double|float|time|year/i', $column->type)) {
|
||||
$record->$name = 0;
|
||||
} else {
|
||||
$record->$name = '';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -433,11 +435,11 @@ function hotpot_restore_logs($restore, $log) {
|
||||
$status = true;
|
||||
}
|
||||
}
|
||||
break;
|
||||
break;
|
||||
case "view all":
|
||||
$log->url = "index.php?id=".$log->course;
|
||||
$status = true;
|
||||
break;
|
||||
break;
|
||||
case "report":
|
||||
if ($log->cmid) {
|
||||
//Get the new_id of the module (to recode the info field)
|
||||
@@ -448,7 +450,7 @@ function hotpot_restore_logs($restore, $log) {
|
||||
$status = true;
|
||||
}
|
||||
}
|
||||
break;
|
||||
break;
|
||||
case "attempt":
|
||||
case "submit":
|
||||
case "review":
|
||||
@@ -467,13 +469,13 @@ function hotpot_restore_logs($restore, $log) {
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
break;
|
||||
default:
|
||||
// Oops, unknown $log->action
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
print "<p>action (".$log->module."-".$log->action.") unknown. Not restored</p>";
|
||||
}
|
||||
break;
|
||||
break;
|
||||
} // end switch
|
||||
return $status ? $log : false;
|
||||
}
|
||||
@@ -486,7 +488,7 @@ function hotpot_decode_content_links($content, $restore) {
|
||||
$start = $matches[0][$i][1];
|
||||
$length = strlen($matches[0][$i][0]);
|
||||
$replace = hotpot_decode_content_link(
|
||||
// $scriptname, $paramname, $paramvalue, $restore
|
||||
// $scriptname, $paramname, $paramvalue, $restore
|
||||
$matches[2][$i][0], $matches[3][$i][0], $matches[4][$i][0], $restore
|
||||
);
|
||||
$content = substr_replace($content, $replace, $start, $length);
|
||||
@@ -530,4 +532,4 @@ function hotpot_decode_content_link($scriptname, $paramname, $paramvalue, &$rest
|
||||
|
||||
return "$CFG->wwwroot/mod/hotpot/$scriptname.php?$paramname=$new_id";
|
||||
}
|
||||
?>
|
||||
?>
|
||||
+15
-9
@@ -141,7 +141,7 @@
|
||||
// HP5 v5
|
||||
$get_html = empty($framename) ? true : false;
|
||||
}
|
||||
|
||||
|
||||
if ($get_html) {
|
||||
|
||||
if (HOTPOT_FIRST_ATTEMPT) {
|
||||
@@ -356,14 +356,20 @@
|
||||
$body .= ""
|
||||
. '<script type="text/javascript">'."\n"
|
||||
. "//<![CDATA[\n"
|
||||
. " var s = (typeof(window.onload)=='function') ? onload.toString() : '';\n"
|
||||
. " if (s.indexOf('".$matches[3]."')<0) {\n"
|
||||
. " if (s=='') {\n" // no previous onload
|
||||
. " window.onload = new Function('".$matches[3]."');\n"
|
||||
. " } else {\n"
|
||||
. " window.onload_hotpot = onload;\n"
|
||||
. " window.onload = new Function('window.onload_hotpot();'+'".$matches[3]."');\n"
|
||||
. " }\n"
|
||||
. " var re = new RegExp('\\\\s+', 'g');\n"
|
||||
. " if (typeof(window.onload)=='function') {\n"
|
||||
. " var s = onload.toString();\n"
|
||||
. " s = s.replace(re, '');\n"
|
||||
. " } else {\n"
|
||||
. " var s = '';\n"
|
||||
. " }\n"
|
||||
. " if (s.indexOf('".$matches[3]."'.replace(re, ''))<0) {\n"
|
||||
. " if (s=='') {\n" // no previous onload
|
||||
. " window.onload = new Function('".$matches[3]."');\n"
|
||||
. " } else {\n"
|
||||
. " window.onload_hotpot = onload;\n"
|
||||
. " window.onload = new Function('window.onload_hotpot();'+'".$matches[3]."');\n"
|
||||
. " }\n"
|
||||
. " }\n"
|
||||
. "//]]>\n"
|
||||
. "</script>\n"
|
||||
|
||||
@@ -42,7 +42,7 @@ class qformat_hotpot extends qformat_default {
|
||||
break;
|
||||
default:
|
||||
// shouldn't happen !!
|
||||
$courseid = 0;
|
||||
$courseid = 0;
|
||||
}
|
||||
require_once($CFG->libdir.'/filelib.php');
|
||||
$baseurl = get_file_url($courseid).'/';
|
||||
@@ -81,7 +81,12 @@ class qformat_hotpot extends qformat_default {
|
||||
$questions = array();
|
||||
switch ($xml->quiztype) {
|
||||
case 'jcloze':
|
||||
$this->process_jcloze($xml, $questions);
|
||||
if (strpos($source, '<gap-fill><question-record>')) {
|
||||
$startwithgap = true;
|
||||
} else {
|
||||
$startwithgap = false;
|
||||
}
|
||||
$this->process_jcloze($xml, $questions, $startwithgap);
|
||||
break;
|
||||
case 'jcross':
|
||||
$this->process_jcross($xml, $questions);
|
||||
@@ -114,7 +119,7 @@ class qformat_hotpot extends qformat_default {
|
||||
}
|
||||
}
|
||||
|
||||
function process_jcloze(&$xml, &$questions) {
|
||||
function process_jcloze(&$xml, &$questions, $startwithgap) {
|
||||
// define default grade (per cloze gap)
|
||||
$defaultgrade = 1;
|
||||
$gap_count = 0;
|
||||
@@ -144,10 +149,27 @@ class qformat_hotpot extends qformat_default {
|
||||
$question->usecase = 0; // Ignore case
|
||||
$question->image = ""; // No images with this format
|
||||
}
|
||||
$question->qtype = MULTIANSWER;
|
||||
|
||||
$question->qtype = MULTIANSWER;
|
||||
$question->name = $this->hotpot_get_title($xml, $x);
|
||||
$question->questiontext = $this->hotpot_get_reading($xml);
|
||||
$question->questiontext = '';
|
||||
|
||||
// add get dropdown list, if any
|
||||
if (intval($xml->xml_value('hotpot-config-file,'.$xml->quiztype.',use-drop-down-list'))) {
|
||||
$dropdownlist = $this->hotpot_jcloze_wordlist($xml);
|
||||
$answertype = MULTICHOICE;
|
||||
} else {
|
||||
$dropdownlist = false;
|
||||
$answertype = SHORTANSWER;
|
||||
|
||||
// add wordlist, if required (not required if we are using dropdowns)
|
||||
if (intval($xml->xml_value('hotpot-config-file,'.$xml->quiztype.',include-word-list'))) {
|
||||
$question->questiontext .= '<p>'.implode(' ', $this->hotpot_jcloze_wordlist($xml)).'</p>';
|
||||
}
|
||||
}
|
||||
|
||||
// add reading, if any
|
||||
$question->questiontext .= $this->hotpot_get_reading($xml);
|
||||
|
||||
// setup answer arrays
|
||||
if ($moodle_14) {
|
||||
@@ -160,71 +182,130 @@ class qformat_hotpot extends qformat_default {
|
||||
}
|
||||
|
||||
$q = 0;
|
||||
while ($text = $xml->xml_value($tags, $exercise."[$q]")) {
|
||||
// add next bit of text
|
||||
$question->questiontext .= $this->hotpot_prepare_str($text);
|
||||
$looping = true;
|
||||
while ($looping) {
|
||||
// get next bit of text
|
||||
$questiontext = $xml->xml_value($tags, $exercise."[$q]");
|
||||
$questiontext = $this->hotpot_prepare_str($questiontext);
|
||||
|
||||
// check for a gap
|
||||
// get next gap
|
||||
$gap = '';
|
||||
$question_record = $exercise."['question-record'][$q]['#']";
|
||||
if ($xml->xml_value($tags, $question_record)) {
|
||||
|
||||
// add gap
|
||||
$gap_count ++;
|
||||
$positionkey = $q+1;
|
||||
$question->questiontext .= '{#'.$positionkey.'}';
|
||||
|
||||
$gap = '{#'.$positionkey.'}';
|
||||
|
||||
// initialize answer settings
|
||||
if ($moodle_14) {
|
||||
$question->answers[$q]->positionkey = $positionkey;
|
||||
$question->answers[$q]->answertype = SHORTANSWER;
|
||||
$question->answers[$q]->answertype = $answertype;
|
||||
$question->answers[$q]->norm = $defaultgrade;
|
||||
$question->answers[$q]->alternatives = array();
|
||||
} else {
|
||||
$wrapped = new stdClass();
|
||||
$wrapped->qtype = SHORTANSWER;
|
||||
$wrapped->qtype = $answertype;
|
||||
$wrapped->usecase = 0;
|
||||
$wrapped->defaultgrade = $defaultgrade;
|
||||
$wrapped->questiontextformat = 0;
|
||||
$wrapped->answer = array();
|
||||
$wrapped->fraction = array();
|
||||
$wrapped->feedback = array();
|
||||
// required for multichoice
|
||||
$wrapped->single = 1;
|
||||
$wrapped->answernumbering = 0;
|
||||
$wrapped->shuffleanswers = 0;
|
||||
$wrapped->correctfeedback = '';
|
||||
$wrapped->partiallycorrectfeedback = '';
|
||||
$wrapped->incorrectfeedback = '';
|
||||
// array of answers
|
||||
$answers = array();
|
||||
}
|
||||
|
||||
|
||||
// add answers
|
||||
$a = 0;
|
||||
while (($answer=$question_record."['answer'][$a]['#']") && $xml->xml_value($tags, $answer)) {
|
||||
$text = $this->hotpot_prepare_str($xml->xml_value($tags, $answer."['text'][0]['#']"));
|
||||
$correct = $xml->xml_value($tags, $answer."['correct'][0]['#']");
|
||||
$feedback = $this->hotpot_prepare_str($xml->xml_value($tags, $answer."['feedback'][0]['#']"));
|
||||
if (strlen($text)) {
|
||||
// set score (0=0%, 1=100%)
|
||||
$fraction = empty($correct) ? 0 : 1;
|
||||
// store answer
|
||||
if ($dropdownlist) {
|
||||
|
||||
$a = 0;
|
||||
$correcttext = '';
|
||||
$correctfeedback = '';
|
||||
while (($answer=$question_record."['answer'][$a]['#']") && $xml->xml_value($tags, $answer)) {
|
||||
if (intval($xml->xml_value($tags, $answer."['correct'][0]['#']"))) {
|
||||
$correcttext = $this->hotpot_prepare_str($xml->xml_value($tags, $answer."['text'][0]['#']"));
|
||||
$correctfeedback = $this->hotpot_prepare_str($xml->xml_value($tags, $answer."['feedback'][0]['#']"));
|
||||
break;
|
||||
}
|
||||
$a++;
|
||||
}
|
||||
|
||||
foreach ($dropdownlist as $a => $answer) {
|
||||
if ($answer==$correcttext) {
|
||||
$fraction = 1;
|
||||
$feedback = $correctfeedback;
|
||||
} else {
|
||||
$fraction = 0;
|
||||
$feedback = '';
|
||||
}
|
||||
if ($moodle_14) {
|
||||
$question->answers[$q]->alternatives[$a] = new stdClass();
|
||||
$question->answers[$q]->alternatives[$a]->answer = $text;
|
||||
$question->answers[$q]->alternatives[$a]->answer = $answer;
|
||||
$question->answers[$q]->alternatives[$a]->fraction = $fraction;
|
||||
$question->answers[$q]->alternatives[$a]->feedback = $feedback;
|
||||
} else {
|
||||
$wrapped->answer[] = $text;
|
||||
$wrapped->answer[] = $answer;
|
||||
$wrapped->fraction[] = $fraction;
|
||||
$wrapped->feedback[] = $feedback;
|
||||
$answers[] = (empty($fraction) ? '' : '=').$text.(empty($feedback) ? '' : ('#'.$feedback));
|
||||
$answers[] = ($fraction==0 ? '' : '=').$answer.($feedback=='' ? '' : ('#'.$feedback));
|
||||
}
|
||||
}
|
||||
$a++;
|
||||
} else {
|
||||
$a = 0;
|
||||
while (($answer=$question_record."['answer'][$a]['#']") && $xml->xml_value($tags, $answer)) {
|
||||
$text = $this->hotpot_prepare_str($xml->xml_value($tags, $answer."['text'][0]['#']"));
|
||||
$correct = $xml->xml_value($tags, $answer."['correct'][0]['#']");
|
||||
$feedback = $this->hotpot_prepare_str($xml->xml_value($tags, $answer."['feedback'][0]['#']"));
|
||||
if (strlen($text)) {
|
||||
// set score (0=0%, 1=100%)
|
||||
$fraction = empty($correct) ? 0 : 1;
|
||||
// store answer
|
||||
if ($moodle_14) {
|
||||
$question->answers[$q]->alternatives[$a] = new stdClass();
|
||||
$question->answers[$q]->alternatives[$a]->answer = $text;
|
||||
$question->answers[$q]->alternatives[$a]->fraction = $fraction;
|
||||
$question->answers[$q]->alternatives[$a]->feedback = $feedback;
|
||||
} else {
|
||||
$wrapped->answer[] = $text;
|
||||
$wrapped->fraction[] = $fraction;
|
||||
$wrapped->feedback[] = $feedback;
|
||||
$answers[] = (empty($fraction) ? '' : '=').$text.(empty($feedback) ? '' : ('#'.$feedback));
|
||||
}
|
||||
}
|
||||
$a++;
|
||||
}
|
||||
}
|
||||
|
||||
// compile answers into question text, if necessary
|
||||
if ($moodle_14) {
|
||||
// do nothing
|
||||
} else {
|
||||
$wrapped->questiontext = '{'.$defaultgrade.':SHORTANSWER:'.implode('~', $answers).'}';
|
||||
$wrapped->questiontext = '{'.$defaultgrade.':'.$answertype.':'.implode('~', $answers).'}';
|
||||
$question->options->questions[] = $wrapped;
|
||||
}
|
||||
} // end if gap
|
||||
|
||||
if (strlen($questiontext) || strlen($gap)) {
|
||||
if ($startwithgap) {
|
||||
$question->questiontext .= $gap.$questiontext;
|
||||
} else {
|
||||
$question->questiontext .= $questiontext.$gap;
|
||||
}
|
||||
} else {
|
||||
$looping = false;
|
||||
}
|
||||
|
||||
$q++;
|
||||
} // end while $text
|
||||
} // end while $looping
|
||||
|
||||
if ($q) {
|
||||
// define total grade for this exercise
|
||||
@@ -241,6 +322,32 @@ class qformat_hotpot extends qformat_default {
|
||||
} // end while $exercise
|
||||
}
|
||||
|
||||
function hotpot_jcloze_wordlist(&$xml) {
|
||||
$wordlist = array();
|
||||
|
||||
$q = 0;
|
||||
$tags = 'data,gap-fill,question-record';
|
||||
while (($question="[$q]['#']") && $xml->xml_value($tags, $question)) {
|
||||
$a = 0;
|
||||
$aa = 0;
|
||||
while (($answer=$question."['answer'][$a]['#']") && $xml->xml_value($tags, $answer)) {
|
||||
$text = $xml->xml_value($tags, $answer."['text'][0]['#']");
|
||||
$correct = $xml->xml_value($tags, $answer."['correct'][0]['#']");
|
||||
if (strlen($text) && intval($correct)) {
|
||||
$wordlist[] = $text;
|
||||
$aa++;
|
||||
}
|
||||
$a++;
|
||||
}
|
||||
$q++;
|
||||
}
|
||||
|
||||
$wordlist = array_unique($wordlist);
|
||||
sort($wordlist);
|
||||
|
||||
return $wordlist;
|
||||
}
|
||||
|
||||
function process_jcross(&$xml, &$questions) {
|
||||
// xml tags to the start of the crossword exercise clue items
|
||||
$tags = 'data,crossword,clues,item';
|
||||
@@ -488,7 +595,7 @@ class qformat_hotpot extends qformat_default {
|
||||
$a++;
|
||||
}
|
||||
if ($correct_answers_all_zero) {
|
||||
// correct answers all have score of 0%,
|
||||
// correct answers all have score of 0%,
|
||||
// so reset score for correct answers 100%
|
||||
foreach ($correct_answers as $aa) {
|
||||
$question->fraction[$aa] = 1;
|
||||
@@ -531,10 +638,10 @@ class qformat_hotpot extends qformat_default {
|
||||
$tags = 'data,reading';
|
||||
if ($xml->xml_value("$tags,include-reading")) {
|
||||
if ($title = $xml->xml_value("$tags,reading-title")) {
|
||||
$str .= "<H3>$title</H3>";
|
||||
$str .= "<h3>$title</h3>";
|
||||
}
|
||||
if ($text = $xml->xml_value("$tags,reading-text")) {
|
||||
$str .= "<P>$text</P>";
|
||||
$str .= "<p>$text</p>";
|
||||
}
|
||||
}
|
||||
return $this->hotpot_prepare_str($str);
|
||||
@@ -572,7 +679,7 @@ function hotpot_charcode_to_utf8($charcode) {
|
||||
return chr(($charcode >> 0x12) + 0xF0).chr((($charcode >> 0x0C) & 0x3F) + 0x80).chr((($charcode >> 0x06) & 0x3F) + 0x80).chr(($charcode & 0x3F) + 0x80);
|
||||
}
|
||||
// unidentified char code !!
|
||||
return ' ';
|
||||
return ' ';
|
||||
}
|
||||
|
||||
function hotpot_convert_relative_urls($str, $baseurl, $filename) {
|
||||
|
||||
+2
-2
@@ -6,10 +6,10 @@
|
||||
// This is compared against the values stored in the database to determine
|
||||
// whether upgrades should be performed (see lib/db/*.php)
|
||||
|
||||
$version = 2007101591.16; // YYYYMMDD = date of the 1.9 branch (don't change)
|
||||
$version = 2007101592.05; // YYYYMMDD = date of the 1.9 branch (don't change)
|
||||
// X = release number 1.9.[0,1,2,3,4,5...]
|
||||
// Y.YY = micro-increments between releases
|
||||
|
||||
$release = '1.9.18 (Build: 20120514)'; // Human-friendly version name
|
||||
$release = '1.9.19+ (Build: 20130513)'; // Human-friendly version name
|
||||
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user