Browse files

CONTRIB-3469 - latest version of the HotPot module.

  • Loading branch information...
1 parent 36c45da commit bb2714e517b068086262742f10fc6e4daef79f3f @gbateson gbateson committed with nebgor May 17, 2012
View
17 mod/hotpot/lang/en_utf8/help/hotpot/addquizchain.html
@@ -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 &quot;File name&quot; 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 &quot;File name&quot; 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>
View
8 mod/hotpot/lang/en_utf8/help/hotpot/analysistable.html
@@ -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>
View
19 mod/hotpot/lang/en_utf8/help/hotpot/clickreporting.html
@@ -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
+ &quot;hint&quot;, &quot;clue&quot; or &quot;check&quot;
+ 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 &quot;click&quot; 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>
View
74 mod/hotpot/lang/en_utf8/help/hotpot/clickreporttable.html
@@ -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 &quot;correct&quot;</li>
+ <li><b>X</b> means &quot;wrong&quot;</li>
+ <li><b>-</b> means &quot;not attempted&quot;</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 &quot;right&quot;</li>
+ <li>the number of questions whose status is &quot;wrong&quot;</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>
View
17 mod/hotpot/lang/en_utf8/help/hotpot/forceplugins.html
@@ -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&amp;file=mediaplayers.html">Relative URLs, media players and Hot Potatoes</a>
+</p>
View
16 mod/hotpot/lang/en_utf8/help/hotpot/index.html
@@ -0,0 +1,16 @@
+<h2>Hot Potatoes</h2>
+<ul>
+ <li><a href="help.php?module=hotpot&amp;file=addquizchain.html">Add quiz chain</a></li>
+ <li><a href="help.php?module=hotpot&amp;file=analysistable.html">Analysis table</a></li>
+ <li><a href="help.php?module=hotpot&amp;file=clickreporting.html">Click trail report</a></li>
+ <li><a href="help.php?module=hotpot&amp;file=forceplugins.html">Force media plugins</a></li>
+ <li><a href="help.php?module=hotpot&amp;file=mediaplayers.html">Media players, relative URLs and Hot Potatoes</a></li>
+ <li><a href="help.php?module=hotpot&amp;file=navigation.html">Navigation</a></li>
+ <li><a href="help.php?module=hotpot&amp;file=outputformat.html">Output format</a></li>
+ <li><a href="help.php?module=hotpot&amp;file=reportcontent.html">Report content</a></li>
+ <li><a href="help.php?module=hotpot&amp;file=reportformat.html">Report format</a></li>
+ <li><a href="help.php?module=hotpot&amp;file=responsestable.html">Responses table</a></li>
+ <li><a href="help.php?module=hotpot&amp;file=shownextquiz.html">Show next quiz</a></li>
+ <li><a href="help.php?module=hotpot&amp;file=studentfeedback.html">Student feedback</a></li>
+ <li><a href="help.php?module=hotpot&amp;file=updatequizchain.html">Update quiz chain</a></li>
+</ul>
View
28 mod/hotpot/lang/en_utf8/help/hotpot/mediaplayers.html
@@ -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 &quot;http://&quot; 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 &quot;http://&quot; is called a relative URL.
+ It can be combined with the absolute URL of a &quot;base&quot; 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 &quot;Force media plugins&quot; option on the quiz's settings page to &quot;Yes&quot;.</p>
View
8 mod/hotpot/lang/en_utf8/help/hotpot/mods.html
@@ -0,0 +1,8 @@
+<p><img src="<?php echo $CFG->wwwroot?>/mod/hotpot/icon.gif" alt="" />&nbsp;<b>Hot Potatoes</b></p>
+<div class="indent">
+ This module, the &quot;HotPot&quot; 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>
View
40 mod/hotpot/lang/en_utf8/help/hotpot/navigation.html
@@ -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 &quot;Give Up&quot; button</b><br />
+ The quiz will be displayed with a single &quot;Give Up&quot; 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 &quot;Show next quiz?&quot; field
+ for the current quiz.
+ </p>
+</div>
View
39 mod/hotpot/lang/en_utf8/help/hotpot/outputformat.html
@@ -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>
View
13 mod/hotpot/lang/en_utf8/help/hotpot/removegradeitem.html
@@ -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>
View
109 mod/hotpot/lang/en_utf8/help/hotpot/reportcontent.html
@@ -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 &quot;in progress&quot; 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 &quot;in progress&quot; attempts.
+
+ The report contains the following tables:
+ </p>
+ <ul>
+ <li>the <a href="help.php?module=hotpot&amp;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&amp;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 &quot;in progress&quot; 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&amp;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&amp;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 &quot;guest&quot; 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 &quot;guest&quot; 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>
View
60 mod/hotpot/lang/en_utf8/help/hotpot/reportformat.html
@@ -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 &quot;.xls&quot; 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 &quot;SJIS&quot; encoding for Japanese.
+
+ The list of possible encodings can be adjusted by the site administrator on the
+ &quot;Settings&quot; 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>
View
22 mod/hotpot/lang/en_utf8/help/hotpot/responsestable.html
@@ -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>
View
17 mod/hotpot/lang/en_utf8/help/hotpot/shownextquiz.html
@@ -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>
View
38 mod/hotpot/lang/en_utf8/help/hotpot/studentfeedback.html
@@ -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 &quot;Check&quot; 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>
View
13 mod/hotpot/lang/en_utf8/help/hotpot/updatequizchain.html
@@ -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>
View
160 mod/hotpot/lang/en_utf8/hotpot.php
@@ -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 &quot;SJIS&quot; 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 &quot;$a&quot;';
+$string['error_couldnotopensourcefile'] = 'Could not open the source file \"$a\"';
+$string['error_couldnotopentemplate'] = 'Could not open template for &quot;$a&quot; 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'] = '&quot;$a&quot; 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 &quot;Give Up&quot; 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 &quot;$a&quot;?';
+$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';
+
+?>
View
14 mod/hotpot/lib.php
@@ -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 @@ function hotpot_convert_relative_urls(&$str) {
$quoteopen = '("|&quot;|&amp;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
View
5 mod/hotpot/restorelib.php
@@ -298,8 +298,9 @@ function hotpot_restore_record(&$restore, $status, &$xml, $table, $foreign_keys,
// maintain a cache of info on table columns
static $table_columns = array();
if (empty($table_columns[$table])) {
- global $CFG, $db;
- $table_columns[$table] = $db->MetaColumns("$CFG->prefix$table");
+ //global $CFG, $db;
+ //$table_columns[$table] = $db->MetaColumns("$CFG->prefix$table");
+ $table_columns[$table] = $DB->get_columns($table);
}
// get values for fields in this record
View
24 mod/hotpot/view.php
@@ -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"
View
175 question/format/hotpot/format.php
@@ -42,7 +42,7 @@ function readquestions ($lines) {
break;
default:
// shouldn't happen !!
- $courseid = 0;
+ $courseid = 0;
}
require_once($CFG->libdir.'/filelib.php');
$baseurl = get_file_url($courseid).'/';
@@ -81,7 +81,12 @@ function readquestions ($lines) {
$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 @@ function readquestions ($lines) {
}
}
- 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 @@ function process_jcloze(&$xml, &$questions) {
$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 @@ function process_jcloze(&$xml, &$questions) {
}
$q = 0;
- while ($text = $xml->xml_value($tags, $exercise."[$q]")) {
- // add next bit of text
- $question->questiontext .= $this->hotpot_prepare_str($text);
-
- // check for a gap
+ $looping = true;
+ while ($looping) {
+ // get next bit of text
+ $questiontext = $xml->xml_value($tags, $exercise."[$q]");
+ $questiontext = $this->hotpot_prepare_str($questiontext);
+
+ // 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 @@ function process_jcloze(&$xml, &$questions) {
} // 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 @@ function process_jquiz(&$xml, &$questions) {
$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 @@ function hotpot_get_reading(&$xml) {
$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) {

0 comments on commit bb2714e

Please sign in to comment.