issues #323, #327, #326 fixed

parent 62dcb069
......@@ -10,7 +10,7 @@ android {
versionCode 1
versionName "1.3"
resValue "string", "db_name", "PCB.db"
resValue "integer", "db_version", "8"
resValue "integer", "db_version", "10"
//resValue "string", "app_version", "1.1"
resValue "string", "core_vocabulary", "core_vocabulary"
resValue "string", "apk", "to_be_set_in_subproject"
......
......@@ -330,7 +330,7 @@ public class Device extends SQLiteOpenHelper {
"'" + user.get_lang_sup() + "'," +
"'" + user.get_tts_engine_sup() + "'," +
"'" + user.get_office() + "'" +
")";
")"; Log.e(LOG_TAG,sentence);
db.execSQL(sentence);
db.setTransactionSuccessful();
......
package com.yottacode.pictogram.net;
import android.content.Context;
import android.content.Intent;
import android.util.Log;
import com.yottacode.net.RestapiWrapper;
......@@ -76,7 +75,7 @@ public class NetService implements Runnable, RestapiWrapper.iSilentLogin {
}
@Override
public void result(JSONObject result) {
public void result(JSONObject result) { PCBcontext.getPcbdb().user_online(true);
}
@Override
......@@ -100,7 +99,7 @@ public class NetService implements Runnable, RestapiWrapper.iSilentLogin {
@Override
public void result(JSONObject result) {
PCBcontext.getPcbdb().user_online(true);
}
@Override
......@@ -217,7 +216,7 @@ public class NetService implements Runnable, RestapiWrapper.iSilentLogin {
return restfullSynchroTimming;
}
private void synchronizeStudentAttributes() {
public void synchronizeStudentAttributes() {
int id=PCBcontext.getPcbdb().getCurrentUser().get_id_stu();
PCBcontext.getRestapiWrapper().ask("stu/" + id, new RestapiWrapper.iRestapiListener() {
@Override
......
......@@ -47,7 +47,7 @@ public class ServerLogin {
try {
if (PCBcontext.is_user_offline()) {
final String TAG_TOKEN="token";
PCBcontext.getPcbdb().user_online(true);
PCBcontext.getPcbdb().user_online(true); ;
PCBcontext.getRestapiWrapper().setToken(result.getString(TAG_TOKEN));
PCBcontext.getVocabulary().synchronize();
PCBcontext.getRoom().connect();
......
......@@ -72,7 +72,7 @@ public final class PCBcontext {
wrapper.setToken(token);
pcbdb = new PCBDBHelper(null, 2, student);
pcbdb.user_online(token!=null);
pcbdb.user_online(token!=null);Log.e("pcbcontextborra", "JSON:");
room = new Room();
actionLog = new ActionLog();
vocabulary = new Vocabulary(listener);
......
......@@ -49,7 +49,7 @@ pwd TEXT(40) NOT NULL,
name TEXT(40) NOT NULL,
surname TEXT(60) NOT NULL,
url_img VARCHAR(250) NOT NULL,
gender TEXT(1) NOT NULL CHECK (gender IN ('M','F')),
gender TEXT(1) NULL CHECK (gender IN (NULL, 'M','F')),
lang TEXT(5) NOT NULL CHECK (lang in ('en-gb','en-us','es-es')),
tts_engine TEXT(100) NULL,
office TEXT(140) NULL
......
......@@ -20,7 +20,7 @@
<string name="loginErrorTxt">Login</string>
<string name="loginErrorMsg">Invalid user or password. Please, try it again.</string>
<string name="loginNoLicenseMsg">Not valid user license. Please, contact with Yotta.</string>
<string name="loginExpiredLicenseMsg">User license was expired on</string>
<string name="loginExpiredLicenseMsg">User license was expired. Please contact with Yotta.</string>
<string name="userInetErrorMsg">Unknown new user name because Internet conection is not available</string>
<string name="userLoadingTxt">Loading</string>
<string name="userLoadingMsg">Loading students. Please wait.</string>
......
......@@ -24,7 +24,7 @@
<string name="loginErrorTxt">Login</string>
<string name="loginErrorMsg">El usuario no existe o la contraseña indicada no es correcta. Inténtelo de nuevo.</string>
<string name="loginNoLicenseMsg">Licencia incorrecta o caducada. Contacte con Yotta para adquirir una.</string>
<string name="loginExpiredLicenseMsg">La licencia del usuario expiró con fecha</string>
<string name="loginExpiredLicenseMsg">La licencia del usuario expiró. Contacte con Yotta para ampliar la licencia actual</string>
<string name="imguserLoadingMsg">Cargando imágenes de los alumnos. Por favor espere.</string>
<string name="imguserLoadingErrMsg">Imagen con formato no válido.</string>
......
......@@ -21,7 +21,7 @@
<string name="loginErrorTxt">Login</string>
<string name="loginErrorMsg">El usuario no existe o la contraseña indicada no es correcta. Inténtelo de nuevo.</string>
<string name="loginNoLicenseMsg">El usuario no tiene una licencia válida. Contacte con Yotta para adquirir una.</string>
<string name="loginExpiredLicenseMsg">La licencia del usuario expiró con fecha</string>
<string name="loginExpiredLicenseMsg">La licencia del usuario expiró. Contacte con Yotta para ampliar la licencia actual</string>
<string name="userInetErrorMsg">Este usuario requiere conexión a internet para ser validado</string>
<string name="userLoadingTxt">Cargando</string>
<string name="userLoadingMsg">Cargando alumnos. Por favor espere.</string>
......
......@@ -8,7 +8,6 @@ import android.content.Intent;
import android.graphics.Bitmap;
import android.os.AsyncTask;
import android.os.Bundle;
import android.text.Editable;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
......@@ -116,7 +115,8 @@ public class StudentFragmentGrid extends Fragment {
return;
}
new_user(i);
new_user(i, licenseStudents[i].equals("pro") || licenseStudents[i].equals("trial") );
download_supervisors(PCBcontext.getPcbdb().getCurrentUser().get_id_stu());
}
}
......@@ -179,8 +179,9 @@ public class StudentFragmentGrid extends Fragment {
/**
* Change user data, load vocabulary and goes to VOCA Activity
* @param i Position on students downloaded collection
* @param license_valid
*/
private void new_user(int i) {
private void new_user(int i, final boolean license_valid) {
JSONObject st = this.downloaded_students.get(i);
Intent intent = getActivity().getIntent();
......@@ -220,6 +221,7 @@ public class StudentFragmentGrid extends Fragment {
public void loadComplete() {
if (progressDialog != null && progressDialog.isShowing())
progressDialog.dismiss();
PCBcontext.getPcbdb().user_valid(license_valid);
Intent pictogramActivity = new Intent(getActivity(), VOCA.class);
startActivity(pictogramActivity);
}
......
......@@ -59,7 +59,13 @@ public class ListInstructionsFragment extends Fragment{
@Override
public void onStart() {
super.onStart();
super.onStart();
checkStudent();
initMethods(getView());
initInstructions(getView());
setMethods();
methodPosition=-1;
instructionPosition=-1;
}
public void initAdapters() {
......@@ -104,16 +110,12 @@ public class ListInstructionsFragment extends Fragment{
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_instructions_session, container, false);
progressDialog = ProgressDialog.show(getActivity(), getString(R.string.session_instruction), getString(R.string.session_loading));
checkStudent();
initMethods(view);
initInstructions(view);
setMethods();
methodPosition=-1;
instructionPosition=-1;
return view;
View view = inflater.inflate(R.layout.fragment_instructions_session, container, false);
progressDialog = ProgressDialog.show(getActivity(), getString(R.string.session_instruction), getString(R.string.session_loading));
return view;
}
void close() {
ListInstructionsFragment.this.getActivity().finish();
startActivity(new Intent(getActivity(), VOCA.class));
......
......@@ -177,7 +177,7 @@ public class SessionWrapper {
public static void getMethods(final iMethodWrapper listener) {
int id=PCBcontext.getPcbdb().getCurrentUser().get_id_stu();
Log.i(LOG_TAG,"License valid:"+ PCBcontext.getPcbdb().isUser_valid()+" User:"+id+","+PCBcontext.getPcbdb().getCurrentUser().get_name_stu());
PCBcontext.getRestapiWrapper().ask("stu/" + id+"/methods",null,"get",true, new RestapiWrapper.iRestapiListener() {
@Override
public void preExecute() {
......@@ -194,6 +194,7 @@ public class SessionWrapper {
try {
listener.methods(new JSONArray(1).put(result));
} catch (JSONException e) {
listener.methods(new JSONArray());
listener.error(e.getMessage());
}
}
......
......@@ -62,13 +62,6 @@
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/rs" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/shaders" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/test/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/shaders" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/assets" type="java-test-resource" />
......@@ -76,6 +69,13 @@
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/shaders" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/shaders" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/annotations" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/blame" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/bundles" />
......@@ -121,5 +121,17 @@
<orderEntry type="library" exported="" name="play-services-ads-9.2.1" level="project" />
<orderEntry type="library" exported="" name="play-services-ads-lite-9.2.1" level="project" />
<orderEntry type="module" module-name="commonlibrary" exported="" />
<orderEntry type="library" exported="" name="android-android-24" level="project" />
<orderEntry type="library" exported="" name="okhttp-ws-2.3.0" level="project" />
<orderEntry type="library" exported="" name="socket.io-client-0.5.0" level="project" />
<orderEntry type="library" exported="" name="okhttp-2.3.0" level="project" />
<orderEntry type="library" exported="" name="support-annotations-23.0.0" level="project" />
<orderEntry type="library" exported="" name="okio-1.3.0" level="project" />
<orderEntry type="library" exported="" name="gson-2.3" level="project" />
<orderEntry type="library" exported="" name="engine.io-client-0.5.0" level="project" />
<orderEntry type="library" exported="" name="appcompat-v7-21.0.3" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="hamcrest-core-1.3" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="junit-4.12" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="json-20090211" level="project" />
</component>
</module>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment