Skip to content

Commit 17b09f8

Browse files
committed
Update the UI.
1 parent ab2bbf2 commit 17b09f8

File tree

9 files changed

+64
-47
lines changed

9 files changed

+64
-47
lines changed

tools/python-data/grade-detail.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,17 @@
99
// Get the user's grade data also checks session
1010
$row = GradeUtil::gradeLoad($_REQUEST['user_id']);
1111

12+
$menu = new \Tsugi\UI\MenuSet();
13+
$menu->addLeft(__('Back to all grades'), 'index.php');
14+
1215
// View
1316
$OUTPUT->header();
1417
$OUTPUT->bodyStart();
18+
$OUTPUT->topNav($menu);
1519
$OUTPUT->flashMessages();
1620

1721
// Show the basic info for this user
18-
GradeUtil::gradeShowInfo($row);
22+
GradeUtil::gradeShowInfo($row, false);
1923

2024
// Unique detail
2125
echo("<p>Submission:</p>\n");

tools/python-data/grades.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
use \Tsugi\Grades\GradeUtil;
66
use \Tsugi\Grades\UI;
77

8+
$menu = new \Tsugi\UI\MenuSet();
9+
$menu->addLeft(__('Back'), 'index.php');
10+
811
$GRADE_DETAIL_CLASS = new \Tsugi\Grades\SimpleGradeDetail();
912

10-
UI::GradeTable($GRADE_DETAIL_CLASS);
13+
UI::GradeTable($GRADE_DETAIL_CLASS, 'none', /* text */ false, $menu);

tools/python-data/index.php

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -47,24 +47,22 @@
4747
return;
4848
}
4949

50-
// View
51-
$OUTPUT->header();
52-
$OUTPUT->bodyStart();
53-
$OUTPUT->topNav();
54-
55-
56-
// Settings button and dialog
57-
58-
echo('<span style="float: right;">');
59-
if ( $USER->instructor ) {
50+
$menu = false;
51+
if ( $LAUNCH->link && $LAUNCH->user && $LAUNCH->user->instructor ) {
52+
$menu = new \Tsugi\UI\MenuSet();
53+
$menu->addLeft('Student Data', 'grades.php');
6054
if ( $CFG->launchactivity ) {
61-
echo('<a href="analytics" class="btn btn-default">Launches</a> ');
55+
$menu->addRight(__('Launches'), 'analytics');
6256
}
63-
echo('<a href="grades.php" target="_blank"><button class="btn btn-info">Grade detail</button></a> '."\n");
64-
SettingsForm::button();
57+
$menu->addRight(__('Settings'), '#', /* push */ false, SettingsForm::attr());
6558
}
66-
echo('</span>');
6759

60+
// View
61+
$OUTPUT->header();
62+
$OUTPUT->bodyStart();
63+
$OUTPUT->topNav($menu);
64+
65+
// Settings dialog
6866
SettingsForm::start();
6967
SettingsForm::select("exercise", __('Please select an assignment'),$assignments);
7068
SettingsForm::dueDate();

tools/pythonauto/grade-detail.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,17 @@
99
// Get the user's grade data also checks session
1010
$row = GradeUtil::gradeLoad($_REQUEST['user_id']);
1111

12+
$menu = new \Tsugi\UI\MenuSet();
13+
$menu->addLeft(__('Back to all grades'), 'index.php');
14+
1215
// View
1316
$OUTPUT->header();
1417
$OUTPUT->bodyStart();
18+
$OUTPUT->topNav($menu);
1519
$OUTPUT->flashMessages();
1620

1721
// Show the basic info for this user
18-
GradeUtil::gradeShowInfo($row);
22+
GradeUtil::gradeShowInfo($row, false);
1923

2024
// Unique detail
2125
echo("<p>Submission:</p>\n");

tools/pythonauto/grades.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
use \Tsugi\Grades\GradeUtil;
66
use \Tsugi\Grades\UI;
77

8+
$menu = new \Tsugi\UI\MenuSet();
9+
$menu->addLeft(__('Back'), 'index.php');
10+
811
$GRADE_DETAIL_CLASS = new \Tsugi\Grades\SimpleGradeDetail();
912

10-
UI::GradeTable($GRADE_DETAIL_CLASS);
13+
UI::GradeTable($GRADE_DETAIL_CLASS, 'none', /* text */ false, $menu);

tools/pythonauto/index.php

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,16 @@
6666
// Get any due date information
6767
$dueDate = SettingsForm::getDueDate();
6868

69+
$menu = false;
70+
if ( $LAUNCH->link && $LAUNCH->user && $LAUNCH->user->instructor ) {
71+
$menu = new \Tsugi\UI\MenuSet();
72+
$menu->addLeft('Student Data', 'grades.php');
73+
if ( $CFG->launchactivity ) {
74+
$menu->addRight(__('Launches'), 'analytics');
75+
}
76+
$menu->addRight(__('Settings'), '#', /* push */ false, SettingsForm::attr());
77+
}
78+
6979
$OUTPUT->header();
7080

7181
// Defaults
@@ -500,7 +510,7 @@ function gradeit() {
500510
</style>
501511
<?php
502512
$OUTPUT->bodyStart();
503-
$OUTPUT->topNav();
513+
$OUTPUT->topNav($menu);
504514

505515
if ( $USER->instructor ) {
506516
SettingsForm::start();
@@ -616,19 +626,6 @@ function gradeit() {
616626
echo('<button onclick="resetcode()" class="btn btn-default" type="button">Reset Code</button> ');
617627
}
618628
echo('<button onclick="$(\'#info\').modal();return false;" class="btn btn-default" type="button"><span class="glyphicon glyphicon-info-sign"></span></button>'."\n");
619-
if ( $USER->instructor ) {
620-
if ( $CFG->launchactivity ) {
621-
echo('<a href="analytics" class="btn btn-default">Analytics</a> ');
622-
}
623-
SettingsForm::button();
624-
}
625-
if ( $USER->instructor ) {
626-
if ( $EX === false ) {
627-
echo(' <a href="grades.php" class="btn btn-default" target="_blank">View Student Code</a>'."\n");
628-
} else {
629-
echo(' <a href="grades.php" class="btn btn-default" target="_blank">View Grades</a>'."\n");
630-
}
631-
}
632629
?>
633630
<img id="spinner" src="static/spinner.gif" style="vertical-align: middle;display: none">
634631
<span id="redo" style="color:red;display:none"> Please correct your code and re-run. </span>

tools/sql-intro/grade-detail.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,17 @@
99
// Get the user's grade data also checks session
1010
$row = GradeUtil::gradeLoad($_REQUEST['user_id']);
1111

12+
$menu = new \Tsugi\UI\MenuSet();
13+
$menu->addLeft(__('Back to all grades'), 'index.php');
14+
1215
// View
1316
$OUTPUT->header();
1417
$OUTPUT->bodyStart();
18+
$OUTPUT->topNav($menu);
1519
$OUTPUT->flashMessages();
1620

1721
// Show the basic info for this user
18-
GradeUtil::gradeShowInfo($row);
22+
GradeUtil::gradeShowInfo($row, false);
1923

2024
// Unique detail
2125
echo("<p>Submitted URL:</p>\n");

tools/sql-intro/grades.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@
55
use \Tsugi\Grades\GradeUtil;
66
use \Tsugi\Grades\UI;
77

8+
$menu = new \Tsugi\UI\MenuSet();
9+
$menu->addLeft(__('Back'), 'index.php');
10+
811
$GRADE_DETAIL_CLASS = new \Tsugi\Grades\SimpleGradeDetail();
912

10-
UI::GradeTable($GRADE_DETAIL_CLASS);
13+
UI::GradeTable($GRADE_DETAIL_CLASS, 'none', /* text */ false, $menu);
14+
15+

tools/sql-intro/index.php

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -44,23 +44,22 @@
4444
return;
4545
}
4646

47-
// View
48-
$OUTPUT->header();
49-
$OUTPUT->bodyStart();
50-
$OUTPUT->topNav();
51-
52-
// Settings button and dialog
53-
54-
echo('<span style="float: right;">');
55-
if ( $USER->instructor ) {
47+
$menu = false;
48+
if ( $LAUNCH->link && $LAUNCH->user && $LAUNCH->user->instructor ) {
49+
$menu = new \Tsugi\UI\MenuSet();
50+
$menu->addLeft('Student Data', 'grades.php');
5651
if ( $CFG->launchactivity ) {
57-
echo('<a href="analytics" class="btn btn-default">Launches</a> ');
52+
$menu->addRight(__('Launches'), 'analytics');
5853
}
59-
echo('<a href="grades.php" target="_blank"><button class="btn btn-info">Grade detail</button></a> '."\n");
60-
SettingsForm::button();
54+
$menu->addRight(__('Settings'), '#', /* push */ false, SettingsForm::attr());
6155
}
62-
echo('</span>');
6356

57+
// View
58+
$OUTPUT->header();
59+
$OUTPUT->bodyStart();
60+
$OUTPUT->topNav($menu);
61+
62+
// Settings dialog
6463
SettingsForm::start();
6564
SettingsForm::select("exercise", __('Please select an assignment'),$assignments);
6665
SettingsForm::dueDate();

0 commit comments

Comments
 (0)