From 17b09f86773f96456a7d7e66cd1540b8294e0067 Mon Sep 17 00:00:00 2001 From: Charles Severance Date: Fri, 10 Apr 2020 16:57:25 -0400 Subject: [PATCH] Update the UI. --- tools/python-data/grade-detail.php | 6 +++++- tools/python-data/grades.php | 5 ++++- tools/python-data/index.php | 26 ++++++++++++-------------- tools/pythonauto/grade-detail.php | 6 +++++- tools/pythonauto/grades.php | 5 ++++- tools/pythonauto/index.php | 25 +++++++++++-------------- tools/sql-intro/grade-detail.php | 6 +++++- tools/sql-intro/grades.php | 7 ++++++- tools/sql-intro/index.php | 25 ++++++++++++------------- 9 files changed, 64 insertions(+), 47 deletions(-) diff --git a/tools/python-data/grade-detail.php b/tools/python-data/grade-detail.php index 11cd1914c..9054dc1f2 100644 --- a/tools/python-data/grade-detail.php +++ b/tools/python-data/grade-detail.php @@ -9,13 +9,17 @@ // Get the user's grade data also checks session $row = GradeUtil::gradeLoad($_REQUEST['user_id']); +$menu = new \Tsugi\UI\MenuSet(); +$menu->addLeft(__('Back to all grades'), 'index.php'); + // View $OUTPUT->header(); $OUTPUT->bodyStart(); +$OUTPUT->topNav($menu); $OUTPUT->flashMessages(); // Show the basic info for this user -GradeUtil::gradeShowInfo($row); +GradeUtil::gradeShowInfo($row, false); // Unique detail echo("

Submission:

\n"); diff --git a/tools/python-data/grades.php b/tools/python-data/grades.php index fe4519830..4bf505624 100644 --- a/tools/python-data/grades.php +++ b/tools/python-data/grades.php @@ -5,6 +5,9 @@ use \Tsugi\Grades\GradeUtil; use \Tsugi\Grades\UI; +$menu = new \Tsugi\UI\MenuSet(); +$menu->addLeft(__('Back'), 'index.php'); + $GRADE_DETAIL_CLASS = new \Tsugi\Grades\SimpleGradeDetail(); -UI::GradeTable($GRADE_DETAIL_CLASS); +UI::GradeTable($GRADE_DETAIL_CLASS, 'none', /* text */ false, $menu); diff --git a/tools/python-data/index.php b/tools/python-data/index.php index 7658f27f2..f9c67c396 100644 --- a/tools/python-data/index.php +++ b/tools/python-data/index.php @@ -47,24 +47,22 @@ return; } -// View -$OUTPUT->header(); -$OUTPUT->bodyStart(); -$OUTPUT->topNav(); - - -// Settings button and dialog - -echo(''); -if ( $USER->instructor ) { +$menu = false; +if ( $LAUNCH->link && $LAUNCH->user && $LAUNCH->user->instructor ) { + $menu = new \Tsugi\UI\MenuSet(); + $menu->addLeft('Student Data', 'grades.php'); if ( $CFG->launchactivity ) { - echo('Launches '); + $menu->addRight(__('Launches'), 'analytics'); } - echo(' '."\n"); -SettingsForm::button(); + $menu->addRight(__('Settings'), '#', /* push */ false, SettingsForm::attr()); } -echo(''); +// View +$OUTPUT->header(); +$OUTPUT->bodyStart(); +$OUTPUT->topNav($menu); + +// Settings dialog SettingsForm::start(); SettingsForm::select("exercise", __('Please select an assignment'),$assignments); SettingsForm::dueDate(); diff --git a/tools/pythonauto/grade-detail.php b/tools/pythonauto/grade-detail.php index d45288bf7..9798534f3 100644 --- a/tools/pythonauto/grade-detail.php +++ b/tools/pythonauto/grade-detail.php @@ -9,13 +9,17 @@ // Get the user's grade data also checks session $row = GradeUtil::gradeLoad($_REQUEST['user_id']); +$menu = new \Tsugi\UI\MenuSet(); +$menu->addLeft(__('Back to all grades'), 'index.php'); + // View $OUTPUT->header(); $OUTPUT->bodyStart(); +$OUTPUT->topNav($menu); $OUTPUT->flashMessages(); // Show the basic info for this user -GradeUtil::gradeShowInfo($row); +GradeUtil::gradeShowInfo($row, false); // Unique detail echo("

Submission:

\n"); diff --git a/tools/pythonauto/grades.php b/tools/pythonauto/grades.php index fe4519830..4bf505624 100644 --- a/tools/pythonauto/grades.php +++ b/tools/pythonauto/grades.php @@ -5,6 +5,9 @@ use \Tsugi\Grades\GradeUtil; use \Tsugi\Grades\UI; +$menu = new \Tsugi\UI\MenuSet(); +$menu->addLeft(__('Back'), 'index.php'); + $GRADE_DETAIL_CLASS = new \Tsugi\Grades\SimpleGradeDetail(); -UI::GradeTable($GRADE_DETAIL_CLASS); +UI::GradeTable($GRADE_DETAIL_CLASS, 'none', /* text */ false, $menu); diff --git a/tools/pythonauto/index.php b/tools/pythonauto/index.php index a17b2aeec..48db8ca13 100644 --- a/tools/pythonauto/index.php +++ b/tools/pythonauto/index.php @@ -66,6 +66,16 @@ // Get any due date information $dueDate = SettingsForm::getDueDate(); +$menu = false; +if ( $LAUNCH->link && $LAUNCH->user && $LAUNCH->user->instructor ) { + $menu = new \Tsugi\UI\MenuSet(); + $menu->addLeft('Student Data', 'grades.php'); + if ( $CFG->launchactivity ) { + $menu->addRight(__('Launches'), 'analytics'); + } + $menu->addRight(__('Settings'), '#', /* push */ false, SettingsForm::attr()); +} + $OUTPUT->header(); // Defaults @@ -500,7 +510,7 @@ function gradeit() { bodyStart(); -$OUTPUT->topNav(); +$OUTPUT->topNav($menu); if ( $USER->instructor ) { SettingsForm::start(); @@ -616,19 +626,6 @@ function gradeit() { echo(' '); } echo(''."\n"); - if ( $USER->instructor ) { - if ( $CFG->launchactivity ) { - echo('Analytics '); - } - SettingsForm::button(); - } - if ( $USER->instructor ) { - if ( $EX === false ) { - echo(' View Student Code'."\n"); - } else { - echo(' View Grades'."\n"); - } - } ?> diff --git a/tools/sql-intro/grade-detail.php b/tools/sql-intro/grade-detail.php index 2e264331f..1a1b2372a 100644 --- a/tools/sql-intro/grade-detail.php +++ b/tools/sql-intro/grade-detail.php @@ -9,13 +9,17 @@ // Get the user's grade data also checks session $row = GradeUtil::gradeLoad($_REQUEST['user_id']); +$menu = new \Tsugi\UI\MenuSet(); +$menu->addLeft(__('Back to all grades'), 'index.php'); + // View $OUTPUT->header(); $OUTPUT->bodyStart(); +$OUTPUT->topNav($menu); $OUTPUT->flashMessages(); // Show the basic info for this user -GradeUtil::gradeShowInfo($row); +GradeUtil::gradeShowInfo($row, false); // Unique detail echo("

Submitted URL:

\n"); diff --git a/tools/sql-intro/grades.php b/tools/sql-intro/grades.php index fe4519830..7642122e2 100644 --- a/tools/sql-intro/grades.php +++ b/tools/sql-intro/grades.php @@ -5,6 +5,11 @@ use \Tsugi\Grades\GradeUtil; use \Tsugi\Grades\UI; +$menu = new \Tsugi\UI\MenuSet(); +$menu->addLeft(__('Back'), 'index.php'); + $GRADE_DETAIL_CLASS = new \Tsugi\Grades\SimpleGradeDetail(); -UI::GradeTable($GRADE_DETAIL_CLASS); +UI::GradeTable($GRADE_DETAIL_CLASS, 'none', /* text */ false, $menu); + + diff --git a/tools/sql-intro/index.php b/tools/sql-intro/index.php index f8b575a79..f8d982f39 100644 --- a/tools/sql-intro/index.php +++ b/tools/sql-intro/index.php @@ -44,23 +44,22 @@ return; } -// View -$OUTPUT->header(); -$OUTPUT->bodyStart(); -$OUTPUT->topNav(); - -// Settings button and dialog - -echo(''); -if ( $USER->instructor ) { +$menu = false; +if ( $LAUNCH->link && $LAUNCH->user && $LAUNCH->user->instructor ) { + $menu = new \Tsugi\UI\MenuSet(); + $menu->addLeft('Student Data', 'grades.php'); if ( $CFG->launchactivity ) { - echo('Launches '); + $menu->addRight(__('Launches'), 'analytics'); } - echo(' '."\n"); -SettingsForm::button(); + $menu->addRight(__('Settings'), '#', /* push */ false, SettingsForm::attr()); } -echo(''); +// View +$OUTPUT->header(); +$OUTPUT->bodyStart(); +$OUTPUT->topNav($menu); + +// Settings dialog SettingsForm::start(); SettingsForm::select("exercise", __('Please select an assignment'),$assignments); SettingsForm::dueDate();