mirrored from git://git.moodle.org/moodle.git
-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Hotpot module v2! Thomas Robb, Gordon Bateson - thanks!!
- Loading branch information
moodler
committed
Apr 25, 2005
1 parent
d4cb2d8
commit d4b950d
Showing
58 changed files
with
15,845 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
This is v2.0.6 (beta) of the HotPot module | ||
It has been tested on Moodle 1.1 thru 1.5, MySQL and PostGres7 databases and PHP 4.1 thru 5.0 | ||
|
||
This module may be distributed under the terms of the General Public License | ||
(see http://www.gnu.org/licenses/gpl.txt for details) | ||
|
||
This software is provided "AS IS" without a warranty of any kind. | ||
|
||
=============== | ||
IMPORTANT NOTES | ||
=============== | ||
* Please be sure to use Hot Potatoes according to the conditions of use which are listed at the end of this file. If you restrict use via a required Moodle login, you most likely can still meet the 'freely available' condition if you make the same material on a separate URL that permits free access. Otherwise, please purchase a license. | ||
|
||
* This is beta software, so please do not use it on live Moodle sites. | ||
|
||
* If you decide to install it on your test Moodle site, please back up your entire Moodle database, and your current "moodle/mod/hotpot" folder, before attempting the install. | ||
|
||
|
||
|
||
TO INSTALL OR UPDATE THIS MODULE | ||
|
||
1. Install the core scripts of the hotpot module | ||
|
||
EITHER: | ||
(a) download the zip file into the "moodle/mod" folder on your Moodle site | ||
(b) unzip the zip file. This will create a folder called "moodle/mod/hotpot" on your Moodle site | ||
|
||
OR: | ||
(a) download the zip file onto your PC | ||
(b) upzip the zip file on your PC. This will create a "hotpot" folder on your PC | ||
(c) create a folder called "hotpot" on your Moodle site in the "moodle/mod" folder | ||
(d) upload the contents of the "hotpot" folder on your PC to the "moodle/mod/hotpot" folder on the Moodle site | ||
|
||
|
||
2. Install the module's messages and help file of the hotpot module | ||
|
||
EITHER: | ||
(a) copy "moodle/mod/hotpot/lang/en/hotpot.php" on the Moodle site to "moodle/lang/en/hotpot.php" | ||
(b) copy "moodle/mod/hotpot/lang/en/help/hotpot" on the Moodle site to "moodle/lang/en/help/hotpot" | ||
(c) repeat for other languages you require from the "moodle/mod/hotpot/lang" folder | ||
|
||
OR: | ||
(a) upload the "hotpot/lang/en/hotpot.php" file on your PC to "moodle/lang/en/hotpot.php" on the Moodle site | ||
(b) create a folder called "hotpot" on your Moodle site in the "moodle/lang/en/help" folder | ||
(c) upload the contents of the "hotpot/lang/en/help/hotpot" folder on your PC to the "moodle/lang/en/help/hotpot" folder on the Moodle site | ||
(d) repeat for other languages you require from the "moodle/mod/hotpot/lang" folder | ||
|
||
|
||
|
||
3. Login to your Moodle site as an administrator. | ||
|
||
a) If you are installing this module for the first time, you should see a report saying that the following (prefix)_hotpot tables have been successfuly created: | ||
hotpot | ||
hotpot_attempts | ||
hotpot_questions | ||
hotpot_responses | ||
hotpot_strings | ||
|
||
b) If you are updating the module, you will probably see messages indicating the progress of the update | ||
|
||
c) If you get error messages, please copy and save them to a file on your PC, and then ask for help on Moodle HotPot supprot forum: | ||
go to http://moodle.org | ||
then click "Free Support", | ||
then click "HotPot" | ||
|
||
|
||
|
||
|
||
TO USE THIS MODULE: | ||
|
||
1. Create a Hot Potatoes quiz of any type using Version 6 of Hot Potatoes. | ||
|
||
2. Upload the quiz's source file (".jcl", ".jcw", ".jmt", ".jmx", ".jqz") or ".html" file to the file area of the intended course. | ||
|
||
3. Also upload any graphics, sound files, stylesheets or javascripts that the quiz uses | ||
|
||
4. On the main page for the course, confirm editing is turned on (click the "Turn editing on" button) then select "ADD / Hot Potatoes XML Quiz". | ||
|
||
6, The "Adding a new Hot Potatoes Quiz" page appears. Click the "Choose or Upload a file ..." button and select the desired quiz file. | ||
|
||
7. Review the other settings for the quiz and click "Save Changes" when you are ready | ||
|
||
8. You can view reports of the results via the "Hot Potatoes Quizzes" link on the "Activities menu". Students will see links to all the quizzes. Administrators and teachers will additionally see links to the statistical reports for each quiz. | ||
|
||
9. You can also import the questions from the Hot Potatoes source file to the Moodle Quiz database, if you installed "mod/quiz/format/hotpot/format.php" | ||
|
||
|
||
============================== | ||
HOT POTATOES CONDITIONS OF USE | ||
============================== | ||
|
||
**Reproduced from the Hot Potatoes site** | ||
|
||
Hot Potatoes is offered free to the educational community by the University of Victoria Humanities Computing and Media Centre (formerly the Language Centre), under certain conditions. Hot Potatoes is free for use by state educational institutions which are non-profit making, on the condition that the material produced using the program is freely available to anyone via the WWW. However, you need to purchase a licence under any of the following conditions: | ||
? You do not work for a public sector educational establishment. | ||
? You charge money for access to the material you make with Hot Potatoes. | ||
? You restrict access to the material in some way. (The only exception here is if you have an account on www.hotpot.net, where you ARE allowed to use password restrictions.) | ||
? You want to use the Masher program included with the Hot Potatoes suite. | ||
|
||
For more information on licences, and details on how to purchase one, check out our Website at: | ||
http://www.halfbakedsoftware.com/hotpot/ | ||
|
||
If you intend using the programs to generate more than a handful of exercises, please make sure you register. This costs you nothing -- see How to register for details. | ||
Martin Holmes, Half-Baked Software and the University of Victoria HCMC, 1998-2004. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
<?php | ||
require_once("../../config.php"); | ||
require_once("lib.php"); | ||
|
||
$next_url = ""; | ||
$msg = ''; | ||
|
||
$attemptid = required_param("attemptid"); | ||
if (is_numeric($attemptid)) { | ||
|
||
if (! $attempt = get_record("hotpot_attempts", "id", $attemptid)) { | ||
error("Hot Potatoes attempt record $attemptid could not be accessed: ".$db->ErrorMsg()); | ||
} | ||
|
||
// Check this is the right user | ||
if ($attempt->userid != $USER->id) { | ||
error("Incorrect user id"); | ||
} | ||
|
||
// get hotpot, course and course_module records | ||
if (! $hotpot = get_record("hotpot", "id", $attempt->hotpot)) { | ||
error("Hot Potatoes ID is incorrect (attempt id = $attempt->id)"); | ||
} | ||
if (! $course = get_record("course", "id", $hotpot->course)) { | ||
error("Course ID is incorrect (hotpot id = $hotpot->id)"); | ||
} | ||
if (! $cm = get_coursemodule_from_instance("hotpot", $hotpot->id, $course->id)) { | ||
error("Course Module ID is incorrect"); | ||
} | ||
|
||
$next_url = "$CFG->wwwroot/course/view.php?id=$course->id"; | ||
|
||
// make sure this user is enrolled in this course | ||
require_login($course->id); | ||
|
||
if ($attempt->timefinish && false) { | ||
|
||
$msg = 'This attempt has already been submitted'; | ||
|
||
} else { | ||
$time = time(); | ||
$msg = get_string('resultssaved', 'hotpot'); | ||
|
||
$attempt->score = isset($_POST['mark']) ? $_POST['mark'] : NULL; | ||
$attempt->details = isset($_POST['detail']) ? $_POST['detail'] : NULL; | ||
$attempt->endtime = isset($_POST['endtime']) ? strtotime($_POST['endtime']) : NULL; | ||
$attempt->starttime = isset($_POST['starttime']) ? strtotime($_POST['starttime']) : NULL; | ||
$attempt->timefinish = $time; | ||
|
||
// for the rare case where a quiz was "in progress" during an update from hotpot v1 to v2 | ||
if (empty($attempt->timestart) && !empty($attempt->starttime)) { | ||
$attempt->timestart = $attempt->starttime; | ||
} | ||
|
||
// remove slashes added by lib/setup.php | ||
$attempt->details = stripslashes($attempt->details); | ||
|
||
// add details of this attempt | ||
hotpot_add_attempt_details($attempt); | ||
|
||
// add slashes again, so the details can be added to the database | ||
$attempt->details = addslashes($attempt->details); | ||
|
||
if (! update_record("hotpot_attempts", $attempt)) { | ||
error("Could not update attempt record: ".$db->ErrorMsg(), $next_url); | ||
} | ||
|
||
// set previously unfinished attempts of this quiz by this user to "finished" | ||
hotpot_close_previous_attempts($hotpot->id, $USER->id, $time); | ||
|
||
add_to_log($course->id, "hotpot", "submit", "review.php?id=$cm->id&attempt=$attempt->id", "$hotpot->id", "$cm->id"); | ||
} | ||
if ($hotpot->shownextquiz==HOTPOT_YES && is_numeric($next_cm = hotpot_get_next_cm($cm))) { | ||
$next_url = "$CFG->wwwroot/mod/hotpot/view.php?id=$next_cm"; | ||
} | ||
} | ||
|
||
// redirect to the next quiz or the course page | ||
redirect($next_url, $msg); | ||
|
||
|
||
// ================= | ||
// functions | ||
// ================= | ||
|
||
function hotpot_get_next_cm(&$cm) { | ||
// gets the next module in this section of the course | ||
// that is the same type of module as the current module | ||
|
||
$next_mod = false; | ||
|
||
// get a list of $ids of modules in this section | ||
if ($ids = get_field('course_sections', 'sequence', 'id', $cm->section)) { | ||
|
||
$ids = explode(',', $ids); | ||
$found = false; | ||
foreach ($ids as $id) { | ||
if ($found && ($cm->module==get_field('course_modules', 'module', 'id', $id))) { | ||
$next_mod = $id; | ||
break; | ||
} else if ($cm->id==$id) { | ||
$found = true; | ||
} | ||
} | ||
} | ||
return $next_mod; | ||
} | ||
?> |
Oops, something went wrong.