Commit bcd3c8d4 by Arturo Montejo Ráez

Merge branch 'develop' of http://scm.ujaen.es/softuno/pictogram into develop

parents a2a34744 9f88bfa7
Showing with 308 additions and 84 deletions
......@@ -52,8 +52,11 @@ src/main/assets/core_vocabulary/57236.png
src/main/assets/core_vocabulary/57384.png
src/main/createdoc.bat
src/main/resources/
tablet/tablet.iml
yotta_tablet/yotta_tablet.iml
commonlibrary/commonlibrary.iml
supervisor_tablet/supervisor_tablet.iml
commonlibrary/commonlibrary.iml
watch/watch.iml
app
......
......@@ -5,7 +5,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.0-alpha3'
classpath 'com.android.tools.build:gradle:2.2.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
......
......@@ -39,7 +39,7 @@ public class RestapiWrapper {
iSilentLogin silentLogin;
public static final int TIME_OUT=20000;
private static final String SERVER_RESULT="result";
private static final String SERVER_ERROR="error";
public static final String SERVER_ERROR="error";
// String constant for logs
private final static String LOG_TAG = RestapiWrapper.class.getSimpleName(); // Or .getCanonicalName()
......
......@@ -58,6 +58,7 @@ class DeviceHelper {
*/
public class PCBDBHelper extends SQLiteOpenHelper {
final String LOG_TAG=this.getClass().getCanonicalName();
User currentUser;
boolean user_online; //true if the given user logged into the server
......@@ -84,7 +85,7 @@ public class PCBDBHelper extends SQLiteOpenHelper {
* @see PCBDBHelper#getCurrentUser()
*/
public void setCurrentUser(User user) {
Log.i(getClass().getCanonicalName(),"user "+user.get_name_stu()+" "+user.get_json_attrs());
Log.i(LOG_TAG,"user "+user.get_name_stu()+" "+user.get_json_attrs());
this.currentUser = user;
PCBcontext.getDevice().setLastStuId(user.get_id_stu());
if (user.is_supervisor()) PCBcontext.getDevice().setLastSupId(user.get_id_sup());
......@@ -106,7 +107,7 @@ public class PCBDBHelper extends SQLiteOpenHelper {
last_user = new User(cursor.getInt(0), cursor.getString(1), cursor.getString(2), cursor.getString(3), cursor.getString(4), cursor.getString(5), cursor.getString(6), cursor.getString(7), cursor.getString(8),
cursor.getInt(9), cursor.getString(10), cursor.getString(11), cursor.getString(12), cursor.getString(13), cursor.getString(14), cursor.getString(15), cursor.getString(16), cursor.getString(17));
} catch (JSONException e) {
Log.e(this.getClass().getName(), e.getMessage() + " BAD FORMED JSON: " + cursor.getString(5));
Log.e(LOG_TAG, e.getMessage() + " BAD FORMED JSON: " + cursor.getString(5));
System.exit(-1);
}
}
......@@ -149,13 +150,13 @@ public class PCBDBHelper extends SQLiteOpenHelper {
SQLiteDatabase db = this.getReadableDatabase();
Cursor cursor = db.query("action", null, null, null, null, null, null, null);
Vector<JSONObject> actions= new Vector(cursor.getCount());
Log.i(this.getClass().getName(), "Local action recovering " + cursor.getCount() + " actions from local DB");
Log.i(LOG_TAG, "Local action recovering " + cursor.getCount() + " actions from local DB");
cursor.moveToFirst();
while (cursor.moveToNext())
try {
actions.add(new JSONObject(cursor.getString(0)));
} catch (JSONException e) {
Log.e(this.getClass().getName(), "Recovering batch actions:"+e.getMessage());
Log.e(LOG_TAG, "Recovering batch actions:"+e.getMessage());
}
cursor.close();
db.close();
......@@ -179,7 +180,7 @@ public class PCBDBHelper extends SQLiteOpenHelper {
int id_stu = this.getCurrentUser().get_id_stu();
SQLiteDatabase db = this.getReadableDatabase();
Cursor cursor = db.query("collection_detail", null, "id_stu=?", new String[]{String.valueOf(id_stu)}, null, null, null, null);
Log.i(this.getClass().getName(), "Local recovering " + cursor.getCount() + " pictos for student " + id_stu + " from local DB");
Log.i(LOG_TAG, "Local recovering " + cursor.getCount() + " pictos for student " + id_stu + " from local DB");
cursor.moveToFirst();
while (cursor.moveToNext()) {
Picto picto = new Picto(cursor.getInt(1), cursor.getString(2), cursor.getString(3), cursor.getString(4));
......@@ -211,6 +212,7 @@ public class PCBDBHelper extends SQLiteOpenHelper {
ContentValues values=new ContentValues(5);
values.put("id_stu", id_stu);
for (Picto picto : vocabulary) {
Log.e(LOG_TAG,"inserting "+picto.get_id()+":"+picto.get_translation()+":"+picto.get_json_attrs());
newsize++;
values.put("id_picto", picto.get_id());
values.put("url", picto.get_url());
......@@ -220,7 +222,7 @@ public class PCBDBHelper extends SQLiteOpenHelper {
}
int seconds2 = Calendar.getInstance().get(Calendar.SECOND);
Log.i(this.getClass().getName(), " Local student vocabulary updated, id:" + id_stu + ", cats: " + vocabulary.size() + " time:" + (seconds2 - seconds1) + " secs. Size: " + newsize + " read only?" + db.isReadOnly());
Log.i(LOG_TAG, " Local student vocabulary updated, id:" + id_stu + ", cats: " + vocabulary.size() + " time:" + (seconds2 - seconds1) + " secs. Size: " + newsize + " read only?" + db.isReadOnly());
db.close();
}
......@@ -241,7 +243,7 @@ public class PCBDBHelper extends SQLiteOpenHelper {
values.put("translation",picto.get_translation());
values.put("attributes",picto.get_json_attrs());
db.insert("collection_detail", null, values);
Log.i(this.getClass().getCanonicalName(),"Picto added:"+picto.get_translation());
Log.i(LOG_TAG,"Picto added:"+picto.get_translation());
db.close();
}
......
......@@ -113,8 +113,11 @@ public class NetService implements Runnable, RestapiWrapper.iSilentLogin {
@Override
public boolean isValidToken(RestapiWrapper.HTTPException error, Object result) {
try {
return error.getCode()!=401 || (((JSONObject)result).getString("err").equalsIgnoreCase("Invalid token undefined"));
try { Log.e(LOG_TAG,"Token valid? "+error.getCode()+":"+result.toString());
return error.getCode()!=401
|| !(result instanceof JSONObject)
|| !((JSONObject)result).has("err")
|| !((JSONObject)result).getString("err").equalsIgnoreCase("Invalid token undefined");
} catch (JSONException e) {
Log.e(LOG_TAG,e.getMessage());
return true;
......
package com.yottacode.pictogram.tabletlibrary.gui.communicator;
import android.animation.Animator;
import android.animation.ObjectAnimator;
import android.animation.ValueAnimator;
import android.app.Activity;
import android.graphics.Color;
import android.graphics.PorterDuff;
import android.support.v4.content.ContextCompat;
import android.util.Log;
import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import android.widget.GridView;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import com.yottacode.pictogram.tabletlibrary.R;
import com.yottacode.pictogram.tools.PCBcontext;
import static android.graphics.Color.argb;
/**
* Created by Fernando on 25/01/2017.
*/
public class PictoAnimation {
private final String LOG_TAG = this.getClass().getCanonicalName();
public void animateTapeView(final int position, final ViewGroup view) {
final GridView gridview = (GridView) view.getChildAt(1);
final TapeAdapter tapeAdapter=(TapeAdapter)gridview.getAdapter();
RelativeLayout relativeLayout = (RelativeLayout) (gridview.getChildAt(position));
FrameLayout layout = (FrameLayout) (relativeLayout.getChildAt(0));
final ImageView v = (ImageView) (layout.getChildAt(0));
final int orange = ContextCompat.getColor(PCBcontext.getContext(), R.color.red);
final ValueAnimator colorAnim = ObjectAnimator.ofFloat(0f, 1f, 0f);
colorAnim.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator animation) {
float mul = (Float) animation.getAnimatedValue();
int alphaOrange = adjustAlpha(orange, mul);
v.setColorFilter(alphaOrange, PorterDuff.Mode.SRC_ATOP);
v.setBackgroundColor(alphaOrange);
v.setPadding(0, 0, 0, 0);
if (mul == 0.0) {
v.setColorFilter(0);
}
}
});
colorAnim.addListener(new ValueAnimator.AnimatorListener() {
@Override
public void onAnimationStart(Animator animation) {
}
@Override
public void onAnimationEnd(Animator animation) { Log.e(LOG_TAG,"animating"+position);
v.setColorFilter(0);
v.setBackgroundColor(ContextCompat.getColor(PCBcontext.getContext(), R.color.picto_default_background));
if (position < (tapeAdapter.getCount() - 1))
animateTapeView(position + 1, view);
else {
((Activity)view.getContext()).runOnUiThread(new Runnable() {
@Override
public void run() {
if (tapeAdapter.play())
tapeAdapter.endPlay();
}
});
}
}
@Override
public void onAnimationCancel(Animator animation) {
}
@Override
public void onAnimationRepeat(Animator animation) {
}
});
colorAnim.setDuration(tapeAdapter.getItem(position).get_translation().length()*100);
colorAnim.start();
}
public static int adjustAlpha(int color, float factor) {
int alpha = Math.round(Color.alpha(color) * factor);
int red = Color.red(color);
int green = Color.green(color);
int blue = Color.blue(color);
return argb(alpha, red, green, blue);
}
public void animateTapeViewVertical(final PictogramActivity activity, final boolean up) {
final View v = activity.findViewById(R.id.pictogramLayout);
int y=v.getHeight()/2-activity.tapeGridView.getHeight()/2;
final ValueAnimator moveAnim = up
? ObjectAnimator.ofInt(y,0)
: ObjectAnimator.ofInt(0, y);
moveAnim.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator animation) {
int i=(int)animation.getAnimatedValue();
v.setTranslationY(i);
if (i<=255) activity.ttsButton.setImageAlpha(255-i);
}
});
moveAnim.setDuration(500);
moveAnim.start();
}
public void animateImageView(final PictogramActivity activity, View view, final int position) {
if (activity.deleting) return;
View borderlayout=((RelativeLayout)view).getChildAt(0);
final ImageView v=((ImageView)((FrameLayout)borderlayout).getChildAt(0));
final int orange = ContextCompat.getColor(PCBcontext.getContext(),R.color.red);
final ValueAnimator colorAnim = ObjectAnimator.ofFloat(0f, 1f);
colorAnim.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator animation) {
float mul = (Float) animation.getAnimatedValue();
int alphaOrange = PictoAnimation.adjustAlpha(orange, mul);
v.setColorFilter(alphaOrange, PorterDuff.Mode.SRC_ATOP);
v.setBackgroundColor(alphaOrange);
v.setPadding(0,0,0,0);
if (mul == 0.0) {
v.setColorFilter(0);
}
}
});
colorAnim.addListener(new ValueAnimator.AnimatorListener() {
@Override
public void onAnimationStart(Animator animation) {
activity.deleting=true;
}
@Override
public void onAnimationEnd(Animator animation) {
activity.tapeAdapter.deleteItem(position);
activity.tapeAdapter.notifyDataSetChanged();
v.setColorFilter(0);
v.setBackgroundColor(ContextCompat.getColor(PCBcontext.getContext(),R.color.picto_default_background));
activity.deleting=false;
if (activity.tapeAdapter.getCount()==0 && activity.tape_delivered) {
activity.showOnlyTape(false);
}
}
@Override
public void onAnimationCancel(Animator animation) {
}
@Override
public void onAnimationRepeat(Animator animation) {
}
});
colorAnim.setDuration(750);
colorAnim.start();
}
}
......@@ -72,6 +72,7 @@ public class TapeAdapter extends BaseAdapter {
}
public void clear() {
pictoLinkedList.clear();
notifyDataSetChanged();
}
// DEVUELVE TODOS LOS ELEMENTOS
......
......@@ -21,8 +21,6 @@ import com.yottacode.pictogram.dao.User;
import com.yottacode.pictogram.dao.UserLogin;
import com.yottacode.pictogram.tabletlibrary.R;
import com.yottacode.pictogram.tabletlibrary.gui.communicator.PictogramActivity;
import com.yottacode.pictogram.tabletlibrary.gui.login.CustomListLogin;
import com.yottacode.pictogram.tabletlibrary.gui.login.LoginActivity;
import com.yottacode.pictogram.tabletlibrary.net.NetServiceTablet;
import com.yottacode.pictogram.tools.PCBcontext;
......
......@@ -82,7 +82,7 @@ public class ListInstructionsFragment extends Fragment{
GUITools.show_alert(ListInstructionsFragment.this.getContext(), R.string.session_empty, getString(R.string.server), new GUITools.iOKListener() {
@Override
public void ok() {
ListInstructionsFragment.this.getActivity().finish();
close();
}
});
}
......@@ -114,12 +114,13 @@ public class ListInstructionsFragment extends Fragment{
instructionPosition=-1;
return view;
}
void close() {
ListInstructionsFragment.this.getActivity().finish();
startActivity(new Intent(getActivity(), PictogramActivity.class));
}
private void checkStudent() {
SessionWrapper.validateStudent(new SessionWrapper.iValidateStudent() {
void close() {
ListInstructionsFragment.this.getActivity().finish();
startActivity(new Intent(getActivity(), PictogramActivity.class));
}
@Override
public void validLicense(boolean valid_license, String sexpiration) {
if (!valid_license) {
......
......@@ -73,14 +73,6 @@
<sourceFolder url="file://$MODULE_DIR$/src/main/jni" 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/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" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/jni" 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" />
......@@ -89,61 +81,80 @@
<sourceFolder url="file://$MODULE_DIR$/src/test/jni" 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" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/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" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/classes" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/dependency-cache" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/animated-vector-drawable/24.2.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/appcompat-v7/24.2.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/support-compat/24.2.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/support-core-ui/24.2.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/support-core-utils/24.2.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/support-fragment/24.2.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/support-media-compat/24.2.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/support-v4/24.2.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/support-vector-drawable/24.2.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental-safeguard" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/jniLibs" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/lint" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/manifests" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/res" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/rs" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/shaders" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/symbols" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/transforms" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/typedefs.txt" />
<excludeFolder url="file://$MODULE_DIR$/build/outputs" />
<excludeFolder url="file://$MODULE_DIR$/build/tmp" />
</content>
<orderEntry type="jdk" jdkName="Android API 24 Platform" jdkType="Android SDK" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" exported="" name="support-annotations-24.2.1" level="project" />
<orderEntry type="library" exported="" name="support-v4-24.2.1" level="project" />
<orderEntry type="library" exported="" name="support-compat-24.2.1" level="project" />
<orderEntry type="library" exported="" name="support-media-compat-24.2.1" level="project" />
<orderEntry type="library" exported="" name="animated-vector-drawable-24.2.1" level="project" />
<orderEntry type="library" exported="" name="support-fragment-24.2.1" level="project" />
<orderEntry type="library" exported="" name="play-services-gcm-9.2.1" level="project" />
<orderEntry type="library" exported="" name="play-services-auth-base-9.2.1" level="project" />
<orderEntry type="library" exported="" name="support-core-ui-24.2.1" level="project" />
<orderEntry type="library" exported="" name="play-services-base-9.2.1" level="project" />
<orderEntry type="library" exported="" name="play-services-gass-9.2.1" level="project" />
<orderEntry type="library" exported="" name="play-services-iid-9.2.1" level="project" />
<orderEntry type="library" exported="" name="appcompat-v7-24.2.1" level="project" />
<orderEntry type="library" exported="" name="support-vector-drawable-24.2.1" level="project" />
<orderEntry type="library" exported="" name="support-core-utils-24.2.1" level="project" />
<orderEntry type="library" exported="" name="androidasync-2.1.9" level="project" />
<orderEntry type="library" exported="" name="play-services-clearcut-9.2.1" level="project" />
<orderEntry type="library" exported="" name="play-services-basement-9.2.1" level="project" />
<orderEntry type="library" exported="" name="play-services-tasks-9.2.1" level="project" />
<orderEntry type="library" exported="" name="support-annotations-24.2.1" level="project" />
<orderEntry type="library" exported="" name="play-services-auth-9.2.1" level="project" />
<orderEntry type="library" exported="" name="play-services-ads-9.2.1" level="project" />
<orderEntry type="library" exported="" name="ion-2.1.9" 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="play-services-base-9.2.1" 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="androidasync-2.1.9" level="project" />
<orderEntry type="library" exported="" name="play-services-clearcut-9.2.1" level="project" />
<orderEntry type="library" exported="" name="support-v4-23.0.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="play-services-gcm-9.2.1" level="project" />
<orderEntry type="library" exported="" name="play-services-auth-base-9.2.1" level="project" />
<orderEntry type="library" exported="" name="play-services-gass-9.2.1" level="project" />
<orderEntry type="library" exported="" name="gson-2.3" level="project" />
<orderEntry type="library" exported="" name="play-services-iid-9.2.1" level="project" />
<orderEntry type="library" exported="" name="play-services-basement-9.2.1" level="project" />
<orderEntry type="library" exported="" name="play-services-tasks-9.2.1" 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="" name="play-services-auth-9.2.1" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="hamcrest-core-1.3" level="project" />
<orderEntry type="library" exported="" name="play-services-ads-9.2.1" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="junit-4.12" level="project" />
<orderEntry type="library" exported="" name="ion-2.1.9" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="json-20090211" level="project" />
<orderEntry type="library" exported="" name="play-services-ads-lite-9.2.1" level="project" />
</component>
</module>
\ No newline at end of file
......@@ -123,59 +123,53 @@
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/shaders" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/blame" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/classes" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/dependency-cache" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/recyclerview-v7/23.0.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/support-v4/23.0.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.google.android.gms/play-services-base/9.2.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.google.android.gms/play-services-basement/9.2.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.google.android.gms/play-services-tasks/9.2.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.google.android.gms/play-services-wearable/9.2.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.google.android.support/wearable/2.0.0-alpha2/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental-safeguard" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/manifests" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/res" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/rs" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/symbols" />
<excludeFolder url="file://$MODULE_DIR$/build/outputs" />
<excludeFolder url="file://$MODULE_DIR$/build/tmp" />
</content>
<orderEntry type="jdk" jdkName="Android API 24 Platform" jdkType="Android SDK" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" exported="" name="wearable-2.0.0-alpha2" level="project" />
<orderEntry type="library" exported="" name="support-v4-24.2.1" level="project" />
<orderEntry type="library" exported="" name="support-compat-24.2.1" level="project" />
<orderEntry type="library" exported="" name="animated-vector-drawable-24.2.1" level="project" />
<orderEntry type="library" exported="" name="support-fragment-24.2.1" level="project" />
<orderEntry type="library" exported="" name="play-services-base-9.2.1" level="project" />
<orderEntry type="library" exported="" name="androidasync-2.1.9" level="project" />
<orderEntry type="library" exported="" name="play-services-clearcut-9.2.1" level="project" />
<orderEntry type="library" exported="" name="play-services-wearable-9.2.1" level="project" />
<orderEntry type="library" exported="" name="recyclerview-v7-23.0.1" level="project" />
<orderEntry type="library" exported="" name="play-services-base-9.2.1" level="project" />
<orderEntry type="library" exported="" name="support-v4-23.0.1" level="project" />
<orderEntry type="library" exported="" name="support-annotations-23.0.1" level="project" />
<orderEntry type="library" exported="" name="support-media-compat-24.2.1" level="project" />
<orderEntry type="library" exported="" name="play-services-gcm-9.2.1" level="project" />
<orderEntry type="library" exported="" name="play-services-auth-base-9.2.1" level="project" />
<orderEntry type="library" exported="" name="support-core-ui-24.2.1" level="project" />
<orderEntry type="library" exported="" name="play-services-gass-9.2.1" level="project" />
<orderEntry type="library" exported="" name="play-services-iid-9.2.1" level="project" />
<orderEntry type="library" exported="" name="appcompat-v7-24.2.1" level="project" />
<orderEntry type="library" exported="" name="support-vector-drawable-24.2.1" level="project" />
<orderEntry type="library" exported="" name="support-core-utils-24.2.1" level="project" />
<orderEntry type="library" exported="" name="play-services-basement-9.2.1" level="project" />
<orderEntry type="library" exported="" name="play-services-tasks-9.2.1" level="project" />
<orderEntry type="library" exported="" name="play-services-auth-9.2.1" level="project" />
<orderEntry type="library" exported="" name="play-services-ads-9.2.1" level="project" />
<orderEntry type="library" exported="" name="ion-2.1.9" level="project" />
<orderEntry type="library" exported="" name="play-services-ads-lite-9.2.1" level="project" />
<orderEntry type="library" exported="" name="support-annotations-23.0.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="androidasync-2.1.9" level="project" />
<orderEntry type="library" exported="" name="play-services-clearcut-9.2.1" level="project" />
<orderEntry type="library" exported="" name="support-v4-23.0.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="play-services-gcm-9.2.1" level="project" />
<orderEntry type="library" exported="" name="play-services-auth-base-9.2.1" level="project" />
<orderEntry type="library" exported="" name="play-services-gass-9.2.1" level="project" />
<orderEntry type="library" exported="" name="gson-2.3" level="project" />
<orderEntry type="library" exported="" name="play-services-iid-9.2.1" 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="" name="play-services-auth-9.2.1" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="hamcrest-core-1.3" level="project" />
<orderEntry type="library" exported="" name="play-services-ads-9.2.1" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="junit-4.12" level="project" />
<orderEntry type="library" exported="" name="ion-2.1.9" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="json-20090211" level="project" />
<orderEntry type="library" exported="" name="play-services-ads-lite-9.2.1" level="project" />
</component>
</module>
\ No newline at end of file
#!/bin/bash
#
# This script backups actual sails server (code and database), pulls new MASTER version and relaunches server
# by amontejo - 23.01.2017
#
TIMESTAMP=`date +"%Y%m%d"`
tar zcf /home/ubuntu/backup/${TIMESTAMP}-sails_src.tgz /home/ubuntu/pictogram/sails/src
mysqldump -u root -p'r00...Tt' pictodb |gzip > /ho:::me/ubuntu/backup/${TIMESTAMP}-mysql.sql.gz
git pull
sudo forever stopall
(cd src; sudo forever start app.js)
......@@ -95,6 +95,8 @@ CREATE TABLE IF NOT EXISTS `instruction` (
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1
COMMENT="An instruction is a 'phase' in a method for learning AAC";
-- CREATE INDEX ix_instruction_begin ON instruction (`begin`);
-- --------------------------------------------------------
......@@ -396,6 +398,7 @@ CREATE TABLE IF NOT EXISTS `try` (
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1
COMMENT="This table contains tries information (they belong to a working session)";
-- CREATE INDEX ix_try_begin ON try (`begin`);
-- --------------------------------------------------------
--
......@@ -427,6 +430,7 @@ CREATE TABLE IF NOT EXISTS `working_session` (
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1
COMMENT="This table stores working session information. Every working session is related to one instruction and one supervisor (and the instruction is related to one method which is related to one student)";
-- CREATE INDEX ix_ws_begin ON working_session (`begin`);
--
-- Restricciones para tablas volcadas
--
......
......@@ -430,6 +430,7 @@ module.exports = {
function (instruction, next_ins) {
Instruction.findOne(instruction.id)
.sort('begin DESC')
.populate('workingSessions')
.then((populated_ins) => {
if (!populated_ins || !populated_ins.workingSessions || populated_ins.workingSessions.length == 0)
......@@ -441,6 +442,7 @@ module.exports = {
function(ws, next_ws) {
WorkingSession.findOne(ws.id)
.sort('begin DESC')
.populate('tries')
.then((populated_ws) => {
if (!populated_ws || !populated_ws.tries || populated_ws.tries.length == 0)
......@@ -452,6 +454,7 @@ module.exports = {
function(t, next_t) {
Try.findOne(t.id)
.sort('begin DESC')
.populate('actions')
.then((populated_try) => {
if (!populated_try || !populated_try.actions || populated_try.actions.length == 0)
......
......@@ -12,7 +12,7 @@ module.exports = {
autoPK : false,
autoCreatedAt : false,
autoUpdatedAt : false,
attributes: {
id: {
type: "integer",
......@@ -43,13 +43,13 @@ module.exports = {
size: 1024
}
},
afterUpdate: function (attrs, next) {
StuOpenTry.findOne({id_ws: attrs.workingSession}).exec(function(err, stuopentry) {
if (err)
throw new Error("Error at"+attrs.workingSession+"("+err+")");
if (stuopentry)
attrs.next_try_id=stuopentry.openTry;
next();
});
afterUpdate: function (attrs, next) {
StuOpenTry.findOne({id_ws: attrs.workingSession}).exec(function(err, stuopentry) {
if (err)
throw new Error("Error at"+attrs.workingSession+"("+err+")");
if (stuopentry)
attrs.next_try_id=stuopentry.openTry;
next();
});
}
}
\ No newline at end of file
}
......@@ -79,14 +79,16 @@ module.exports = {
next(err);
})
},
afterCreate: function (attrs, next) {
StuOpenTry.findOne({id_ws: attrs.id}).exec(function(err, stuopentry) {
afterCreate: function (attrs, next) {
// stu_opentry table is updated when a new try is inserted in try table
// (which is, itself, fired by a new session insertion)
// see triggers-sessions-integrity-constraints.sql
StuOpenTry.findOne({id_ws: attrs.id}).exec(function(err, stuopentry) {
if (err || !stuopentry)
throw new Error("No try found at"+attrs.id+"("+err+")");
throw new Error("No try found at"+attrs.id+"("+err+")");
attrs.first_try_id=stuopentry.openTry;
next();
});
});
},
//
......
......@@ -188,7 +188,7 @@
"no": "No",
"no_method": "Método sin definir",
"no_instruction": "Instrucción sin definir",
"no_students_for_user": "Su cuenta no está asociada a ningún estudiante. Por favor, contacto con su gabinete para enlazar su cuenta a un estudiante.",
"no_students_for_user": "Su cuenta no está asociada a ningún estudiante. Por favor, contacte con su gabinete para enlazar su cuenta a un estudiante.",
"no_space_in_category": "No queda espacio en la categoría",
"no_subscribed": "Sin conexión a la cuenta del estudiante",
"nobegin": "Sin iniciar",
......
......@@ -32,7 +32,12 @@
</a>
</div>
<div class="col-md-2" style="text-align: right">
<button ng-click="showSessions = !showSessions" class="btn btn-success btn-sm" style="font-size: 10pt">{{ 'sessions' | translate}} <span class="badge" style="font-size: 10pt">{{wsessions.length}}</span> <span class="glyphicon glyphicon-menu-down" ng-show="!showSessions"></span></button>
<button ng-click="showSessions = !showSessions" class="btn btn-success btn-sm" style="font-size: 10pt">
<i class="fa fa-caret-down" aria-hidden="true" ng-show="!showSessions"></i>
<i class="fa fa-caret-up" aria-hidden="true" ng-show="showSessions"></i>
<span translate> sessions </span>
<span class="badge" style="font-size: 10pt"> {{wsessions.length} }</span>
</button>
</div>
</p>
</div>
......
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