Skip to content

Commit

Permalink
Update the UI.
Browse files Browse the repository at this point in the history
  • Loading branch information
csev committed Apr 10, 2020
1 parent ab2bbf2 commit 17b09f8
Show file tree
Hide file tree
Showing 9 changed files with 64 additions and 47 deletions.
6 changes: 5 additions & 1 deletion tools/python-data/grade-detail.php
Original file line number Diff line number Diff line change
Expand Up @@ -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("<p>Submission:</p>\n");
Expand Down
5 changes: 4 additions & 1 deletion tools/python-data/grades.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
26 changes: 12 additions & 14 deletions tools/python-data/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,24 +47,22 @@
return;
}

// View
$OUTPUT->header();
$OUTPUT->bodyStart();
$OUTPUT->topNav();


// Settings button and dialog

echo('<span style="float: right;">');
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('<a href="analytics" class="btn btn-default">Launches</a> ');
$menu->addRight(__('Launches'), 'analytics');
}
echo('<a href="grades.php" target="_blank"><button class="btn btn-info">Grade detail</button></a> '."\n");
SettingsForm::button();
$menu->addRight(__('Settings'), '#', /* push */ false, SettingsForm::attr());
}
echo('</span>');

// View
$OUTPUT->header();
$OUTPUT->bodyStart();
$OUTPUT->topNav($menu);

// Settings dialog
SettingsForm::start();
SettingsForm::select("exercise", __('Please select an assignment'),$assignments);
SettingsForm::dueDate();
Expand Down
6 changes: 5 additions & 1 deletion tools/pythonauto/grade-detail.php
Original file line number Diff line number Diff line change
Expand Up @@ -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("<p>Submission:</p>\n");
Expand Down
5 changes: 4 additions & 1 deletion tools/pythonauto/grades.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
25 changes: 11 additions & 14 deletions tools/pythonauto/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -500,7 +510,7 @@ function gradeit() {
</style>
<?php
$OUTPUT->bodyStart();
$OUTPUT->topNav();
$OUTPUT->topNav($menu);

if ( $USER->instructor ) {
SettingsForm::start();
Expand Down Expand Up @@ -616,19 +626,6 @@ function gradeit() {
echo('<button onclick="resetcode()" class="btn btn-default" type="button">Reset Code</button> ');
}
echo('<button onclick="$(\'#info\').modal();return false;" class="btn btn-default" type="button"><span class="glyphicon glyphicon-info-sign"></span></button>'."\n");
if ( $USER->instructor ) {
if ( $CFG->launchactivity ) {
echo('<a href="analytics" class="btn btn-default">Analytics</a> ');
}
SettingsForm::button();
}
if ( $USER->instructor ) {
if ( $EX === false ) {
echo(' <a href="grades.php" class="btn btn-default" target="_blank">View Student Code</a>'."\n");
} else {
echo(' <a href="grades.php" class="btn btn-default" target="_blank">View Grades</a>'."\n");
}
}
?>
<img id="spinner" src="static/spinner.gif" style="vertical-align: middle;display: none">
<span id="redo" style="color:red;display:none"> Please correct your code and re-run. </span>
Expand Down
6 changes: 5 additions & 1 deletion tools/sql-intro/grade-detail.php
Original file line number Diff line number Diff line change
Expand Up @@ -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("<p>Submitted URL:</p>\n");
Expand Down
7 changes: 6 additions & 1 deletion tools/sql-intro/grades.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);


25 changes: 12 additions & 13 deletions tools/sql-intro/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,23 +44,22 @@
return;
}

// View
$OUTPUT->header();
$OUTPUT->bodyStart();
$OUTPUT->topNav();

// Settings button and dialog

echo('<span style="float: right;">');
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('<a href="analytics" class="btn btn-default">Launches</a> ');
$menu->addRight(__('Launches'), 'analytics');
}
echo('<a href="grades.php" target="_blank"><button class="btn btn-info">Grade detail</button></a> '."\n");
SettingsForm::button();
$menu->addRight(__('Settings'), '#', /* push */ false, SettingsForm::attr());
}
echo('</span>');

// View
$OUTPUT->header();
$OUTPUT->bodyStart();
$OUTPUT->topNav($menu);

// Settings dialog
SettingsForm::start();
SettingsForm::select("exercise", __('Please select an assignment'),$assignments);
SettingsForm::dueDate();
Expand Down

0 comments on commit 17b09f8

Please sign in to comment.