<?php $g_vars['page']['location'] = array('administration', 'configuration'); $g_vars['page']['header'] = $lngstr['page_header_config']; $g_vars['page']['selected_section'] = 'administration'; $g_vars['page']['selected_tab'] = 'config'; $g_vars['page']['menu_2_items'] = getMenu2Items($g_vars['page']['selected_section']); $g_vars['page']['list_length_content'] = getInputElement('list_length', getConfigItem(CONFIG_list_length), 3); $g_vars['page']['text_editor_content'] = getSelectElement('editor_type', getConfigItem(CONFIG_editor_type), $lngstr['page_config']['text_editorlist']); $g_vars['page']['store_logs_content'] = getSelectElement('store_logs', getConfigItem(CONFIG_store_logs), array(0 => $lngstr['label_no'], 1 => $lngstr['label_yes'])); $g_vars['page']['can_register_content'] = getSelectElement('can_register', getConfigItem(CONFIG_can_register), array(0 => $lngstr['label_no'], 1 => $lngstr['label_yes'])); $g_vars['page']['upon_registration_content'] = getSelectElement('upon_registration', getConfigItem(CONFIG_upon_registration), $lngstr['page_config']['upon_registration_select']); $g_vars['page']['reg_intro_content'] = getTextEditor(0, 'reg_intro', getConfigItem(CONFIG_reg_intro), 3); $g_vars['page']['username_content'] = getSelectElement('username', getConfigItem(CONFIG_reg_username), array(CONFIG_CONST_donotshow => $lngstr['page_config']['donotshow'], CONFIG_CONST_donotshow_autogenerate => $lngstr['page_config']['donotshow_autogenerate'], CONFIG_CONST_show_donotrequire => $lngstr['page_config']['show_donotrequire'], CONFIG_CONST_show_autogenerate => $lngstr['page_config']['show_autogenerate'], CONFIG_CONST_show_require => $lngstr['page_config']['show_require'])); $g_vars['page']['password_content'] = getSelectElement('password', getConfigItem(CONFIG_reg_password), array(CONFIG_CONST_donotshow => $lngstr['page_config']['donotshow'], CONFIG_CONST_donotshow_autogenerate => $lngstr['page_config']['donotshow_autogenerate'], CONFIG_CONST_show_donotrequire => $lngstr['page_config']['show_donotrequire'], CONFIG_CONST_show_autogenerate => $lngstr['page_config']['show_autogenerate'], CONFIG_CONST_show_require => $lngstr['page_config']['show_require'])); $g_vars['page']['email_content'] = getSelectElement('email', getConfigItem(CONFIG_reg_email), array(CONFIG_CONST_donotshow => $lngstr['page_config']['donotshow'], CONFIG_CONST_show_donotrequire => $lngstr['page_config']['show_donotrequire'], CONFIG_CONST_show_require => $lngstr['page_config']['show_require'])); $g_vars['page']['title_content'] = getSelectElement('title', getConfigItem(CONFIG_reg_title), array(CONFIG_CONST_donotshow => $lngstr['page_config']['donotshow'], CONFIG_CONST_show_donotrequire => $lngstr['page_config']['show_donotrequire'], CONFIG_CONST_show_require => $lngstr['page_config']['show_require'])); $g_vars['page']['firstname_content'] = getSelectElement('firstname', getConfigItem(CONFIG_reg_firstname), array(CONFIG_CONST_donotshow => $lngstr['page_config']['donotshow'], CONFIG_CONST_show_donotrequire => $lngstr['page_config']['show_donotrequire'], CONFIG_CONST_show_require => $lngstr['page_config']['show_require'])); $g_vars['page']['lastname_content'] = getSelectElement('lastname', getConfigItem(CONFIG_reg_lastname), array(CONFIG_CONST_donotshow => $lngstr['page_config']['donotshow'], CONFIG_CONST_show_donotrequire => $lngstr['page_config']['show_donotrequire'], CONFIG_CONST_show_require => $lngstr['page_config']['show_require'])); $g_vars['page']['middlename_content'] = getSelectElement('middlename', getConfigItem(CONFIG_reg_middlename), array(CONFIG_CONST_donotshow => $lngstr['page_config']['donotshow'], CONFIG_CONST_show_donotrequire => $lngstr['page_config']['show_donotrequire'], CONFIG_CONST_show_require => $lngstr['page_config']['show_require'])); $g_vars['page']['address_content'] = getSelectElement('address', getConfigItem(CONFIG_reg_address), array(CONFIG_CONST_donotshow => $lngstr['page_config']['donotshow'], CONFIG_CONST_show_donotrequire => $lngstr['page_config']['show_donotrequire'], CONFIG_CONST_show_require => $lngstr['page_config']['show_require'])); $g_vars['page']['city_content'] = getSelectElement('city', getConfigItem(CONFIG_reg_city), array(CONFIG_CONST_donotshow => $lngstr['page_config']['donotshow'], CONFIG_CONST_show_donotrequire => $lngstr['page_config']['show_donotrequire'], CONFIG_CONST_show_require => $lngstr['page_config']['show_require'])); $g_vars['page']['state_content'] = getSelectElement('state', getConfigItem(CONFIG_reg_state), array(CONFIG_CONST_donotshow => $lngstr['page_config']['donotshow'], CONFIG_CONST_show_donotrequire => $lngstr['page_config']['show_donotrequire'], CONFIG_CONST_show_require => $lngstr['page_config']['show_require'])); $g_vars['page']['zip_content'] = getSelectElement('zip', getConfigItem(CONFIG_reg_zip), array(CONFIG_CONST_donotshow => $lngstr['page_config']['donotshow'], CONFIG_CONST_show_donotrequire => $lngstr['page_config']['show_donotrequire'], CONFIG_CONST_show_require => $lngstr['page_config']['show_require'])); $g_vars['page']['country_content'] = getSelectElement('country', getConfigItem(CONFIG_reg_country), array(CONFIG_CONST_donotshow => $lngstr['page_config']['donotshow'], CONFIG_CONST_show_donotrequire => $lngstr['page_config']['show_donotrequire'], CONFIG_CONST_show_require => $lngstr['page_config']['show_require'])); $g_vars['page']['phone_content'] = getSelectElement('phone', getConfigItem(CONFIG_reg_phone), array(CONFIG_CONST_donotshow => $lngstr['page_config']['donotshow'], CONFIG_CONST_show_donotrequire => $lngstr['page_config']['show_donotrequire'], CONFIG_CONST_show_require => $lngstr['page_config']['show_require'])); $g_vars['page']['fax_content'] = getSelectElement('fax', getConfigItem(CONFIG_reg_fax), array(CONFIG_CONST_donotshow => $lngstr['page_config']['donotshow'], CONFIG_CONST_show_donotrequire => $lngstr['page_config']['show_donotrequire'], CONFIG_CONST_show_require => $lngstr['page_config']['show_require'])); $g_vars['page']['mobile_content'] = getSelectElement('mobile', getConfigItem(CONFIG_reg_mobile), array(CONFIG_CONST_donotshow => $lngstr['page_config']['donotshow'], CONFIG_CONST_show_donotrequire => $lngstr['page_config']['show_donotrequire'], CONFIG_CONST_show_require => $lngstr['page_config']['show_require'])); $g_vars['page']['pager_content'] = getSelectElement('pager', getConfigItem(CONFIG_reg_pager), array(CONFIG_CONST_donotshow => $lngstr['page_config']['donotshow'], CONFIG_CONST_show_donotrequire => $lngstr['page_config']['show_donotrequire'], CONFIG_CONST_show_require => $lngstr['page_config']['show_require'])); $g_vars['page']['ipphone_content'] = getSelectElement('ipphone', getConfigItem(CONFIG_reg_ipphone), array(CONFIG_CONST_donotshow => $lngstr['page_config']['donotshow'], CONFIG_CONST_show_donotrequire => $lngstr['page_config']['show_donotrequire'], CONFIG_CONST_show_require => $lngstr['page_config']['show_require'])); $g_vars['page']['webpage_content'] = getSelectElement('webpage', getConfigItem(CONFIG_reg_webpage), array(CONFIG_CONST_donotshow => $lngstr['page_config']['donotshow'], CONFIG_CONST_show_donotrequire => $lngstr['page_config']['show_donotrequire'], CONFIG_CONST_show_require => $lngstr['page_config']['show_require']));
$i_rowno++; writeTR2(sprintf($lngstr['label_answer_feedback_no'], $i), getTextEditor($i_feedback_editor, 'answer_feedback_' . $i, $i_answer_feedback, 3)); break; case QUESTION_TYPE_FILLINTHEBLANK: writeTR2($lngstr['page_editquestion_answer_count'], '1'); writeTR2($lngstr['page_editquestion_question_text'], getTextEditor($G_SESSION['config_editortype'], 'question_text', !empty($i_rSet1->fields['question_text']) ? $i_rSet1->fields['question_text'] : $lngstr['page_editquestion_emptyquestion'])); $i = 1; $i_answer_text = ''; if (!$i_rSet3->EOF) { $i_answer_text = $i_rSet3->fields['answer_text']; } writeTR2(sprintf($lngstr['label_answer_text'], $i), getTextEditor(0, 'answer_text[' . $i . ']', $i_answer_text, 3)); break; case QUESTION_TYPE_ESSAY: writeTR2($lngstr['page_editquestion_answer_count'], $lngstr['label_notapplicable']); writeTR2($lngstr['page_editquestion_question_text'], getTextEditor($G_SESSION['config_editortype'], 'question_text', !empty($i_rSet1->fields['question_text']) ? $i_rSet1->fields['question_text'] : $lngstr['page_editquestion_emptyquestion'])); break; case QUESTION_TYPE_RANDOM: writeTR2($lngstr['page_editquestion_question_name'], getInputElement('question_text', !empty($i_rSet1->fields['question_text']) ? $i_rSet1->fields['question_text'] : $lngstr['label_atype_random'] . ' (' . $i_subjects[$f_subjectid] . ')')); break; } $i_rSet3->Close(); } if ($f_question_type != QUESTION_TYPE_RANDOM) { writeTR2($lngstr['page_editquestion_points'], getInputElement('question_points', $i_rSet1->fields['question_points'], 3)); } echo '</table>'; echo '<p class=center><input class=btn type=submit name=bsubmit value=" ' . $lngstr['button_update'] . ' "> <input class=btn type=submit name=bsubmit2 value=" ' . $lngstr['button_update_and_create_new_question'] . ' "> <input class=btn type=submit name=bcancel value=" ' . $lngstr['button_cancel'] . ' "></form>'; echo '<script language=JavaScript type="text/javascript"> function updateQuestion() { ctlQuestionType = document.getElementById("question_type");
} else { while (!$i_rSet2->EOF) { $i_subjects[$i_rSet2->fields['subjectid']] = $i_rSet2->fields['subject_name']; $i_rSet2->MoveNext(); } $i_rSet2->Close(); } echo '<p><form method=post action="test-manager.php?testid=' . $f_testid . '&action=settings" onsubmit="return submitForm();">'; echo '<table class=rowtable2 cellpadding=5 cellspacing=1 border=0 width="100%">'; echo '<tr class=rowtwo valign=top><td colspan=2>' . getCheckbox('test_enabled', $i_rSet1->fields['test_enabled'], $lngstr['page_edittests_testenabled']) . '</td></tr>'; $i_rowno = 1; writeTR2Fixed($lngstr['page_edittests_subjectid'], getSelectElement('subjectid', $i_rSet1->fields['subjectid'], $i_subjects) . ' <a href="subjects.php?testid=' . $f_testid . '">' . $lngstr['label_subjects_edit'] . '</a>'); writeTR2Fixed($lngstr['page_edittests_testname'], getInputElement('test_name', $i_rSet1->fields['test_name'])); writeTR2Fixed($lngstr['page_testmanager']['test_code'], getInputElement('test_code', $i_rSet1->fields['test_code'])); writeTR2Fixed($lngstr['page_edittests_testdescription'], getInputElement('test_description', $i_rSet1->fields['test_description'])); writeTR2Fixed($lngstr['page_edittests_testinstructions'], getTextEditor($G_SESSION['config_editortype'], 'test_instructions', $i_rSet1->fields['test_instructions'])); $strTestDateStartFormatted = $i_rSet1->fields['test_datestart'] > 0 ? getDateLocal($lngstr['language']['calendar']['date_format'], $i_rSet1->fields['test_datestart']) : ''; $strTestDateStart = '<input name="test_datestart" id="test_datestart" value="' . $strTestDateStartFormatted . '" class=inp type=text size=20><a href="javascript:void(0);" title="' . $lngstr['calendar']['hint'] . '"><img src="images/button-calendar.gif" alt="' . $lngstr['calendar']['hint'] . '" class="calendar-icon" onclick="return showCalendar(\'test_datestart\', \'' . $lngstr['language']['calendar']['date_format'] . '\', \'24\', true);" onmouseover="this.className+=\' calendar-icon-hover\';" onmouseout="this.className = this.className.replace(/\\s*calendar-icon-hover/ig, \'\');"></a>'; writeTR2Fixed($lngstr['page_edittests_teststart'], $strTestDateStart); $strTestDateEndFormatted = $i_rSet1->fields['test_dateend'] > 0 ? getDateLocal($lngstr['language']['calendar']['date_format'], $i_rSet1->fields['test_dateend']) : ''; $strTestDateEnd = '<input name="test_dateend" id="test_dateend" value="' . $strTestDateEndFormatted . '" class=inp type=text size=20><a href="javascript:void(0);" title="' . $lngstr['calendar']['hint'] . '"><img src="images/button-calendar.gif" alt="' . $lngstr['calendar']['hint'] . '" class="calendar-icon" onclick="return showCalendar(\'test_dateend\', \'' . $lngstr['language']['calendar']['date_format'] . '\', \'24\', true);" onmouseover="this.className+=\' calendar-icon-hover\';" onmouseout="this.className = this.className.replace(/\\s*calendar-icon-hover/ig, \'\');"></a>'; writeTR2Fixed($lngstr['page_edittests_testend'], $strTestDateEnd); writeTR2Fixed($lngstr['page_edittests_testtime'], getTimeElement('test_time', $i_rSet1->fields['test_time']) . '<br>' . getCheckbox('test_timeforceout', $i_rSet1->fields['test_timeforceout'], $lngstr['page_edittests_testtimeforceout'])); writeTR2Fixed($lngstr['page-testmanager']['attempts_allowed'], getSelectElement('test_attempts', $i_rSet1->fields['test_attempts'], $lngstr['page-testmanager']['attempts_allowed_list'])); $i_gradingsystems = array(); $i_rSet5 = $g_db->Execute("SELECT gscaleid, gscale_name FROM " . $srv_settings['table_prefix'] . "gscales ORDER BY gscaleid"); if (!$i_rSet5) { showDBError(__FILE__, 5); } else { while (!$i_rSet5->EOF) { $i_gradingsystems[$i_rSet5->fields['gscaleid']] = $i_rSet5->fields['gscale_name'];
$i_addon .= getTemplateTag(ETEMPLATE_TAG_USER_USERFIELD2) . ', '; $i_addon .= getTemplateTag(ETEMPLATE_TAG_USER_USERFIELD3) . ', '; $i_addon .= getTemplateTag(ETEMPLATE_TAG_USER_USERFIELD4) . ', '; $i_addon .= getTemplateTag(ETEMPLATE_TAG_USER_USERFIELD5) . ', '; $i_addon .= getTemplateTag(ETEMPLATE_TAG_USER_USERFIELD6) . ', '; $i_addon .= getTemplateTag(ETEMPLATE_TAG_USER_USERFIELD7) . ', '; $i_addon .= getTemplateTag(ETEMPLATE_TAG_USER_USERFIELD8) . ', '; $i_addon .= getTemplateTag(ETEMPLATE_TAG_USER_USERFIELD9) . ', '; $i_addon .= getTemplateTag(ETEMPLATE_TAG_TEST_NAME) . ', '; $i_addon .= getTemplateTag(ETEMPLATE_TAG_RESULT_ID) . ', '; $i_addon .= getTemplateTag(ETEMPLATE_TAG_RESULT_DATE) . ', '; $i_addon .= getTemplateTag(ETEMPLATE_TAG_RESULT_TIME_SPENT) . ', '; $i_addon .= getTemplateTag(ETEMPLATE_TAG_RESULT_TIME_EXCEEDED) . ', '; $i_addon .= getTemplateTag(ETEMPLATE_TAG_RESULT_POINTS_SCORED) . ', '; $i_addon .= getTemplateTag(ETEMPLATE_TAG_RESULT_POINTS_POSSIBLE) . ', '; $i_addon .= getTemplateTag(ETEMPLATE_TAG_RESULT_PERCENTS) . ', '; $i_addon .= getTemplateTag(ETEMPLATE_TAG_RESULT_GRADE) . ', '; $i_addon .= getTemplateTag(ETEMPLATE_TAG_RESULT_GRADE_FEEDBACK) . ', '; $i_addon .= getTemplateTag(ETEMPLATE_TAG_RESULT_ATTACHMENT_REPORT_PDF) . ', '; $i_addon .= getTemplateTag(ETEMPLATE_TAG_RESULT_DETAILED_1) . ', '; $i_addon .= getTemplateTag(ETEMPLATE_TAG_RESULT_DETAILED_2) . ', '; $i_addon .= getTemplateTag(ETEMPLATE_TAG_RESULT_DETAILED_3) . ', '; $i_addon .= getTemplateTag(ETEMPLATE_TAG_RESULT_DETAILED_4); $i_addon .= '];'; writeTR2($lngstr['page-rtemplates']['rtemplatebody'], getTextEditor($G_SESSION['config_editortype'], 'rtemplate_body', $i_rSet1->fields['rtemplate_body'], NULL, NULL, $i_addon)); echo '</table>'; echo '<p class=center><input class=btn type=submit name=bsubmit value=" ' . $lngstr['button_update'] . ' "> <input class=btn type=submit name=bcancel value=" ' . $lngstr['button_cancel'] . ' "></form>'; } $i_rSet1->Close(); } displayTemplate('_footer');
$f_gscaleid = (int) readGetVar('gscaleid'); $f_gscale_gradeid = (int) readGetVar('gscale_gradeid'); $g_vars['page']['selected_section'] = 'testmanager'; $g_vars['page']['selected_tab'] = 'grades-7'; $g_vars['page']['menu_2_items'] = getMenu2Items($g_vars['page']['selected_section']); writePanel2($g_vars['page']['menu_2_items']); echo '<h2>' . $lngstr['page_header_grade_settings'] . '</h2>'; writeErrorsWarningsBar(); $i_rSet1 = $g_db->Execute("SELECT * FROM " . $srv_settings['table_prefix'] . "gscales_grades WHERE gscaleid=" . $f_gscaleid . " AND gscale_gradeid=" . $f_gscale_gradeid); if (!$i_rSet1) { showDBError(__FILE__, 1); } else { if (!$i_rSet1->EOF) { echo '<p><form method=post action="grades.php?action=edits&gscaleid=' . $f_gscaleid . '&gscale_gradeid=' . $f_gscale_gradeid . '">'; echo '<table class=rowtable2 cellpadding=5 cellspacing=1 border=0 width="100%">'; $i_rowno = 0; writeTR2Fixed($lngstr['page_grade_gscaleid'], $i_rSet1->fields['gscale_gradeid']); writeTR2Fixed($lngstr['page_grade_gradename'], getInputElement('grade_name', $i_rSet1->fields['grade_name'])); writeTR2Fixed($lngstr['page_grade_gradefrom'], getInputElement('grade_from', $i_rSet1->fields['grade_from'])); writeTR2Fixed($lngstr['page_grade_gradeto'], getInputElement('grade_to', $i_rSet1->fields['grade_to'])); writeTR2Fixed($lngstr['page_grade_gradedescription'], getTextArea('grade_description', $i_rSet1->fields['grade_description'])); echo '<tr valign=top><td class=rowhdr2 colspan=2><a class=rowhdr2 href="javascript:void(0)" onclick="javascript:toggleSection(\'div_grades_advanced\')">' . $lngstr['page_grade']['section_advanced'] . '</td></tr>'; echo '<tr valign=top><td class=rowone colspan=2><div id=div_grades_advanced style="display:' . (!isset($_COOKIE['div_grades_advanced']) || $_COOKIE['div_grades_advanced'] == 'Y' ? 'block' : 'none') . '"><table class=rowtable2 cellpadding=5 cellspacing=1 border=0 width="100%">'; writeTR2Fixed($lngstr['page_grade']['feedback'], getTextEditor($G_SESSION['config_editortype'], 'grade_feedback', $i_rSet1->fields['grade_feedback'])); echo '</table></div></td></tr>'; echo '</table>'; echo '<p class=center><input class=btn type=submit name=bsubmit value=" ' . $lngstr['button_update'] . ' "> <input class=btn type=submit name=bcancel value=" ' . $lngstr['button_cancel'] . ' "></form>'; } $i_rSet1->Close(); } displayTemplate('_footer');