'; echo ''; echo ''; echo ''; echo 'teachPress - Assessment details'; echo ''; echo ''; echo '
'; echo '
'; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
' . __('Title','teachpress') . '
'; echo '

'; echo '
'; echo '
'; echo ''; echo ''; } /** * Gets the info screen for a single assessment. * @param int $assessment_id The assessment ID * @since 5.0.0 * @access public */ public static function get_assessment_screen($assessment_id) { global $current_user; $assessment = TP_Assessments::get_assessment($assessment_id); $artefact = TP_Artefacts::get_artefact($assessment['artefact_id']); $course_id = ( $assessment['course_id'] !== '' ) ? $assessment['course_id'] : $artefact['course_id']; $capability = TP_Courses::get_capability($course_id, $current_user->ID); $student = TP_Students::get_student($assessment['wp_id']); $examiner = get_userdata($assessment['examiner_id']); // Check capability if ( $capability !== 'owner' && $capability !== 'approved' ) { return; } $artefact['title'] = ( $artefact['title'] == '' ) ? __('Complete Course','teachpress') : $artefact['title']; echo ''; echo ''; echo ''; echo ''; echo 'teachPress - Assessment details'; echo ''; echo ''; echo '
'; echo '
'; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
' . __('Name','teachpress') . '' . stripslashes($student['firstname']) . ' ' . stripslashes($student['lastname']) . '
' . __('Artefact','teachpress') . '' . stripslashes($artefact['title']) . '
' . __('Type','teachpress') . '' . TP_Admin::get_assessment_type_field('tp_type', $assessment['type']) . '
' . __('Value/Grade','teachpress') . '
' . __('Comment','teachpress') . '
' . __('Has passed','teachpress') . '' . TP_Admin::get_assessment_passed_field('tp_passed', $assessment['passed']) . '
' . __('Date','teachpress') . '' . $assessment['exam_date'] . '
' . __('Examiner','teachpress') . '' . stripslashes($examiner->display_name) . '
'; echo '

'; echo '
'; echo '
'; echo ''; echo ''; } /** * Gets a list of publications of a single author. This function is used for teachpress/admin/show_authors.php * @param int $author_id The authur ID * @since 5.0.0 * @access public */ public static function get_author_publications( $author_id ) { $author_id = intval($author_id); $pubs = TP_Authors::get_related_publications($author_id, ARRAY_A); echo '
    '; foreach ( $pubs as $pub) { echo '
  1. '; echo '' . TP_HTML::prepare_title($pub['title'], 'decode') . ', ' . stripslashes($pub['type']) . ', ' . $pub['year']; if ( $pub['is_author'] == 1 ) { echo ' (' . __('as author','teachpress') . ')'; } if ( $pub['is_editor'] == 1 ) { echo ' (' . __('as editor','teachpress') . ')'; } echo '
  2. '; } echo '
'; } /** * Gets a unique bibtex key from a given string * @param string $string * @since 6.1.1 * @access public */ public static function get_generated_bibtex_key ($string) { echo TP_Publications::generate_unique_bibtex_key($string); } /** * Gets the cite screen for a single publication. * @param int $cite_id The publication ID * @since 6.0.0 * @access public */ public static function get_cite_screen ($cite_id) { $publication = TP_Publications::get_publication($cite_id, ARRAY_A); $cite_id = intval($cite_id); echo ''; echo ''; echo ''; echo ''; echo 'teachPress - cite publication'; echo ''; echo ''; echo '
'; echo '
'; echo ''; echo '
'; echo ''; echo ''; echo '
'; echo '
'; echo '
'; echo ''; echo ''; } /** * Gets the cite text for a publication * @param int $cite_id the publication ID * @param string $mode text or bibtex * @access public * @since 6.0.0 */ public static function get_cite_text ($cite_id, $mode) { if ( $mode === 'bibtex' ) { $publication = TP_Publications::get_publication($cite_id, ARRAY_A); $tags = TP_Tags::get_tags(array('pub_id' => $cite_id, 'output_type' => ARRAY_A)); echo TP_Bibtex::get_single_publication_bibtex($publication, $tags); } if ( $mode === 'text' ) { $publication = TP_Publications::get_publication($cite_id, ARRAY_A); echo TP_Export::text_row($publication); } } /** * Gets the name of a document * @param int $doc_id The ID of the document * @since 5.0.0 * @access public */ public static function get_document_name( $doc_id ) { $doc_id = intval($doc_id); $data = TP_Documents::get_document($doc_id); echo stripslashes($data['name']); } /** * Gets the meta field screen for the settings panel * @param int $meta_field_id The meta field ID * @since 6.0.0 * @access public */ public static function get_meta_field_screen ( $meta_field_id ) { $meta_field_id = intval( $meta_field_id ); if ( $meta_field_id === 0 ) { $data = array( 'name' => '', 'title' => '', 'type' => '', 'min' => '', 'max' => '', 'step' => '', 'visibility' => '', 'required' ); } else { $field = TP_Options::get_option_by_id($meta_field_id); $data = TP_DB_Helpers::extract_column_data($field['value']); } echo ''; echo ''; echo ''; echo ''; echo 'teachPress - Meta Field Screen'; echo ''; echo ''; echo '
'; echo '
'; echo ''; echo ''; // field name if ( $meta_field_id === 0 ) { echo ''; echo ''; echo ''; echo ''; } else { echo ''; } // label echo ''; echo ''; echo ''; echo ''; // field type $field_types = array('TEXT', 'TEXTAREA', 'INT', 'DATE', 'SELECT', 'CHECKBOX', 'RADIO'); echo ''; echo ''; echo ''; echo ''; // min $min = ( $data['min'] === 'false' ) ? '' : intval($min); echo ''; echo ''; echo ''; echo ''; // max $max = ( $data['max'] === 'false' ) ? '' : intval($max); echo ''; echo ''; echo ''; echo ''; // step $step = ( $data['step'] === 'false' ) ? '' : intval($step); echo ''; echo ''; echo ''; echo ''; // visibility echo ''; echo ''; echo ''; echo ''; // required $req = ( $data['required'] === 'true' ) ? 'checked="checked"' : ''; echo ''; echo ''; echo ''; echo '
'; echo ''; echo '
'; echo ''; echo '
'; echo '

'; echo '
'; echo '
'; echo ''; echo ''; } /** * Gets the url of a mimetype image * @param string $filename The filename or the url * @since 5.0.0 * @access public */ public static function get_mimetype_image( $filename ) { echo TP_Icons::get_class($filename); } /** * Saves the order of a document list * @param array $array A numeric array which represents the sort order of course documents * @since 5.0.0 * @access public */ public static function set_sort_order( $array ) { $i = 0; foreach ( $array as $value ) { TP_Documents::set_sort( intval($value), $i ); $i++; } } }