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
4a7bd0f1
authored
Jul 27, 2016
by
Fernando Martínez Santiago
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
bug #497, #498 fixed. Working on #503
parent
68db9ecf
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
7 deletions
android/Pictogram/app/src/main/java/com/yottacode/pictogram/grammar/Vocabulary.java
android/Pictogram/app/src/main/java/com/yottacode/pictogram/gui/StudentFragmentGrid.java
android/Pictogram/app/src/main/java/com/yottacode/pictogram/net/ServerLogin.java
android/Pictogram/app/src/main/java/com/yottacode/pictogram/grammar/Vocabulary.java
View file @
4a7bd0f1
...
@@ -159,11 +159,13 @@ public class Vocabulary implements Iterable<Picto> {
...
@@ -159,11 +159,13 @@ public class Vocabulary implements Iterable<Picto> {
Picto
[]
pictos
=
new
Picto
[
result
.
length
()];
Picto
[]
pictos
=
new
Picto
[
result
.
length
()];
JSONObject
picto
=
null
,
expression
=
null
,
attributes
=
null
;
JSONObject
picto
=
null
,
expression
=
null
,
attributes
=
null
;
JSONObject
ojpicto
=
null
;
try
{
try
{
for
(
int
i
=
0
;
i
<
result
.
length
();
i
++)
{
for
(
int
i
=
0
;
i
<
result
.
length
();
i
++)
{
picto
=
result
.
getJSONObject
(
i
).
getJSONObject
(
jpicto
);
ojpicto
=
result
.
getJSONObject
(
i
);
expression
=
result
.
getJSONObject
(
i
).
getJSONObject
(
jexpression
);
picto
=
ojpicto
.
getJSONObject
(
jpicto
);
attributes
=
result
.
getJSONObject
(
i
).
getJSONObject
(
jattributes
);
expression
=
ojpicto
.
getJSONObject
(
jexpression
);
attributes
=
ojpicto
.
getJSONObject
(
jattributes
);
pictos
[
i
]
=
new
Picto
(
picto
.
getInt
(
jid
),
pictos
[
i
]
=
new
Picto
(
picto
.
getInt
(
jid
),
picto
.
getString
(
juri
),
picto
.
getString
(
juri
),
expression
.
getString
(
jexpression_text
),
expression
.
getString
(
jexpression_text
),
...
@@ -176,7 +178,7 @@ public class Vocabulary implements Iterable<Picto> {
...
@@ -176,7 +178,7 @@ public class Vocabulary implements Iterable<Picto> {
StackTraceElement
traces
[]
=
e
.
getStackTrace
();
StackTraceElement
traces
[]
=
e
.
getStackTrace
();
for
(
StackTraceElement
s:
traces
)
for
(
StackTraceElement
s:
traces
)
Log
.
e
(
s
.
getClassName
()+
"."
+
s
.
getFileName
()+
"."
+
s
.
getLineNumber
(),
s
.
toString
());
Log
.
e
(
s
.
getClassName
()+
"."
+
s
.
getFileName
()+
"."
+
s
.
getLineNumber
(),
s
.
toString
());
Log
.
e
(
this
.
getClass
().
getName
(),
" Picto
json error from server: "
+
picto
.
toString
()+
" expression:"
+
expression
.
toString
()+
" attributes:"
+
attributes
.
toString
());
Log
.
e
(
this
.
getClass
().
getName
(),
" Picto
JSON error from server: "
+
ojpicto
.
toString
());
this
.
error
(
e
);
this
.
error
(
e
);
}
}
}
}
...
...
android/Pictogram/app/src/main/java/com/yottacode/pictogram/gui/StudentFragmentGrid.java
View file @
4a7bd0f1
...
@@ -212,7 +212,14 @@ public class StudentFragmentGrid extends Fragment{
...
@@ -212,7 +212,14 @@ public class StudentFragmentGrid extends Fragment{
wrapper
.
ask
(
operation
,
new
iRestapiListener
()
{
wrapper
.
ask
(
operation
,
new
iRestapiListener
()
{
@Override
@Override
public
void
error
(
Exception
e
)
{
public
void
error
(
Exception
e
)
{
Log
.
e
(
this
.
getClass
().
getName
(),
" Server restapi error: "
+
e
.
getLocalizedMessage
());
Log
.
e
(
this
.
getClass
().
getName
(),
" Server restapi error: "
+
e
.
getLocalizedMessage
());
progressDialog
.
dismiss
();
GUITools
.
show_alert
(
getActivity
(),
R
.
string
.
loginErrorTxt
,
getString
(
R
.
string
.
serverError
),
new
GUITools
.
iOKListener
()
{
@Override
public
void
ok
()
{
PCBcontext
.
restart_app
();
}
});
}
}
@Override
@Override
public
void
preExecute
()
{
public
void
preExecute
()
{
...
...
android/Pictogram/app/src/main/java/com/yottacode/pictogram/net/ServerLogin.java
View file @
4a7bd0f1
...
@@ -60,7 +60,9 @@ public class ServerLogin {
...
@@ -60,7 +60,9 @@ public class ServerLogin {
@Override
@Override
public
void
error
(
Exception
e
)
{
public
void
error
(
Exception
e
)
{
listener
.
error
(
new
LoginException
(
e
.
getMessage
(),
LoginException
.
BAD_LOGIN
));
listener
.
error
(
new
LoginException
(
e
.
getMessage
(),
e
.
getMessage
().
contains
(
"User without students"
)
?
LoginException
.
NO_STUDENTS
:
LoginException
.
BAD_LOGIN
));
}
}
});
});
}
}
...
...
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