Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
yotta
/
pictogram
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
60
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
f24d4ceb
authored
Jan 23, 2017
by
Arturo Montejo Ráez
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
added sort values to Student.tries
parent
1e1e63f3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
0 deletions
sails/src/api/models/Student.js
sails/src/api/models/Student.js
View file @
f24d4ceb
...
@@ -430,6 +430,7 @@ module.exports = {
...
@@ -430,6 +430,7 @@ module.exports = {
function
(
instruction
,
next_ins
)
{
function
(
instruction
,
next_ins
)
{
Instruction
.
findOne
(
instruction
.
id
)
Instruction
.
findOne
(
instruction
.
id
)
.
sort
(
'begin DESC'
)
.
populate
(
'workingSessions'
)
.
populate
(
'workingSessions'
)
.
then
((
populated_ins
)
=>
{
.
then
((
populated_ins
)
=>
{
if
(
!
populated_ins
||
!
populated_ins
.
workingSessions
||
populated_ins
.
workingSessions
.
length
==
0
)
if
(
!
populated_ins
||
!
populated_ins
.
workingSessions
||
populated_ins
.
workingSessions
.
length
==
0
)
...
@@ -441,6 +442,7 @@ module.exports = {
...
@@ -441,6 +442,7 @@ module.exports = {
function
(
ws
,
next_ws
)
{
function
(
ws
,
next_ws
)
{
WorkingSession
.
findOne
(
ws
.
id
)
WorkingSession
.
findOne
(
ws
.
id
)
.
sort
(
'begin DESC'
)
.
populate
(
'tries'
)
.
populate
(
'tries'
)
.
then
((
populated_ws
)
=>
{
.
then
((
populated_ws
)
=>
{
if
(
!
populated_ws
||
!
populated_ws
.
tries
||
populated_ws
.
tries
.
length
==
0
)
if
(
!
populated_ws
||
!
populated_ws
.
tries
||
populated_ws
.
tries
.
length
==
0
)
...
@@ -452,6 +454,7 @@ module.exports = {
...
@@ -452,6 +454,7 @@ module.exports = {
function
(
t
,
next_t
)
{
function
(
t
,
next_t
)
{
Try
.
findOne
(
t
.
id
)
Try
.
findOne
(
t
.
id
)
.
sort
(
'begin DESC'
)
.
populate
(
'actions'
)
.
populate
(
'actions'
)
.
then
((
populated_try
)
=>
{
.
then
((
populated_try
)
=>
{
if
(
!
populated_try
||
!
populated_try
.
actions
||
populated_try
.
actions
.
length
==
0
)
if
(
!
populated_try
||
!
populated_try
.
actions
||
populated_try
.
actions
.
length
==
0
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment