edu_display_class_info

one of the documented procedures in this installation of the ACS
Usage:
edu_display_class_info   db   class_id
What it does:
returns the vital course info: description, prereqs, credit hours, link to syllabus, etc. Returns results in a table
Defined in: /web/philip/tcl/education.tcl

Source code:


    set selection [ns_db 0or1row $db "select 
               term_id,
               c.subject_id,
               start_date,
               end_date,
               nvl(c.description, s.description) as description,
               where_and_when,
               syllabus_id,
               version_id,
               file_extension,
               exams_p,
               final_exam_p,
               credit_hours, 
               prerequisites
          from edu_current_classes c,
               (select * from fs_versions_latest 
                where ad_general_permissions.user_has_row_permission_p([ad_verify_and_get_user_id], 'read', version_id, 'FS_VERSIONS') = 't') ver,
               edu_subjects s
         where class_id = $class_id
           and syllabus_id = file_id(+)
           and c.subject_id = s.subject_id(+)"]
    
    if {$selection==""} {
	return ""
    } else {
	set_variables_after_query
    }

    set class_info_text "
    <table>
    <tr>
    <th valign=top align=left>
    Description:
    </td>
    <td valign=top>
    [edu_maybe_display_text $description]
    </td>
    </tr>
    "
    
    if {![empty_string_p $credit_hours]} {
	append class_info_text "
	<tr>
	<th valign=top align=left nowrap>
	Credit Hours:
	</td>
	<td valign=top>
	$credit_hours
	</td>
	</tr>
	"
    }
    
    # if there is a syllabus, show a link here
    
    if {![empty_string_p $syllabus_id]} {
	set syllabus_text "
	<a href=\"/file-storage/download/Syllabus.$file_extension?version_id=$version_id\">Syllabus</a>"
    } else {
	set syllabus_text ""
    }
    
    if {![empty_string_p $prerequisites]} {
	append class_info_text "
	<tr>
	<th valign=top align=left>
	Prerequisites:
	</td>
	<td valign=top>
	$prerequisites
	</td>
	</tr>
	"
    }
    
    append class_info_text "
    <tr><td></td><td><b>$syllabus_text</td></tr>
    </table>"

    return $class_info_text


philg@mit.edu