dirroot{$ds}mod{$ds}hotpot{$ds}lib.php"); // set default values in form fields, if necessary set_form_fields($form); // commonly used array of options $yes_no_options = array( HOTPOT_NO => get_string("no"), HOTPOT_YES => get_string("yes") ); $text_source_options = array( HOTPOT_TEXTSOURCE_QUIZ => get_string("textsourcequiz", "hotpot"), HOTPOT_TEXTSOURCE_FILENAME => get_string("textsourcefilename", "hotpot"), HOTPOT_TEXTSOURCE_FILEPATH => get_string("textsourcefilepath", "hotpot"), HOTPOT_TEXTSOURCE_SPECIFIC => get_string("textsourcespecific", "hotpot") ); ?>

: | mode=='add') { choose_from_menu($text_source_options, "namesource", "$form->namesource", ""); } else { print ''; } print ''; print ''; print ''; ?>

:
'; helpbutton("writing", get_string("helpwriting"), "moodle", true, true); print '
'; if (isset($usehtmleditor) && $usehtmleditor) { helpbutton("richtext", get_string("helprichtext"), "moodle", true, true); print '
'; } else { helpbutton("text", get_string("helptext"), "moodle", true, true); print '
'; emoticonhelpbutton("form", "description"); print '
'; } ?>

mode=='add') { choose_from_menu($text_source_options, "summarysource", "$form->summarysource", ""); } else { print ''; } print ''; if (function_exists("print_textarea") && isset($usehtmleditor)) { print_textarea($usehtmleditor, 10, 65, 680, 400, "summary", $form->summary); } else { // Moodle 1.1.1 (original size was rows="5" cols="50") print ''.$form->summary.''; } print ''; ?>

:

get_string("alwaysopen", "hotpot"), HOTPOT_YES => get_string("specifictime", "hotpot") ); choose_from_menu($options, "enabletimeopen", "$form->enabletimeopen", ""); print ''; print ' '; if (!$form->timeopen && $course->format == "weeks") { $form->timeopen= $course->startdate + (($form->section - 1) * 608400); } print_date_selector("openday", "openmonth", "openyear", $form->timeopen); print ' - '; print_time_selector("openhour", "openminute", $form->timeopen); helpbutton("timeopen", get_string("quizopen","quiz"), "quiz"); print ''; ?>

:

get_string("neverclosed", "hotpot"), HOTPOT_YES => get_string("specifictime", "hotpot") ); choose_from_menu($options, "enabletimeclose", "$form->enabletimeclose", ""); print ''; print ' '; if (!$form->timeclose && $course->format == "weeks") { $form->timeclose= $course->startdate + (($form->section) * 608400); } print_date_selector("closeday", "closemonth", "closeyear", $form->timeclose); print ' - '; print_time_selector("closehour", "closeminute", $form->timeclose); helpbutton("timeopen", get_string("quizclose","quiz"), "quiz"); print ''; ?>

:

id==$site->id) { $id = $site->id; $location = HOTPOT_LOCATION_SITEFILES; } else { $id = "'+(getObjValue(this.form.location)==".HOTPOT_LOCATION_SITEFILES."?".$site->id.":".$course->id.")+'"; $location = ''; } } else { // ordinary teacher or content creator $id = $course->id; $location = HOTPOT_LOCATION_COURSEFILES; } if (array_key_exists($location, $HOTPOT_LOCATION)) { print ''; print ''.$HOTPOT_LOCATION[$location].' '; } else { // admin can select from "site" or "course" files choose_from_menu($HOTPOT_LOCATION, "location", "$form->location", ""); } if (function_exists("button_to_popup_window")) { // use javascript to extract wdir from the reference field $wdir = "'+getDir(getObjValue(this.form.reference))+'"; // set button url depending on Moodle version if ($CFG->version < 2004083125) { // version may need refining // up to and including Moodle 1.4.1 $url = "/mod/resource/coursefiles.php?id=$id&wdir=$wdir"; } else { // Moodle 1.4.2 and beyond $url = "/files/index.php?id=$id&wdir=$wdir&choose=form.reference"; } $strchooseafile = get_string("chooseafile", "resource"); button_to_popup_window ($url, 'coursefiles', $strchooseafile, 500, 750, $strchooseafile); } ?>

:

reference.'"> '; } else if (function_exists("get_directory_list")) { // Moodle 1.1 (and perhaps some others) $dirs = get_directory_list("$CFG->dataroot/$course->id"); $options = array(); foreach ($dirs as $dir) { $options["$dir"] = $dir; } choose_from_menu ($options, "reference", $form->reference); } else { // a very old Moodle (may be none left :-) print ' '; } print '
'; hotpot_print_show_links($form->course, $form->location, $form->reference, '', ' ', true); ?>

mode}quizchain"; print_string($quizchain, "hotpot"); ?>: | quizchain, ""); helpbutton($quizchain, get_string($quizchain,"hotpot"), "hotpot"); ?>
: | outputformat", ""); helpbutton("outputformat", get_string("outputformat","hotpot"), "hotpot"); ?>
: | navigation", ""); helpbutton("navigation", get_string("navigation","hotpot"), "hotpot"); ?>
: | studentfeedback", ""); print "studentfeedbackurl\">"; helpbutton("studentfeedback", get_string("studentfeedback","hotpot"), "hotpot"); ?>
: | forceplugins", ""); helpbutton("forceplugins", get_string("forceplugins","hotpot"), "hotpot"); ?>
: | shownextquiz", ""); helpbutton("shownextquiz", get_string("shownextquiz","hotpot"), "hotpot"); ?>
: | review", ""); helpbutton("review", get_string("allowreview","quiz"), "quiz"); ?>
: | =1; $i--) { $options[$i] = $i; } $options[0] = get_string("nograde"); choose_from_menu($options, "grade", "$form->grade", ""); helpbutton("maxgrade", get_string("maximumgrade"), "quiz"); ?>
: | grademethod", ""); helpbutton("grademethod", get_string("grademethod","quiz"), "quiz"); ?>
: | get_string("attemptsunlimited", "quiz"), 1 => '1 '.strtolower(get_string("attempt", "quiz")) ); for ($i=2; $i<=10; $i++) { $options[$i] = "$i ".strtolower(get_string("attempts", "quiz")); } choose_from_menu($options, "attempts", "$form->attempts", ""); helpbutton("attempts", get_string("attemptsallowed","quiz"), "quiz"); ?>
: |
: |
: | clickreporting", ""); helpbutton("clickreporting", get_string("clickreporting","hotpot"), "hotpot"); ?>
| "> " /> release) && substr($CFG->release, 0, 3)>=1.5) { $options = array( HOTPOT_DISPLAYNEXT_QUIZ => get_string("displayhotpotnext", "hotpot"), HOTPOT_DISPLAYNEXT_COURSE => get_string("displaycoursenext", "hotpot"), HOTPOT_DISPLAYNEXT_INDEX => get_string("displayindexnext", "hotpot") ); choose_from_menu($options, "displaynext", "$form->displaynext", ""); } else { print ''."\n"; } ?>

sesskey)) { ?>
timeopen) ? HOTPOT_NO : HOTPOT_YES); set_form_field($form, 'timeclose', get_user_preferences('hotpot_timeclose', 0)); set_form_field($form, 'enabletimeclose', empty($form->timeclose) ? HOTPOT_NO : HOTPOT_YES); set_form_field($form, 'location', HOTPOT_LOCATION_COURSEFILES); set_form_field($form, 'reference'); set_form_field($form, 'navigation', get_user_preferences('hotpot_navigation', HOTPOT_NAVIGATION_BAR)); set_form_field($form, 'outputformat', get_user_preferences('hotpot_outputformat', HOTPOT_OUTPUTFORMAT_BEST)); set_form_field($form, 'studentfeedback', get_user_preferences('hotpot_studentfeedback', HOTPOT_FEEDBACK_NONE)); set_form_field($form, 'studentfeedbackurl', get_user_preferences('hotpot_studentfeedbackurl', 'http://')); set_form_field($form, 'forceplugins', get_user_preferences('hotpot_forceplugins', HOTPOT_NO)); if ($form->mode=='add') { set_form_field($form, 'namesource', get_user_preferences('hotpot_namesource', HOTPOT_TEXTSOURCE_QUIZ)); set_form_field($form, 'summarysource', get_user_preferences('hotpot_summarysource', HOTPOT_TEXTSOURCE_QUIZ)); $quizchain = get_user_preferences('hotpot_quizchain', HOTPOT_NO); } else { $quizchain = empty($form->quizchain) ? HOTPOT_NO : HOTPOT_YES; } set_form_field($form, 'quizchain', $quizchain); set_form_field($form, 'shownextquiz', get_user_preferences('hotpot_shownextquiz', HOTPOT_NO)); set_form_field($form, 'review', get_user_preferences('hotpot_review', HOTPOT_YES)); set_form_field($form, 'grade', get_user_preferences('hotpot_grade', 100)); set_form_field($form, 'grademethod', get_user_preferences('hotpot_grademethod', HOTPOT_GRADEMETHOD_HIGHEST)); set_form_field($form, 'attempts', get_user_preferences('hotpot_attempts', 0)); // 0=unlimited set_form_field($form, 'password'); set_form_field($form, 'subnet', get_user_preferences('hotpot_subnet')); set_form_field($form, 'clickreporting', HOTPOT_NO); set_form_field($form, 'displaynext', get_user_preferences('hotpot_displaynext', HOTPOT_DISPLAYNEXT_QUIZ)); } function set_form_field(&$form, $fieldname, $defaultvalue='') { if (!isset($form->$fieldname)) { $form->$fieldname = $defaultvalue; } } ?>