Skip to content

Commit

Permalink
FIX: Unit grading to include students without portfolios
Browse files Browse the repository at this point in the history
  • Loading branch information
macite committed Aug 31, 2016
1 parent 3cb92c7 commit d169183
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/app/common/filters/filters.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ angular.module("doubtfire.common.filters", [])
)

.filter('studentsWithPortfolio', ->
(input) ->
(input, option) ->
if input
_.filter input, (student) -> (student?) && student.has_portfolio > 0
_.filter input, (student) -> option == 'allStudents' || ((student?) && student.has_portfolio > 0)
else
input
)
Expand Down
2 changes: 1 addition & 1 deletion src/app/units/states/teacher-view/teacher-view.tpl.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ <h2>{{unit.name}} <small>{{unit.code}}</small><p class="lead"> Teacher View</p><
<tutor-group-manager ng-if="activeTab === tabs.groupsTab"></tutor-group-manager>
<unit-student-plagiarism-list ng-if="activeTab === tabs.plagiarismTab"></unit-student-plagiarism-list>
<unit-analytics-viewer unit="unit" ng-if="activeTab === tabs.analyticsTab"></unit-analytics-viewer>
<unit-student-portfolio-list unit="unit" ng-if="activeTab === tabs.gradingTab"></unit-student-portfolio-list>
<unit-student-portfolio-list unit="unit" unit-loaded="unitLoaded" ng-if="activeTab === tabs.gradingTab"></unit-student-portfolio-list>
</div><!--content-->
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,15 @@ angular.module('doubtfire.units.unit-student-portfolio-list', [])
templateUrl: 'units/unit-student-portfolio-list/unit-student-portfolio-list.tpl.html'
scope:
unit: "="
controller: ($scope, Unit, analyticsService, gradeService, projectService, unitService, currentUser) ->
unitLoaded: "="
controller: ($scope, Unit, analyticsService, gradeService, projectService, unitService, currentUser, Visualisation) ->
$scope.portfolioDownloadUrl = Unit.getPortfoliosUrl $scope.unit
$scope.gradeDownloadUrl = Unit.getGradesUrl $scope.unit

$scope.studentFilter = 'allStudents'
$scope.portfolioFilter = 'withPortfolio'

refreshCharts = Visualisation.refreshAll

#
# Sets the active tab
Expand All @@ -25,6 +29,9 @@ angular.module('doubtfire.units.unit-student-portfolio-list', [])
$scope.activeTab = tab
$scope.activeTab.active = true

if $scope.activeTab == $scope.gradingTabs.viewProgress
refreshCharts()

#
# Active task tab group
#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,20 @@ <h4 class="panel-title">Mark Portfolios</h4>
</div>
<div class="pull-right toolbar">
<div class="buttons">
<div class="btn-group">
<label class="btn btn-default" ng-model="portfolioFilter" btn-radio="'allStudents'">
<i class="fa fa-globe" tooltip-placement="{{ fullscreen ? 'bottom' : 'top' }}" tooltip="Show all students, even those without portfolios"></i>
</label>
<label class="btn btn-default" ng-model="portfolioFilter" btn-radio="'withPortfolio'">
<i class="fa fa-book" tooltip-placement="{{ fullscreen ? 'bottom' : 'top' }}" tooltip="Show only students with portfolios"></i>
</label>
</div>
<div class="btn-group">
<label class="btn btn-default" ng-model="studentFilter" btn-radio="'allStudents'">
<i class="fa fa-university" tooltip-placement="{{ fullscreen ? 'bottom' : 'top' }}" tooltip="Show all students"></i>
</label>
<label class="btn btn-default" ng-model="studentFilter" btn-radio="'myStudents'">
<i class="fa fa-pencil" tooltip-placement="{{ fullscreen ? 'bottom' : 'top' }}" tooltip="Show only my students"></i>
<span class="tooltip">Show only my students</span>
</label>
</div>
<div class="btn-group btn-group-sm select-portfolio-grade">
Expand Down Expand Up @@ -66,11 +73,12 @@ <h4 class="panel-title">Mark Portfolios</h4>
Target Grade
</th>
<th>Stats</th>
<th ng-show="portfolioFilter == 'allStudents'">Portfolio?</th>
<th>Grade</th>
</tr>
</thead>
<tbody>
<tr class="task-progress-row" ng-repeat="student in filteredStudents = (allStudents = (unit.students | showStudents:studentFilter:tutorName | studentsWithPortfolio | studentsWithTargetGrade:filterOptions.selectedGrade) | filter:search) | orderBy:sortOrder:reverse | startFrom:(currentPage - 1) * pageSize | limitTo: pageSize" ng-class="{'info': selectedStudent == student}" ng-click="selectStudent(student)">
<tr class="task-progress-row" ng-repeat="student in filteredStudents = (allStudents = (unit.students | showStudents:studentFilter:tutorName | studentsWithPortfolio:portfolioFilter | studentsWithTargetGrade:filterOptions.selectedGrade) | filter:search) | orderBy:sortOrder:reverse | startFrom:(currentPage - 1) * pageSize | limitTo: pageSize" ng-class="{'info': selectedStudent == student}" ng-click="selectStudent(student)">
<td>{{student.student_id}}</td>
<td>{{student.name}}</td>
<td>{{student.tutorial ? student.tutorial.tutor_name : 'None'}}</td>
Expand All @@ -85,6 +93,7 @@ <h4 class="panel-title">Mark Portfolios</h4>
</bar>
</progress>
</td>
<td ng-show="portfolioFilter == 'allStudents'">{{student.has_portfolio ? "Yes" : "No"}}</td>
<td>{{student.grade}}</td>
</tr>
</tbody>
Expand Down Expand Up @@ -134,6 +143,10 @@ <h3 class="panel-title">Review Portfolio of {{selectedStudent.name}}</h3><!--/ti
View or download portfolio for assessment.
</div>
</div>
<div class="panel-body large-notice-block" ng-hide="project.portfolio_available">
<i class="fa fa-book"></i>
<p>No Portfolio Submitted</p>
</div>
<pdf-panel-viewer
ng-show="project.portfolio_available"
pdf-url="project.portfolioUrl()">
Expand Down

0 comments on commit d169183

Please sign in to comment.