';
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'] == '' ) ? esc_html__('Complete Course','teachpress') : $artefact['title'];
echo '';
echo '';
echo '';
echo '';
echo 'teachPress - Assessment details';
echo '';
echo '';
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 '
';
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));
TP_HTML::line( TP_Bibtex::get_single_publication_bibtex($publication, $tags) );
}
if ( $mode === 'text' ) {
$publication = TP_Publications::get_publication($cite_id, ARRAY_A);
TP_HTML::line( 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 = [
'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 '';
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 esc_html( 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++;
}
}
}